Skip to content

Commit

Permalink
CodeGen from PR 14968 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[python] readme.python.md configuration for `monitor` and `network` (Azure#14968)

* monitor

* network

* monitor

* monitor
  • Loading branch information
SDKAuto committed Jun 25, 2021
1 parent 1e316d6 commit c6747e5
Show file tree
Hide file tree
Showing 376 changed files with 22,561 additions and 2,762 deletions.
1 change: 1 addition & 0 deletions sdk/monitor/azure-mgmt-monitor/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include _meta.json
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
Expand Down
11 changes: 11 additions & 0 deletions sdk/monitor/azure-mgmt-monitor/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"autorest": "3.4.2",
"use": [
"@autorest/python@5.8.1",
"@autorest/modelerfour@4.19.2"
],
"commit": "92b3333a08b469b61ad112978068e6b43e77b599",
"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/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.1 --use=@autorest/modelerfour@4.19.2 --version=3.4.2",
"readme": "specification/monitor/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from typing import Any
from typing import TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy

from ._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any

from azure.core.credentials import TokenCredential

class MonitorManagementClientConfiguration(Configuration):
"""Configuration for MonitorManagementClient.
Expand All @@ -25,7 +30,7 @@ class MonitorManagementClientConfiguration(Configuration):
: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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,22 @@
# regenerated.
# --------------------------------------------------------------------------

from azure.mgmt.core import ARMPipelineClient
from msrest import Serializer, Deserializer
from typing import TYPE_CHECKING

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

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

class _SDKClient(object):
def __init__(self, *args, **kwargs):
"""This is a fake class to support current implemetation of MultiApiClientMixin."
Expand All @@ -36,31 +45,30 @@ 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.
:param str base_url: Service URL
:param api_version: API version to use if no profile is provided, or if missing in profile.
:type api_version: str
:param base_url: Service URL
:type base_url: str
:param profile: A profile definition, from KnownProfiles to dict.
:type profile: azure.profiles.KnownProfiles
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

DEFAULT_API_VERSION = '2019-10-17-preview'
DEFAULT_API_VERSION = '2021-04-01'
_PROFILE_TAG = "azure.mgmt.monitor.MonitorManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION,
'action_groups': '2019-06-01',
'activity_log_alerts': '2017-04-01',
'activity_log_alerts': '2020-10-01',
'activity_logs': '2015-04-01',
'alert_rule_incidents': '2016-03-01',
'alert_rules': '2016-03-01',
'autoscale_settings': '2015-04-01',
'baseline': '2018-09-01',
'baselines': '2019-03-01',
'diagnostic_settings': '2017-05-01-preview',
'diagnostic_settings_category': '2017-05-01-preview',
'event_categories': '2015-04-01',
'guest_diagnostics_settings': '2018-06-01-preview',
'guest_diagnostics_settings_association': '2018-06-01-preview',
Expand All @@ -72,9 +80,13 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
'metric_namespaces': '2017-12-01-preview',
'metrics': '2018-01-01',
'operations': '2015-04-01',
'private_endpoint_connections': '2019-10-17-preview',
'private_link_resources': '2019-10-17-preview',
'private_link_scope_operation_status': '2019-10-17-preview',
'private_link_scoped_resources': '2019-10-17-preview',
'private_link_scopes': '2019-10-17-preview',
'scheduled_query_rules': '2018-04-16',
'service_diagnostic_settings': '2016-09-01',
'subscription_diagnostic_settings': '2017-05-01-preview',
'tenant_activity_logs': '2015-04-01',
'vm_insights': '2018-11-27-preview',
}},
Expand All @@ -85,9 +97,9 @@ def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
api_version=None,
base_url=None,
profile=KnownProfiles.default,
api_version=None, # type: Optional[str]
base_url=None, # type: Optional[str]
profile=KnownProfiles.default, # type: KnownProfiles
**kwargs # type: Any
):
if not base_url:
Expand Down Expand Up @@ -128,6 +140,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2019-11-01-preview: :mod:`v2019_11_01_preview.models<azure.mgmt.monitor.v2019_11_01_preview.models>`
* 2020-01-01-preview: :mod:`v2020_01_01_preview.models<azure.mgmt.monitor.v2020_01_01_preview.models>`
* 2020-05-01-preview: :mod:`v2020_05_01_preview.models<azure.mgmt.monitor.v2020_05_01_preview.models>`
* 2020-10-01: :mod:`v2020_10_01.models<azure.mgmt.monitor.v2020_10_01.models>`
* 2021-04-01: :mod:`v2021_04_01.models<azure.mgmt.monitor.v2021_04_01.models>`
* 2021-05-01-preview: :mod:`v2021_05_01_preview.models<azure.mgmt.monitor.v2021_05_01_preview.models>`
"""
if api_version == '2015-04-01':
from .v2015_04_01 import models
Expand Down Expand Up @@ -192,6 +207,15 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2020-05-01-preview':
from .v2020_05_01_preview import models
return models
elif api_version == '2020-10-01':
from .v2020_10_01 import models
return models
elif api_version == '2021-04-01':
from .v2021_04_01 import models
return models
elif api_version == '2021-05-01-preview':
from .v2021_05_01_preview import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
Expand Down Expand Up @@ -225,12 +249,15 @@ def activity_log_alerts(self):
* 2017-03-01-preview: :class:`ActivityLogAlertsOperations<azure.mgmt.monitor.v2017_03_01_preview.operations.ActivityLogAlertsOperations>`
* 2017-04-01: :class:`ActivityLogAlertsOperations<azure.mgmt.monitor.v2017_04_01.operations.ActivityLogAlertsOperations>`
* 2020-10-01: :class:`ActivityLogAlertsOperations<azure.mgmt.monitor.v2020_10_01.operations.ActivityLogAlertsOperations>`
"""
api_version = self._get_api_version('activity_log_alerts')
if api_version == '2017-03-01-preview':
from .v2017_03_01_preview.operations import ActivityLogAlertsOperations as OperationClass
elif api_version == '2017-04-01':
from .v2017_04_01.operations import ActivityLogAlertsOperations as OperationClass
elif api_version == '2020-10-01':
from .v2020_10_01.operations import ActivityLogAlertsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'activity_log_alerts'".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 @@ -265,10 +292,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 @@ -313,15 +346,31 @@ def baselines(self):
raise ValueError("API version {} does not have operation group 'baselines'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def data_collection_endpoints(self):
"""Instance depends on the API version:
* 2021-04-01: :class:`DataCollectionEndpointsOperations<azure.mgmt.monitor.v2021_04_01.operations.DataCollectionEndpointsOperations>`
"""
api_version = self._get_api_version('data_collection_endpoints')
if api_version == '2021-04-01':
from .v2021_04_01.operations import DataCollectionEndpointsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'data_collection_endpoints'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def data_collection_rule_associations(self):
"""Instance depends on the API version:
* 2019-11-01-preview: :class:`DataCollectionRuleAssociationsOperations<azure.mgmt.monitor.v2019_11_01_preview.operations.DataCollectionRuleAssociationsOperations>`
* 2021-04-01: :class:`DataCollectionRuleAssociationsOperations<azure.mgmt.monitor.v2021_04_01.operations.DataCollectionRuleAssociationsOperations>`
"""
api_version = self._get_api_version('data_collection_rule_associations')
if api_version == '2019-11-01-preview':
from .v2019_11_01_preview.operations import DataCollectionRuleAssociationsOperations as OperationClass
elif api_version == '2021-04-01':
from .v2021_04_01.operations import DataCollectionRuleAssociationsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'data_collection_rule_associations'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -331,10 +380,13 @@ def data_collection_rules(self):
"""Instance depends on the API version:
* 2019-11-01-preview: :class:`DataCollectionRulesOperations<azure.mgmt.monitor.v2019_11_01_preview.operations.DataCollectionRulesOperations>`
* 2021-04-01: :class:`DataCollectionRulesOperations<azure.mgmt.monitor.v2021_04_01.operations.DataCollectionRulesOperations>`
"""
api_version = self._get_api_version('data_collection_rules')
if api_version == '2019-11-01-preview':
from .v2019_11_01_preview.operations import DataCollectionRulesOperations as OperationClass
elif api_version == '2021-04-01':
from .v2021_04_01.operations import DataCollectionRulesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'data_collection_rules'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -344,10 +396,13 @@ def diagnostic_settings(self):
"""Instance depends on the API version:
* 2017-05-01-preview: :class:`DiagnosticSettingsOperations<azure.mgmt.monitor.v2017_05_01_preview.operations.DiagnosticSettingsOperations>`
* 2021-05-01-preview: :class:`DiagnosticSettingsOperations<azure.mgmt.monitor.v2021_05_01_preview.operations.DiagnosticSettingsOperations>`
"""
api_version = self._get_api_version('diagnostic_settings')
if api_version == '2017-05-01-preview':
from .v2017_05_01_preview.operations import DiagnosticSettingsOperations as OperationClass
elif api_version == '2021-05-01-preview':
from .v2021_05_01_preview.operations import DiagnosticSettingsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'diagnostic_settings'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -357,10 +412,13 @@ def diagnostic_settings_category(self):
"""Instance depends on the API version:
* 2017-05-01-preview: :class:`DiagnosticSettingsCategoryOperations<azure.mgmt.monitor.v2017_05_01_preview.operations.DiagnosticSettingsCategoryOperations>`
* 2021-05-01-preview: :class:`DiagnosticSettingsCategoryOperations<azure.mgmt.monitor.v2021_05_01_preview.operations.DiagnosticSettingsCategoryOperations>`
"""
api_version = self._get_api_version('diagnostic_settings_category')
if api_version == '2017-05-01-preview':
from .v2017_05_01_preview.operations import DiagnosticSettingsCategoryOperations as OperationClass
elif api_version == '2021-05-01-preview':
from .v2021_05_01_preview.operations import DiagnosticSettingsCategoryOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'diagnostic_settings_category'".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 @@ -422,10 +480,13 @@ def management_group_diagnostic_settings(self):
"""Instance depends on the API version:
* 2020-01-01-preview: :class:`ManagementGroupDiagnosticSettingsOperations<azure.mgmt.monitor.v2020_01_01_preview.operations.ManagementGroupDiagnosticSettingsOperations>`
* 2021-05-01-preview: :class:`ManagementGroupDiagnosticSettingsOperations<azure.mgmt.monitor.v2021_05_01_preview.operations.ManagementGroupDiagnosticSettingsOperations>`
"""
api_version = self._get_api_version('management_group_diagnostic_settings')
if api_version == '2020-01-01-preview':
from .v2020_01_01_preview.operations import ManagementGroupDiagnosticSettingsOperations as OperationClass
elif api_version == '2021-05-01-preview':
from .v2021_05_01_preview.operations import ManagementGroupDiagnosticSettingsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'management_group_diagnostic_settings'".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 @@ -638,10 +699,13 @@ def subscription_diagnostic_settings(self):
"""Instance depends on the API version:
* 2017-05-01-preview: :class:`SubscriptionDiagnosticSettingsOperations<azure.mgmt.monitor.v2017_05_01_preview.operations.SubscriptionDiagnosticSettingsOperations>`
* 2021-05-01-preview: :class:`SubscriptionDiagnosticSettingsOperations<azure.mgmt.monitor.v2021_05_01_preview.operations.SubscriptionDiagnosticSettingsOperations>`
"""
api_version = self._get_api_version('subscription_diagnostic_settings')
if api_version == '2017-05-01-preview':
from .v2017_05_01_preview.operations import SubscriptionDiagnosticSettingsOperations as OperationClass
elif api_version == '2021-05-01-preview':
from .v2021_05_01_preview.operations import SubscriptionDiagnosticSettingsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'subscription_diagnostic_settings'".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,14 +8,17 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from typing import Any
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy

from .._version import VERSION

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

class MonitorManagementClientConfiguration(Configuration):
"""Configuration for MonitorManagementClient.
Expand All @@ -25,14 +28,14 @@ class MonitorManagementClientConfiguration(Configuration):
: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
"""

def __init__(
self,
credential, # type: "AsyncTokenCredential"
subscription_id, # type: str
credential: "AsyncTokenCredential",
subscription_id: str,
**kwargs # type: Any
) -> None:
if credential is None:
Expand Down
Loading

0 comments on commit c6747e5

Please sign in to comment.