From 3a7f12f945b60a0a923d28c3ebdf6589f9dc77f6 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 13 Mar 2020 09:43:05 +0000 Subject: [PATCH 1/3] sdk release for monitor --- .../azure/mgmt/monitor/__init__.py | 6 +- .../azure/mgmt/monitor/_configuration.py | 8 +- .../azure/mgmt/monitor/_monitor_client.py | 596 ++++++++++++++++++ .../azure/mgmt/monitor/models.py | 1 + .../operations/_activity_logs_operations.py | 10 +- .../v2017_05_01_preview/models/_models.py | 17 +- .../v2017_05_01_preview/models/_models_py3.py | 19 +- .../monitor/v2018_01_01/models/_models.py | 10 +- .../monitor/v2018_01_01/models/_models_py3.py | 12 +- .../_monitor_management_client_enums.py | 4 + .../monitor/v2018_03_01/models/__init__.py | 9 + .../monitor/v2018_03_01/models/_models.py | 63 +- .../monitor/v2018_03_01/models/_models_py3.py | 65 +- .../_monitor_management_client_enums.py | 24 + .../operations/_baselines_operations.py | 2 +- .../mgmt/monitor/v2019_10_17/__init__.py | 19 + .../monitor/v2019_10_17/_configuration.py | 48 ++ .../monitor/v2019_10_17/_monitor_client.py | 69 ++ .../monitor/v2019_10_17/models/__init__.py | 60 ++ .../monitor/v2019_10_17/models/_models.py | 475 ++++++++++++++ .../monitor/v2019_10_17/models/_models_py3.py | 475 ++++++++++++++ .../v2019_10_17/models/_paged_models.py | 66 ++ .../v2019_10_17/operations/__init__.py | 24 + ...private_endpoint_connections_operations.py | 379 +++++++++++ .../_private_link_resources_operations.py | 182 ++++++ ..._link_scope_operation_status_operations.py | 103 +++ ...rivate_link_scoped_resources_operations.py | 379 +++++++++++ .../_private_link_scopes_operations.py | 466 ++++++++++++++ .../azure/mgmt/monitor/v2019_10_17/version.py | 13 + 29 files changed, 3544 insertions(+), 60 deletions(-) create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_client.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/__init__.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_configuration.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_client.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/__init__.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/_models.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/_models_py3.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/_paged_models.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/__init__.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_resources_operations.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scope_operation_status_operations.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scoped_resources_operations.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scopes_operations.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/version.py diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/__init__.py index 8e97360e5ffb..940dc0469831 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/__init__.py @@ -9,9 +9,9 @@ # regenerated. # -------------------------------------------------------------------------- -from ._configuration import MonitorManagementClientConfiguration -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient', 'MonitorManagementClientConfiguration'] +from ._configuration import MonitorClientConfiguration +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient', 'MonitorClientConfiguration'] from .version import VERSION diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_configuration.py index 88436f6b4a33..f9af3d0f4eba 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_configuration.py @@ -13,15 +13,15 @@ from .version import VERSION -class MonitorManagementClientConfiguration(AzureConfiguration): - """Configuration for MonitorManagementClient +class MonitorClientConfiguration(AzureConfiguration): + """Configuration for MonitorClient Note that all parameters used to create this instance are saved as instance attributes. :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -36,7 +36,7 @@ def __init__( if not base_url: base_url = 'https://management.azure.com' - super(MonitorManagementClientConfiguration, self).__init__(base_url) + super(MonitorClientConfiguration, self).__init__(base_url) # Starting Autorest.Python 4.0.64, make connection pool activated by default self.keep_alive = True diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_client.py new file mode 100644 index 000000000000..ccedafbc273c --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_client.py @@ -0,0 +1,596 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from azure.profiles import KnownProfiles, ProfileDefinition +from azure.profiles.multiapiclient import MultiApiClientMixin +from ._configuration import MonitorClientConfiguration + + + +class MonitorClient(MultiApiClientMixin, SDKClient): + """Monitor Management Client + + This ready contains multiple API versions, to help you deal with all Azure clouds + (Azure Stack, Azure Government, Azure China, etc.). + By default, uses latest API version available on public Azure. + For production, you should stick a particular api-version and/or profile. + The profile sets a mapping between the operation group and an API version. + The api-version parameter sets the default API version if the operation + group is not described in the profile. + + :ivar config: Configuration for client. + :vartype config: MonitorClientConfiguration + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials which uniquely identify + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :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 profile: A profile definition, from KnownProfiles to dict. + :type profile: azure.profiles.KnownProfiles + """ + + DEFAULT_API_VERSION = '2019-10-17-preview' + _PROFILE_TAG = "azure.mgmt.monitor.MonitorClient" + LATEST_PROFILE = ProfileDefinition({ + _PROFILE_TAG: { + None: DEFAULT_API_VERSION, + 'action_groups': '2019-06-01', + 'activity_log_alerts': '2017-04-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', + 'log_profiles': '2016-03-01', + 'metric_alerts': '2018-03-01', + 'metric_alerts_status': '2018-03-01', + 'metric_baseline': '2018-09-01', + 'metric_definitions': '2018-01-01', + 'metric_namespaces': '2017-12-01-preview', + 'metrics': '2018-01-01', + 'operations': '2015-04-01', + 'scheduled_query_rules': '2018-04-16', + 'service_diagnostic_settings': '2016-09-01', + 'tenant_activity_logs': '2015-04-01', + 'vm_insights': '2018-11-27-preview', + }}, + _PROFILE_TAG + " latest" + ) + + def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default): + self.config = MonitorClientConfiguration(credentials, subscription_id, base_url) + super(MonitorClient, self).__init__( + credentials, + self.config, + api_version=api_version, + profile=profile + ) + + @classmethod + def _models_dict(cls, api_version): + return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} + + @classmethod + def models(cls, api_version=DEFAULT_API_VERSION): + """Module depends on the API version: + + * 2015-04-01: :mod:`v2015_04_01.models` + * 2015-07-01: :mod:`v2015_07_01.models` + * 2016-03-01: :mod:`v2016_03_01.models` + * 2016-09-01: :mod:`v2016_09_01.models` + * 2017-03-01-preview: :mod:`v2017_03_01_preview.models` + * 2017-04-01: :mod:`v2017_04_01.models` + * 2017-05-01-preview: :mod:`v2017_05_01_preview.models` + * 2017-11-01-preview: :mod:`v2017_11_01_preview.models` + * 2017-12-01-preview: :mod:`v2017_12_01_preview.models` + * 2018-01-01: :mod:`v2018_01_01.models` + * 2018-03-01: :mod:`v2018_03_01.models` + * 2018-04-16: :mod:`v2018_04_16.models` + * 2018-06-01-preview: :mod:`v2018_06_01_preview.models` + * 2018-09-01: :mod:`v2018_09_01.models` + * 2018-11-27-preview: :mod:`v2018_11_27_preview.models` + * 2019-03-01: :mod:`v2019_03_01.models` + * 2019-06-01: :mod:`v2019_06_01.models` + * 2019-10-17-preview: :mod:`v2019_10_17.models` + """ + if api_version == '2015-04-01': + from .v2015_04_01 import models + return models + elif api_version == '2015-07-01': + from .v2015_07_01 import models + return models + elif api_version == '2016-03-01': + from .v2016_03_01 import models + return models + elif api_version == '2016-09-01': + from .v2016_09_01 import models + return models + elif api_version == '2017-03-01-preview': + from .v2017_03_01_preview import models + return models + elif api_version == '2017-04-01': + from .v2017_04_01 import models + return models + elif api_version == '2017-05-01-preview': + from .v2017_05_01_preview import models + return models + elif api_version == '2017-11-01-preview': + from .v2017_11_01_preview import models + return models + elif api_version == '2017-12-01-preview': + from .v2017_12_01_preview import models + return models + elif api_version == '2018-01-01': + from .v2018_01_01 import models + return models + elif api_version == '2018-03-01': + from .v2018_03_01 import models + return models + elif api_version == '2018-04-16': + from .v2018_04_16 import models + return models + elif api_version == '2018-06-01-preview': + from .v2018_06_01_preview import models + return models + elif api_version == '2018-09-01': + from .v2018_09_01 import models + return models + elif api_version == '2018-11-27-preview': + from .v2018_11_27_preview import models + return models + elif api_version == '2019-03-01': + from .v2019_03_01 import models + return models + elif api_version == '2019-06-01': + from .v2019_06_01 import models + return models + elif api_version == '2019-10-17-preview': + from .v2019_10_17 import models + return models + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + + @property + def action_groups(self): + """Instance depends on the API version: + + * 2017-04-01: :class:`ActionGroupsOperations` + * 2018-03-01: :class:`ActionGroupsOperations` + * 2018-09-01: :class:`ActionGroupsOperations` + * 2019-03-01: :class:`ActionGroupsOperations` + * 2019-06-01: :class:`ActionGroupsOperations` + """ + api_version = self._get_api_version('action_groups') + if api_version == '2017-04-01': + from .v2017_04_01.operations import ActionGroupsOperations as OperationClass + elif api_version == '2018-03-01': + from .v2018_03_01.operations import ActionGroupsOperations as OperationClass + elif api_version == '2018-09-01': + from .v2018_09_01.operations import ActionGroupsOperations as OperationClass + elif api_version == '2019-03-01': + from .v2019_03_01.operations import ActionGroupsOperations as OperationClass + elif api_version == '2019-06-01': + from .v2019_06_01.operations import ActionGroupsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def activity_log_alerts(self): + """Instance depends on the API version: + + * 2017-03-01-preview: :class:`ActivityLogAlertsOperations` + * 2017-04-01: :class:`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 + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def activity_logs(self): + """Instance depends on the API version: + + * 2015-04-01: :class:`ActivityLogsOperations` + """ + api_version = self._get_api_version('activity_logs') + if api_version == '2015-04-01': + from .v2015_04_01.operations import ActivityLogsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def alert_rule_incidents(self): + """Instance depends on the API version: + + * 2016-03-01: :class:`AlertRuleIncidentsOperations` + """ + api_version = self._get_api_version('alert_rule_incidents') + if api_version == '2016-03-01': + from .v2016_03_01.operations import AlertRuleIncidentsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def alert_rules(self): + """Instance depends on the API version: + + * 2016-03-01: :class:`AlertRulesOperations` + """ + api_version = self._get_api_version('alert_rules') + if api_version == '2016-03-01': + from .v2016_03_01.operations import AlertRulesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def autoscale_settings(self): + """Instance depends on the API version: + + * 2015-04-01: :class:`AutoscaleSettingsOperations` + """ + api_version = self._get_api_version('autoscale_settings') + if api_version == '2015-04-01': + from .v2015_04_01.operations import AutoscaleSettingsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".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` + """ + api_version = self._get_api_version('baseline') + if api_version == '2018-09-01': + from .v2018_09_01.operations import BaselineOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".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: + + * 2019-03-01: :class:`BaselinesOperations` + """ + api_version = self._get_api_version('baselines') + if api_version == '2019-03-01': + from .v2019_03_01.operations import BaselinesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def diagnostic_settings(self): + """Instance depends on the API version: + + * 2017-05-01-preview: :class:`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 + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def diagnostic_settings_category(self): + """Instance depends on the API version: + + * 2017-05-01-preview: :class:`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 + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def event_categories(self): + """Instance depends on the API version: + + * 2015-04-01: :class:`EventCategoriesOperations` + """ + api_version = self._get_api_version('event_categories') + if api_version == '2015-04-01': + from .v2015_04_01.operations import EventCategoriesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def guest_diagnostics_settings(self): + """Instance depends on the API version: + + * 2018-06-01-preview: :class:`GuestDiagnosticsSettingsOperations` + """ + api_version = self._get_api_version('guest_diagnostics_settings') + if api_version == '2018-06-01-preview': + from .v2018_06_01_preview.operations import GuestDiagnosticsSettingsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def guest_diagnostics_settings_association(self): + """Instance depends on the API version: + + * 2018-06-01-preview: :class:`GuestDiagnosticsSettingsAssociationOperations` + """ + api_version = self._get_api_version('guest_diagnostics_settings_association') + if api_version == '2018-06-01-preview': + from .v2018_06_01_preview.operations import GuestDiagnosticsSettingsAssociationOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def log_profiles(self): + """Instance depends on the API version: + + * 2016-03-01: :class:`LogProfilesOperations` + """ + api_version = self._get_api_version('log_profiles') + if api_version == '2016-03-01': + from .v2016_03_01.operations import LogProfilesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def metric_alerts(self): + """Instance depends on the API version: + + * 2018-03-01: :class:`MetricAlertsOperations` + """ + api_version = self._get_api_version('metric_alerts') + if api_version == '2018-03-01': + from .v2018_03_01.operations import MetricAlertsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def metric_alerts_status(self): + """Instance depends on the API version: + + * 2018-03-01: :class:`MetricAlertsStatusOperations` + """ + api_version = self._get_api_version('metric_alerts_status') + if api_version == '2018-03-01': + from .v2018_03_01.operations import MetricAlertsStatusOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def metric_baseline(self): + """Instance depends on the API version: + + * 2017-11-01-preview: :class:`MetricBaselineOperations` + * 2018-09-01: :class:`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 NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def metric_definitions(self): + """Instance depends on the API version: + + * 2016-03-01: :class:`MetricDefinitionsOperations` + * 2017-05-01-preview: :class:`MetricDefinitionsOperations` + * 2018-01-01: :class:`MetricDefinitionsOperations` + """ + api_version = self._get_api_version('metric_definitions') + if api_version == '2016-03-01': + from .v2016_03_01.operations import MetricDefinitionsOperations as OperationClass + elif api_version == '2017-05-01-preview': + from .v2017_05_01_preview.operations import MetricDefinitionsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import MetricDefinitionsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def metric_namespaces(self): + """Instance depends on the API version: + + * 2017-12-01-preview: :class:`MetricNamespacesOperations` + """ + api_version = self._get_api_version('metric_namespaces') + if api_version == '2017-12-01-preview': + from .v2017_12_01_preview.operations import MetricNamespacesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def metrics(self): + """Instance depends on the API version: + + * 2016-09-01: :class:`MetricsOperations` + * 2017-05-01-preview: :class:`MetricsOperations` + * 2018-01-01: :class:`MetricsOperations` + """ + api_version = self._get_api_version('metrics') + if api_version == '2016-09-01': + from .v2016_09_01.operations import MetricsOperations as OperationClass + elif api_version == '2017-05-01-preview': + from .v2017_05_01_preview.operations import MetricsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import MetricsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def operations(self): + """Instance depends on the API version: + + * 2015-04-01: :class:`Operations` + """ + api_version = self._get_api_version('operations') + if api_version == '2015-04-01': + from .v2015_04_01.operations import Operations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def private_endpoint_connections(self): + """Instance depends on the API version: + + * 2019-10-17-preview: :class:`PrivateEndpointConnectionsOperations` + """ + api_version = self._get_api_version('private_endpoint_connections') + if api_version == '2019-10-17-preview': + from .v2019_10_17.operations import PrivateEndpointConnectionsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def private_link_resources(self): + """Instance depends on the API version: + + * 2019-10-17-preview: :class:`PrivateLinkResourcesOperations` + """ + api_version = self._get_api_version('private_link_resources') + if api_version == '2019-10-17-preview': + from .v2019_10_17.operations import PrivateLinkResourcesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def private_link_scope_operation_status(self): + """Instance depends on the API version: + + * 2019-10-17-preview: :class:`PrivateLinkScopeOperationStatusOperations` + """ + api_version = self._get_api_version('private_link_scope_operation_status') + if api_version == '2019-10-17-preview': + from .v2019_10_17.operations import PrivateLinkScopeOperationStatusOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def private_link_scoped_resources(self): + """Instance depends on the API version: + + * 2019-10-17-preview: :class:`PrivateLinkScopedResourcesOperations` + """ + api_version = self._get_api_version('private_link_scoped_resources') + if api_version == '2019-10-17-preview': + from .v2019_10_17.operations import PrivateLinkScopedResourcesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def private_link_scopes(self): + """Instance depends on the API version: + + * 2019-10-17-preview: :class:`PrivateLinkScopesOperations` + """ + api_version = self._get_api_version('private_link_scopes') + if api_version == '2019-10-17-preview': + from .v2019_10_17.operations import PrivateLinkScopesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def scheduled_query_rules(self): + """Instance depends on the API version: + + * 2018-04-16: :class:`ScheduledQueryRulesOperations` + """ + api_version = self._get_api_version('scheduled_query_rules') + if api_version == '2018-04-16': + from .v2018_04_16.operations import ScheduledQueryRulesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def service_diagnostic_settings(self): + """Instance depends on the API version: + + * 2015-07-01: :class:`ServiceDiagnosticSettingsOperations` + * 2016-09-01: :class:`ServiceDiagnosticSettingsOperations` + """ + api_version = self._get_api_version('service_diagnostic_settings') + if api_version == '2015-07-01': + from .v2015_07_01.operations import ServiceDiagnosticSettingsOperations as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import ServiceDiagnosticSettingsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def tenant_activity_logs(self): + """Instance depends on the API version: + + * 2015-04-01: :class:`TenantActivityLogsOperations` + """ + api_version = self._get_api_version('tenant_activity_logs') + if api_version == '2015-04-01': + from .v2015_04_01.operations import TenantActivityLogsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def vm_insights(self): + """Instance depends on the API version: + + * 2018-11-27-preview: :class:`VMInsightsOperations` + """ + api_version = self._get_api_version('vm_insights') + if api_version == '2018-11-27-preview': + from .v2018_11_27_preview.operations import VMInsightsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models.py index 078f7216425a..09110c75b60e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models.py @@ -18,3 +18,4 @@ from .v2018_11_27_preview.models import * from .v2019_03_01.models import * from .v2019_06_01.models import * +from .v2019_10_17.models import * diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_activity_logs_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_activity_logs_operations.py index 70e9f879d39f..16004d4d9b34 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_activity_logs_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_activity_logs_operations.py @@ -39,11 +39,12 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list( - self, filter=None, select=None, custom_headers=None, raw=False, **operation_config): + self, filter, select=None, custom_headers=None, raw=False, **operation_config): """Provides the list of records from the activity logs. - :param filter: Reduces the set of data collected.
The **$filter** - argument is very restricted and allows only the following + :param filter: Reduces the set of data collected.
This argument is + required and it also requires at least the start date/time.
The + **$filter** argument is very restricted and allows only the following patterns.
- *List events for a resource group*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName @@ -93,8 +94,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_models.py index 1f45012628e6..ec08c11a750e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_models.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_models.py @@ -131,17 +131,22 @@ class DiagnosticSettingsResource(ProxyOnlyResource): :param event_hub_name: The name of the event hub. If none is specified, the default event hub will be selected. :type event_hub_name: str - :param metrics: the list of metric settings. + :param metrics: The list of metric settings. :type metrics: list[~azure.mgmt.monitor.v2017_05_01_preview.models.MetricSettings] - :param logs: the list of logs settings. + :param logs: The list of logs settings. :type logs: list[~azure.mgmt.monitor.v2017_05_01_preview.models.LogSettings] - :param workspace_id: The workspace ID (resource ID of a Log Analytics - workspace) for a Log Analytics workspace to which you would like to send - Diagnostic Logs. Example: + :param workspace_id: The full ARM resource ID of the Log Analytics + workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 :type workspace_id: str + :param log_analytics_destination_type: A string indicating whether the + export to Log Analytics should use the default destination type, i.e. + AzureDiagnostics, or use a destination type constructed as follows: + _. Possible values + are: Dedicated and null (null is default.) + :type log_analytics_destination_type: str """ _validation = { @@ -161,6 +166,7 @@ class DiagnosticSettingsResource(ProxyOnlyResource): 'metrics': {'key': 'properties.metrics', 'type': '[MetricSettings]'}, 'logs': {'key': 'properties.logs', 'type': '[LogSettings]'}, 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, + 'log_analytics_destination_type': {'key': 'properties.logAnalyticsDestinationType', 'type': 'str'}, } def __init__(self, **kwargs): @@ -172,6 +178,7 @@ def __init__(self, **kwargs): self.metrics = kwargs.get('metrics', None) self.logs = kwargs.get('logs', None) self.workspace_id = kwargs.get('workspace_id', None) + self.log_analytics_destination_type = kwargs.get('log_analytics_destination_type', None) class DiagnosticSettingsResourceCollection(Model): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_models_py3.py index 62b3b6b184d8..f1fbd5d163f1 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_models_py3.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_models_py3.py @@ -131,17 +131,22 @@ class DiagnosticSettingsResource(ProxyOnlyResource): :param event_hub_name: The name of the event hub. If none is specified, the default event hub will be selected. :type event_hub_name: str - :param metrics: the list of metric settings. + :param metrics: The list of metric settings. :type metrics: list[~azure.mgmt.monitor.v2017_05_01_preview.models.MetricSettings] - :param logs: the list of logs settings. + :param logs: The list of logs settings. :type logs: list[~azure.mgmt.monitor.v2017_05_01_preview.models.LogSettings] - :param workspace_id: The workspace ID (resource ID of a Log Analytics - workspace) for a Log Analytics workspace to which you would like to send - Diagnostic Logs. Example: + :param workspace_id: The full ARM resource ID of the Log Analytics + workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 :type workspace_id: str + :param log_analytics_destination_type: A string indicating whether the + export to Log Analytics should use the default destination type, i.e. + AzureDiagnostics, or use a destination type constructed as follows: + _. Possible values + are: Dedicated and null (null is default.) + :type log_analytics_destination_type: str """ _validation = { @@ -161,9 +166,10 @@ class DiagnosticSettingsResource(ProxyOnlyResource): 'metrics': {'key': 'properties.metrics', 'type': '[MetricSettings]'}, 'logs': {'key': 'properties.logs', 'type': '[LogSettings]'}, 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, + 'log_analytics_destination_type': {'key': 'properties.logAnalyticsDestinationType', 'type': 'str'}, } - def __init__(self, *, storage_account_id: str=None, service_bus_rule_id: str=None, event_hub_authorization_rule_id: str=None, event_hub_name: str=None, metrics=None, logs=None, workspace_id: str=None, **kwargs) -> None: + def __init__(self, *, storage_account_id: str=None, service_bus_rule_id: str=None, event_hub_authorization_rule_id: str=None, event_hub_name: str=None, metrics=None, logs=None, workspace_id: str=None, log_analytics_destination_type: str=None, **kwargs) -> None: super(DiagnosticSettingsResource, self).__init__(**kwargs) self.storage_account_id = storage_account_id self.service_bus_rule_id = service_bus_rule_id @@ -172,6 +178,7 @@ def __init__(self, *, storage_account_id: str=None, service_bus_rule_id: str=Non self.metrics = metrics self.logs = logs self.workspace_id = workspace_id + self.log_analytics_destination_type = log_analytics_destination_type class DiagnosticSettingsResourceCollection(Model): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_models.py index 645a3895d476..7f6c659c93a4 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_models.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_models.py @@ -113,7 +113,8 @@ class Metric(Model): :type name: ~azure.mgmt.monitor.v2018_01_01.models.LocalizableString :param unit: Required. the unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', - 'Percent', 'MilliSeconds', 'ByteSeconds', 'Unspecified' + 'Percent', 'MilliSeconds', 'ByteSeconds', 'Unspecified', 'Cores', + 'MilliCores', 'NanoCores', 'BitsPerSecond' :type unit: str or ~azure.mgmt.monitor.v2018_01_01.models.Unit :param timeseries: Required. the time series returned when a data query is performed. @@ -185,7 +186,8 @@ class MetricDefinition(Model): :type name: ~azure.mgmt.monitor.v2018_01_01.models.LocalizableString :param unit: the unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', 'Percent', - 'MilliSeconds', 'ByteSeconds', 'Unspecified' + 'MilliSeconds', 'ByteSeconds', 'Unspecified', 'Cores', 'MilliCores', + 'NanoCores', 'BitsPerSecond' :type unit: str or ~azure.mgmt.monitor.v2018_01_01.models.Unit :param primary_aggregation_type: the primary aggregation type value defining how to use the values for display. Possible values include: @@ -253,7 +255,7 @@ class MetricValue(Model): :type total: float :param count: the number of samples in the time range. Can be used to determine the number of values that contributed to the average value. - :type count: long + :type count: float """ _validation = { @@ -266,7 +268,7 @@ class MetricValue(Model): 'minimum': {'key': 'minimum', 'type': 'float'}, 'maximum': {'key': 'maximum', 'type': 'float'}, 'total': {'key': 'total', 'type': 'float'}, - 'count': {'key': 'count', 'type': 'long'}, + 'count': {'key': 'count', 'type': 'float'}, } def __init__(self, **kwargs): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_models_py3.py index 972b2120cfb0..946d425e0f4b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_models_py3.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_models_py3.py @@ -113,7 +113,8 @@ class Metric(Model): :type name: ~azure.mgmt.monitor.v2018_01_01.models.LocalizableString :param unit: Required. the unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', - 'Percent', 'MilliSeconds', 'ByteSeconds', 'Unspecified' + 'Percent', 'MilliSeconds', 'ByteSeconds', 'Unspecified', 'Cores', + 'MilliCores', 'NanoCores', 'BitsPerSecond' :type unit: str or ~azure.mgmt.monitor.v2018_01_01.models.Unit :param timeseries: Required. the time series returned when a data query is performed. @@ -185,7 +186,8 @@ class MetricDefinition(Model): :type name: ~azure.mgmt.monitor.v2018_01_01.models.LocalizableString :param unit: the unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', 'Percent', - 'MilliSeconds', 'ByteSeconds', 'Unspecified' + 'MilliSeconds', 'ByteSeconds', 'Unspecified', 'Cores', 'MilliCores', + 'NanoCores', 'BitsPerSecond' :type unit: str or ~azure.mgmt.monitor.v2018_01_01.models.Unit :param primary_aggregation_type: the primary aggregation type value defining how to use the values for display. Possible values include: @@ -253,7 +255,7 @@ class MetricValue(Model): :type total: float :param count: the number of samples in the time range. Can be used to determine the number of values that contributed to the average value. - :type count: long + :type count: float """ _validation = { @@ -266,10 +268,10 @@ class MetricValue(Model): 'minimum': {'key': 'minimum', 'type': 'float'}, 'maximum': {'key': 'maximum', 'type': 'float'}, 'total': {'key': 'total', 'type': 'float'}, - 'count': {'key': 'count', 'type': 'long'}, + 'count': {'key': 'count', 'type': 'float'}, } - def __init__(self, *, time_stamp, average: float=None, minimum: float=None, maximum: float=None, total: float=None, count: int=None, **kwargs) -> None: + def __init__(self, *, time_stamp, average: float=None, minimum: float=None, maximum: float=None, total: float=None, count: float=None, **kwargs) -> None: super(MetricValue, self).__init__(**kwargs) self.time_stamp = time_stamp self.average = average diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_monitor_management_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_monitor_management_client_enums.py index 61455e4c0c37..b8c55a6ea3b6 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_monitor_management_client_enums.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_monitor_management_client_enums.py @@ -23,6 +23,10 @@ class Unit(str, Enum): milli_seconds = "MilliSeconds" byte_seconds = "ByteSeconds" unspecified = "Unspecified" + cores = "Cores" + milli_cores = "MilliCores" + nano_cores = "NanoCores" + bits_per_second = "BitsPerSecond" class AggregationType(str, Enum): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/__init__.py index 99bcdefd12eb..5b2123b0bea5 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/__init__.py @@ -38,6 +38,7 @@ from ._models_py3 import SmsReceiver from ._models_py3 import VoiceReceiver from ._models_py3 import WebhookReceiver + from ._models_py3 import WebtestLocationAvailabilityCriteria except (SyntaxError, ImportError): from ._models import ActionGroupPatchBody from ._models import ActionGroupResource @@ -67,10 +68,14 @@ from ._models import SmsReceiver from ._models import VoiceReceiver from ._models import WebhookReceiver + from ._models import WebtestLocationAvailabilityCriteria from ._paged_models import ActionGroupResourcePaged from ._paged_models import MetricAlertResourcePaged from ._monitor_management_client_enums import ( ReceiverStatus, + Operator, + DynamicThresholdOperator, + DynamicThresholdSensitivity, ) __all__ = [ @@ -102,7 +107,11 @@ 'SmsReceiver', 'VoiceReceiver', 'WebhookReceiver', + 'WebtestLocationAvailabilityCriteria', 'ActionGroupResourcePaged', 'MetricAlertResourcePaged', 'ReceiverStatus', + 'Operator', + 'DynamicThresholdOperator', + 'DynamicThresholdSensitivity', ] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models.py index afd1c724fc87..69a7f66bd140 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models.py @@ -390,12 +390,15 @@ class DynamicMetricCriteria(MultiMetricCriteria): :param criterion_type: Required. Constant filled by server. :type criterion_type: str :param operator: Required. The operator used to compare the metric value - against the threshold. - :type operator: object + against the threshold. Possible values include: 'GreaterThan', 'LessThan', + 'GreaterOrLessThan' + :type operator: str or + ~azure.mgmt.monitor.v2018_03_01.models.DynamicThresholdOperator :param alert_sensitivity: Required. The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the - metric series pattern. - :type alert_sensitivity: object + metric series pattern. Possible values include: 'Low', 'Medium', 'High' + :type alert_sensitivity: str or + ~azure.mgmt.monitor.v2018_03_01.models.DynamicThresholdSensitivity :param failing_periods: Required. The minimum number of violations required within the selected lookback time window required to raise an alert. @@ -425,8 +428,8 @@ class DynamicMetricCriteria(MultiMetricCriteria): 'time_aggregation': {'key': 'timeAggregation', 'type': 'object'}, 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, 'criterion_type': {'key': 'criterionType', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'object'}, - 'alert_sensitivity': {'key': 'alertSensitivity', 'type': 'object'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'alert_sensitivity': {'key': 'alertSensitivity', 'type': 'str'}, 'failing_periods': {'key': 'failingPeriods', 'type': 'DynamicThresholdFailingPeriods'}, 'ignore_data_before': {'key': 'ignoreDataBefore', 'type': 'iso-8601'}, } @@ -651,19 +654,19 @@ class MetricAlertAction(Model): :param action_group_id: the id of the action group to use. :type action_group_id: str - :param webhook_properties: The properties of a webhook object. - :type webhook_properties: dict[str, str] + :param web_hook_properties: The properties of a webhook object. + :type web_hook_properties: dict[str, str] """ _attribute_map = { 'action_group_id': {'key': 'actionGroupId', 'type': 'str'}, - 'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'}, + 'web_hook_properties': {'key': 'webHookProperties', 'type': '{str}'}, } def __init__(self, **kwargs): super(MetricAlertAction, self).__init__(**kwargs) self.action_group_id = kwargs.get('action_group_id', None) - self.webhook_properties = kwargs.get('webhook_properties', None) + self.web_hook_properties = kwargs.get('web_hook_properties', None) class MetricAlertCriteria(Model): @@ -1055,8 +1058,10 @@ class MetricCriteria(MultiMetricCriteria): list[~azure.mgmt.monitor.v2018_03_01.models.MetricDimension] :param criterion_type: Required. Constant filled by server. :type criterion_type: str - :param operator: Required. the criteria operator. - :type operator: object + :param operator: Required. the criteria operator. Possible values include: + 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', + 'LessThanOrEqual' + :type operator: str or ~azure.mgmt.monitor.v2018_03_01.models.Operator :param threshold: Required. the criteria threshold value that activates the alert. :type threshold: float @@ -1079,7 +1084,7 @@ class MetricCriteria(MultiMetricCriteria): 'time_aggregation': {'key': 'timeAggregation', 'type': 'object'}, 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, 'criterion_type': {'key': 'criterionType', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'object'}, + 'operator': {'key': 'operator', 'type': 'str'}, 'threshold': {'key': 'threshold', 'type': 'float'}, } @@ -1225,3 +1230,35 @@ def __init__(self, **kwargs): super(WebhookReceiver, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.service_uri = kwargs.get('service_uri', None) + + +class WebtestLocationAvailabilityCriteria(Model): + """Specifies the metric alert rule criteria for a web test resource. + + All required parameters must be populated in order to send to Azure. + + :param web_test_id: Required. The Application Insights web test Id. + :type web_test_id: str + :param component_id: Required. The Application Insights resource Id. + :type component_id: str + :param failed_location_count: Required. The number of failed locations. + :type failed_location_count: float + """ + + _validation = { + 'web_test_id': {'required': True}, + 'component_id': {'required': True}, + 'failed_location_count': {'required': True}, + } + + _attribute_map = { + 'web_test_id': {'key': 'webTestId', 'type': 'str'}, + 'component_id': {'key': 'componentId', 'type': 'str'}, + 'failed_location_count': {'key': 'failedLocationCount', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(WebtestLocationAvailabilityCriteria, self).__init__(**kwargs) + self.web_test_id = kwargs.get('web_test_id', None) + self.component_id = kwargs.get('component_id', None) + self.failed_location_count = kwargs.get('failed_location_count', None) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models_py3.py index 9defb4f09032..e053f5e488d4 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models_py3.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models_py3.py @@ -390,12 +390,15 @@ class DynamicMetricCriteria(MultiMetricCriteria): :param criterion_type: Required. Constant filled by server. :type criterion_type: str :param operator: Required. The operator used to compare the metric value - against the threshold. - :type operator: object + against the threshold. Possible values include: 'GreaterThan', 'LessThan', + 'GreaterOrLessThan' + :type operator: str or + ~azure.mgmt.monitor.v2018_03_01.models.DynamicThresholdOperator :param alert_sensitivity: Required. The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the - metric series pattern. - :type alert_sensitivity: object + metric series pattern. Possible values include: 'Low', 'Medium', 'High' + :type alert_sensitivity: str or + ~azure.mgmt.monitor.v2018_03_01.models.DynamicThresholdSensitivity :param failing_periods: Required. The minimum number of violations required within the selected lookback time window required to raise an alert. @@ -425,8 +428,8 @@ class DynamicMetricCriteria(MultiMetricCriteria): 'time_aggregation': {'key': 'timeAggregation', 'type': 'object'}, 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, 'criterion_type': {'key': 'criterionType', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'object'}, - 'alert_sensitivity': {'key': 'alertSensitivity', 'type': 'object'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'alert_sensitivity': {'key': 'alertSensitivity', 'type': 'str'}, 'failing_periods': {'key': 'failingPeriods', 'type': 'DynamicThresholdFailingPeriods'}, 'ignore_data_before': {'key': 'ignoreDataBefore', 'type': 'iso-8601'}, } @@ -651,19 +654,19 @@ class MetricAlertAction(Model): :param action_group_id: the id of the action group to use. :type action_group_id: str - :param webhook_properties: The properties of a webhook object. - :type webhook_properties: dict[str, str] + :param web_hook_properties: The properties of a webhook object. + :type web_hook_properties: dict[str, str] """ _attribute_map = { 'action_group_id': {'key': 'actionGroupId', 'type': 'str'}, - 'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'}, + 'web_hook_properties': {'key': 'webHookProperties', 'type': '{str}'}, } - def __init__(self, *, action_group_id: str=None, webhook_properties=None, **kwargs) -> None: + def __init__(self, *, action_group_id: str=None, web_hook_properties=None, **kwargs) -> None: super(MetricAlertAction, self).__init__(**kwargs) self.action_group_id = action_group_id - self.webhook_properties = webhook_properties + self.web_hook_properties = web_hook_properties class MetricAlertCriteria(Model): @@ -1055,8 +1058,10 @@ class MetricCriteria(MultiMetricCriteria): list[~azure.mgmt.monitor.v2018_03_01.models.MetricDimension] :param criterion_type: Required. Constant filled by server. :type criterion_type: str - :param operator: Required. the criteria operator. - :type operator: object + :param operator: Required. the criteria operator. Possible values include: + 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', + 'LessThanOrEqual' + :type operator: str or ~azure.mgmt.monitor.v2018_03_01.models.Operator :param threshold: Required. the criteria threshold value that activates the alert. :type threshold: float @@ -1079,7 +1084,7 @@ class MetricCriteria(MultiMetricCriteria): 'time_aggregation': {'key': 'timeAggregation', 'type': 'object'}, 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, 'criterion_type': {'key': 'criterionType', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'object'}, + 'operator': {'key': 'operator', 'type': 'str'}, 'threshold': {'key': 'threshold', 'type': 'float'}, } @@ -1225,3 +1230,35 @@ def __init__(self, *, name: str, service_uri: str, **kwargs) -> None: super(WebhookReceiver, self).__init__(**kwargs) self.name = name self.service_uri = service_uri + + +class WebtestLocationAvailabilityCriteria(Model): + """Specifies the metric alert rule criteria for a web test resource. + + All required parameters must be populated in order to send to Azure. + + :param web_test_id: Required. The Application Insights web test Id. + :type web_test_id: str + :param component_id: Required. The Application Insights resource Id. + :type component_id: str + :param failed_location_count: Required. The number of failed locations. + :type failed_location_count: float + """ + + _validation = { + 'web_test_id': {'required': True}, + 'component_id': {'required': True}, + 'failed_location_count': {'required': True}, + } + + _attribute_map = { + 'web_test_id': {'key': 'webTestId', 'type': 'str'}, + 'component_id': {'key': 'componentId', 'type': 'str'}, + 'failed_location_count': {'key': 'failedLocationCount', 'type': 'float'}, + } + + def __init__(self, *, web_test_id: str, component_id: str, failed_location_count: float, **kwargs) -> None: + super(WebtestLocationAvailabilityCriteria, self).__init__(**kwargs) + self.web_test_id = web_test_id + self.component_id = component_id + self.failed_location_count = failed_location_count diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_monitor_management_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_monitor_management_client_enums.py index b6d8fd20db3d..3812569fefbd 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_monitor_management_client_enums.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_monitor_management_client_enums.py @@ -17,3 +17,27 @@ class ReceiverStatus(str, Enum): not_specified = "NotSpecified" enabled = "Enabled" disabled = "Disabled" + + +class Operator(str, Enum): + + equals = "Equals" + not_equals = "NotEquals" + greater_than = "GreaterThan" + greater_than_or_equal = "GreaterThanOrEqual" + less_than = "LessThan" + less_than_or_equal = "LessThanOrEqual" + + +class DynamicThresholdOperator(str, Enum): + + greater_than = "GreaterThan" + less_than = "LessThan" + greater_or_less_than = "GreaterOrLessThan" + + +class DynamicThresholdSensitivity(str, Enum): + + low = "Low" + medium = "Medium" + high = "High" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/operations/_baselines_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/operations/_baselines_operations.py index 3451d65c20b7..90c871a1aa40 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/operations/_baselines_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/operations/_baselines_operations.py @@ -69,7 +69,7 @@ def list( eq ‘*’ or B = ‘b2’**
This is invalid because the logical or operator cannot separate two different metadata names.
- Return all time series where A = a1, B = b1 and C = c1:
**$filter=A eq ‘a1’ - and B eq ‘b1’ and C eq ‘c1’**
- Return all time series where A = + and B eq ‘b1�� and C eq ‘c1’**
- Return all time series where A = a1
**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. :type filter: str :param result_type: Allows retrieving only metadata of the baseline. diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/__init__.py new file mode 100644 index 000000000000..940dc0469831 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/__init__.py @@ -0,0 +1,19 @@ +# 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. +# -------------------------------------------------------------------------- + +from ._configuration import MonitorClientConfiguration +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient', 'MonitorClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_configuration.py new file mode 100644 index 000000000000..f9af3d0f4eba --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_configuration.py @@ -0,0 +1,48 @@ +# 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. +# -------------------------------------------------------------------------- +from msrestazure import AzureConfiguration + +from .version import VERSION + + +class MonitorClientConfiguration(AzureConfiguration): + """Configuration for MonitorClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(MonitorClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-monitor/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_client.py new file mode 100644 index 000000000000..6b79182d8964 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_client.py @@ -0,0 +1,69 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import MonitorClientConfiguration +from .operations import PrivateLinkScopesOperations +from .operations import PrivateLinkScopeOperationStatusOperations +from .operations import PrivateLinkResourcesOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkScopedResourcesOperations +from . import models + + +class MonitorClient(SDKClient): + """Monitor Management Client + + :ivar config: Configuration for client. + :vartype config: MonitorClientConfiguration + + :ivar private_link_scopes: PrivateLinkScopes operations + :vartype private_link_scopes: azure.mgmt.monitor.v2019_10_17.operations.PrivateLinkScopesOperations + :ivar private_link_scope_operation_status: PrivateLinkScopeOperationStatus operations + :vartype private_link_scope_operation_status: azure.mgmt.monitor.v2019_10_17.operations.PrivateLinkScopeOperationStatusOperations + :ivar private_link_resources: PrivateLinkResources operations + :vartype private_link_resources: azure.mgmt.monitor.v2019_10_17.operations.PrivateLinkResourcesOperations + :ivar private_endpoint_connections: PrivateEndpointConnections operations + :vartype private_endpoint_connections: azure.mgmt.monitor.v2019_10_17.operations.PrivateEndpointConnectionsOperations + :ivar private_link_scoped_resources: PrivateLinkScopedResources operations + :vartype private_link_scoped_resources: azure.mgmt.monitor.v2019_10_17.operations.PrivateLinkScopedResourcesOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = MonitorClientConfiguration(credentials, subscription_id, base_url) + super(MonitorClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2019-10-17-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.private_link_scopes = PrivateLinkScopesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_scope_operation_status = PrivateLinkScopeOperationStatusOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_scoped_resources = PrivateLinkScopedResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/__init__.py new file mode 100644 index 000000000000..1c5f14f0e4ef --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/__init__.py @@ -0,0 +1,60 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AzureMonitorPrivateLinkScope + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import OperationStatus + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointProperty + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkScopesResource + from ._models_py3 import PrivateLinkServiceConnectionStateProperty + from ._models_py3 import ProxyResource + from ._models_py3 import ScopedResource + from ._models_py3 import TagsResource +except (SyntaxError, ImportError): + from ._models import AzureMonitorPrivateLinkScope + from ._models import ErrorAdditionalInfo + from ._models import ErrorResponse, ErrorResponseException + from ._models import OperationStatus + from ._models import PrivateEndpointConnection + from ._models import PrivateEndpointProperty + from ._models import PrivateLinkResource + from ._models import PrivateLinkScopesResource + from ._models import PrivateLinkServiceConnectionStateProperty + from ._models import ProxyResource + from ._models import ScopedResource + from ._models import TagsResource +from ._paged_models import AzureMonitorPrivateLinkScopePaged +from ._paged_models import PrivateEndpointConnectionPaged +from ._paged_models import PrivateLinkResourcePaged +from ._paged_models import ScopedResourcePaged + +__all__ = [ + 'AzureMonitorPrivateLinkScope', + 'ErrorAdditionalInfo', + 'ErrorResponse', 'ErrorResponseException', + 'OperationStatus', + 'PrivateEndpointConnection', + 'PrivateEndpointProperty', + 'PrivateLinkResource', + 'PrivateLinkScopesResource', + 'PrivateLinkServiceConnectionStateProperty', + 'ProxyResource', + 'ScopedResource', + 'TagsResource', + 'AzureMonitorPrivateLinkScopePaged', + 'PrivateLinkResourcePaged', + 'PrivateEndpointConnectionPaged', + 'ScopedResourcePaged', +] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/_models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/_models.py new file mode 100644 index 000000000000..3000a8a2c424 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/_models.py @@ -0,0 +1,475 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class PrivateLinkScopesResource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkScopesResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class AzureMonitorPrivateLinkScope(PrivateLinkScopesResource): + """An Azure Monitor PrivateLinkScope definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar provisioning_state: Current state of this PrivateLinkScope: whether + or not is has been provisioned within the resource group it is defined. + Users cannot change this value but are able to read from it. Values will + include Provisioning ,Succeeded, Canceled and Failed. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureMonitorPrivateLinkScope, self).__init__(**kwargs) + self.provisioning_state = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorResponse(Model): + """The resource management error response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.monitor.v2019_10_17.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.monitor.v2019_10_17.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class OperationStatus(Model): + """The status of operation. + + :param id: The operation Id. + :type id: str + :param name: The operation name. + :type name: str + :param start_time: Start time of the job in standard ISO8601 format. + :type start_time: datetime + :param end_time: End time of the job in standard ISO8601 format. + :type end_time: datetime + :param status: The status of the operation. + :type status: str + :param error: The error detail of the operation if any. + :type error: ~azure.mgmt.monitor.v2019_10_17.models.ErrorResponse + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs): + super(OperationStatus, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) + + +class ProxyResource(Model): + """Common properties of proxy resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.tags = kwargs.get('tags', None) + + +class PrivateEndpointConnection(ProxyResource): + """A private endpoint connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags + :type tags: dict[str, str] + :param private_endpoint: Private endpoint which the connection belongs to. + :type private_endpoint: + ~azure.mgmt.monitor.v2019_10_17.models.PrivateEndpointProperty + :param private_link_service_connection_state: Connection state of the + private endpoint connection. + :type private_link_service_connection_state: + ~azure.mgmt.monitor.v2019_10_17.models.PrivateLinkServiceConnectionStateProperty + :ivar provisioning_state: State of the private endpoint connection. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointProperty'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionStateProperty'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = None + + +class PrivateEndpointProperty(Model): + """Private endpoint which the connection belongs to. + + :param id: Resource id of the private endpoint. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpointProperty, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class PrivateLinkResource(ProxyResource): + """A private link resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + + +class PrivateLinkServiceConnectionStateProperty(Model): + """State of the private endpoint connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. The private link service connection status. + :type status: str + :param description: Required. The private link service connection + description. + :type description: str + :ivar actions_required: The actions required for private link service + connection. + :vartype actions_required: str + """ + + _validation = { + 'status': {'required': True}, + 'description': {'required': True}, + 'actions_required': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkServiceConnectionStateProperty, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = None + + +class ScopedResource(ProxyResource): + """A private link scoped resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags + :type tags: dict[str, str] + :param linked_resource_id: The resource id of the scoped Azure monitor + resource. + :type linked_resource_id: str + :ivar provisioning_state: State of the private endpoint connection. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'linked_resource_id': {'key': 'properties.linkedResourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ScopedResource, self).__init__(**kwargs) + self.linked_resource_id = kwargs.get('linked_resource_id', None) + self.provisioning_state = None + + +class TagsResource(Model): + """A container holding only the Tags for a resource, allowing the user to + update the tags on a PrivateLinkScope instance. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TagsResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/_models_py3.py new file mode 100644 index 000000000000..56a08b9b57f0 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/_models_py3.py @@ -0,0 +1,475 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class PrivateLinkScopesResource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(PrivateLinkScopesResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class AzureMonitorPrivateLinkScope(PrivateLinkScopesResource): + """An Azure Monitor PrivateLinkScope definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar provisioning_state: Current state of this PrivateLinkScope: whether + or not is has been provisioned within the resource group it is defined. + Users cannot change this value but are able to read from it. Values will + include Provisioning ,Succeeded, Canceled and Failed. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(AzureMonitorPrivateLinkScope, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorResponse(Model): + """The resource management error response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.monitor.v2019_10_17.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.monitor.v2019_10_17.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class OperationStatus(Model): + """The status of operation. + + :param id: The operation Id. + :type id: str + :param name: The operation name. + :type name: str + :param start_time: Start time of the job in standard ISO8601 format. + :type start_time: datetime + :param end_time: End time of the job in standard ISO8601 format. + :type end_time: datetime + :param status: The status of the operation. + :type status: str + :param error: The error detail of the operation if any. + :type error: ~azure.mgmt.monitor.v2019_10_17.models.ErrorResponse + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, *, id: str=None, name: str=None, start_time=None, end_time=None, status: str=None, error=None, **kwargs) -> None: + super(OperationStatus, self).__init__(**kwargs) + self.id = id + self.name = name + self.start_time = start_time + self.end_time = end_time + self.status = status + self.error = error + + +class ProxyResource(Model): + """Common properties of proxy resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.tags = tags + + +class PrivateEndpointConnection(ProxyResource): + """A private endpoint connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags + :type tags: dict[str, str] + :param private_endpoint: Private endpoint which the connection belongs to. + :type private_endpoint: + ~azure.mgmt.monitor.v2019_10_17.models.PrivateEndpointProperty + :param private_link_service_connection_state: Connection state of the + private endpoint connection. + :type private_link_service_connection_state: + ~azure.mgmt.monitor.v2019_10_17.models.PrivateLinkServiceConnectionStateProperty + :ivar provisioning_state: State of the private endpoint connection. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointProperty'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionStateProperty'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, tags=None, private_endpoint=None, private_link_service_connection_state=None, **kwargs) -> None: + super(PrivateEndpointConnection, self).__init__(tags=tags, **kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None + + +class PrivateEndpointProperty(Model): + """Private endpoint which the connection belongs to. + + :param id: Resource id of the private endpoint. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(PrivateEndpointProperty, self).__init__(**kwargs) + self.id = id + + +class PrivateLinkResource(ProxyResource): + """A private link resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(PrivateLinkResource, self).__init__(tags=tags, **kwargs) + self.group_id = None + self.required_members = None + + +class PrivateLinkServiceConnectionStateProperty(Model): + """State of the private endpoint connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. The private link service connection status. + :type status: str + :param description: Required. The private link service connection + description. + :type description: str + :ivar actions_required: The actions required for private link service + connection. + :vartype actions_required: str + """ + + _validation = { + 'status': {'required': True}, + 'description': {'required': True}, + 'actions_required': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, *, status: str, description: str, **kwargs) -> None: + super(PrivateLinkServiceConnectionStateProperty, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = None + + +class ScopedResource(ProxyResource): + """A private link scoped resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags + :type tags: dict[str, str] + :param linked_resource_id: The resource id of the scoped Azure monitor + resource. + :type linked_resource_id: str + :ivar provisioning_state: State of the private endpoint connection. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'linked_resource_id': {'key': 'properties.linkedResourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, tags=None, linked_resource_id: str=None, **kwargs) -> None: + super(ScopedResource, self).__init__(tags=tags, **kwargs) + self.linked_resource_id = linked_resource_id + self.provisioning_state = None + + +class TagsResource(Model): + """A container holding only the Tags for a resource, allowing the user to + update the tags on a PrivateLinkScope instance. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(TagsResource, self).__init__(**kwargs) + self.tags = tags diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/_paged_models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/_paged_models.py new file mode 100644 index 000000000000..c79b661be20f --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/models/_paged_models.py @@ -0,0 +1,66 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class AzureMonitorPrivateLinkScopePaged(Paged): + """ + A paging container for iterating over a list of :class:`AzureMonitorPrivateLinkScope ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AzureMonitorPrivateLinkScope]'} + } + + def __init__(self, *args, **kwargs): + + super(AzureMonitorPrivateLinkScopePaged, self).__init__(*args, **kwargs) +class PrivateLinkResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateLinkResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateLinkResource]'} + } + + def __init__(self, *args, **kwargs): + + super(PrivateLinkResourcePaged, self).__init__(*args, **kwargs) +class PrivateEndpointConnectionPaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateEndpointConnection ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateEndpointConnection]'} + } + + def __init__(self, *args, **kwargs): + + super(PrivateEndpointConnectionPaged, self).__init__(*args, **kwargs) +class ScopedResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`ScopedResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ScopedResource]'} + } + + def __init__(self, *args, **kwargs): + + super(ScopedResourcePaged, self).__init__(*args, **kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/__init__.py new file mode 100644 index 000000000000..700ace1f9db0 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/__init__.py @@ -0,0 +1,24 @@ +# 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. +# -------------------------------------------------------------------------- + +from ._private_link_scopes_operations import PrivateLinkScopesOperations +from ._private_link_scope_operation_status_operations import PrivateLinkScopeOperationStatusOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_scoped_resources_operations import PrivateLinkScopedResourcesOperations + +__all__ = [ + 'PrivateLinkScopesOperations', + 'PrivateLinkScopeOperationStatusOperations', + 'PrivateLinkResourcesOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkScopedResourcesOperations', +] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_endpoint_connections_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..a226ee28cb33 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,379 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2019-10-17-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-17-preview" + + self.config = config + + def get( + self, resource_group_name, scope_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """Gets a private endpoint connection. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param scope_name: Name of the Azure Monitor PrivateLinkScope that + will contain the datasource + :type scope_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection. + :type private_endpoint_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.monitor.v2019_10_17.models.PrivateEndpointConnection or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + + def _create_or_update_initial( + self, resource_group_name, scope_name, private_endpoint_connection_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, scope_name, private_endpoint_connection_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param scope_name: Name of the Azure Monitor PrivateLinkScope that + will contain the datasource + :type scope_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection. + :type private_endpoint_connection_name: str + :param parameters: + :type parameters: + ~azure.mgmt.monitor.v2019_10_17.models.PrivateEndpointConnection + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PrivateEndpointConnection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.monitor.v2019_10_17.models.PrivateEndpointConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.monitor.v2019_10_17.models.PrivateEndpointConnection]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + + def _delete_initial( + self, resource_group_name, scope_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, scope_name, private_endpoint_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param scope_name: Name of the Azure Monitor PrivateLinkScope that + will contain the datasource + :type scope_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection. + :type private_endpoint_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + def list_by_private_link_scope( + self, resource_group_name, scope_name, custom_headers=None, raw=False, **operation_config): + """Gets all private endpoint connections on a private link scope. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param scope_name: Name of the Azure Monitor PrivateLinkScope that + will contain the datasource + :type scope_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PrivateEndpointConnection + :rtype: + ~azure.mgmt.monitor.v2019_10_17.models.PrivateEndpointConnectionPaged[~azure.mgmt.monitor.v2019_10_17.models.PrivateEndpointConnection] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_private_link_scope.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateEndpointConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_private_link_scope.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateEndpointConnections'} diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_resources_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..6442301ac264 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_resources_operations.py @@ -0,0 +1,182 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2019-10-17-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-17-preview" + + self.config = config + + def list_by_private_link_scope( + self, resource_group_name, scope_name, custom_headers=None, raw=False, **operation_config): + """Gets the private link resources that need to be created for a Azure + Monitor PrivateLinkScope. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param scope_name: Name of the Azure Monitor PrivateLinkScope that + will contain the datasource + :type scope_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PrivateLinkResource + :rtype: + ~azure.mgmt.monitor.v2019_10_17.models.PrivateLinkResourcePaged[~azure.mgmt.monitor.v2019_10_17.models.PrivateLinkResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_private_link_scope.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateLinkResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_private_link_scope.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateLinkResources'} + + def get( + self, resource_group_name, scope_name, group_name, custom_headers=None, raw=False, **operation_config): + """Gets the private link resources that need to be created for a Azure + Monitor PrivateLinkScope. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param scope_name: Name of the Azure Monitor PrivateLinkScope that + will contain the datasource + :type scope_name: str + :param group_name: The name of the private link resource. + :type group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PrivateLinkResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.v2019_10_17.models.PrivateLinkResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}'} diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scope_operation_status_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scope_operation_status_operations.py new file mode 100644 index 000000000000..5eece5421950 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scope_operation_status_operations.py @@ -0,0 +1,103 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class PrivateLinkScopeOperationStatusOperations(object): + """PrivateLinkScopeOperationStatusOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2019-10-17-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-17-preview" + + self.config = config + + def get( + self, async_operation_id, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get the status of an azure asynchronous operation associated with a + private link scope operation. + + :param async_operation_id: The operation Id. + :type async_operation_id: str + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.v2019_10_17.models.OperationStatus or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'asyncOperationId': self._serialize.url("async_operation_id", async_operation_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopeOperationStatuses/{asyncOperationId}'} diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scoped_resources_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scoped_resources_operations.py new file mode 100644 index 000000000000..7b4fdbeaa933 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scoped_resources_operations.py @@ -0,0 +1,379 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class PrivateLinkScopedResourcesOperations(object): + """PrivateLinkScopedResourcesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2019-10-17-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-17-preview" + + self.config = config + + def get( + self, resource_group_name, scope_name, name, custom_headers=None, raw=False, **operation_config): + """Gets a scoped resource in a private link scope. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param scope_name: Name of the Azure Monitor PrivateLinkScope that + will contain the datasource + :type scope_name: str + :param name: The name of the scoped resource object. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ScopedResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.v2019_10_17.models.ScopedResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'name': self._serialize.url("name", name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ScopedResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/scopedResources/{name}'} + + + def _create_or_update_initial( + self, resource_group_name, scope_name, name, tags=None, linked_resource_id=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ScopedResource(tags=tags, linked_resource_id=linked_resource_id) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'name': self._serialize.url("name", name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ScopedResource') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ScopedResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, scope_name, name, tags=None, linked_resource_id=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param scope_name: Name of the Azure Monitor PrivateLinkScope that + will contain the datasource + :type scope_name: str + :param name: The name of the scoped resource object. + :type name: str + :param tags: Resource tags + :type tags: dict[str, str] + :param linked_resource_id: The resource id of the scoped Azure monitor + resource. + :type linked_resource_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ScopedResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.monitor.v2019_10_17.models.ScopedResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.monitor.v2019_10_17.models.ScopedResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + scope_name=scope_name, + name=name, + tags=tags, + linked_resource_id=linked_resource_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ScopedResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/scopedResources/{name}'} + + + def _delete_initial( + self, resource_group_name, scope_name, name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'name': self._serialize.url("name", name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, scope_name, name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param scope_name: Name of the Azure Monitor PrivateLinkScope that + will contain the datasource + :type scope_name: str + :param name: The name of the scoped resource object. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + scope_name=scope_name, + name=name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/scopedResources/{name}'} + + def list_by_private_link_scope( + self, resource_group_name, scope_name, custom_headers=None, raw=False, **operation_config): + """Gets all private endpoint connections on a private link scope. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param scope_name: Name of the Azure Monitor PrivateLinkScope that + will contain the datasource + :type scope_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ScopedResource + :rtype: + ~azure.mgmt.monitor.v2019_10_17.models.ScopedResourcePaged[~azure.mgmt.monitor.v2019_10_17.models.ScopedResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_private_link_scope.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ScopedResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_private_link_scope.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/scopedResources'} diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scopes_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scopes_operations.py new file mode 100644 index 000000000000..7f4b5fbde940 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scopes_operations.py @@ -0,0 +1,466 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class PrivateLinkScopesOperations(object): + """PrivateLinkScopesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2019-10-17-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-17-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of all Azure Monitor PrivateLinkScopes within a + subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AzureMonitorPrivateLinkScope + :rtype: + ~azure.mgmt.monitor.v2019_10_17.models.AzureMonitorPrivateLinkScopePaged[~azure.mgmt.monitor.v2019_10_17.models.AzureMonitorPrivateLinkScope] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AzureMonitorPrivateLinkScopePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/privateLinkScopes'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of Azure Monitor PrivateLinkScopes within a resource group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AzureMonitorPrivateLinkScope + :rtype: + ~azure.mgmt.monitor.v2019_10_17.models.AzureMonitorPrivateLinkScopePaged[~azure.mgmt.monitor.v2019_10_17.models.AzureMonitorPrivateLinkScope] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AzureMonitorPrivateLinkScopePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes'} + + + def _delete_initial( + self, resource_group_name, scope_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, scope_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a Azure Monitor PrivateLinkScope. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Monitor PrivateLinkScope + resource. + :type scope_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + scope_name=scope_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes/{scopeName}'} + + def get( + self, resource_group_name, scope_name, custom_headers=None, raw=False, **operation_config): + """Returns a Azure Monitor PrivateLinkScope. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Monitor PrivateLinkScope + resource. + :type scope_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AzureMonitorPrivateLinkScope or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.monitor.v2019_10_17.models.AzureMonitorPrivateLinkScope or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AzureMonitorPrivateLinkScope', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes/{scopeName}'} + + def create_or_update( + self, resource_group_name, scope_name, location, tags=None, custom_headers=None, raw=False, **operation_config): + """Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot + specify a different value for InstrumentationKey nor AppId in the Put + operation. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Monitor PrivateLinkScope + resource. + :type scope_name: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AzureMonitorPrivateLinkScope or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.monitor.v2019_10_17.models.AzureMonitorPrivateLinkScope or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + azure_monitor_private_link_scope_payload = models.AzureMonitorPrivateLinkScope(location=location, tags=tags) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(azure_monitor_private_link_scope_payload, 'AzureMonitorPrivateLinkScope') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AzureMonitorPrivateLinkScope', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes/{scopeName}'} + + def update_tags( + self, resource_group_name, scope_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates an existing PrivateLinkScope's tags. To update other fields use + the CreateOrUpdate method. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Monitor PrivateLinkScope + resource. + :type scope_name: str + :param tags: Resource tags + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AzureMonitorPrivateLinkScope or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.monitor.v2019_10_17.models.AzureMonitorPrivateLinkScope or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + private_link_scope_tags = models.TagsResource(tags=tags) + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(private_link_scope_tags, 'TagsResource') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AzureMonitorPrivateLinkScope', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes/{scopeName}'} diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/version.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/version.py new file mode 100644 index 000000000000..663461d3c4c7 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "2019-10-17-preview" + From eef25bfa5b5d8f4f4cb48ec7495f7da505ef09fd Mon Sep 17 00:00:00 2001 From: root Date: Sat, 14 Mar 2020 08:48:50 +0000 Subject: [PATCH 2/3] add change log --- sdk/monitor/azure-mgmt-monitor/CHANGELOG.md | 19 +++++++++++++++++++ .../azure/mgmt/monitor/version.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/sdk/monitor/azure-mgmt-monitor/CHANGELOG.md b/sdk/monitor/azure-mgmt-monitor/CHANGELOG.md index b300c9c6b173..ddd528b9ab1d 100644 --- a/sdk/monitor/azure-mgmt-monitor/CHANGELOG.md +++ b/sdk/monitor/azure-mgmt-monitor/CHANGELOG.md @@ -1,5 +1,24 @@ # Release History +## 0.8.0 (2020-03-14) + +**Features** + +- Model DiagnosticSettingsResource has a new parameter log_analytics_destination_type +- Model ProxyResource has a new parameter tags +- Model MetricAlertAction has a new parameter web_hook_properties +- Added operation group PrivateEndpointConnectionsOperations +- Added operation group PrivateLinkScopedResourcesOperations +- Added operation group PrivateLinkScopeOperationStatusOperations +- Added operation group PrivateLinkResourcesOperations +- Added operation group PrivateLinkScopesOperations + +**Breaking changes** + +- Model MetricAlertAction no longer has parameter webhook_properties +- Model ErrorResponse has a new signature + + ## 0.7.0 (2019-06-24) This package now support profiles as parameter for sovereign cloud diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/version.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/version.py index 981739e4ff95..e4f3d5055303 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/version.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.7.0" +VERSION = "0.8.0" From 0f209eb07b9f53f74d0e2a8aefbdb5cb693a6ecf Mon Sep 17 00:00:00 2001 From: Azure SDK Bot Date: Sat, 14 Mar 2020 08:54:23 +0000 Subject: [PATCH 3/3] Packaging update of azure-mgmt-monitor --- sdk/monitor/azure-mgmt-monitor/README.md | 30 +++++++++--------------- sdk/monitor/azure-mgmt-monitor/setup.py | 2 +- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/sdk/monitor/azure-mgmt-monitor/README.md b/sdk/monitor/azure-mgmt-monitor/README.md index 50e5e81ca360..63160ba1e003 100644 --- a/sdk/monitor/azure-mgmt-monitor/README.md +++ b/sdk/monitor/azure-mgmt-monitor/README.md @@ -1,29 +1,21 @@ -## Microsoft Azure SDK for Python +# Microsoft Azure SDK for Python This is the Microsoft Azure Monitor Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/) -Azure Resource Manager (ARM) is the next generation of management APIs -that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. +# Usage -For the older Azure Service Management (ASM) libraries, see -[azure-servicemanagement-legacy](https://pypi.python.org/pypi/azure-servicemanagement-legacy) -library. - -For a more complete set of Azure libraries, see the -[azure](https://pypi.python.org/pypi/azure) bundle package. - -## Usage - -For code examples, see -[Monitor](https://docs.microsoft.com/python/api/overview/azure/monitoring) +For code examples, see [Monitor](https://docs.microsoft.com/python/api/overview/azure/monitoring) on docs.microsoft.com. -## Provide Feedback -If you encounter any bugs or have suggestions, please file an issue in -the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. -![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-monitor%2FREADME.png) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-monitor%2FREADME.png) diff --git a/sdk/monitor/azure-mgmt-monitor/setup.py b/sdk/monitor/azure-mgmt-monitor/setup.py index 505a9c4ece6d..23cbb6fe9a57 100644 --- a/sdk/monitor/azure-mgmt-monitor/setup.py +++ b/sdk/monitor/azure-mgmt-monitor/setup.py @@ -64,10 +64,10 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', ], zip_safe=False,