diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/__init__.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/__init__.py new file mode 100644 index 000000000000..d45e80c75a79 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/__init__.py @@ -0,0 +1,18 @@ +# 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 .monitor_management_client import MonitorManagementClient +from .version import VERSION + +__all__ = ['MonitorManagementClient'] + +__version__ = VERSION + diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py new file mode 100644 index 000000000000..0e8040be7c8f --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py @@ -0,0 +1,443 @@ +# 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 .resource_py3 import Resource + from .scale_capacity_py3 import ScaleCapacity + from .metric_trigger_py3 import MetricTrigger + from .scale_action_py3 import ScaleAction + from .scale_rule_py3 import ScaleRule + from .time_window_py3 import TimeWindow + from .recurrent_schedule_py3 import RecurrentSchedule + from .recurrence_py3 import Recurrence + from .autoscale_profile_py3 import AutoscaleProfile + from .email_notification_py3 import EmailNotification + from .webhook_notification_py3 import WebhookNotification + from .autoscale_notification_py3 import AutoscaleNotification + from .autoscale_setting_resource_py3 import AutoscaleSettingResource + from .autoscale_setting_resource_patch_py3 import AutoscaleSettingResourcePatch + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .operation_list_result_py3 import OperationListResult + from .incident_py3 import Incident + from .rule_data_source_py3 import RuleDataSource + from .rule_condition_py3 import RuleCondition + from .rule_metric_data_source_py3 import RuleMetricDataSource + from .rule_management_event_claims_data_source_py3 import RuleManagementEventClaimsDataSource + from .rule_management_event_data_source_py3 import RuleManagementEventDataSource + from .threshold_rule_condition_py3 import ThresholdRuleCondition + from .location_threshold_rule_condition_py3 import LocationThresholdRuleCondition + from .management_event_aggregation_condition_py3 import ManagementEventAggregationCondition + from .management_event_rule_condition_py3 import ManagementEventRuleCondition + from .rule_action_py3 import RuleAction + from .rule_email_action_py3 import RuleEmailAction + from .rule_webhook_action_py3 import RuleWebhookAction + from .alert_rule_resource_py3 import AlertRuleResource + from .alert_rule_resource_patch_py3 import AlertRuleResourcePatch + from .retention_policy_py3 import RetentionPolicy + from .log_profile_resource_py3 import LogProfileResource + from .log_profile_resource_patch_py3 import LogProfileResourcePatch + from .proxy_only_resource_py3 import ProxyOnlyResource + from .metric_settings_py3 import MetricSettings + from .log_settings_py3 import LogSettings + from .diagnostic_settings_resource_py3 import DiagnosticSettingsResource + from .diagnostic_settings_resource_collection_py3 import DiagnosticSettingsResourceCollection + from .diagnostic_settings_category_resource_py3 import DiagnosticSettingsCategoryResource + from .diagnostic_settings_category_resource_collection_py3 import DiagnosticSettingsCategoryResourceCollection + from .email_receiver_py3 import EmailReceiver + from .sms_receiver_py3 import SmsReceiver + from .webhook_receiver_py3 import WebhookReceiver + from .itsm_receiver_py3 import ItsmReceiver + from .azure_app_push_receiver_py3 import AzureAppPushReceiver + from .automation_runbook_receiver_py3 import AutomationRunbookReceiver + from .voice_receiver_py3 import VoiceReceiver + from .logic_app_receiver_py3 import LogicAppReceiver + from .azure_function_receiver_py3 import AzureFunctionReceiver + from .arm_role_receiver_py3 import ArmRoleReceiver + from .action_group_resource_py3 import ActionGroupResource + from .enable_request_py3 import EnableRequest + from .action_group_patch_body_py3 import ActionGroupPatchBody + from .activity_log_alert_leaf_condition_py3 import ActivityLogAlertLeafCondition + from .activity_log_alert_all_of_condition_py3 import ActivityLogAlertAllOfCondition + from .activity_log_alert_action_group_py3 import ActivityLogAlertActionGroup + from .activity_log_alert_action_list_py3 import ActivityLogAlertActionList + from .activity_log_alert_resource_py3 import ActivityLogAlertResource + from .activity_log_alert_patch_body_py3 import ActivityLogAlertPatchBody + from .localizable_string_py3 import LocalizableString + from .sender_authorization_py3 import SenderAuthorization + from .http_request_info_py3 import HttpRequestInfo + from .event_data_py3 import EventData + from .metric_availability_py3 import MetricAvailability + from .metric_definition_py3 import MetricDefinition + from .metric_value_py3 import MetricValue + from .metadata_value_py3 import MetadataValue + from .time_series_element_py3 import TimeSeriesElement + from .metric_py3 import Metric + from .response_py3 import Response + from .baseline_metadata_value_py3 import BaselineMetadataValue + from .baseline_py3 import Baseline + from .baseline_response_py3 import BaselineResponse + from .time_series_information_py3 import TimeSeriesInformation + from .calculate_baseline_response_py3 import CalculateBaselineResponse + from .metric_single_dimension_py3 import MetricSingleDimension + from .single_baseline_py3 import SingleBaseline + from .baseline_metadata_py3 import BaselineMetadata + from .time_series_baseline_py3 import TimeSeriesBaseline + from .single_metric_baseline_py3 import SingleMetricBaseline + from .metric_alert_action_py3 import MetricAlertAction + from .metric_alert_criteria_py3 import MetricAlertCriteria + from .metric_alert_resource_py3 import MetricAlertResource + from .metric_alert_resource_patch_py3 import MetricAlertResourcePatch + from .metric_alert_status_properties_py3 import MetricAlertStatusProperties + from .metric_alert_status_py3 import MetricAlertStatus + from .metric_alert_status_collection_py3 import MetricAlertStatusCollection + from .metric_criteria_py3 import MetricCriteria + from .metric_alert_single_resource_multiple_metric_criteria_py3 import MetricAlertSingleResourceMultipleMetricCriteria + from .metric_dimension_py3 import MetricDimension + from .multi_metric_criteria_py3 import MultiMetricCriteria + from .metric_alert_multiple_resource_multiple_metric_criteria_py3 import MetricAlertMultipleResourceMultipleMetricCriteria + from .dynamic_threshold_failing_periods_py3 import DynamicThresholdFailingPeriods + from .dynamic_metric_criteria_py3 import DynamicMetricCriteria + from .source_py3 import Source + from .schedule_py3 import Schedule + from .action_py3 import Action + from .log_search_rule_resource_py3 import LogSearchRuleResource + from .log_search_rule_resource_patch_py3 import LogSearchRuleResourcePatch + from .log_metric_trigger_py3 import LogMetricTrigger + from .trigger_condition_py3 import TriggerCondition + from .az_ns_action_group_py3 import AzNsActionGroup + from .alerting_action_py3 import AlertingAction + from .dimension_py3 import Dimension + from .criteria_py3 import Criteria + from .log_to_metric_action_py3 import LogToMetricAction + from .metric_namespace_name_py3 import MetricNamespaceName + from .metric_namespace_py3 import MetricNamespace + from .proxy_resource_py3 import ProxyResource + from .error_py3 import Error + from .response_with_error_py3 import ResponseWithError, ResponseWithErrorException + from .workspace_info_py3 import WorkspaceInfo + from .data_container_py3 import DataContainer + from .vm_insights_onboarding_status_py3 import VMInsightsOnboardingStatus +except (SyntaxError, ImportError): + from .resource import Resource + from .scale_capacity import ScaleCapacity + from .metric_trigger import MetricTrigger + from .scale_action import ScaleAction + from .scale_rule import ScaleRule + from .time_window import TimeWindow + from .recurrent_schedule import RecurrentSchedule + from .recurrence import Recurrence + from .autoscale_profile import AutoscaleProfile + from .email_notification import EmailNotification + from .webhook_notification import WebhookNotification + from .autoscale_notification import AutoscaleNotification + from .autoscale_setting_resource import AutoscaleSettingResource + from .autoscale_setting_resource_patch import AutoscaleSettingResourcePatch + from .error_response import ErrorResponse, ErrorResponseException + from .operation_display import OperationDisplay + from .operation import Operation + from .operation_list_result import OperationListResult + from .incident import Incident + from .rule_data_source import RuleDataSource + from .rule_condition import RuleCondition + from .rule_metric_data_source import RuleMetricDataSource + from .rule_management_event_claims_data_source import RuleManagementEventClaimsDataSource + from .rule_management_event_data_source import RuleManagementEventDataSource + from .threshold_rule_condition import ThresholdRuleCondition + from .location_threshold_rule_condition import LocationThresholdRuleCondition + from .management_event_aggregation_condition import ManagementEventAggregationCondition + from .management_event_rule_condition import ManagementEventRuleCondition + from .rule_action import RuleAction + from .rule_email_action import RuleEmailAction + from .rule_webhook_action import RuleWebhookAction + from .alert_rule_resource import AlertRuleResource + from .alert_rule_resource_patch import AlertRuleResourcePatch + from .retention_policy import RetentionPolicy + from .log_profile_resource import LogProfileResource + from .log_profile_resource_patch import LogProfileResourcePatch + from .proxy_only_resource import ProxyOnlyResource + from .metric_settings import MetricSettings + from .log_settings import LogSettings + from .diagnostic_settings_resource import DiagnosticSettingsResource + from .diagnostic_settings_resource_collection import DiagnosticSettingsResourceCollection + from .diagnostic_settings_category_resource import DiagnosticSettingsCategoryResource + from .diagnostic_settings_category_resource_collection import DiagnosticSettingsCategoryResourceCollection + from .email_receiver import EmailReceiver + from .sms_receiver import SmsReceiver + from .webhook_receiver import WebhookReceiver + from .itsm_receiver import ItsmReceiver + from .azure_app_push_receiver import AzureAppPushReceiver + from .automation_runbook_receiver import AutomationRunbookReceiver + from .voice_receiver import VoiceReceiver + from .logic_app_receiver import LogicAppReceiver + from .azure_function_receiver import AzureFunctionReceiver + from .arm_role_receiver import ArmRoleReceiver + from .action_group_resource import ActionGroupResource + from .enable_request import EnableRequest + from .action_group_patch_body import ActionGroupPatchBody + from .activity_log_alert_leaf_condition import ActivityLogAlertLeafCondition + from .activity_log_alert_all_of_condition import ActivityLogAlertAllOfCondition + from .activity_log_alert_action_group import ActivityLogAlertActionGroup + from .activity_log_alert_action_list import ActivityLogAlertActionList + from .activity_log_alert_resource import ActivityLogAlertResource + from .activity_log_alert_patch_body import ActivityLogAlertPatchBody + from .localizable_string import LocalizableString + from .sender_authorization import SenderAuthorization + from .http_request_info import HttpRequestInfo + from .event_data import EventData + from .metric_availability import MetricAvailability + from .metric_definition import MetricDefinition + from .metric_value import MetricValue + from .metadata_value import MetadataValue + from .time_series_element import TimeSeriesElement + from .metric import Metric + from .response import Response + from .baseline_metadata_value import BaselineMetadataValue + from .baseline import Baseline + from .baseline_response import BaselineResponse + from .time_series_information import TimeSeriesInformation + from .calculate_baseline_response import CalculateBaselineResponse + from .metric_single_dimension import MetricSingleDimension + from .single_baseline import SingleBaseline + from .baseline_metadata import BaselineMetadata + from .time_series_baseline import TimeSeriesBaseline + from .single_metric_baseline import SingleMetricBaseline + from .metric_alert_action import MetricAlertAction + from .metric_alert_criteria import MetricAlertCriteria + from .metric_alert_resource import MetricAlertResource + from .metric_alert_resource_patch import MetricAlertResourcePatch + from .metric_alert_status_properties import MetricAlertStatusProperties + from .metric_alert_status import MetricAlertStatus + from .metric_alert_status_collection import MetricAlertStatusCollection + from .metric_criteria import MetricCriteria + from .metric_alert_single_resource_multiple_metric_criteria import MetricAlertSingleResourceMultipleMetricCriteria + from .metric_dimension import MetricDimension + from .multi_metric_criteria import MultiMetricCriteria + from .metric_alert_multiple_resource_multiple_metric_criteria import MetricAlertMultipleResourceMultipleMetricCriteria + from .dynamic_threshold_failing_periods import DynamicThresholdFailingPeriods + from .dynamic_metric_criteria import DynamicMetricCriteria + from .source import Source + from .schedule import Schedule + from .action import Action + from .log_search_rule_resource import LogSearchRuleResource + from .log_search_rule_resource_patch import LogSearchRuleResourcePatch + from .log_metric_trigger import LogMetricTrigger + from .trigger_condition import TriggerCondition + from .az_ns_action_group import AzNsActionGroup + from .alerting_action import AlertingAction + from .dimension import Dimension + from .criteria import Criteria + from .log_to_metric_action import LogToMetricAction + from .metric_namespace_name import MetricNamespaceName + from .metric_namespace import MetricNamespace + from .proxy_resource import ProxyResource + from .error import Error + from .response_with_error import ResponseWithError, ResponseWithErrorException + from .workspace_info import WorkspaceInfo + from .data_container import DataContainer + from .vm_insights_onboarding_status import VMInsightsOnboardingStatus +from .autoscale_setting_resource_paged import AutoscaleSettingResourcePaged +from .incident_paged import IncidentPaged +from .alert_rule_resource_paged import AlertRuleResourcePaged +from .log_profile_resource_paged import LogProfileResourcePaged +from .action_group_resource_paged import ActionGroupResourcePaged +from .activity_log_alert_resource_paged import ActivityLogAlertResourcePaged +from .event_data_paged import EventDataPaged +from .localizable_string_paged import LocalizableStringPaged +from .metric_definition_paged import MetricDefinitionPaged +from .single_metric_baseline_paged import SingleMetricBaselinePaged +from .metric_alert_resource_paged import MetricAlertResourcePaged +from .log_search_rule_resource_paged import LogSearchRuleResourcePaged +from .metric_namespace_paged import MetricNamespacePaged +from .monitor_management_client_enums import ( + MetricStatisticType, + TimeAggregationType, + ComparisonOperationType, + ScaleDirection, + ScaleType, + RecurrenceFrequency, + ConditionOperator, + TimeAggregationOperator, + CategoryType, + ReceiverStatus, + EventLevel, + Unit, + AggregationType, + Sensitivity, + BaselineSensitivity, + Enabled, + ProvisioningState, + QueryType, + ConditionalOperator, + MetricTriggerType, + AlertSeverity, + OnboardingStatus, + DataStatus, + ResultType, +) + +__all__ = [ + 'Resource', + 'ScaleCapacity', + 'MetricTrigger', + 'ScaleAction', + 'ScaleRule', + 'TimeWindow', + 'RecurrentSchedule', + 'Recurrence', + 'AutoscaleProfile', + 'EmailNotification', + 'WebhookNotification', + 'AutoscaleNotification', + 'AutoscaleSettingResource', + 'AutoscaleSettingResourcePatch', + 'ErrorResponse', 'ErrorResponseException', + 'OperationDisplay', + 'Operation', + 'OperationListResult', + 'Incident', + 'RuleDataSource', + 'RuleCondition', + 'RuleMetricDataSource', + 'RuleManagementEventClaimsDataSource', + 'RuleManagementEventDataSource', + 'ThresholdRuleCondition', + 'LocationThresholdRuleCondition', + 'ManagementEventAggregationCondition', + 'ManagementEventRuleCondition', + 'RuleAction', + 'RuleEmailAction', + 'RuleWebhookAction', + 'AlertRuleResource', + 'AlertRuleResourcePatch', + 'RetentionPolicy', + 'LogProfileResource', + 'LogProfileResourcePatch', + 'ProxyOnlyResource', + 'MetricSettings', + 'LogSettings', + 'DiagnosticSettingsResource', + 'DiagnosticSettingsResourceCollection', + 'DiagnosticSettingsCategoryResource', + 'DiagnosticSettingsCategoryResourceCollection', + 'EmailReceiver', + 'SmsReceiver', + 'WebhookReceiver', + 'ItsmReceiver', + 'AzureAppPushReceiver', + 'AutomationRunbookReceiver', + 'VoiceReceiver', + 'LogicAppReceiver', + 'AzureFunctionReceiver', + 'ArmRoleReceiver', + 'ActionGroupResource', + 'EnableRequest', + 'ActionGroupPatchBody', + 'ActivityLogAlertLeafCondition', + 'ActivityLogAlertAllOfCondition', + 'ActivityLogAlertActionGroup', + 'ActivityLogAlertActionList', + 'ActivityLogAlertResource', + 'ActivityLogAlertPatchBody', + 'LocalizableString', + 'SenderAuthorization', + 'HttpRequestInfo', + 'EventData', + 'MetricAvailability', + 'MetricDefinition', + 'MetricValue', + 'MetadataValue', + 'TimeSeriesElement', + 'Metric', + 'Response', + 'BaselineMetadataValue', + 'Baseline', + 'BaselineResponse', + 'TimeSeriesInformation', + 'CalculateBaselineResponse', + 'MetricSingleDimension', + 'SingleBaseline', + 'BaselineMetadata', + 'TimeSeriesBaseline', + 'SingleMetricBaseline', + 'MetricAlertAction', + 'MetricAlertCriteria', + 'MetricAlertResource', + 'MetricAlertResourcePatch', + 'MetricAlertStatusProperties', + 'MetricAlertStatus', + 'MetricAlertStatusCollection', + 'MetricCriteria', + 'MetricAlertSingleResourceMultipleMetricCriteria', + 'MetricDimension', + 'MultiMetricCriteria', + 'MetricAlertMultipleResourceMultipleMetricCriteria', + 'DynamicThresholdFailingPeriods', + 'DynamicMetricCriteria', + 'Source', + 'Schedule', + 'Action', + 'LogSearchRuleResource', + 'LogSearchRuleResourcePatch', + 'LogMetricTrigger', + 'TriggerCondition', + 'AzNsActionGroup', + 'AlertingAction', + 'Dimension', + 'Criteria', + 'LogToMetricAction', + 'MetricNamespaceName', + 'MetricNamespace', + 'ProxyResource', + 'Error', + 'ResponseWithError', 'ResponseWithErrorException', + 'WorkspaceInfo', + 'DataContainer', + 'VMInsightsOnboardingStatus', + 'AutoscaleSettingResourcePaged', + 'IncidentPaged', + 'AlertRuleResourcePaged', + 'LogProfileResourcePaged', + 'ActionGroupResourcePaged', + 'ActivityLogAlertResourcePaged', + 'EventDataPaged', + 'LocalizableStringPaged', + 'MetricDefinitionPaged', + 'SingleMetricBaselinePaged', + 'MetricAlertResourcePaged', + 'LogSearchRuleResourcePaged', + 'MetricNamespacePaged', + 'MetricStatisticType', + 'TimeAggregationType', + 'ComparisonOperationType', + 'ScaleDirection', + 'ScaleType', + 'RecurrenceFrequency', + 'ConditionOperator', + 'TimeAggregationOperator', + 'CategoryType', + 'ReceiverStatus', + 'EventLevel', + 'Unit', + 'AggregationType', + 'Sensitivity', + 'BaselineSensitivity', + 'Enabled', + 'ProvisioningState', + 'QueryType', + 'ConditionalOperator', + 'MetricTriggerType', + 'AlertSeverity', + 'OnboardingStatus', + 'DataStatus', + 'ResultType', +] diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action.py new file mode 100644 index 000000000000..494f5e696a81 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action.py @@ -0,0 +1,41 @@ +# 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 + + +class Action(Model): + """Action descriptor. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AlertingAction, LogToMetricAction + + All required parameters must be populated in order to send to Azure. + + :param odatatype: Required. Constant filled by server. + :type odatatype: str + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + } + + _subtype_map = { + 'odatatype': {'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction': 'AlertingAction', 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction': 'LogToMetricAction'} + } + + def __init__(self, **kwargs): + super(Action, self).__init__(**kwargs) + self.odatatype = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action_group_patch_body.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action_group_patch_body.py new file mode 100644 index 000000000000..5c4c2016543a --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action_group_patch_body.py @@ -0,0 +1,34 @@ +# 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 + + +class ActionGroupPatchBody(Model): + """An action group object for the body of patch operations. + + :param tags: Resource tags + :type tags: dict[str, str] + :param enabled: Indicates whether this action group is enabled. If an + action group is not enabled, then none of its actions will be activated. + Default value: True . + :type enabled: bool + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ActionGroupPatchBody, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.enabled = kwargs.get('enabled', True) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action_group_patch_body_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action_group_patch_body_py3.py new file mode 100644 index 000000000000..9840a35ee526 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action_group_patch_body_py3.py @@ -0,0 +1,34 @@ +# 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 + + +class ActionGroupPatchBody(Model): + """An action group object for the body of patch operations. + + :param tags: Resource tags + :type tags: dict[str, str] + :param enabled: Indicates whether this action group is enabled. If an + action group is not enabled, then none of its actions will be activated. + Default value: True . + :type enabled: bool + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__(self, *, tags=None, enabled: bool=True, **kwargs) -> None: + super(ActionGroupPatchBody, self).__init__(**kwargs) + self.tags = tags + self.enabled = enabled diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action_group_resource.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action_group_resource.py new file mode 100644 index 000000000000..283a746bb5f9 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action_group_resource.py @@ -0,0 +1,119 @@ +# 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 .resource import Resource + + +class ActionGroupResource(Resource): + """An action group resource. + + 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] + :param group_short_name: Required. The short name of the action group. + This will be used in SMS messages. + :type group_short_name: str + :param enabled: Required. Indicates whether this action group is enabled. + If an action group is not enabled, then none of its receivers will receive + communications. Default value: True . + :type enabled: bool + :param email_receivers: The list of email receivers that are part of this + action group. + :type email_receivers: list[~azure.mgmt.monitor.models.EmailReceiver] + :param sms_receivers: The list of SMS receivers that are part of this + action group. + :type sms_receivers: list[~azure.mgmt.monitor.models.SmsReceiver] + :param webhook_receivers: The list of webhook receivers that are part of + this action group. + :type webhook_receivers: list[~azure.mgmt.monitor.models.WebhookReceiver] + :param itsm_receivers: The list of ITSM receivers that are part of this + action group. + :type itsm_receivers: list[~azure.mgmt.monitor.models.ItsmReceiver] + :param azure_app_push_receivers: The list of AzureAppPush receivers that + are part of this action group. + :type azure_app_push_receivers: + list[~azure.mgmt.monitor.models.AzureAppPushReceiver] + :param automation_runbook_receivers: The list of AutomationRunbook + receivers that are part of this action group. + :type automation_runbook_receivers: + list[~azure.mgmt.monitor.models.AutomationRunbookReceiver] + :param voice_receivers: The list of voice receivers that are part of this + action group. + :type voice_receivers: list[~azure.mgmt.monitor.models.VoiceReceiver] + :param logic_app_receivers: The list of logic app receivers that are part + of this action group. + :type logic_app_receivers: + list[~azure.mgmt.monitor.models.LogicAppReceiver] + :param azure_function_receivers: The list of azure function receivers that + are part of this action group. + :type azure_function_receivers: + list[~azure.mgmt.monitor.models.AzureFunctionReceiver] + :param arm_role_receivers: The list of ARM role receivers that are part of + this action group. Roles are Azure RBAC roles and only built-in roles are + supported. + :type arm_role_receivers: list[~azure.mgmt.monitor.models.ArmRoleReceiver] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'group_short_name': {'required': True, 'max_length': 12}, + 'enabled': {'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}'}, + 'group_short_name': {'key': 'properties.groupShortName', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'email_receivers': {'key': 'properties.emailReceivers', 'type': '[EmailReceiver]'}, + 'sms_receivers': {'key': 'properties.smsReceivers', 'type': '[SmsReceiver]'}, + 'webhook_receivers': {'key': 'properties.webhookReceivers', 'type': '[WebhookReceiver]'}, + 'itsm_receivers': {'key': 'properties.itsmReceivers', 'type': '[ItsmReceiver]'}, + 'azure_app_push_receivers': {'key': 'properties.azureAppPushReceivers', 'type': '[AzureAppPushReceiver]'}, + 'automation_runbook_receivers': {'key': 'properties.automationRunbookReceivers', 'type': '[AutomationRunbookReceiver]'}, + 'voice_receivers': {'key': 'properties.voiceReceivers', 'type': '[VoiceReceiver]'}, + 'logic_app_receivers': {'key': 'properties.logicAppReceivers', 'type': '[LogicAppReceiver]'}, + 'azure_function_receivers': {'key': 'properties.azureFunctionReceivers', 'type': '[AzureFunctionReceiver]'}, + 'arm_role_receivers': {'key': 'properties.armRoleReceivers', 'type': '[ArmRoleReceiver]'}, + } + + def __init__(self, **kwargs): + super(ActionGroupResource, self).__init__(**kwargs) + self.group_short_name = kwargs.get('group_short_name', None) + self.enabled = kwargs.get('enabled', True) + self.email_receivers = kwargs.get('email_receivers', None) + self.sms_receivers = kwargs.get('sms_receivers', None) + self.webhook_receivers = kwargs.get('webhook_receivers', None) + self.itsm_receivers = kwargs.get('itsm_receivers', None) + self.azure_app_push_receivers = kwargs.get('azure_app_push_receivers', None) + self.automation_runbook_receivers = kwargs.get('automation_runbook_receivers', None) + self.voice_receivers = kwargs.get('voice_receivers', None) + self.logic_app_receivers = kwargs.get('logic_app_receivers', None) + self.azure_function_receivers = kwargs.get('azure_function_receivers', None) + self.arm_role_receivers = kwargs.get('arm_role_receivers', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action_group_resource_paged.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action_group_resource_paged.py new file mode 100644 index 000000000000..f9adf543b495 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action_group_resource_paged.py @@ -0,0 +1,27 @@ +# 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 ActionGroupResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`ActionGroupResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ActionGroupResource]'} + } + + def __init__(self, *args, **kwargs): + + super(ActionGroupResourcePaged, self).__init__(*args, **kwargs) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action_group_resource_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action_group_resource_py3.py new file mode 100644 index 000000000000..772787ad39c5 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action_group_resource_py3.py @@ -0,0 +1,119 @@ +# 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 .resource_py3 import Resource + + +class ActionGroupResource(Resource): + """An action group resource. + + 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] + :param group_short_name: Required. The short name of the action group. + This will be used in SMS messages. + :type group_short_name: str + :param enabled: Required. Indicates whether this action group is enabled. + If an action group is not enabled, then none of its receivers will receive + communications. Default value: True . + :type enabled: bool + :param email_receivers: The list of email receivers that are part of this + action group. + :type email_receivers: list[~azure.mgmt.monitor.models.EmailReceiver] + :param sms_receivers: The list of SMS receivers that are part of this + action group. + :type sms_receivers: list[~azure.mgmt.monitor.models.SmsReceiver] + :param webhook_receivers: The list of webhook receivers that are part of + this action group. + :type webhook_receivers: list[~azure.mgmt.monitor.models.WebhookReceiver] + :param itsm_receivers: The list of ITSM receivers that are part of this + action group. + :type itsm_receivers: list[~azure.mgmt.monitor.models.ItsmReceiver] + :param azure_app_push_receivers: The list of AzureAppPush receivers that + are part of this action group. + :type azure_app_push_receivers: + list[~azure.mgmt.monitor.models.AzureAppPushReceiver] + :param automation_runbook_receivers: The list of AutomationRunbook + receivers that are part of this action group. + :type automation_runbook_receivers: + list[~azure.mgmt.monitor.models.AutomationRunbookReceiver] + :param voice_receivers: The list of voice receivers that are part of this + action group. + :type voice_receivers: list[~azure.mgmt.monitor.models.VoiceReceiver] + :param logic_app_receivers: The list of logic app receivers that are part + of this action group. + :type logic_app_receivers: + list[~azure.mgmt.monitor.models.LogicAppReceiver] + :param azure_function_receivers: The list of azure function receivers that + are part of this action group. + :type azure_function_receivers: + list[~azure.mgmt.monitor.models.AzureFunctionReceiver] + :param arm_role_receivers: The list of ARM role receivers that are part of + this action group. Roles are Azure RBAC roles and only built-in roles are + supported. + :type arm_role_receivers: list[~azure.mgmt.monitor.models.ArmRoleReceiver] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'group_short_name': {'required': True, 'max_length': 12}, + 'enabled': {'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}'}, + 'group_short_name': {'key': 'properties.groupShortName', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'email_receivers': {'key': 'properties.emailReceivers', 'type': '[EmailReceiver]'}, + 'sms_receivers': {'key': 'properties.smsReceivers', 'type': '[SmsReceiver]'}, + 'webhook_receivers': {'key': 'properties.webhookReceivers', 'type': '[WebhookReceiver]'}, + 'itsm_receivers': {'key': 'properties.itsmReceivers', 'type': '[ItsmReceiver]'}, + 'azure_app_push_receivers': {'key': 'properties.azureAppPushReceivers', 'type': '[AzureAppPushReceiver]'}, + 'automation_runbook_receivers': {'key': 'properties.automationRunbookReceivers', 'type': '[AutomationRunbookReceiver]'}, + 'voice_receivers': {'key': 'properties.voiceReceivers', 'type': '[VoiceReceiver]'}, + 'logic_app_receivers': {'key': 'properties.logicAppReceivers', 'type': '[LogicAppReceiver]'}, + 'azure_function_receivers': {'key': 'properties.azureFunctionReceivers', 'type': '[AzureFunctionReceiver]'}, + 'arm_role_receivers': {'key': 'properties.armRoleReceivers', 'type': '[ArmRoleReceiver]'}, + } + + def __init__(self, *, location: str, group_short_name: str, tags=None, enabled: bool=True, email_receivers=None, sms_receivers=None, webhook_receivers=None, itsm_receivers=None, azure_app_push_receivers=None, automation_runbook_receivers=None, voice_receivers=None, logic_app_receivers=None, azure_function_receivers=None, arm_role_receivers=None, **kwargs) -> None: + super(ActionGroupResource, self).__init__(location=location, tags=tags, **kwargs) + self.group_short_name = group_short_name + self.enabled = enabled + self.email_receivers = email_receivers + self.sms_receivers = sms_receivers + self.webhook_receivers = webhook_receivers + self.itsm_receivers = itsm_receivers + self.azure_app_push_receivers = azure_app_push_receivers + self.automation_runbook_receivers = automation_runbook_receivers + self.voice_receivers = voice_receivers + self.logic_app_receivers = logic_app_receivers + self.azure_function_receivers = azure_function_receivers + self.arm_role_receivers = arm_role_receivers diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action_py3.py new file mode 100644 index 000000000000..354eb4565038 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/action_py3.py @@ -0,0 +1,41 @@ +# 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 + + +class Action(Model): + """Action descriptor. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AlertingAction, LogToMetricAction + + All required parameters must be populated in order to send to Azure. + + :param odatatype: Required. Constant filled by server. + :type odatatype: str + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + } + + _subtype_map = { + 'odatatype': {'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction': 'AlertingAction', 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction': 'LogToMetricAction'} + } + + def __init__(self, **kwargs) -> None: + super(Action, self).__init__(**kwargs) + self.odatatype = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_action_group.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_action_group.py new file mode 100644 index 000000000000..e1594897e5cc --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_action_group.py @@ -0,0 +1,40 @@ +# 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 + + +class ActivityLogAlertActionGroup(Model): + """A pointer to an Azure Action Group. + + All required parameters must be populated in order to send to Azure. + + :param action_group_id: Required. The resourceId of the action group. This + cannot be null or empty. + :type action_group_id: str + :param webhook_properties: the dictionary of custom properties to include + with the post operation. These data are appended to the webhook payload. + :type webhook_properties: dict[str, str] + """ + + _validation = { + 'action_group_id': {'required': True}, + } + + _attribute_map = { + 'action_group_id': {'key': 'actionGroupId', 'type': 'str'}, + 'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ActivityLogAlertActionGroup, self).__init__(**kwargs) + self.action_group_id = kwargs.get('action_group_id', None) + self.webhook_properties = kwargs.get('webhook_properties', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_action_group_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_action_group_py3.py new file mode 100644 index 000000000000..b138c3d966d6 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_action_group_py3.py @@ -0,0 +1,40 @@ +# 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 + + +class ActivityLogAlertActionGroup(Model): + """A pointer to an Azure Action Group. + + All required parameters must be populated in order to send to Azure. + + :param action_group_id: Required. The resourceId of the action group. This + cannot be null or empty. + :type action_group_id: str + :param webhook_properties: the dictionary of custom properties to include + with the post operation. These data are appended to the webhook payload. + :type webhook_properties: dict[str, str] + """ + + _validation = { + 'action_group_id': {'required': True}, + } + + _attribute_map = { + 'action_group_id': {'key': 'actionGroupId', 'type': 'str'}, + 'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'}, + } + + def __init__(self, *, action_group_id: str, webhook_properties=None, **kwargs) -> None: + super(ActivityLogAlertActionGroup, self).__init__(**kwargs) + self.action_group_id = action_group_id + self.webhook_properties = webhook_properties diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_action_list.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_action_list.py new file mode 100644 index 000000000000..7fb9b68880fc --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_action_list.py @@ -0,0 +1,29 @@ +# 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 + + +class ActivityLogAlertActionList(Model): + """A list of activity log alert actions. + + :param action_groups: The list of activity log alerts. + :type action_groups: + list[~azure.mgmt.monitor.models.ActivityLogAlertActionGroup] + """ + + _attribute_map = { + 'action_groups': {'key': 'actionGroups', 'type': '[ActivityLogAlertActionGroup]'}, + } + + def __init__(self, **kwargs): + super(ActivityLogAlertActionList, self).__init__(**kwargs) + self.action_groups = kwargs.get('action_groups', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_action_list_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_action_list_py3.py new file mode 100644 index 000000000000..c5e38e2fe62f --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_action_list_py3.py @@ -0,0 +1,29 @@ +# 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 + + +class ActivityLogAlertActionList(Model): + """A list of activity log alert actions. + + :param action_groups: The list of activity log alerts. + :type action_groups: + list[~azure.mgmt.monitor.models.ActivityLogAlertActionGroup] + """ + + _attribute_map = { + 'action_groups': {'key': 'actionGroups', 'type': '[ActivityLogAlertActionGroup]'}, + } + + def __init__(self, *, action_groups=None, **kwargs) -> None: + super(ActivityLogAlertActionList, self).__init__(**kwargs) + self.action_groups = action_groups diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_all_of_condition.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_all_of_condition.py new file mode 100644 index 000000000000..0ba82fb32498 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_all_of_condition.py @@ -0,0 +1,36 @@ +# 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 + + +class ActivityLogAlertAllOfCondition(Model): + """An Activity Log alert condition that is met when all its member conditions + are met. + + All required parameters must be populated in order to send to Azure. + + :param all_of: Required. The list of activity log alert conditions. + :type all_of: + list[~azure.mgmt.monitor.models.ActivityLogAlertLeafCondition] + """ + + _validation = { + 'all_of': {'required': True}, + } + + _attribute_map = { + 'all_of': {'key': 'allOf', 'type': '[ActivityLogAlertLeafCondition]'}, + } + + def __init__(self, **kwargs): + super(ActivityLogAlertAllOfCondition, self).__init__(**kwargs) + self.all_of = kwargs.get('all_of', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_all_of_condition_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_all_of_condition_py3.py new file mode 100644 index 000000000000..e9a59663a2ce --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_all_of_condition_py3.py @@ -0,0 +1,36 @@ +# 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 + + +class ActivityLogAlertAllOfCondition(Model): + """An Activity Log alert condition that is met when all its member conditions + are met. + + All required parameters must be populated in order to send to Azure. + + :param all_of: Required. The list of activity log alert conditions. + :type all_of: + list[~azure.mgmt.monitor.models.ActivityLogAlertLeafCondition] + """ + + _validation = { + 'all_of': {'required': True}, + } + + _attribute_map = { + 'all_of': {'key': 'allOf', 'type': '[ActivityLogAlertLeafCondition]'}, + } + + def __init__(self, *, all_of, **kwargs) -> None: + super(ActivityLogAlertAllOfCondition, self).__init__(**kwargs) + self.all_of = all_of diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_leaf_condition.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_leaf_condition.py new file mode 100644 index 000000000000..682dada893dc --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_leaf_condition.py @@ -0,0 +1,45 @@ +# 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 + + +class ActivityLogAlertLeafCondition(Model): + """An Activity Log alert condition that is met by comparing an activity log + field and value. + + All required parameters must be populated in order to send to Azure. + + :param field: Required. The name of the field that this condition will + examine. The possible values for this field are (case-insensitive): + 'resourceId', 'category', 'caller', 'level', 'operationName', + 'resourceGroup', 'resourceProvider', 'status', 'subStatus', + 'resourceType', or anything beginning with 'properties.'. + :type field: str + :param equals: Required. The field value will be compared to this value + (case-insensitive) to determine if the condition is met. + :type equals: str + """ + + _validation = { + 'field': {'required': True}, + 'equals': {'required': True}, + } + + _attribute_map = { + 'field': {'key': 'field', 'type': 'str'}, + 'equals': {'key': 'equals', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ActivityLogAlertLeafCondition, self).__init__(**kwargs) + self.field = kwargs.get('field', None) + self.equals = kwargs.get('equals', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_leaf_condition_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_leaf_condition_py3.py new file mode 100644 index 000000000000..ddab0eec0048 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_leaf_condition_py3.py @@ -0,0 +1,45 @@ +# 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 + + +class ActivityLogAlertLeafCondition(Model): + """An Activity Log alert condition that is met by comparing an activity log + field and value. + + All required parameters must be populated in order to send to Azure. + + :param field: Required. The name of the field that this condition will + examine. The possible values for this field are (case-insensitive): + 'resourceId', 'category', 'caller', 'level', 'operationName', + 'resourceGroup', 'resourceProvider', 'status', 'subStatus', + 'resourceType', or anything beginning with 'properties.'. + :type field: str + :param equals: Required. The field value will be compared to this value + (case-insensitive) to determine if the condition is met. + :type equals: str + """ + + _validation = { + 'field': {'required': True}, + 'equals': {'required': True}, + } + + _attribute_map = { + 'field': {'key': 'field', 'type': 'str'}, + 'equals': {'key': 'equals', 'type': 'str'}, + } + + def __init__(self, *, field: str, equals: str, **kwargs) -> None: + super(ActivityLogAlertLeafCondition, self).__init__(**kwargs) + self.field = field + self.equals = equals diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_patch_body.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_patch_body.py new file mode 100644 index 000000000000..904b640b483e --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_patch_body.py @@ -0,0 +1,34 @@ +# 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 + + +class ActivityLogAlertPatchBody(Model): + """An activity log alert object for the body of patch operations. + + :param tags: Resource tags + :type tags: dict[str, str] + :param enabled: Indicates whether this activity log alert is enabled. If + an activity log alert is not enabled, then none of its actions will be + activated. Default value: True . + :type enabled: bool + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ActivityLogAlertPatchBody, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.enabled = kwargs.get('enabled', True) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_patch_body_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_patch_body_py3.py new file mode 100644 index 000000000000..886a84337990 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_patch_body_py3.py @@ -0,0 +1,34 @@ +# 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 + + +class ActivityLogAlertPatchBody(Model): + """An activity log alert object for the body of patch operations. + + :param tags: Resource tags + :type tags: dict[str, str] + :param enabled: Indicates whether this activity log alert is enabled. If + an activity log alert is not enabled, then none of its actions will be + activated. Default value: True . + :type enabled: bool + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__(self, *, tags=None, enabled: bool=True, **kwargs) -> None: + super(ActivityLogAlertPatchBody, self).__init__(**kwargs) + self.tags = tags + self.enabled = enabled diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_resource.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_resource.py new file mode 100644 index 000000000000..6fe9ff307863 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_resource.py @@ -0,0 +1,81 @@ +# 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 .resource import Resource + + +class ActivityLogAlertResource(Resource): + """An activity log alert resource. + + 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] + :param scopes: Required. A list of resourceIds that will be used as + prefixes. The alert will only apply to activityLogs with resourceIds that + fall under one of these prefixes. This list must include at least one + item. + :type scopes: list[str] + :param enabled: Indicates whether this activity log alert is enabled. If + an activity log alert is not enabled, then none of its actions will be + activated. Default value: True . + :type enabled: bool + :param condition: Required. The condition that will cause this alert to + activate. + :type condition: ~azure.mgmt.monitor.models.ActivityLogAlertAllOfCondition + :param actions: Required. The actions that will activate when the + condition is met. + :type actions: ~azure.mgmt.monitor.models.ActivityLogAlertActionList + :param description: A description of this activity log alert. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'scopes': {'required': True}, + 'condition': {'required': True}, + 'actions': {'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}'}, + 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'condition': {'key': 'properties.condition', 'type': 'ActivityLogAlertAllOfCondition'}, + 'actions': {'key': 'properties.actions', 'type': 'ActivityLogAlertActionList'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ActivityLogAlertResource, self).__init__(**kwargs) + self.scopes = kwargs.get('scopes', None) + self.enabled = kwargs.get('enabled', True) + self.condition = kwargs.get('condition', None) + self.actions = kwargs.get('actions', None) + self.description = kwargs.get('description', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_resource_paged.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_resource_paged.py new file mode 100644 index 000000000000..e1dcd6619eb6 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_resource_paged.py @@ -0,0 +1,27 @@ +# 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 ActivityLogAlertResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`ActivityLogAlertResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ActivityLogAlertResource]'} + } + + def __init__(self, *args, **kwargs): + + super(ActivityLogAlertResourcePaged, self).__init__(*args, **kwargs) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_resource_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_resource_py3.py new file mode 100644 index 000000000000..1d44d057e560 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_resource_py3.py @@ -0,0 +1,81 @@ +# 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 .resource_py3 import Resource + + +class ActivityLogAlertResource(Resource): + """An activity log alert resource. + + 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] + :param scopes: Required. A list of resourceIds that will be used as + prefixes. The alert will only apply to activityLogs with resourceIds that + fall under one of these prefixes. This list must include at least one + item. + :type scopes: list[str] + :param enabled: Indicates whether this activity log alert is enabled. If + an activity log alert is not enabled, then none of its actions will be + activated. Default value: True . + :type enabled: bool + :param condition: Required. The condition that will cause this alert to + activate. + :type condition: ~azure.mgmt.monitor.models.ActivityLogAlertAllOfCondition + :param actions: Required. The actions that will activate when the + condition is met. + :type actions: ~azure.mgmt.monitor.models.ActivityLogAlertActionList + :param description: A description of this activity log alert. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'scopes': {'required': True}, + 'condition': {'required': True}, + 'actions': {'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}'}, + 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'condition': {'key': 'properties.condition', 'type': 'ActivityLogAlertAllOfCondition'}, + 'actions': {'key': 'properties.actions', 'type': 'ActivityLogAlertActionList'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, location: str, scopes, condition, actions, tags=None, enabled: bool=True, description: str=None, **kwargs) -> None: + super(ActivityLogAlertResource, self).__init__(location=location, tags=tags, **kwargs) + self.scopes = scopes + self.enabled = enabled + self.condition = condition + self.actions = actions + self.description = description diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource.py new file mode 100644 index 000000000000..1ed610f6e0f1 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource.py @@ -0,0 +1,83 @@ +# 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 .resource import Resource + + +class AlertRuleResource(Resource): + """The alert rule resource. + + 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] + :param alert_rule_resource_name: Required. the name of the alert rule. + :type alert_rule_resource_name: str + :param description: the description of the alert rule that will be + included in the alert email. + :type description: str + :param is_enabled: Required. the flag that indicates whether the alert + rule is enabled. + :type is_enabled: bool + :param condition: Required. the condition that results in the alert rule + being activated. + :type condition: ~azure.mgmt.monitor.models.RuleCondition + :param actions: the array of actions that are performed when the alert + rule becomes active, and when an alert condition is resolved. + :type actions: list[~azure.mgmt.monitor.models.RuleAction] + :ivar last_updated_time: Last time the rule was updated in ISO8601 format. + :vartype last_updated_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'alert_rule_resource_name': {'required': True}, + 'is_enabled': {'required': True}, + 'condition': {'required': True}, + 'last_updated_time': {'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}'}, + 'alert_rule_resource_name': {'key': 'properties.name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'condition': {'key': 'properties.condition', 'type': 'RuleCondition'}, + 'actions': {'key': 'properties.actions', 'type': '[RuleAction]'}, + 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(AlertRuleResource, self).__init__(**kwargs) + self.alert_rule_resource_name = kwargs.get('alert_rule_resource_name', None) + self.description = kwargs.get('description', None) + self.is_enabled = kwargs.get('is_enabled', None) + self.condition = kwargs.get('condition', None) + self.actions = kwargs.get('actions', None) + self.last_updated_time = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource_paged.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource_paged.py new file mode 100644 index 000000000000..c341391db927 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource_paged.py @@ -0,0 +1,27 @@ +# 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 AlertRuleResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`AlertRuleResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AlertRuleResource]'} + } + + def __init__(self, *args, **kwargs): + + super(AlertRuleResourcePaged, self).__init__(*args, **kwargs) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource_patch.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource_patch.py new file mode 100644 index 000000000000..c557856b15a9 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource_patch.py @@ -0,0 +1,68 @@ +# 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 + + +class AlertRuleResourcePatch(Model): + """The alert rule object for patch operations. + + 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 tags: Resource tags + :type tags: dict[str, str] + :param name: Required. the name of the alert rule. + :type name: str + :param description: the description of the alert rule that will be + included in the alert email. + :type description: str + :param is_enabled: Required. the flag that indicates whether the alert + rule is enabled. + :type is_enabled: bool + :param condition: Required. the condition that results in the alert rule + being activated. + :type condition: ~azure.mgmt.monitor.models.RuleCondition + :param actions: the array of actions that are performed when the alert + rule becomes active, and when an alert condition is resolved. + :type actions: list[~azure.mgmt.monitor.models.RuleAction] + :ivar last_updated_time: Last time the rule was updated in ISO8601 format. + :vartype last_updated_time: datetime + """ + + _validation = { + 'name': {'required': True}, + 'is_enabled': {'required': True}, + 'condition': {'required': True}, + 'last_updated_time': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'properties.name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'condition': {'key': 'properties.condition', 'type': 'RuleCondition'}, + 'actions': {'key': 'properties.actions', 'type': '[RuleAction]'}, + 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(AlertRuleResourcePatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.is_enabled = kwargs.get('is_enabled', None) + self.condition = kwargs.get('condition', None) + self.actions = kwargs.get('actions', None) + self.last_updated_time = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource_patch_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource_patch_py3.py new file mode 100644 index 000000000000..61a979fde502 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource_patch_py3.py @@ -0,0 +1,68 @@ +# 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 + + +class AlertRuleResourcePatch(Model): + """The alert rule object for patch operations. + + 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 tags: Resource tags + :type tags: dict[str, str] + :param name: Required. the name of the alert rule. + :type name: str + :param description: the description of the alert rule that will be + included in the alert email. + :type description: str + :param is_enabled: Required. the flag that indicates whether the alert + rule is enabled. + :type is_enabled: bool + :param condition: Required. the condition that results in the alert rule + being activated. + :type condition: ~azure.mgmt.monitor.models.RuleCondition + :param actions: the array of actions that are performed when the alert + rule becomes active, and when an alert condition is resolved. + :type actions: list[~azure.mgmt.monitor.models.RuleAction] + :ivar last_updated_time: Last time the rule was updated in ISO8601 format. + :vartype last_updated_time: datetime + """ + + _validation = { + 'name': {'required': True}, + 'is_enabled': {'required': True}, + 'condition': {'required': True}, + 'last_updated_time': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'properties.name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'condition': {'key': 'properties.condition', 'type': 'RuleCondition'}, + 'actions': {'key': 'properties.actions', 'type': '[RuleAction]'}, + 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, name: str, is_enabled: bool, condition, tags=None, description: str=None, actions=None, **kwargs) -> None: + super(AlertRuleResourcePatch, self).__init__(**kwargs) + self.tags = tags + self.name = name + self.description = description + self.is_enabled = is_enabled + self.condition = condition + self.actions = actions + self.last_updated_time = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource_py3.py new file mode 100644 index 000000000000..c5d83396e2ab --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource_py3.py @@ -0,0 +1,83 @@ +# 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 .resource_py3 import Resource + + +class AlertRuleResource(Resource): + """The alert rule resource. + + 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] + :param alert_rule_resource_name: Required. the name of the alert rule. + :type alert_rule_resource_name: str + :param description: the description of the alert rule that will be + included in the alert email. + :type description: str + :param is_enabled: Required. the flag that indicates whether the alert + rule is enabled. + :type is_enabled: bool + :param condition: Required. the condition that results in the alert rule + being activated. + :type condition: ~azure.mgmt.monitor.models.RuleCondition + :param actions: the array of actions that are performed when the alert + rule becomes active, and when an alert condition is resolved. + :type actions: list[~azure.mgmt.monitor.models.RuleAction] + :ivar last_updated_time: Last time the rule was updated in ISO8601 format. + :vartype last_updated_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'alert_rule_resource_name': {'required': True}, + 'is_enabled': {'required': True}, + 'condition': {'required': True}, + 'last_updated_time': {'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}'}, + 'alert_rule_resource_name': {'key': 'properties.name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'condition': {'key': 'properties.condition', 'type': 'RuleCondition'}, + 'actions': {'key': 'properties.actions', 'type': '[RuleAction]'}, + 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, location: str, alert_rule_resource_name: str, is_enabled: bool, condition, tags=None, description: str=None, actions=None, **kwargs) -> None: + super(AlertRuleResource, self).__init__(location=location, tags=tags, **kwargs) + self.alert_rule_resource_name = alert_rule_resource_name + self.description = description + self.is_enabled = is_enabled + self.condition = condition + self.actions = actions + self.last_updated_time = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alerting_action.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alerting_action.py new file mode 100644 index 000000000000..40b18efc5f7a --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alerting_action.py @@ -0,0 +1,55 @@ +# 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 .action import Action + + +class AlertingAction(Action): + """Specify action need to be taken when rule type is Alert. + + All required parameters must be populated in order to send to Azure. + + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param severity: Required. Severity of the alert. Possible values include: + '0', '1', '2', '3', '4' + :type severity: str or ~azure.mgmt.monitor.models.AlertSeverity + :param azns_action: Azure action group reference. + :type azns_action: ~azure.mgmt.monitor.models.AzNsActionGroup + :param throttling_in_min: time (in minutes) for which Alerts should be + throttled or suppressed. + :type throttling_in_min: int + :param trigger: Required. The trigger condition that results in the alert + rule being. + :type trigger: ~azure.mgmt.monitor.models.TriggerCondition + """ + + _validation = { + 'odatatype': {'required': True}, + 'severity': {'required': True}, + 'trigger': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'azns_action': {'key': 'aznsAction', 'type': 'AzNsActionGroup'}, + 'throttling_in_min': {'key': 'throttlingInMin', 'type': 'int'}, + 'trigger': {'key': 'trigger', 'type': 'TriggerCondition'}, + } + + def __init__(self, **kwargs): + super(AlertingAction, self).__init__(**kwargs) + self.severity = kwargs.get('severity', None) + self.azns_action = kwargs.get('azns_action', None) + self.throttling_in_min = kwargs.get('throttling_in_min', None) + self.trigger = kwargs.get('trigger', None) + self.odatatype = 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alerting_action_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alerting_action_py3.py new file mode 100644 index 000000000000..301c82c45332 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/alerting_action_py3.py @@ -0,0 +1,55 @@ +# 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 .action_py3 import Action + + +class AlertingAction(Action): + """Specify action need to be taken when rule type is Alert. + + All required parameters must be populated in order to send to Azure. + + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param severity: Required. Severity of the alert. Possible values include: + '0', '1', '2', '3', '4' + :type severity: str or ~azure.mgmt.monitor.models.AlertSeverity + :param azns_action: Azure action group reference. + :type azns_action: ~azure.mgmt.monitor.models.AzNsActionGroup + :param throttling_in_min: time (in minutes) for which Alerts should be + throttled or suppressed. + :type throttling_in_min: int + :param trigger: Required. The trigger condition that results in the alert + rule being. + :type trigger: ~azure.mgmt.monitor.models.TriggerCondition + """ + + _validation = { + 'odatatype': {'required': True}, + 'severity': {'required': True}, + 'trigger': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'azns_action': {'key': 'aznsAction', 'type': 'AzNsActionGroup'}, + 'throttling_in_min': {'key': 'throttlingInMin', 'type': 'int'}, + 'trigger': {'key': 'trigger', 'type': 'TriggerCondition'}, + } + + def __init__(self, *, severity, trigger, azns_action=None, throttling_in_min: int=None, **kwargs) -> None: + super(AlertingAction, self).__init__(**kwargs) + self.severity = severity + self.azns_action = azns_action + self.throttling_in_min = throttling_in_min + self.trigger = trigger + self.odatatype = 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/arm_role_receiver.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/arm_role_receiver.py new file mode 100644 index 000000000000..8b86662593d9 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/arm_role_receiver.py @@ -0,0 +1,46 @@ +# 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 + + +class ArmRoleReceiver(Model): + """An arm role receiver. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the arm role receiver. Names must be + unique across all receivers within an action group. + :type name: str + :param role_id: Required. The arm role id. + :type role_id: str + :param use_common_alert_schema: Required. Indicates whether to use common + alert schema. + :type use_common_alert_schema: bool + """ + + _validation = { + 'name': {'required': True}, + 'role_id': {'required': True}, + 'use_common_alert_schema': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'role_id': {'key': 'roleId', 'type': 'str'}, + 'use_common_alert_schema': {'key': 'useCommonAlertSchema', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ArmRoleReceiver, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.role_id = kwargs.get('role_id', None) + self.use_common_alert_schema = kwargs.get('use_common_alert_schema', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/arm_role_receiver_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/arm_role_receiver_py3.py new file mode 100644 index 000000000000..ff2b974d12b4 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/arm_role_receiver_py3.py @@ -0,0 +1,46 @@ +# 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 + + +class ArmRoleReceiver(Model): + """An arm role receiver. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the arm role receiver. Names must be + unique across all receivers within an action group. + :type name: str + :param role_id: Required. The arm role id. + :type role_id: str + :param use_common_alert_schema: Required. Indicates whether to use common + alert schema. + :type use_common_alert_schema: bool + """ + + _validation = { + 'name': {'required': True}, + 'role_id': {'required': True}, + 'use_common_alert_schema': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'role_id': {'key': 'roleId', 'type': 'str'}, + 'use_common_alert_schema': {'key': 'useCommonAlertSchema', 'type': 'bool'}, + } + + def __init__(self, *, name: str, role_id: str, use_common_alert_schema: bool, **kwargs) -> None: + super(ArmRoleReceiver, self).__init__(**kwargs) + self.name = name + self.role_id = role_id + self.use_common_alert_schema = use_common_alert_schema diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/automation_runbook_receiver.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/automation_runbook_receiver.py new file mode 100644 index 000000000000..41840c45f7b7 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/automation_runbook_receiver.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.serialization import Model + + +class AutomationRunbookReceiver(Model): + """The Azure Automation Runbook notification receiver. + + All required parameters must be populated in order to send to Azure. + + :param automation_account_id: Required. The Azure automation account Id + which holds this runbook and authenticate to Azure resource. + :type automation_account_id: str + :param runbook_name: Required. The name for this runbook. + :type runbook_name: str + :param webhook_resource_id: Required. The resource id for webhook linked + to this runbook. + :type webhook_resource_id: str + :param is_global_runbook: Required. Indicates whether this instance is + global runbook. + :type is_global_runbook: bool + :param name: Indicates name of the webhook. + :type name: str + :param service_uri: The URI where webhooks should be sent. + :type service_uri: str + :param use_common_alert_schema: Required. Indicates whether to use common + alert schema. + :type use_common_alert_schema: bool + """ + + _validation = { + 'automation_account_id': {'required': True}, + 'runbook_name': {'required': True}, + 'webhook_resource_id': {'required': True}, + 'is_global_runbook': {'required': True}, + 'use_common_alert_schema': {'required': True}, + } + + _attribute_map = { + 'automation_account_id': {'key': 'automationAccountId', 'type': 'str'}, + 'runbook_name': {'key': 'runbookName', 'type': 'str'}, + 'webhook_resource_id': {'key': 'webhookResourceId', 'type': 'str'}, + 'is_global_runbook': {'key': 'isGlobalRunbook', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'service_uri': {'key': 'serviceUri', 'type': 'str'}, + 'use_common_alert_schema': {'key': 'useCommonAlertSchema', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(AutomationRunbookReceiver, self).__init__(**kwargs) + self.automation_account_id = kwargs.get('automation_account_id', None) + self.runbook_name = kwargs.get('runbook_name', None) + self.webhook_resource_id = kwargs.get('webhook_resource_id', None) + self.is_global_runbook = kwargs.get('is_global_runbook', None) + self.name = kwargs.get('name', None) + self.service_uri = kwargs.get('service_uri', None) + self.use_common_alert_schema = kwargs.get('use_common_alert_schema', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/automation_runbook_receiver_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/automation_runbook_receiver_py3.py new file mode 100644 index 000000000000..8d85eddd3e5d --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/automation_runbook_receiver_py3.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.serialization import Model + + +class AutomationRunbookReceiver(Model): + """The Azure Automation Runbook notification receiver. + + All required parameters must be populated in order to send to Azure. + + :param automation_account_id: Required. The Azure automation account Id + which holds this runbook and authenticate to Azure resource. + :type automation_account_id: str + :param runbook_name: Required. The name for this runbook. + :type runbook_name: str + :param webhook_resource_id: Required. The resource id for webhook linked + to this runbook. + :type webhook_resource_id: str + :param is_global_runbook: Required. Indicates whether this instance is + global runbook. + :type is_global_runbook: bool + :param name: Indicates name of the webhook. + :type name: str + :param service_uri: The URI where webhooks should be sent. + :type service_uri: str + :param use_common_alert_schema: Required. Indicates whether to use common + alert schema. + :type use_common_alert_schema: bool + """ + + _validation = { + 'automation_account_id': {'required': True}, + 'runbook_name': {'required': True}, + 'webhook_resource_id': {'required': True}, + 'is_global_runbook': {'required': True}, + 'use_common_alert_schema': {'required': True}, + } + + _attribute_map = { + 'automation_account_id': {'key': 'automationAccountId', 'type': 'str'}, + 'runbook_name': {'key': 'runbookName', 'type': 'str'}, + 'webhook_resource_id': {'key': 'webhookResourceId', 'type': 'str'}, + 'is_global_runbook': {'key': 'isGlobalRunbook', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'service_uri': {'key': 'serviceUri', 'type': 'str'}, + 'use_common_alert_schema': {'key': 'useCommonAlertSchema', 'type': 'bool'}, + } + + def __init__(self, *, automation_account_id: str, runbook_name: str, webhook_resource_id: str, is_global_runbook: bool, use_common_alert_schema: bool, name: str=None, service_uri: str=None, **kwargs) -> None: + super(AutomationRunbookReceiver, self).__init__(**kwargs) + self.automation_account_id = automation_account_id + self.runbook_name = runbook_name + self.webhook_resource_id = webhook_resource_id + self.is_global_runbook = is_global_runbook + self.name = name + self.service_uri = service_uri + self.use_common_alert_schema = use_common_alert_schema diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_notification.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_notification.py new file mode 100644 index 000000000000..602508bd4e69 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_notification.py @@ -0,0 +1,47 @@ +# 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 + + +class AutoscaleNotification(Model): + """Autoscale notification. + + 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 operation: Required. the operation associated with the notification + and its value must be "scale". Default value: "Scale" . + :vartype operation: str + :param email: the email notification. + :type email: ~azure.mgmt.monitor.models.EmailNotification + :param webhooks: the collection of webhook notifications. + :type webhooks: list[~azure.mgmt.monitor.models.WebhookNotification] + """ + + _validation = { + 'operation': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'operation': {'key': 'operation', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'EmailNotification'}, + 'webhooks': {'key': 'webhooks', 'type': '[WebhookNotification]'}, + } + + operation = "Scale" + + def __init__(self, **kwargs): + super(AutoscaleNotification, self).__init__(**kwargs) + self.email = kwargs.get('email', None) + self.webhooks = kwargs.get('webhooks', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_notification_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_notification_py3.py new file mode 100644 index 000000000000..0c441f1321fb --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_notification_py3.py @@ -0,0 +1,47 @@ +# 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 + + +class AutoscaleNotification(Model): + """Autoscale notification. + + 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 operation: Required. the operation associated with the notification + and its value must be "scale". Default value: "Scale" . + :vartype operation: str + :param email: the email notification. + :type email: ~azure.mgmt.monitor.models.EmailNotification + :param webhooks: the collection of webhook notifications. + :type webhooks: list[~azure.mgmt.monitor.models.WebhookNotification] + """ + + _validation = { + 'operation': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'operation': {'key': 'operation', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'EmailNotification'}, + 'webhooks': {'key': 'webhooks', 'type': '[WebhookNotification]'}, + } + + operation = "Scale" + + def __init__(self, *, email=None, webhooks=None, **kwargs) -> None: + super(AutoscaleNotification, self).__init__(**kwargs) + self.email = email + self.webhooks = webhooks diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_profile.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_profile.py new file mode 100644 index 000000000000..401b6f802543 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_profile.py @@ -0,0 +1,57 @@ +# 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 + + +class AutoscaleProfile(Model): + """Autoscale profile. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. the name of the profile. + :type name: str + :param capacity: Required. the number of instances that can be used during + this profile. + :type capacity: ~azure.mgmt.monitor.models.ScaleCapacity + :param rules: Required. the collection of rules that provide the triggers + and parameters for the scaling action. A maximum of 10 rules can be + specified. + :type rules: list[~azure.mgmt.monitor.models.ScaleRule] + :param fixed_date: the specific date-time for the profile. This element is + not used if the Recurrence element is used. + :type fixed_date: ~azure.mgmt.monitor.models.TimeWindow + :param recurrence: the repeating times at which this profile begins. This + element is not used if the FixedDate element is used. + :type recurrence: ~azure.mgmt.monitor.models.Recurrence + """ + + _validation = { + 'name': {'required': True}, + 'capacity': {'required': True}, + 'rules': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'ScaleCapacity'}, + 'rules': {'key': 'rules', 'type': '[ScaleRule]'}, + 'fixed_date': {'key': 'fixedDate', 'type': 'TimeWindow'}, + 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, + } + + def __init__(self, **kwargs): + super(AutoscaleProfile, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.capacity = kwargs.get('capacity', None) + self.rules = kwargs.get('rules', None) + self.fixed_date = kwargs.get('fixed_date', None) + self.recurrence = kwargs.get('recurrence', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_profile_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_profile_py3.py new file mode 100644 index 000000000000..5665e09b1353 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_profile_py3.py @@ -0,0 +1,57 @@ +# 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 + + +class AutoscaleProfile(Model): + """Autoscale profile. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. the name of the profile. + :type name: str + :param capacity: Required. the number of instances that can be used during + this profile. + :type capacity: ~azure.mgmt.monitor.models.ScaleCapacity + :param rules: Required. the collection of rules that provide the triggers + and parameters for the scaling action. A maximum of 10 rules can be + specified. + :type rules: list[~azure.mgmt.monitor.models.ScaleRule] + :param fixed_date: the specific date-time for the profile. This element is + not used if the Recurrence element is used. + :type fixed_date: ~azure.mgmt.monitor.models.TimeWindow + :param recurrence: the repeating times at which this profile begins. This + element is not used if the FixedDate element is used. + :type recurrence: ~azure.mgmt.monitor.models.Recurrence + """ + + _validation = { + 'name': {'required': True}, + 'capacity': {'required': True}, + 'rules': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'ScaleCapacity'}, + 'rules': {'key': 'rules', 'type': '[ScaleRule]'}, + 'fixed_date': {'key': 'fixedDate', 'type': 'TimeWindow'}, + 'recurrence': {'key': 'recurrence', 'type': 'Recurrence'}, + } + + def __init__(self, *, name: str, capacity, rules, fixed_date=None, recurrence=None, **kwargs) -> None: + super(AutoscaleProfile, self).__init__(**kwargs) + self.name = name + self.capacity = capacity + self.rules = rules + self.fixed_date = fixed_date + self.recurrence = recurrence diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource.py new file mode 100644 index 000000000000..8659f72e634e --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource.py @@ -0,0 +1,78 @@ +# 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 .resource import Resource + + +class AutoscaleSettingResource(Resource): + """The autoscale setting resource. + + 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] + :param profiles: Required. the collection of automatic scaling profiles + that specify different scaling parameters for different time periods. A + maximum of 20 profiles can be specified. + :type profiles: list[~azure.mgmt.monitor.models.AutoscaleProfile] + :param notifications: the collection of notifications. + :type notifications: + list[~azure.mgmt.monitor.models.AutoscaleNotification] + :param enabled: the enabled flag. Specifies whether automatic scaling is + enabled for the resource. The default value is 'true'. Default value: True + . + :type enabled: bool + :param autoscale_setting_resource_name: the name of the autoscale setting. + :type autoscale_setting_resource_name: str + :param target_resource_uri: the resource identifier of the resource that + the autoscale setting should be added to. + :type target_resource_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'profiles': {'required': True, 'max_items': 20}, + } + + _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}'}, + 'profiles': {'key': 'properties.profiles', 'type': '[AutoscaleProfile]'}, + 'notifications': {'key': 'properties.notifications', 'type': '[AutoscaleNotification]'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'autoscale_setting_resource_name': {'key': 'properties.name', 'type': 'str'}, + 'target_resource_uri': {'key': 'properties.targetResourceUri', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AutoscaleSettingResource, self).__init__(**kwargs) + self.profiles = kwargs.get('profiles', None) + self.notifications = kwargs.get('notifications', None) + self.enabled = kwargs.get('enabled', True) + self.autoscale_setting_resource_name = kwargs.get('autoscale_setting_resource_name', None) + self.target_resource_uri = kwargs.get('target_resource_uri', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource_paged.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource_paged.py new file mode 100644 index 000000000000..daa36994ff32 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource_paged.py @@ -0,0 +1,27 @@ +# 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 AutoscaleSettingResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`AutoscaleSettingResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AutoscaleSettingResource]'} + } + + def __init__(self, *args, **kwargs): + + super(AutoscaleSettingResourcePaged, self).__init__(*args, **kwargs) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource_patch.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource_patch.py new file mode 100644 index 000000000000..e5dd6ebd6c08 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource_patch.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AutoscaleSettingResourcePatch(Model): + """The autoscale setting object for patch operations. + + All required parameters must be populated in order to send to Azure. + + :param tags: Resource tags + :type tags: dict[str, str] + :param profiles: Required. the collection of automatic scaling profiles + that specify different scaling parameters for different time periods. A + maximum of 20 profiles can be specified. + :type profiles: list[~azure.mgmt.monitor.models.AutoscaleProfile] + :param notifications: the collection of notifications. + :type notifications: + list[~azure.mgmt.monitor.models.AutoscaleNotification] + :param enabled: the enabled flag. Specifies whether automatic scaling is + enabled for the resource. The default value is 'true'. Default value: True + . + :type enabled: bool + :param name: the name of the autoscale setting. + :type name: str + :param target_resource_uri: the resource identifier of the resource that + the autoscale setting should be added to. + :type target_resource_uri: str + """ + + _validation = { + 'profiles': {'required': True, 'max_items': 20}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'profiles': {'key': 'properties.profiles', 'type': '[AutoscaleProfile]'}, + 'notifications': {'key': 'properties.notifications', 'type': '[AutoscaleNotification]'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'name': {'key': 'properties.name', 'type': 'str'}, + 'target_resource_uri': {'key': 'properties.targetResourceUri', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AutoscaleSettingResourcePatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.profiles = kwargs.get('profiles', None) + self.notifications = kwargs.get('notifications', None) + self.enabled = kwargs.get('enabled', True) + self.name = kwargs.get('name', None) + self.target_resource_uri = kwargs.get('target_resource_uri', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource_patch_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource_patch_py3.py new file mode 100644 index 000000000000..be2567532ab0 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource_patch_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AutoscaleSettingResourcePatch(Model): + """The autoscale setting object for patch operations. + + All required parameters must be populated in order to send to Azure. + + :param tags: Resource tags + :type tags: dict[str, str] + :param profiles: Required. the collection of automatic scaling profiles + that specify different scaling parameters for different time periods. A + maximum of 20 profiles can be specified. + :type profiles: list[~azure.mgmt.monitor.models.AutoscaleProfile] + :param notifications: the collection of notifications. + :type notifications: + list[~azure.mgmt.monitor.models.AutoscaleNotification] + :param enabled: the enabled flag. Specifies whether automatic scaling is + enabled for the resource. The default value is 'true'. Default value: True + . + :type enabled: bool + :param name: the name of the autoscale setting. + :type name: str + :param target_resource_uri: the resource identifier of the resource that + the autoscale setting should be added to. + :type target_resource_uri: str + """ + + _validation = { + 'profiles': {'required': True, 'max_items': 20}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'profiles': {'key': 'properties.profiles', 'type': '[AutoscaleProfile]'}, + 'notifications': {'key': 'properties.notifications', 'type': '[AutoscaleNotification]'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'name': {'key': 'properties.name', 'type': 'str'}, + 'target_resource_uri': {'key': 'properties.targetResourceUri', 'type': 'str'}, + } + + def __init__(self, *, profiles, tags=None, notifications=None, enabled: bool=True, name: str=None, target_resource_uri: str=None, **kwargs) -> None: + super(AutoscaleSettingResourcePatch, self).__init__(**kwargs) + self.tags = tags + self.profiles = profiles + self.notifications = notifications + self.enabled = enabled + self.name = name + self.target_resource_uri = target_resource_uri diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource_py3.py new file mode 100644 index 000000000000..23eb4643a585 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource_py3.py @@ -0,0 +1,78 @@ +# 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 .resource_py3 import Resource + + +class AutoscaleSettingResource(Resource): + """The autoscale setting resource. + + 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] + :param profiles: Required. the collection of automatic scaling profiles + that specify different scaling parameters for different time periods. A + maximum of 20 profiles can be specified. + :type profiles: list[~azure.mgmt.monitor.models.AutoscaleProfile] + :param notifications: the collection of notifications. + :type notifications: + list[~azure.mgmt.monitor.models.AutoscaleNotification] + :param enabled: the enabled flag. Specifies whether automatic scaling is + enabled for the resource. The default value is 'true'. Default value: True + . + :type enabled: bool + :param autoscale_setting_resource_name: the name of the autoscale setting. + :type autoscale_setting_resource_name: str + :param target_resource_uri: the resource identifier of the resource that + the autoscale setting should be added to. + :type target_resource_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'profiles': {'required': True, 'max_items': 20}, + } + + _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}'}, + 'profiles': {'key': 'properties.profiles', 'type': '[AutoscaleProfile]'}, + 'notifications': {'key': 'properties.notifications', 'type': '[AutoscaleNotification]'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'autoscale_setting_resource_name': {'key': 'properties.name', 'type': 'str'}, + 'target_resource_uri': {'key': 'properties.targetResourceUri', 'type': 'str'}, + } + + def __init__(self, *, location: str, profiles, tags=None, notifications=None, enabled: bool=True, autoscale_setting_resource_name: str=None, target_resource_uri: str=None, **kwargs) -> None: + super(AutoscaleSettingResource, self).__init__(location=location, tags=tags, **kwargs) + self.profiles = profiles + self.notifications = notifications + self.enabled = enabled + self.autoscale_setting_resource_name = autoscale_setting_resource_name + self.target_resource_uri = target_resource_uri diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/az_ns_action_group.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/az_ns_action_group.py new file mode 100644 index 000000000000..90dfa0f13876 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/az_ns_action_group.py @@ -0,0 +1,38 @@ +# 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 + + +class AzNsActionGroup(Model): + """Azure action group. + + :param action_group: Azure Action Group reference. + :type action_group: list[str] + :param email_subject: Custom subject override for all email ids in Azure + action group + :type email_subject: str + :param custom_webhook_payload: Custom payload to be sent for all webhook + URI in Azure action group + :type custom_webhook_payload: str + """ + + _attribute_map = { + 'action_group': {'key': 'actionGroup', 'type': '[str]'}, + 'email_subject': {'key': 'emailSubject', 'type': 'str'}, + 'custom_webhook_payload': {'key': 'customWebhookPayload', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzNsActionGroup, self).__init__(**kwargs) + self.action_group = kwargs.get('action_group', None) + self.email_subject = kwargs.get('email_subject', None) + self.custom_webhook_payload = kwargs.get('custom_webhook_payload', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/az_ns_action_group_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/az_ns_action_group_py3.py new file mode 100644 index 000000000000..e614bec2d5a7 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/az_ns_action_group_py3.py @@ -0,0 +1,38 @@ +# 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 + + +class AzNsActionGroup(Model): + """Azure action group. + + :param action_group: Azure Action Group reference. + :type action_group: list[str] + :param email_subject: Custom subject override for all email ids in Azure + action group + :type email_subject: str + :param custom_webhook_payload: Custom payload to be sent for all webhook + URI in Azure action group + :type custom_webhook_payload: str + """ + + _attribute_map = { + 'action_group': {'key': 'actionGroup', 'type': '[str]'}, + 'email_subject': {'key': 'emailSubject', 'type': 'str'}, + 'custom_webhook_payload': {'key': 'customWebhookPayload', 'type': 'str'}, + } + + def __init__(self, *, action_group=None, email_subject: str=None, custom_webhook_payload: str=None, **kwargs) -> None: + super(AzNsActionGroup, self).__init__(**kwargs) + self.action_group = action_group + self.email_subject = email_subject + self.custom_webhook_payload = custom_webhook_payload diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/azure_app_push_receiver.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/azure_app_push_receiver.py new file mode 100644 index 000000000000..3acb85b22433 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/azure_app_push_receiver.py @@ -0,0 +1,41 @@ +# 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 + + +class AzureAppPushReceiver(Model): + """The Azure mobile App push notification receiver. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the Azure mobile app push receiver. + Names must be unique across all receivers within an action group. + :type name: str + :param email_address: Required. The email address registered for the Azure + mobile app. + :type email_address: str + """ + + _validation = { + 'name': {'required': True}, + 'email_address': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'email_address': {'key': 'emailAddress', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureAppPushReceiver, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.email_address = kwargs.get('email_address', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/azure_app_push_receiver_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/azure_app_push_receiver_py3.py new file mode 100644 index 000000000000..eee03feaa788 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/azure_app_push_receiver_py3.py @@ -0,0 +1,41 @@ +# 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 + + +class AzureAppPushReceiver(Model): + """The Azure mobile App push notification receiver. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the Azure mobile app push receiver. + Names must be unique across all receivers within an action group. + :type name: str + :param email_address: Required. The email address registered for the Azure + mobile app. + :type email_address: str + """ + + _validation = { + 'name': {'required': True}, + 'email_address': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'email_address': {'key': 'emailAddress', 'type': 'str'}, + } + + def __init__(self, *, name: str, email_address: str, **kwargs) -> None: + super(AzureAppPushReceiver, self).__init__(**kwargs) + self.name = name + self.email_address = email_address diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/azure_function_receiver.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/azure_function_receiver.py new file mode 100644 index 000000000000..cad1e0ff738b --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/azure_function_receiver.py @@ -0,0 +1,58 @@ +# 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 + + +class AzureFunctionReceiver(Model): + """An azure function receiver. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the azure function receiver. Names must + be unique across all receivers within an action group. + :type name: str + :param function_app_resource_id: Required. The azure resource id of the + function app. + :type function_app_resource_id: str + :param function_name: Required. The function name in the function app. + :type function_name: str + :param http_trigger_url: Required. The http trigger url where http request + sent to. + :type http_trigger_url: str + :param use_common_alert_schema: Required. Indicates whether to use common + alert schema. + :type use_common_alert_schema: bool + """ + + _validation = { + 'name': {'required': True}, + 'function_app_resource_id': {'required': True}, + 'function_name': {'required': True}, + 'http_trigger_url': {'required': True}, + 'use_common_alert_schema': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'function_app_resource_id': {'key': 'functionAppResourceId', 'type': 'str'}, + 'function_name': {'key': 'functionName', 'type': 'str'}, + 'http_trigger_url': {'key': 'httpTriggerUrl', 'type': 'str'}, + 'use_common_alert_schema': {'key': 'useCommonAlertSchema', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(AzureFunctionReceiver, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.function_app_resource_id = kwargs.get('function_app_resource_id', None) + self.function_name = kwargs.get('function_name', None) + self.http_trigger_url = kwargs.get('http_trigger_url', None) + self.use_common_alert_schema = kwargs.get('use_common_alert_schema', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/azure_function_receiver_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/azure_function_receiver_py3.py new file mode 100644 index 000000000000..f5d28c8df177 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/azure_function_receiver_py3.py @@ -0,0 +1,58 @@ +# 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 + + +class AzureFunctionReceiver(Model): + """An azure function receiver. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the azure function receiver. Names must + be unique across all receivers within an action group. + :type name: str + :param function_app_resource_id: Required. The azure resource id of the + function app. + :type function_app_resource_id: str + :param function_name: Required. The function name in the function app. + :type function_name: str + :param http_trigger_url: Required. The http trigger url where http request + sent to. + :type http_trigger_url: str + :param use_common_alert_schema: Required. Indicates whether to use common + alert schema. + :type use_common_alert_schema: bool + """ + + _validation = { + 'name': {'required': True}, + 'function_app_resource_id': {'required': True}, + 'function_name': {'required': True}, + 'http_trigger_url': {'required': True}, + 'use_common_alert_schema': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'function_app_resource_id': {'key': 'functionAppResourceId', 'type': 'str'}, + 'function_name': {'key': 'functionName', 'type': 'str'}, + 'http_trigger_url': {'key': 'httpTriggerUrl', 'type': 'str'}, + 'use_common_alert_schema': {'key': 'useCommonAlertSchema', 'type': 'bool'}, + } + + def __init__(self, *, name: str, function_app_resource_id: str, function_name: str, http_trigger_url: str, use_common_alert_schema: bool, **kwargs) -> None: + super(AzureFunctionReceiver, self).__init__(**kwargs) + self.name = name + self.function_app_resource_id = function_app_resource_id + self.function_name = function_name + self.http_trigger_url = http_trigger_url + self.use_common_alert_schema = use_common_alert_schema diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline.py new file mode 100644 index 000000000000..ae375dd23587 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline.py @@ -0,0 +1,45 @@ +# 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 + + +class Baseline(Model): + """The baseline values for a single sensitivity value. + + All required parameters must be populated in order to send to Azure. + + :param sensitivity: Required. the sensitivity of the baseline. Possible + values include: 'Low', 'Medium', 'High' + :type sensitivity: str or ~azure.mgmt.monitor.models.Sensitivity + :param low_thresholds: Required. The low thresholds of the baseline. + :type low_thresholds: list[float] + :param high_thresholds: Required. The high thresholds of the baseline. + :type high_thresholds: list[float] + """ + + _validation = { + 'sensitivity': {'required': True}, + 'low_thresholds': {'required': True}, + 'high_thresholds': {'required': True}, + } + + _attribute_map = { + 'sensitivity': {'key': 'sensitivity', 'type': 'Sensitivity'}, + 'low_thresholds': {'key': 'lowThresholds', 'type': '[float]'}, + 'high_thresholds': {'key': 'highThresholds', 'type': '[float]'}, + } + + def __init__(self, **kwargs): + super(Baseline, self).__init__(**kwargs) + self.sensitivity = kwargs.get('sensitivity', None) + self.low_thresholds = kwargs.get('low_thresholds', None) + self.high_thresholds = kwargs.get('high_thresholds', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_metadata.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_metadata.py new file mode 100644 index 000000000000..f712751fe44b --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_metadata.py @@ -0,0 +1,39 @@ +# 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 + + +class BaselineMetadata(Model): + """Represents a baseline metadata value. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the baseline metadata. + :type name: str + :param value: Required. Value of the baseline metadata. + :type value: str + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BaselineMetadata, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_metadata_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_metadata_py3.py new file mode 100644 index 000000000000..9c4eb9c042dc --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_metadata_py3.py @@ -0,0 +1,39 @@ +# 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 + + +class BaselineMetadata(Model): + """Represents a baseline metadata value. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the baseline metadata. + :type name: str + :param value: Required. Value of the baseline metadata. + :type value: str + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name: str, value: str, **kwargs) -> None: + super(BaselineMetadata, self).__init__(**kwargs) + self.name = name + self.value = value diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_metadata_value.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_metadata_value.py new file mode 100644 index 000000000000..33364a07cf4f --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_metadata_value.py @@ -0,0 +1,32 @@ +# 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 + + +class BaselineMetadataValue(Model): + """Represents a baseline metadata value. + + :param name: the name of the metadata. + :type name: ~azure.mgmt.monitor.models.LocalizableString + :param value: the value of the metadata. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'LocalizableString'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BaselineMetadataValue, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_metadata_value_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_metadata_value_py3.py new file mode 100644 index 000000000000..9ac4552031d0 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_metadata_value_py3.py @@ -0,0 +1,32 @@ +# 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 + + +class BaselineMetadataValue(Model): + """Represents a baseline metadata value. + + :param name: the name of the metadata. + :type name: ~azure.mgmt.monitor.models.LocalizableString + :param value: the value of the metadata. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'LocalizableString'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name=None, value: str=None, **kwargs) -> None: + super(BaselineMetadataValue, self).__init__(**kwargs) + self.name = name + self.value = value diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_py3.py new file mode 100644 index 000000000000..6fbaab8dc7e6 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_py3.py @@ -0,0 +1,45 @@ +# 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 + + +class Baseline(Model): + """The baseline values for a single sensitivity value. + + All required parameters must be populated in order to send to Azure. + + :param sensitivity: Required. the sensitivity of the baseline. Possible + values include: 'Low', 'Medium', 'High' + :type sensitivity: str or ~azure.mgmt.monitor.models.Sensitivity + :param low_thresholds: Required. The low thresholds of the baseline. + :type low_thresholds: list[float] + :param high_thresholds: Required. The high thresholds of the baseline. + :type high_thresholds: list[float] + """ + + _validation = { + 'sensitivity': {'required': True}, + 'low_thresholds': {'required': True}, + 'high_thresholds': {'required': True}, + } + + _attribute_map = { + 'sensitivity': {'key': 'sensitivity', 'type': 'Sensitivity'}, + 'low_thresholds': {'key': 'lowThresholds', 'type': '[float]'}, + 'high_thresholds': {'key': 'highThresholds', 'type': '[float]'}, + } + + def __init__(self, *, sensitivity, low_thresholds, high_thresholds, **kwargs) -> None: + super(Baseline, self).__init__(**kwargs) + self.sensitivity = sensitivity + self.low_thresholds = low_thresholds + self.high_thresholds = high_thresholds diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_response.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_response.py new file mode 100644 index 000000000000..781ab85b07a7 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_response.py @@ -0,0 +1,76 @@ +# 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 + + +class BaselineResponse(Model): + """The response to a baseline query. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: the metric baseline Id. + :vartype id: str + :ivar type: the resource type of the baseline resource. + :vartype type: str + :ivar name: the name and the display name of the metric, i.e. it is + localizable string. + :vartype name: ~azure.mgmt.monitor.models.LocalizableString + :param timespan: The timespan for which the data was retrieved. Its value + consists of two datetimes concatenated, separated by '/'. This may be + adjusted in the future and returned back from what was originally + requested. + :type timespan: str + :param interval: The interval (window size) for which the metric data was + returned in. This may be adjusted in the future and returned back from + what was originally requested. This is not present if a metadata request + was made. + :type interval: timedelta + :param aggregation: The aggregation type of the metric. + :type aggregation: str + :param timestamps: the array of timestamps of the baselines. + :type timestamps: list[datetime] + :param baseline: the baseline values for each sensitivity. + :type baseline: list[~azure.mgmt.monitor.models.Baseline] + :param metadata: the baseline metadata values. + :type metadata: list[~azure.mgmt.monitor.models.BaselineMetadataValue] + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'LocalizableString'}, + 'timespan': {'key': 'properties.timespan', 'type': 'str'}, + 'interval': {'key': 'properties.interval', 'type': 'duration'}, + 'aggregation': {'key': 'properties.aggregation', 'type': 'str'}, + 'timestamps': {'key': 'properties.timestamps', 'type': '[iso-8601]'}, + 'baseline': {'key': 'properties.baseline', 'type': '[Baseline]'}, + 'metadata': {'key': 'properties.metadata', 'type': '[BaselineMetadataValue]'}, + } + + def __init__(self, **kwargs): + super(BaselineResponse, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.timespan = kwargs.get('timespan', None) + self.interval = kwargs.get('interval', None) + self.aggregation = kwargs.get('aggregation', None) + self.timestamps = kwargs.get('timestamps', None) + self.baseline = kwargs.get('baseline', None) + self.metadata = kwargs.get('metadata', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_response_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_response_py3.py new file mode 100644 index 000000000000..3f91146aa0b3 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_response_py3.py @@ -0,0 +1,76 @@ +# 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 + + +class BaselineResponse(Model): + """The response to a baseline query. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: the metric baseline Id. + :vartype id: str + :ivar type: the resource type of the baseline resource. + :vartype type: str + :ivar name: the name and the display name of the metric, i.e. it is + localizable string. + :vartype name: ~azure.mgmt.monitor.models.LocalizableString + :param timespan: The timespan for which the data was retrieved. Its value + consists of two datetimes concatenated, separated by '/'. This may be + adjusted in the future and returned back from what was originally + requested. + :type timespan: str + :param interval: The interval (window size) for which the metric data was + returned in. This may be adjusted in the future and returned back from + what was originally requested. This is not present if a metadata request + was made. + :type interval: timedelta + :param aggregation: The aggregation type of the metric. + :type aggregation: str + :param timestamps: the array of timestamps of the baselines. + :type timestamps: list[datetime] + :param baseline: the baseline values for each sensitivity. + :type baseline: list[~azure.mgmt.monitor.models.Baseline] + :param metadata: the baseline metadata values. + :type metadata: list[~azure.mgmt.monitor.models.BaselineMetadataValue] + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'LocalizableString'}, + 'timespan': {'key': 'properties.timespan', 'type': 'str'}, + 'interval': {'key': 'properties.interval', 'type': 'duration'}, + 'aggregation': {'key': 'properties.aggregation', 'type': 'str'}, + 'timestamps': {'key': 'properties.timestamps', 'type': '[iso-8601]'}, + 'baseline': {'key': 'properties.baseline', 'type': '[Baseline]'}, + 'metadata': {'key': 'properties.metadata', 'type': '[BaselineMetadataValue]'}, + } + + def __init__(self, *, timespan: str=None, interval=None, aggregation: str=None, timestamps=None, baseline=None, metadata=None, **kwargs) -> None: + super(BaselineResponse, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.timespan = timespan + self.interval = interval + self.aggregation = aggregation + self.timestamps = timestamps + self.baseline = baseline + self.metadata = metadata diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/calculate_baseline_response.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/calculate_baseline_response.py new file mode 100644 index 000000000000..b6ad8365fdc4 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/calculate_baseline_response.py @@ -0,0 +1,43 @@ +# 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 + + +class CalculateBaselineResponse(Model): + """The response to a calculate baseline call. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. the resource type of the baseline resource. + :type type: str + :param timestamps: the array of timestamps of the baselines. + :type timestamps: list[datetime] + :param baseline: Required. the baseline values for each sensitivity. + :type baseline: list[~azure.mgmt.monitor.models.Baseline] + """ + + _validation = { + 'type': {'required': True}, + 'baseline': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'timestamps': {'key': 'timestamps', 'type': '[iso-8601]'}, + 'baseline': {'key': 'baseline', 'type': '[Baseline]'}, + } + + def __init__(self, **kwargs): + super(CalculateBaselineResponse, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.timestamps = kwargs.get('timestamps', None) + self.baseline = kwargs.get('baseline', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/calculate_baseline_response_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/calculate_baseline_response_py3.py new file mode 100644 index 000000000000..b0fabc452648 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/calculate_baseline_response_py3.py @@ -0,0 +1,43 @@ +# 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 + + +class CalculateBaselineResponse(Model): + """The response to a calculate baseline call. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. the resource type of the baseline resource. + :type type: str + :param timestamps: the array of timestamps of the baselines. + :type timestamps: list[datetime] + :param baseline: Required. the baseline values for each sensitivity. + :type baseline: list[~azure.mgmt.monitor.models.Baseline] + """ + + _validation = { + 'type': {'required': True}, + 'baseline': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'timestamps': {'key': 'timestamps', 'type': '[iso-8601]'}, + 'baseline': {'key': 'baseline', 'type': '[Baseline]'}, + } + + def __init__(self, *, type: str, baseline, timestamps=None, **kwargs) -> None: + super(CalculateBaselineResponse, self).__init__(**kwargs) + self.type = type + self.timestamps = timestamps + self.baseline = baseline diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/criteria.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/criteria.py new file mode 100644 index 000000000000..34bb08dd5fce --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/criteria.py @@ -0,0 +1,38 @@ +# 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 + + +class Criteria(Model): + """Specifies the criteria for converting log to metric. + + All required parameters must be populated in order to send to Azure. + + :param metric_name: Required. Name of the metric + :type metric_name: str + :param dimensions: List of Dimensions for creating metric + :type dimensions: list[~azure.mgmt.monitor.models.Dimension] + """ + + _validation = { + 'metric_name': {'required': True}, + } + + _attribute_map = { + 'metric_name': {'key': 'metricName', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + } + + def __init__(self, **kwargs): + super(Criteria, self).__init__(**kwargs) + self.metric_name = kwargs.get('metric_name', None) + self.dimensions = kwargs.get('dimensions', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/criteria_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/criteria_py3.py new file mode 100644 index 000000000000..e6266bc19003 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/criteria_py3.py @@ -0,0 +1,38 @@ +# 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 + + +class Criteria(Model): + """Specifies the criteria for converting log to metric. + + All required parameters must be populated in order to send to Azure. + + :param metric_name: Required. Name of the metric + :type metric_name: str + :param dimensions: List of Dimensions for creating metric + :type dimensions: list[~azure.mgmt.monitor.models.Dimension] + """ + + _validation = { + 'metric_name': {'required': True}, + } + + _attribute_map = { + 'metric_name': {'key': 'metricName', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + } + + def __init__(self, *, metric_name: str, dimensions=None, **kwargs) -> None: + super(Criteria, self).__init__(**kwargs) + self.metric_name = metric_name + self.dimensions = dimensions diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/data_container.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/data_container.py new file mode 100644 index 000000000000..175998582146 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/data_container.py @@ -0,0 +1,34 @@ +# 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 + + +class DataContainer(Model): + """Information about a container with data for a given resource. + + All required parameters must be populated in order to send to Azure. + + :param workspace: Required. Log Analytics workspace information. + :type workspace: ~azure.mgmt.monitor.models.WorkspaceInfo + """ + + _validation = { + 'workspace': {'required': True}, + } + + _attribute_map = { + 'workspace': {'key': 'workspace', 'type': 'WorkspaceInfo'}, + } + + def __init__(self, **kwargs): + super(DataContainer, self).__init__(**kwargs) + self.workspace = kwargs.get('workspace', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/data_container_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/data_container_py3.py new file mode 100644 index 000000000000..76b3b81f984b --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/data_container_py3.py @@ -0,0 +1,34 @@ +# 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 + + +class DataContainer(Model): + """Information about a container with data for a given resource. + + All required parameters must be populated in order to send to Azure. + + :param workspace: Required. Log Analytics workspace information. + :type workspace: ~azure.mgmt.monitor.models.WorkspaceInfo + """ + + _validation = { + 'workspace': {'required': True}, + } + + _attribute_map = { + 'workspace': {'key': 'workspace', 'type': 'WorkspaceInfo'}, + } + + def __init__(self, *, workspace, **kwargs) -> None: + super(DataContainer, self).__init__(**kwargs) + self.workspace = workspace diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_category_resource.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_category_resource.py new file mode 100644 index 000000000000..22a2951b0b3f --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_category_resource.py @@ -0,0 +1,47 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class DiagnosticSettingsCategoryResource(ProxyOnlyResource): + """The diagnostic settings category resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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 category_type: The type of the diagnostic settings category. + Possible values include: 'Metrics', 'Logs' + :type category_type: str or ~azure.mgmt.monitor.models.CategoryType + """ + + _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'}, + 'category_type': {'key': 'properties.categoryType', 'type': 'CategoryType'}, + } + + def __init__(self, **kwargs): + super(DiagnosticSettingsCategoryResource, self).__init__(**kwargs) + self.category_type = kwargs.get('category_type', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_category_resource_collection.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_category_resource_collection.py new file mode 100644 index 000000000000..1192f620b392 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_category_resource_collection.py @@ -0,0 +1,29 @@ +# 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 + + +class DiagnosticSettingsCategoryResourceCollection(Model): + """Represents a collection of diagnostic setting category resources. + + :param value: The collection of diagnostic settings category resources. + :type value: + list[~azure.mgmt.monitor.models.DiagnosticSettingsCategoryResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DiagnosticSettingsCategoryResource]'}, + } + + def __init__(self, **kwargs): + super(DiagnosticSettingsCategoryResourceCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_category_resource_collection_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_category_resource_collection_py3.py new file mode 100644 index 000000000000..7e7e044da6c8 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_category_resource_collection_py3.py @@ -0,0 +1,29 @@ +# 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 + + +class DiagnosticSettingsCategoryResourceCollection(Model): + """Represents a collection of diagnostic setting category resources. + + :param value: The collection of diagnostic settings category resources. + :type value: + list[~azure.mgmt.monitor.models.DiagnosticSettingsCategoryResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DiagnosticSettingsCategoryResource]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(DiagnosticSettingsCategoryResourceCollection, self).__init__(**kwargs) + self.value = value diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_category_resource_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_category_resource_py3.py new file mode 100644 index 000000000000..f97b609a6e0a --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_category_resource_py3.py @@ -0,0 +1,47 @@ +# 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 .proxy_only_resource_py3 import ProxyOnlyResource + + +class DiagnosticSettingsCategoryResource(ProxyOnlyResource): + """The diagnostic settings category resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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 category_type: The type of the diagnostic settings category. + Possible values include: 'Metrics', 'Logs' + :type category_type: str or ~azure.mgmt.monitor.models.CategoryType + """ + + _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'}, + 'category_type': {'key': 'properties.categoryType', 'type': 'CategoryType'}, + } + + def __init__(self, *, category_type=None, **kwargs) -> None: + super(DiagnosticSettingsCategoryResource, self).__init__(**kwargs) + self.category_type = category_type diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_resource.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_resource.py new file mode 100644 index 000000000000..c5f28afc8219 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_resource.py @@ -0,0 +1,77 @@ +# 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 .proxy_only_resource import ProxyOnlyResource + + +class DiagnosticSettingsResource(ProxyOnlyResource): + """The diagnostic setting resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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 storage_account_id: The resource ID of the storage account to which + you would like to send Diagnostic Logs. + :type storage_account_id: str + :param service_bus_rule_id: The service bus rule Id of the diagnostic + setting. This is here to maintain backwards compatibility. + :type service_bus_rule_id: str + :param event_hub_authorization_rule_id: The resource Id for the event hub + authorization rule. + :type event_hub_authorization_rule_id: str + :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. + :type metrics: list[~azure.mgmt.monitor.models.MetricSettings] + :param logs: the list of logs settings. + :type logs: list[~azure.mgmt.monitor.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: + /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 + :type workspace_id: 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'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + 'service_bus_rule_id': {'key': 'properties.serviceBusRuleId', 'type': 'str'}, + 'event_hub_authorization_rule_id': {'key': 'properties.eventHubAuthorizationRuleId', 'type': 'str'}, + 'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'}, + 'metrics': {'key': 'properties.metrics', 'type': '[MetricSettings]'}, + 'logs': {'key': 'properties.logs', 'type': '[LogSettings]'}, + 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DiagnosticSettingsResource, self).__init__(**kwargs) + self.storage_account_id = kwargs.get('storage_account_id', None) + self.service_bus_rule_id = kwargs.get('service_bus_rule_id', None) + self.event_hub_authorization_rule_id = kwargs.get('event_hub_authorization_rule_id', None) + self.event_hub_name = kwargs.get('event_hub_name', None) + self.metrics = kwargs.get('metrics', None) + self.logs = kwargs.get('logs', None) + self.workspace_id = kwargs.get('workspace_id', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_resource_collection.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_resource_collection.py new file mode 100644 index 000000000000..396b3e7b7afb --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_resource_collection.py @@ -0,0 +1,28 @@ +# 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 + + +class DiagnosticSettingsResourceCollection(Model): + """Represents a collection of alert rule resources. + + :param value: The collection of diagnostic settings resources;. + :type value: list[~azure.mgmt.monitor.models.DiagnosticSettingsResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DiagnosticSettingsResource]'}, + } + + def __init__(self, **kwargs): + super(DiagnosticSettingsResourceCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_resource_collection_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_resource_collection_py3.py new file mode 100644 index 000000000000..8e1ec8c0813b --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_resource_collection_py3.py @@ -0,0 +1,28 @@ +# 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 + + +class DiagnosticSettingsResourceCollection(Model): + """Represents a collection of alert rule resources. + + :param value: The collection of diagnostic settings resources;. + :type value: list[~azure.mgmt.monitor.models.DiagnosticSettingsResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DiagnosticSettingsResource]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(DiagnosticSettingsResourceCollection, self).__init__(**kwargs) + self.value = value diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_resource_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_resource_py3.py new file mode 100644 index 000000000000..454c57f52765 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_resource_py3.py @@ -0,0 +1,77 @@ +# 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 .proxy_only_resource_py3 import ProxyOnlyResource + + +class DiagnosticSettingsResource(ProxyOnlyResource): + """The diagnostic setting resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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 storage_account_id: The resource ID of the storage account to which + you would like to send Diagnostic Logs. + :type storage_account_id: str + :param service_bus_rule_id: The service bus rule Id of the diagnostic + setting. This is here to maintain backwards compatibility. + :type service_bus_rule_id: str + :param event_hub_authorization_rule_id: The resource Id for the event hub + authorization rule. + :type event_hub_authorization_rule_id: str + :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. + :type metrics: list[~azure.mgmt.monitor.models.MetricSettings] + :param logs: the list of logs settings. + :type logs: list[~azure.mgmt.monitor.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: + /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 + :type workspace_id: 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'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + 'service_bus_rule_id': {'key': 'properties.serviceBusRuleId', 'type': 'str'}, + 'event_hub_authorization_rule_id': {'key': 'properties.eventHubAuthorizationRuleId', 'type': 'str'}, + 'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'}, + 'metrics': {'key': 'properties.metrics', 'type': '[MetricSettings]'}, + 'logs': {'key': 'properties.logs', 'type': '[LogSettings]'}, + 'workspace_id': {'key': 'properties.workspaceId', '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: + super(DiagnosticSettingsResource, self).__init__(**kwargs) + self.storage_account_id = storage_account_id + self.service_bus_rule_id = service_bus_rule_id + self.event_hub_authorization_rule_id = event_hub_authorization_rule_id + self.event_hub_name = event_hub_name + self.metrics = metrics + self.logs = logs + self.workspace_id = workspace_id diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/dimension.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/dimension.py new file mode 100644 index 000000000000..82826c978cd8 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/dimension.py @@ -0,0 +1,49 @@ +# 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 + + +class Dimension(Model): + """Specifies the criteria for converting log to metric. + + 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 name: Required. Name of the dimension + :type name: str + :ivar operator: Required. Operator for dimension values. Default value: + "Include" . + :vartype operator: str + :param values: Required. List of dimension values + :type values: list[str] + """ + + _validation = { + 'name': {'required': True}, + 'operator': {'required': True, 'constant': True}, + 'values': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + operator = "Include" + + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.values = kwargs.get('values', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/dimension_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/dimension_py3.py new file mode 100644 index 000000000000..d506b33189c4 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/dimension_py3.py @@ -0,0 +1,49 @@ +# 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 + + +class Dimension(Model): + """Specifies the criteria for converting log to metric. + + 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 name: Required. Name of the dimension + :type name: str + :ivar operator: Required. Operator for dimension values. Default value: + "Include" . + :vartype operator: str + :param values: Required. List of dimension values + :type values: list[str] + """ + + _validation = { + 'name': {'required': True}, + 'operator': {'required': True, 'constant': True}, + 'values': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + operator = "Include" + + def __init__(self, *, name: str, values, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.values = values diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/dynamic_metric_criteria.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/dynamic_metric_criteria.py new file mode 100644 index 000000000000..9608b7ae26b1 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/dynamic_metric_criteria.py @@ -0,0 +1,83 @@ +# 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 .multi_metric_criteria import MultiMetricCriteria + + +class DynamicMetricCriteria(MultiMetricCriteria): + """Criterion for dynamic threshold. + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param name: Required. Name of the criteria. + :type name: str + :param metric_name: Required. Name of the metric. + :type metric_name: str + :param metric_namespace: Namespace of the metric. + :type metric_namespace: str + :param time_aggregation: Required. the criteria time aggregation types. + :type time_aggregation: object + :param dimensions: List of dimension conditions. + :type dimensions: list[~azure.mgmt.monitor.models.MetricDimension] + :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 + :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 + :param failing_periods: Required. The minimum number of violations + required within the selected lookback time window required to raise an + alert. + :type failing_periods: + ~azure.mgmt.monitor.models.DynamicThresholdFailingPeriods + :param ignore_data_before: Use this option to set the date from which to + start learning the metric historical data and calculate the dynamic + thresholds (in ISO8601 format) + :type ignore_data_before: datetime + """ + + _validation = { + 'name': {'required': True}, + 'metric_name': {'required': True}, + 'time_aggregation': {'required': True}, + 'criterion_type': {'required': True}, + 'operator': {'required': True}, + 'alert_sensitivity': {'required': True}, + 'failing_periods': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'metric_name': {'key': 'metricName', 'type': 'str'}, + 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, + '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'}, + 'failing_periods': {'key': 'failingPeriods', 'type': 'DynamicThresholdFailingPeriods'}, + 'ignore_data_before': {'key': 'ignoreDataBefore', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(DynamicMetricCriteria, self).__init__(**kwargs) + self.operator = kwargs.get('operator', None) + self.alert_sensitivity = kwargs.get('alert_sensitivity', None) + self.failing_periods = kwargs.get('failing_periods', None) + self.ignore_data_before = kwargs.get('ignore_data_before', None) + self.criterion_type = 'DynamicThresholdCriterion' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/dynamic_metric_criteria_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/dynamic_metric_criteria_py3.py new file mode 100644 index 000000000000..4ceee195c47f --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/dynamic_metric_criteria_py3.py @@ -0,0 +1,83 @@ +# 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 .multi_metric_criteria_py3 import MultiMetricCriteria + + +class DynamicMetricCriteria(MultiMetricCriteria): + """Criterion for dynamic threshold. + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param name: Required. Name of the criteria. + :type name: str + :param metric_name: Required. Name of the metric. + :type metric_name: str + :param metric_namespace: Namespace of the metric. + :type metric_namespace: str + :param time_aggregation: Required. the criteria time aggregation types. + :type time_aggregation: object + :param dimensions: List of dimension conditions. + :type dimensions: list[~azure.mgmt.monitor.models.MetricDimension] + :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 + :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 + :param failing_periods: Required. The minimum number of violations + required within the selected lookback time window required to raise an + alert. + :type failing_periods: + ~azure.mgmt.monitor.models.DynamicThresholdFailingPeriods + :param ignore_data_before: Use this option to set the date from which to + start learning the metric historical data and calculate the dynamic + thresholds (in ISO8601 format) + :type ignore_data_before: datetime + """ + + _validation = { + 'name': {'required': True}, + 'metric_name': {'required': True}, + 'time_aggregation': {'required': True}, + 'criterion_type': {'required': True}, + 'operator': {'required': True}, + 'alert_sensitivity': {'required': True}, + 'failing_periods': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'metric_name': {'key': 'metricName', 'type': 'str'}, + 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, + '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'}, + 'failing_periods': {'key': 'failingPeriods', 'type': 'DynamicThresholdFailingPeriods'}, + 'ignore_data_before': {'key': 'ignoreDataBefore', 'type': 'iso-8601'}, + } + + def __init__(self, *, name: str, metric_name: str, time_aggregation, operator, alert_sensitivity, failing_periods, additional_properties=None, metric_namespace: str=None, dimensions=None, ignore_data_before=None, **kwargs) -> None: + super(DynamicMetricCriteria, self).__init__(additional_properties=additional_properties, name=name, metric_name=metric_name, metric_namespace=metric_namespace, time_aggregation=time_aggregation, dimensions=dimensions, **kwargs) + self.operator = operator + self.alert_sensitivity = alert_sensitivity + self.failing_periods = failing_periods + self.ignore_data_before = ignore_data_before + self.criterion_type = 'DynamicThresholdCriterion' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/dynamic_threshold_failing_periods.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/dynamic_threshold_failing_periods.py new file mode 100644 index 000000000000..b3980af78497 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/dynamic_threshold_failing_periods.py @@ -0,0 +1,44 @@ +# 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 + + +class DynamicThresholdFailingPeriods(Model): + """The minimum number of violations required within the selected lookback time + window required to raise an alert. + + All required parameters must be populated in order to send to Azure. + + :param number_of_evaluation_periods: Required. The number of aggregated + lookback points. The lookback time window is calculated based on the + aggregation granularity (windowSize) and the selected number of aggregated + points. + :type number_of_evaluation_periods: float + :param min_failing_periods_to_alert: Required. The number of violations to + trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. + :type min_failing_periods_to_alert: float + """ + + _validation = { + 'number_of_evaluation_periods': {'required': True}, + 'min_failing_periods_to_alert': {'required': True}, + } + + _attribute_map = { + 'number_of_evaluation_periods': {'key': 'numberOfEvaluationPeriods', 'type': 'float'}, + 'min_failing_periods_to_alert': {'key': 'minFailingPeriodsToAlert', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(DynamicThresholdFailingPeriods, self).__init__(**kwargs) + self.number_of_evaluation_periods = kwargs.get('number_of_evaluation_periods', None) + self.min_failing_periods_to_alert = kwargs.get('min_failing_periods_to_alert', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/dynamic_threshold_failing_periods_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/dynamic_threshold_failing_periods_py3.py new file mode 100644 index 000000000000..249e9f4782f8 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/dynamic_threshold_failing_periods_py3.py @@ -0,0 +1,44 @@ +# 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 + + +class DynamicThresholdFailingPeriods(Model): + """The minimum number of violations required within the selected lookback time + window required to raise an alert. + + All required parameters must be populated in order to send to Azure. + + :param number_of_evaluation_periods: Required. The number of aggregated + lookback points. The lookback time window is calculated based on the + aggregation granularity (windowSize) and the selected number of aggregated + points. + :type number_of_evaluation_periods: float + :param min_failing_periods_to_alert: Required. The number of violations to + trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. + :type min_failing_periods_to_alert: float + """ + + _validation = { + 'number_of_evaluation_periods': {'required': True}, + 'min_failing_periods_to_alert': {'required': True}, + } + + _attribute_map = { + 'number_of_evaluation_periods': {'key': 'numberOfEvaluationPeriods', 'type': 'float'}, + 'min_failing_periods_to_alert': {'key': 'minFailingPeriodsToAlert', 'type': 'float'}, + } + + def __init__(self, *, number_of_evaluation_periods: float, min_failing_periods_to_alert: float, **kwargs) -> None: + super(DynamicThresholdFailingPeriods, self).__init__(**kwargs) + self.number_of_evaluation_periods = number_of_evaluation_periods + self.min_failing_periods_to_alert = min_failing_periods_to_alert diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/email_notification.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/email_notification.py new file mode 100644 index 000000000000..558502e35955 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/email_notification.py @@ -0,0 +1,39 @@ +# 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 + + +class EmailNotification(Model): + """Email notification of an autoscale event. + + :param send_to_subscription_administrator: a value indicating whether to + send email to subscription administrator. + :type send_to_subscription_administrator: bool + :param send_to_subscription_co_administrators: a value indicating whether + to send email to subscription co-administrators. + :type send_to_subscription_co_administrators: bool + :param custom_emails: the custom e-mails list. This value can be null or + empty, in which case this attribute will be ignored. + :type custom_emails: list[str] + """ + + _attribute_map = { + 'send_to_subscription_administrator': {'key': 'sendToSubscriptionAdministrator', 'type': 'bool'}, + 'send_to_subscription_co_administrators': {'key': 'sendToSubscriptionCoAdministrators', 'type': 'bool'}, + 'custom_emails': {'key': 'customEmails', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(EmailNotification, self).__init__(**kwargs) + self.send_to_subscription_administrator = kwargs.get('send_to_subscription_administrator', None) + self.send_to_subscription_co_administrators = kwargs.get('send_to_subscription_co_administrators', None) + self.custom_emails = kwargs.get('custom_emails', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/email_notification_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/email_notification_py3.py new file mode 100644 index 000000000000..aef62c2218b5 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/email_notification_py3.py @@ -0,0 +1,39 @@ +# 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 + + +class EmailNotification(Model): + """Email notification of an autoscale event. + + :param send_to_subscription_administrator: a value indicating whether to + send email to subscription administrator. + :type send_to_subscription_administrator: bool + :param send_to_subscription_co_administrators: a value indicating whether + to send email to subscription co-administrators. + :type send_to_subscription_co_administrators: bool + :param custom_emails: the custom e-mails list. This value can be null or + empty, in which case this attribute will be ignored. + :type custom_emails: list[str] + """ + + _attribute_map = { + 'send_to_subscription_administrator': {'key': 'sendToSubscriptionAdministrator', 'type': 'bool'}, + 'send_to_subscription_co_administrators': {'key': 'sendToSubscriptionCoAdministrators', 'type': 'bool'}, + 'custom_emails': {'key': 'customEmails', 'type': '[str]'}, + } + + def __init__(self, *, send_to_subscription_administrator: bool=None, send_to_subscription_co_administrators: bool=None, custom_emails=None, **kwargs) -> None: + super(EmailNotification, self).__init__(**kwargs) + self.send_to_subscription_administrator = send_to_subscription_administrator + self.send_to_subscription_co_administrators = send_to_subscription_co_administrators + self.custom_emails = custom_emails diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/email_receiver.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/email_receiver.py new file mode 100644 index 000000000000..1f3bfd600ea8 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/email_receiver.py @@ -0,0 +1,55 @@ +# 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 + + +class EmailReceiver(Model): + """An email receiver. + + 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 name: Required. The name of the email receiver. Names must be + unique across all receivers within an action group. + :type name: str + :param email_address: Required. The email address of this receiver. + :type email_address: str + :param use_common_alert_schema: Required. Indicates whether to use common + alert schema. + :type use_common_alert_schema: bool + :ivar status: The receiver status of the e-mail. Possible values include: + 'NotSpecified', 'Enabled', 'Disabled' + :vartype status: str or ~azure.mgmt.monitor.models.ReceiverStatus + """ + + _validation = { + 'name': {'required': True}, + 'email_address': {'required': True}, + 'use_common_alert_schema': {'required': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'email_address': {'key': 'emailAddress', 'type': 'str'}, + 'use_common_alert_schema': {'key': 'useCommonAlertSchema', 'type': 'bool'}, + 'status': {'key': 'status', 'type': 'ReceiverStatus'}, + } + + def __init__(self, **kwargs): + super(EmailReceiver, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.email_address = kwargs.get('email_address', None) + self.use_common_alert_schema = kwargs.get('use_common_alert_schema', None) + self.status = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/email_receiver_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/email_receiver_py3.py new file mode 100644 index 000000000000..00c489387d24 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/email_receiver_py3.py @@ -0,0 +1,55 @@ +# 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 + + +class EmailReceiver(Model): + """An email receiver. + + 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 name: Required. The name of the email receiver. Names must be + unique across all receivers within an action group. + :type name: str + :param email_address: Required. The email address of this receiver. + :type email_address: str + :param use_common_alert_schema: Required. Indicates whether to use common + alert schema. + :type use_common_alert_schema: bool + :ivar status: The receiver status of the e-mail. Possible values include: + 'NotSpecified', 'Enabled', 'Disabled' + :vartype status: str or ~azure.mgmt.monitor.models.ReceiverStatus + """ + + _validation = { + 'name': {'required': True}, + 'email_address': {'required': True}, + 'use_common_alert_schema': {'required': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'email_address': {'key': 'emailAddress', 'type': 'str'}, + 'use_common_alert_schema': {'key': 'useCommonAlertSchema', 'type': 'bool'}, + 'status': {'key': 'status', 'type': 'ReceiverStatus'}, + } + + def __init__(self, *, name: str, email_address: str, use_common_alert_schema: bool, **kwargs) -> None: + super(EmailReceiver, self).__init__(**kwargs) + self.name = name + self.email_address = email_address + self.use_common_alert_schema = use_common_alert_schema + self.status = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/enable_request.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/enable_request.py new file mode 100644 index 000000000000..655222716b8c --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/enable_request.py @@ -0,0 +1,34 @@ +# 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 + + +class EnableRequest(Model): + """Describes a receiver that should be resubscribed. + + All required parameters must be populated in order to send to Azure. + + :param receiver_name: Required. The name of the receiver to resubscribe. + :type receiver_name: str + """ + + _validation = { + 'receiver_name': {'required': True}, + } + + _attribute_map = { + 'receiver_name': {'key': 'receiverName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EnableRequest, self).__init__(**kwargs) + self.receiver_name = kwargs.get('receiver_name', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/enable_request_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/enable_request_py3.py new file mode 100644 index 000000000000..cd2037beb359 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/enable_request_py3.py @@ -0,0 +1,34 @@ +# 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 + + +class EnableRequest(Model): + """Describes a receiver that should be resubscribed. + + All required parameters must be populated in order to send to Azure. + + :param receiver_name: Required. The name of the receiver to resubscribe. + :type receiver_name: str + """ + + _validation = { + 'receiver_name': {'required': True}, + } + + _attribute_map = { + 'receiver_name': {'key': 'receiverName', 'type': 'str'}, + } + + def __init__(self, *, receiver_name: str, **kwargs) -> None: + super(EnableRequest, self).__init__(**kwargs) + self.receiver_name = receiver_name diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/error.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/error.py new file mode 100644 index 000000000000..cb534a038ce5 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/error.py @@ -0,0 +1,38 @@ +# 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 + + +class Error(Model): + """Error details. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Error code identifying the specific error. + :type code: str + :param message: Error message in the caller's locale. + :type message: str + """ + + _validation = { + 'code': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/error_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/error_py3.py new file mode 100644 index 000000000000..d75aa4e7a12d --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/error_py3.py @@ -0,0 +1,38 @@ +# 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 + + +class Error(Model): + """Error details. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Error code identifying the specific error. + :type code: str + :param message: Error message in the caller's locale. + :type message: str + """ + + _validation = { + 'code': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str, message: str=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/error_response.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/error_response.py new file mode 100644 index 000000000000..b3d490a49503 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/error_response.py @@ -0,0 +1,45 @@ +# 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 ErrorResponse(Model): + """Describes the format of Error response. + + :param code: Error code + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', 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) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/error_response_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/error_response_py3.py new file mode 100644 index 000000000000..5504940d6873 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/error_response_py3.py @@ -0,0 +1,45 @@ +# 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 ErrorResponse(Model): + """Describes the format of Error response. + + :param code: Error code + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + + +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) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/event_data.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/event_data.py new file mode 100644 index 000000000000..e9bb3647f764 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/event_data.py @@ -0,0 +1,181 @@ +# 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 + + +class EventData(Model): + """The Azure event log entries are of type EventData. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar authorization: The sender authorization information. + :vartype authorization: ~azure.mgmt.monitor.models.SenderAuthorization + :ivar claims: key value pairs to identify ARM permissions. + :vartype claims: dict[str, str] + :ivar caller: the email address of the user who has performed the + operation, the UPN claim or SPN claim based on availability. + :vartype caller: str + :ivar description: the description of the event. + :vartype description: str + :ivar id: the Id of this event as required by ARM for RBAC. It contains + the EventDataID and a timestamp information. + :vartype id: str + :ivar event_data_id: the event data Id. This is a unique identifier for an + event. + :vartype event_data_id: str + :ivar correlation_id: the correlation Id, usually a GUID in the string + format. The correlation Id is shared among the events that belong to the + same uber operation. + :vartype correlation_id: str + :ivar event_name: the event name. This value should not be confused with + OperationName. For practical purposes, OperationName might be more + appealing to end users. + :vartype event_name: ~azure.mgmt.monitor.models.LocalizableString + :ivar category: the event category. + :vartype category: ~azure.mgmt.monitor.models.LocalizableString + :ivar http_request: the HTTP request info. Usually includes the + 'clientRequestId', 'clientIpAddress' (IP address of the user who initiated + the event) and 'method' (HTTP method e.g. PUT). + :vartype http_request: ~azure.mgmt.monitor.models.HttpRequestInfo + :ivar level: the event level. Possible values include: 'Critical', + 'Error', 'Warning', 'Informational', 'Verbose' + :vartype level: str or ~azure.mgmt.monitor.models.EventLevel + :ivar resource_group_name: the resource group name of the impacted + resource. + :vartype resource_group_name: str + :ivar resource_provider_name: the resource provider name of the impacted + resource. + :vartype resource_provider_name: + ~azure.mgmt.monitor.models.LocalizableString + :ivar resource_id: the resource uri that uniquely identifies the resource + that caused this event. + :vartype resource_id: str + :ivar resource_type: the resource type + :vartype resource_type: ~azure.mgmt.monitor.models.LocalizableString + :ivar operation_id: It is usually a GUID shared among the events + corresponding to single operation. This value should not be confused with + EventName. + :vartype operation_id: str + :ivar operation_name: the operation name. + :vartype operation_name: ~azure.mgmt.monitor.models.LocalizableString + :ivar properties: the set of pairs (usually a + Dictionary) that includes details about the event. + :vartype properties: dict[str, str] + :ivar status: a string describing the status of the operation. Some + typical values are: Started, In progress, Succeeded, Failed, Resolved. + :vartype status: ~azure.mgmt.monitor.models.LocalizableString + :ivar sub_status: the event sub status. Most of the time, when included, + this captures the HTTP status code of the REST call. Common values are: OK + (HTTP Status Code: 200), Created (HTTP Status Code: 201), Accepted (HTTP + Status Code: 202), No Content (HTTP Status Code: 204), Bad Request(HTTP + Status Code: 400), Not Found (HTTP Status Code: 404), Conflict (HTTP + Status Code: 409), Internal Server Error (HTTP Status Code: 500), Service + Unavailable (HTTP Status Code:503), Gateway Timeout (HTTP Status Code: + 504) + :vartype sub_status: ~azure.mgmt.monitor.models.LocalizableString + :ivar event_timestamp: the timestamp of when the event was generated by + the Azure service processing the request corresponding the event. It in + ISO 8601 format. + :vartype event_timestamp: datetime + :ivar submission_timestamp: the timestamp of when the event became + available for querying via this API. It is in ISO 8601 format. This value + should not be confused eventTimestamp. As there might be a delay between + the occurrence time of the event, and the time that the event is submitted + to the Azure logging infrastructure. + :vartype submission_timestamp: datetime + :ivar subscription_id: the Azure subscription Id usually a GUID. + :vartype subscription_id: str + :ivar tenant_id: the Azure tenant Id + :vartype tenant_id: str + """ + + _validation = { + 'authorization': {'readonly': True}, + 'claims': {'readonly': True}, + 'caller': {'readonly': True}, + 'description': {'readonly': True}, + 'id': {'readonly': True}, + 'event_data_id': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'event_name': {'readonly': True}, + 'category': {'readonly': True}, + 'http_request': {'readonly': True}, + 'level': {'readonly': True}, + 'resource_group_name': {'readonly': True}, + 'resource_provider_name': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'operation_id': {'readonly': True}, + 'operation_name': {'readonly': True}, + 'properties': {'readonly': True}, + 'status': {'readonly': True}, + 'sub_status': {'readonly': True}, + 'event_timestamp': {'readonly': True}, + 'submission_timestamp': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'authorization': {'key': 'authorization', 'type': 'SenderAuthorization'}, + 'claims': {'key': 'claims', 'type': '{str}'}, + 'caller': {'key': 'caller', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'event_data_id': {'key': 'eventDataId', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'event_name': {'key': 'eventName', 'type': 'LocalizableString'}, + 'category': {'key': 'category', 'type': 'LocalizableString'}, + 'http_request': {'key': 'httpRequest', 'type': 'HttpRequestInfo'}, + 'level': {'key': 'level', 'type': 'EventLevel'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'resource_provider_name': {'key': 'resourceProviderName', 'type': 'LocalizableString'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'LocalizableString'}, + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'operation_name': {'key': 'operationName', 'type': 'LocalizableString'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'status': {'key': 'status', 'type': 'LocalizableString'}, + 'sub_status': {'key': 'subStatus', 'type': 'LocalizableString'}, + 'event_timestamp': {'key': 'eventTimestamp', 'type': 'iso-8601'}, + 'submission_timestamp': {'key': 'submissionTimestamp', 'type': 'iso-8601'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EventData, self).__init__(**kwargs) + self.authorization = None + self.claims = None + self.caller = None + self.description = None + self.id = None + self.event_data_id = None + self.correlation_id = None + self.event_name = None + self.category = None + self.http_request = None + self.level = None + self.resource_group_name = None + self.resource_provider_name = None + self.resource_id = None + self.resource_type = None + self.operation_id = None + self.operation_name = None + self.properties = None + self.status = None + self.sub_status = None + self.event_timestamp = None + self.submission_timestamp = None + self.subscription_id = None + self.tenant_id = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/event_data_paged.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/event_data_paged.py new file mode 100644 index 000000000000..dbe14dfbe747 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/event_data_paged.py @@ -0,0 +1,27 @@ +# 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 EventDataPaged(Paged): + """ + A paging container for iterating over a list of :class:`EventData ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[EventData]'} + } + + def __init__(self, *args, **kwargs): + + super(EventDataPaged, self).__init__(*args, **kwargs) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/event_data_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/event_data_py3.py new file mode 100644 index 000000000000..3a345291877b --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/event_data_py3.py @@ -0,0 +1,181 @@ +# 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 + + +class EventData(Model): + """The Azure event log entries are of type EventData. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar authorization: The sender authorization information. + :vartype authorization: ~azure.mgmt.monitor.models.SenderAuthorization + :ivar claims: key value pairs to identify ARM permissions. + :vartype claims: dict[str, str] + :ivar caller: the email address of the user who has performed the + operation, the UPN claim or SPN claim based on availability. + :vartype caller: str + :ivar description: the description of the event. + :vartype description: str + :ivar id: the Id of this event as required by ARM for RBAC. It contains + the EventDataID and a timestamp information. + :vartype id: str + :ivar event_data_id: the event data Id. This is a unique identifier for an + event. + :vartype event_data_id: str + :ivar correlation_id: the correlation Id, usually a GUID in the string + format. The correlation Id is shared among the events that belong to the + same uber operation. + :vartype correlation_id: str + :ivar event_name: the event name. This value should not be confused with + OperationName. For practical purposes, OperationName might be more + appealing to end users. + :vartype event_name: ~azure.mgmt.monitor.models.LocalizableString + :ivar category: the event category. + :vartype category: ~azure.mgmt.monitor.models.LocalizableString + :ivar http_request: the HTTP request info. Usually includes the + 'clientRequestId', 'clientIpAddress' (IP address of the user who initiated + the event) and 'method' (HTTP method e.g. PUT). + :vartype http_request: ~azure.mgmt.monitor.models.HttpRequestInfo + :ivar level: the event level. Possible values include: 'Critical', + 'Error', 'Warning', 'Informational', 'Verbose' + :vartype level: str or ~azure.mgmt.monitor.models.EventLevel + :ivar resource_group_name: the resource group name of the impacted + resource. + :vartype resource_group_name: str + :ivar resource_provider_name: the resource provider name of the impacted + resource. + :vartype resource_provider_name: + ~azure.mgmt.monitor.models.LocalizableString + :ivar resource_id: the resource uri that uniquely identifies the resource + that caused this event. + :vartype resource_id: str + :ivar resource_type: the resource type + :vartype resource_type: ~azure.mgmt.monitor.models.LocalizableString + :ivar operation_id: It is usually a GUID shared among the events + corresponding to single operation. This value should not be confused with + EventName. + :vartype operation_id: str + :ivar operation_name: the operation name. + :vartype operation_name: ~azure.mgmt.monitor.models.LocalizableString + :ivar properties: the set of pairs (usually a + Dictionary) that includes details about the event. + :vartype properties: dict[str, str] + :ivar status: a string describing the status of the operation. Some + typical values are: Started, In progress, Succeeded, Failed, Resolved. + :vartype status: ~azure.mgmt.monitor.models.LocalizableString + :ivar sub_status: the event sub status. Most of the time, when included, + this captures the HTTP status code of the REST call. Common values are: OK + (HTTP Status Code: 200), Created (HTTP Status Code: 201), Accepted (HTTP + Status Code: 202), No Content (HTTP Status Code: 204), Bad Request(HTTP + Status Code: 400), Not Found (HTTP Status Code: 404), Conflict (HTTP + Status Code: 409), Internal Server Error (HTTP Status Code: 500), Service + Unavailable (HTTP Status Code:503), Gateway Timeout (HTTP Status Code: + 504) + :vartype sub_status: ~azure.mgmt.monitor.models.LocalizableString + :ivar event_timestamp: the timestamp of when the event was generated by + the Azure service processing the request corresponding the event. It in + ISO 8601 format. + :vartype event_timestamp: datetime + :ivar submission_timestamp: the timestamp of when the event became + available for querying via this API. It is in ISO 8601 format. This value + should not be confused eventTimestamp. As there might be a delay between + the occurrence time of the event, and the time that the event is submitted + to the Azure logging infrastructure. + :vartype submission_timestamp: datetime + :ivar subscription_id: the Azure subscription Id usually a GUID. + :vartype subscription_id: str + :ivar tenant_id: the Azure tenant Id + :vartype tenant_id: str + """ + + _validation = { + 'authorization': {'readonly': True}, + 'claims': {'readonly': True}, + 'caller': {'readonly': True}, + 'description': {'readonly': True}, + 'id': {'readonly': True}, + 'event_data_id': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'event_name': {'readonly': True}, + 'category': {'readonly': True}, + 'http_request': {'readonly': True}, + 'level': {'readonly': True}, + 'resource_group_name': {'readonly': True}, + 'resource_provider_name': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'operation_id': {'readonly': True}, + 'operation_name': {'readonly': True}, + 'properties': {'readonly': True}, + 'status': {'readonly': True}, + 'sub_status': {'readonly': True}, + 'event_timestamp': {'readonly': True}, + 'submission_timestamp': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'authorization': {'key': 'authorization', 'type': 'SenderAuthorization'}, + 'claims': {'key': 'claims', 'type': '{str}'}, + 'caller': {'key': 'caller', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'event_data_id': {'key': 'eventDataId', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'event_name': {'key': 'eventName', 'type': 'LocalizableString'}, + 'category': {'key': 'category', 'type': 'LocalizableString'}, + 'http_request': {'key': 'httpRequest', 'type': 'HttpRequestInfo'}, + 'level': {'key': 'level', 'type': 'EventLevel'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'resource_provider_name': {'key': 'resourceProviderName', 'type': 'LocalizableString'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'LocalizableString'}, + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'operation_name': {'key': 'operationName', 'type': 'LocalizableString'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'status': {'key': 'status', 'type': 'LocalizableString'}, + 'sub_status': {'key': 'subStatus', 'type': 'LocalizableString'}, + 'event_timestamp': {'key': 'eventTimestamp', 'type': 'iso-8601'}, + 'submission_timestamp': {'key': 'submissionTimestamp', 'type': 'iso-8601'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(EventData, self).__init__(**kwargs) + self.authorization = None + self.claims = None + self.caller = None + self.description = None + self.id = None + self.event_data_id = None + self.correlation_id = None + self.event_name = None + self.category = None + self.http_request = None + self.level = None + self.resource_group_name = None + self.resource_provider_name = None + self.resource_id = None + self.resource_type = None + self.operation_id = None + self.operation_name = None + self.properties = None + self.status = None + self.sub_status = None + self.event_timestamp = None + self.submission_timestamp = None + self.subscription_id = None + self.tenant_id = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/http_request_info.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/http_request_info.py new file mode 100644 index 000000000000..45e910390503 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/http_request_info.py @@ -0,0 +1,40 @@ +# 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 + + +class HttpRequestInfo(Model): + """The Http request info. + + :param client_request_id: the client request id. + :type client_request_id: str + :param client_ip_address: the client Ip Address + :type client_ip_address: str + :param method: the Http request method. + :type method: str + :param uri: the Uri. + :type uri: str + """ + + _attribute_map = { + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'client_ip_address': {'key': 'clientIpAddress', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(HttpRequestInfo, self).__init__(**kwargs) + self.client_request_id = kwargs.get('client_request_id', None) + self.client_ip_address = kwargs.get('client_ip_address', None) + self.method = kwargs.get('method', None) + self.uri = kwargs.get('uri', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/http_request_info_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/http_request_info_py3.py new file mode 100644 index 000000000000..5e0e15d35a83 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/http_request_info_py3.py @@ -0,0 +1,40 @@ +# 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 + + +class HttpRequestInfo(Model): + """The Http request info. + + :param client_request_id: the client request id. + :type client_request_id: str + :param client_ip_address: the client Ip Address + :type client_ip_address: str + :param method: the Http request method. + :type method: str + :param uri: the Uri. + :type uri: str + """ + + _attribute_map = { + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'client_ip_address': {'key': 'clientIpAddress', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + } + + def __init__(self, *, client_request_id: str=None, client_ip_address: str=None, method: str=None, uri: str=None, **kwargs) -> None: + super(HttpRequestInfo, self).__init__(**kwargs) + self.client_request_id = client_request_id + self.client_ip_address = client_ip_address + self.method = method + self.uri = uri diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/incident.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/incident.py new file mode 100644 index 000000000000..806624781a55 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/incident.py @@ -0,0 +1,58 @@ +# 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 + + +class Incident(Model): + """An alert incident indicates the activation status of an alert rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Incident name. + :vartype name: str + :ivar rule_name: Rule name that is associated with the incident. + :vartype rule_name: str + :ivar is_active: A boolean to indicate whether the incident is active or + resolved. + :vartype is_active: bool + :ivar activated_time: The time at which the incident was activated in + ISO8601 format. + :vartype activated_time: datetime + :ivar resolved_time: The time at which the incident was resolved in + ISO8601 format. If null, it means the incident is still active. + :vartype resolved_time: datetime + """ + + _validation = { + 'name': {'readonly': True}, + 'rule_name': {'readonly': True}, + 'is_active': {'readonly': True}, + 'activated_time': {'readonly': True}, + 'resolved_time': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'rule_name': {'key': 'ruleName', 'type': 'str'}, + 'is_active': {'key': 'isActive', 'type': 'bool'}, + 'activated_time': {'key': 'activatedTime', 'type': 'iso-8601'}, + 'resolved_time': {'key': 'resolvedTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(Incident, self).__init__(**kwargs) + self.name = None + self.rule_name = None + self.is_active = None + self.activated_time = None + self.resolved_time = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/incident_paged.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/incident_paged.py new file mode 100644 index 000000000000..df984869269a --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/incident_paged.py @@ -0,0 +1,27 @@ +# 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 IncidentPaged(Paged): + """ + A paging container for iterating over a list of :class:`Incident ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Incident]'} + } + + def __init__(self, *args, **kwargs): + + super(IncidentPaged, self).__init__(*args, **kwargs) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/incident_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/incident_py3.py new file mode 100644 index 000000000000..ea8b18ee8554 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/incident_py3.py @@ -0,0 +1,58 @@ +# 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 + + +class Incident(Model): + """An alert incident indicates the activation status of an alert rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Incident name. + :vartype name: str + :ivar rule_name: Rule name that is associated with the incident. + :vartype rule_name: str + :ivar is_active: A boolean to indicate whether the incident is active or + resolved. + :vartype is_active: bool + :ivar activated_time: The time at which the incident was activated in + ISO8601 format. + :vartype activated_time: datetime + :ivar resolved_time: The time at which the incident was resolved in + ISO8601 format. If null, it means the incident is still active. + :vartype resolved_time: datetime + """ + + _validation = { + 'name': {'readonly': True}, + 'rule_name': {'readonly': True}, + 'is_active': {'readonly': True}, + 'activated_time': {'readonly': True}, + 'resolved_time': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'rule_name': {'key': 'ruleName', 'type': 'str'}, + 'is_active': {'key': 'isActive', 'type': 'bool'}, + 'activated_time': {'key': 'activatedTime', 'type': 'iso-8601'}, + 'resolved_time': {'key': 'resolvedTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(Incident, self).__init__(**kwargs) + self.name = None + self.rule_name = None + self.is_active = None + self.activated_time = None + self.resolved_time = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/itsm_receiver.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/itsm_receiver.py new file mode 100644 index 000000000000..054037009c07 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/itsm_receiver.py @@ -0,0 +1,59 @@ +# 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 + + +class ItsmReceiver(Model): + """An Itsm receiver. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the Itsm receiver. Names must be unique + across all receivers within an action group. + :type name: str + :param workspace_id: Required. OMS LA instance identifier. + :type workspace_id: str + :param connection_id: Required. Unique identification of ITSM connection + among multiple defined in above workspace. + :type connection_id: str + :param ticket_configuration: Required. JSON blob for the configurations of + the ITSM action. CreateMultipleWorkItems option will be part of this blob + as well. + :type ticket_configuration: str + :param region: Required. Region in which workspace resides. Supported + values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope' + :type region: str + """ + + _validation = { + 'name': {'required': True}, + 'workspace_id': {'required': True}, + 'connection_id': {'required': True}, + 'ticket_configuration': {'required': True}, + 'region': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + 'connection_id': {'key': 'connectionId', 'type': 'str'}, + 'ticket_configuration': {'key': 'ticketConfiguration', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ItsmReceiver, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.workspace_id = kwargs.get('workspace_id', None) + self.connection_id = kwargs.get('connection_id', None) + self.ticket_configuration = kwargs.get('ticket_configuration', None) + self.region = kwargs.get('region', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/itsm_receiver_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/itsm_receiver_py3.py new file mode 100644 index 000000000000..581cb90911b5 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/itsm_receiver_py3.py @@ -0,0 +1,59 @@ +# 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 + + +class ItsmReceiver(Model): + """An Itsm receiver. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the Itsm receiver. Names must be unique + across all receivers within an action group. + :type name: str + :param workspace_id: Required. OMS LA instance identifier. + :type workspace_id: str + :param connection_id: Required. Unique identification of ITSM connection + among multiple defined in above workspace. + :type connection_id: str + :param ticket_configuration: Required. JSON blob for the configurations of + the ITSM action. CreateMultipleWorkItems option will be part of this blob + as well. + :type ticket_configuration: str + :param region: Required. Region in which workspace resides. Supported + values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope' + :type region: str + """ + + _validation = { + 'name': {'required': True}, + 'workspace_id': {'required': True}, + 'connection_id': {'required': True}, + 'ticket_configuration': {'required': True}, + 'region': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + 'connection_id': {'key': 'connectionId', 'type': 'str'}, + 'ticket_configuration': {'key': 'ticketConfiguration', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + } + + def __init__(self, *, name: str, workspace_id: str, connection_id: str, ticket_configuration: str, region: str, **kwargs) -> None: + super(ItsmReceiver, self).__init__(**kwargs) + self.name = name + self.workspace_id = workspace_id + self.connection_id = connection_id + self.ticket_configuration = ticket_configuration + self.region = region diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/localizable_string.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/localizable_string.py new file mode 100644 index 000000000000..05db04fb721f --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/localizable_string.py @@ -0,0 +1,38 @@ +# 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 + + +class LocalizableString(Model): + """The localizable string class. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. the invariant value. + :type value: str + :param localized_value: the locale specific value. + :type localized_value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LocalizableString, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/localizable_string_paged.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/localizable_string_paged.py new file mode 100644 index 000000000000..bde773362a14 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/localizable_string_paged.py @@ -0,0 +1,27 @@ +# 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 LocalizableStringPaged(Paged): + """ + A paging container for iterating over a list of :class:`LocalizableString ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[LocalizableString]'} + } + + def __init__(self, *args, **kwargs): + + super(LocalizableStringPaged, self).__init__(*args, **kwargs) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/localizable_string_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/localizable_string_py3.py new file mode 100644 index 000000000000..8bae3303a19f --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/localizable_string_py3.py @@ -0,0 +1,38 @@ +# 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 + + +class LocalizableString(Model): + """The localizable string class. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. the invariant value. + :type value: str + :param localized_value: the locale specific value. + :type localized_value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str, localized_value: str=None, **kwargs) -> None: + super(LocalizableString, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/location_threshold_rule_condition.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/location_threshold_rule_condition.py new file mode 100644 index 000000000000..50a9b346dbd6 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/location_threshold_rule_condition.py @@ -0,0 +1,50 @@ +# 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 .rule_condition import RuleCondition + + +class LocationThresholdRuleCondition(RuleCondition): + """A rule condition based on a certain number of locations failing. + + All required parameters must be populated in order to send to Azure. + + :param data_source: the resource from which the rule collects its data. + For this type dataSource will always be of type RuleMetricDataSource. + :type data_source: ~azure.mgmt.monitor.models.RuleDataSource + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param window_size: the period of time (in ISO 8601 duration format) that + is used to monitor alert activity based on the threshold. If specified + then it must be between 5 minutes and 1 day. + :type window_size: timedelta + :param failed_location_count: Required. the number of locations that must + fail to activate the alert. + :type failed_location_count: int + """ + + _validation = { + 'odatatype': {'required': True}, + 'failed_location_count': {'required': True, 'minimum': 0}, + } + + _attribute_map = { + 'data_source': {'key': 'dataSource', 'type': 'RuleDataSource'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'window_size': {'key': 'windowSize', 'type': 'duration'}, + 'failed_location_count': {'key': 'failedLocationCount', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(LocationThresholdRuleCondition, self).__init__(**kwargs) + self.window_size = kwargs.get('window_size', None) + self.failed_location_count = kwargs.get('failed_location_count', None) + self.odatatype = 'Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/location_threshold_rule_condition_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/location_threshold_rule_condition_py3.py new file mode 100644 index 000000000000..e0d0eff9a386 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/location_threshold_rule_condition_py3.py @@ -0,0 +1,50 @@ +# 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 .rule_condition_py3 import RuleCondition + + +class LocationThresholdRuleCondition(RuleCondition): + """A rule condition based on a certain number of locations failing. + + All required parameters must be populated in order to send to Azure. + + :param data_source: the resource from which the rule collects its data. + For this type dataSource will always be of type RuleMetricDataSource. + :type data_source: ~azure.mgmt.monitor.models.RuleDataSource + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param window_size: the period of time (in ISO 8601 duration format) that + is used to monitor alert activity based on the threshold. If specified + then it must be between 5 minutes and 1 day. + :type window_size: timedelta + :param failed_location_count: Required. the number of locations that must + fail to activate the alert. + :type failed_location_count: int + """ + + _validation = { + 'odatatype': {'required': True}, + 'failed_location_count': {'required': True, 'minimum': 0}, + } + + _attribute_map = { + 'data_source': {'key': 'dataSource', 'type': 'RuleDataSource'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'window_size': {'key': 'windowSize', 'type': 'duration'}, + 'failed_location_count': {'key': 'failedLocationCount', 'type': 'int'}, + } + + def __init__(self, *, failed_location_count: int, data_source=None, window_size=None, **kwargs) -> None: + super(LocationThresholdRuleCondition, self).__init__(data_source=data_source, **kwargs) + self.window_size = window_size + self.failed_location_count = failed_location_count + self.odatatype = 'Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_metric_trigger.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_metric_trigger.py new file mode 100644 index 000000000000..519d58917a67 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_metric_trigger.py @@ -0,0 +1,45 @@ +# 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 + + +class LogMetricTrigger(Model): + """A log metrics trigger descriptor. + + :param threshold_operator: Evaluation operation for Metric -'GreaterThan' + or 'LessThan' or 'Equal'. Possible values include: 'GreaterThan', + 'LessThan', 'Equal' + :type threshold_operator: str or + ~azure.mgmt.monitor.models.ConditionalOperator + :param threshold: The threshold of the metric trigger. + :type threshold: float + :param metric_trigger_type: Metric Trigger Type - 'Consecutive' or + 'Total'. Possible values include: 'Consecutive', 'Total' + :type metric_trigger_type: str or + ~azure.mgmt.monitor.models.MetricTriggerType + :param metric_column: Evaluation of metric on a particular column + :type metric_column: str + """ + + _attribute_map = { + 'threshold_operator': {'key': 'thresholdOperator', 'type': 'str'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + 'metric_trigger_type': {'key': 'metricTriggerType', 'type': 'str'}, + 'metric_column': {'key': 'metricColumn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LogMetricTrigger, self).__init__(**kwargs) + self.threshold_operator = kwargs.get('threshold_operator', None) + self.threshold = kwargs.get('threshold', None) + self.metric_trigger_type = kwargs.get('metric_trigger_type', None) + self.metric_column = kwargs.get('metric_column', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_metric_trigger_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_metric_trigger_py3.py new file mode 100644 index 000000000000..08ae46234456 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_metric_trigger_py3.py @@ -0,0 +1,45 @@ +# 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 + + +class LogMetricTrigger(Model): + """A log metrics trigger descriptor. + + :param threshold_operator: Evaluation operation for Metric -'GreaterThan' + or 'LessThan' or 'Equal'. Possible values include: 'GreaterThan', + 'LessThan', 'Equal' + :type threshold_operator: str or + ~azure.mgmt.monitor.models.ConditionalOperator + :param threshold: The threshold of the metric trigger. + :type threshold: float + :param metric_trigger_type: Metric Trigger Type - 'Consecutive' or + 'Total'. Possible values include: 'Consecutive', 'Total' + :type metric_trigger_type: str or + ~azure.mgmt.monitor.models.MetricTriggerType + :param metric_column: Evaluation of metric on a particular column + :type metric_column: str + """ + + _attribute_map = { + 'threshold_operator': {'key': 'thresholdOperator', 'type': 'str'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + 'metric_trigger_type': {'key': 'metricTriggerType', 'type': 'str'}, + 'metric_column': {'key': 'metricColumn', 'type': 'str'}, + } + + def __init__(self, *, threshold_operator=None, threshold: float=None, metric_trigger_type=None, metric_column: str=None, **kwargs) -> None: + super(LogMetricTrigger, self).__init__(**kwargs) + self.threshold_operator = threshold_operator + self.threshold = threshold + self.metric_trigger_type = metric_trigger_type + self.metric_column = metric_column diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource.py new file mode 100644 index 000000000000..42e068ce12b8 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource.py @@ -0,0 +1,83 @@ +# 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 .resource import Resource + + +class LogProfileResource(Resource): + """The log profile resource. + + 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] + :param storage_account_id: the resource id of the storage account to which + you would like to send the Activity Log. + :type storage_account_id: str + :param service_bus_rule_id: The service bus rule ID of the service bus + namespace in which you would like to have Event Hubs created for streaming + the Activity Log. The rule ID is of the format: '{service bus resource + ID}/authorizationrules/{key name}'. + :type service_bus_rule_id: str + :param locations: Required. List of regions for which Activity Log events + should be stored or streamed. It is a comma separated list of valid ARM + locations including the 'global' location. + :type locations: list[str] + :param categories: Required. the categories of the logs. These categories + are created as is convenient to the user. Some values are: 'Write', + 'Delete', and/or 'Action.' + :type categories: list[str] + :param retention_policy: Required. the retention policy for the events in + the log. + :type retention_policy: ~azure.mgmt.monitor.models.RetentionPolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'locations': {'required': True}, + 'categories': {'required': True}, + 'retention_policy': {'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}'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + 'service_bus_rule_id': {'key': 'properties.serviceBusRuleId', 'type': 'str'}, + 'locations': {'key': 'properties.locations', 'type': '[str]'}, + 'categories': {'key': 'properties.categories', 'type': '[str]'}, + 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicy'}, + } + + def __init__(self, **kwargs): + super(LogProfileResource, self).__init__(**kwargs) + self.storage_account_id = kwargs.get('storage_account_id', None) + self.service_bus_rule_id = kwargs.get('service_bus_rule_id', None) + self.locations = kwargs.get('locations', None) + self.categories = kwargs.get('categories', None) + self.retention_policy = kwargs.get('retention_policy', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource_paged.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource_paged.py new file mode 100644 index 000000000000..e0002b74c127 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource_paged.py @@ -0,0 +1,27 @@ +# 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 LogProfileResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`LogProfileResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[LogProfileResource]'} + } + + def __init__(self, *args, **kwargs): + + super(LogProfileResourcePaged, self).__init__(*args, **kwargs) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource_patch.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource_patch.py new file mode 100644 index 000000000000..c6ae3dc17e4b --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource_patch.py @@ -0,0 +1,65 @@ +# 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 + + +class LogProfileResourcePatch(Model): + """The log profile resource for patch operations. + + All required parameters must be populated in order to send to Azure. + + :param tags: Resource tags + :type tags: dict[str, str] + :param storage_account_id: the resource id of the storage account to which + you would like to send the Activity Log. + :type storage_account_id: str + :param service_bus_rule_id: The service bus rule ID of the service bus + namespace in which you would like to have Event Hubs created for streaming + the Activity Log. The rule ID is of the format: '{service bus resource + ID}/authorizationrules/{key name}'. + :type service_bus_rule_id: str + :param locations: Required. List of regions for which Activity Log events + should be stored or streamed. It is a comma separated list of valid ARM + locations including the 'global' location. + :type locations: list[str] + :param categories: Required. the categories of the logs. These categories + are created as is convenient to the user. Some values are: 'Write', + 'Delete', and/or 'Action.' + :type categories: list[str] + :param retention_policy: Required. the retention policy for the events in + the log. + :type retention_policy: ~azure.mgmt.monitor.models.RetentionPolicy + """ + + _validation = { + 'locations': {'required': True}, + 'categories': {'required': True}, + 'retention_policy': {'required': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + 'service_bus_rule_id': {'key': 'properties.serviceBusRuleId', 'type': 'str'}, + 'locations': {'key': 'properties.locations', 'type': '[str]'}, + 'categories': {'key': 'properties.categories', 'type': '[str]'}, + 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicy'}, + } + + def __init__(self, **kwargs): + super(LogProfileResourcePatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.storage_account_id = kwargs.get('storage_account_id', None) + self.service_bus_rule_id = kwargs.get('service_bus_rule_id', None) + self.locations = kwargs.get('locations', None) + self.categories = kwargs.get('categories', None) + self.retention_policy = kwargs.get('retention_policy', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource_patch_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource_patch_py3.py new file mode 100644 index 000000000000..783dc9fb262c --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource_patch_py3.py @@ -0,0 +1,65 @@ +# 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 + + +class LogProfileResourcePatch(Model): + """The log profile resource for patch operations. + + All required parameters must be populated in order to send to Azure. + + :param tags: Resource tags + :type tags: dict[str, str] + :param storage_account_id: the resource id of the storage account to which + you would like to send the Activity Log. + :type storage_account_id: str + :param service_bus_rule_id: The service bus rule ID of the service bus + namespace in which you would like to have Event Hubs created for streaming + the Activity Log. The rule ID is of the format: '{service bus resource + ID}/authorizationrules/{key name}'. + :type service_bus_rule_id: str + :param locations: Required. List of regions for which Activity Log events + should be stored or streamed. It is a comma separated list of valid ARM + locations including the 'global' location. + :type locations: list[str] + :param categories: Required. the categories of the logs. These categories + are created as is convenient to the user. Some values are: 'Write', + 'Delete', and/or 'Action.' + :type categories: list[str] + :param retention_policy: Required. the retention policy for the events in + the log. + :type retention_policy: ~azure.mgmt.monitor.models.RetentionPolicy + """ + + _validation = { + 'locations': {'required': True}, + 'categories': {'required': True}, + 'retention_policy': {'required': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + 'service_bus_rule_id': {'key': 'properties.serviceBusRuleId', 'type': 'str'}, + 'locations': {'key': 'properties.locations', 'type': '[str]'}, + 'categories': {'key': 'properties.categories', 'type': '[str]'}, + 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicy'}, + } + + def __init__(self, *, locations, categories, retention_policy, tags=None, storage_account_id: str=None, service_bus_rule_id: str=None, **kwargs) -> None: + super(LogProfileResourcePatch, self).__init__(**kwargs) + self.tags = tags + self.storage_account_id = storage_account_id + self.service_bus_rule_id = service_bus_rule_id + self.locations = locations + self.categories = categories + self.retention_policy = retention_policy diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource_py3.py new file mode 100644 index 000000000000..28d3892f442d --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource_py3.py @@ -0,0 +1,83 @@ +# 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 .resource_py3 import Resource + + +class LogProfileResource(Resource): + """The log profile resource. + + 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] + :param storage_account_id: the resource id of the storage account to which + you would like to send the Activity Log. + :type storage_account_id: str + :param service_bus_rule_id: The service bus rule ID of the service bus + namespace in which you would like to have Event Hubs created for streaming + the Activity Log. The rule ID is of the format: '{service bus resource + ID}/authorizationrules/{key name}'. + :type service_bus_rule_id: str + :param locations: Required. List of regions for which Activity Log events + should be stored or streamed. It is a comma separated list of valid ARM + locations including the 'global' location. + :type locations: list[str] + :param categories: Required. the categories of the logs. These categories + are created as is convenient to the user. Some values are: 'Write', + 'Delete', and/or 'Action.' + :type categories: list[str] + :param retention_policy: Required. the retention policy for the events in + the log. + :type retention_policy: ~azure.mgmt.monitor.models.RetentionPolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'locations': {'required': True}, + 'categories': {'required': True}, + 'retention_policy': {'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}'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + 'service_bus_rule_id': {'key': 'properties.serviceBusRuleId', 'type': 'str'}, + 'locations': {'key': 'properties.locations', 'type': '[str]'}, + 'categories': {'key': 'properties.categories', 'type': '[str]'}, + 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicy'}, + } + + def __init__(self, *, location: str, locations, categories, retention_policy, tags=None, storage_account_id: str=None, service_bus_rule_id: str=None, **kwargs) -> None: + super(LogProfileResource, self).__init__(location=location, tags=tags, **kwargs) + self.storage_account_id = storage_account_id + self.service_bus_rule_id = service_bus_rule_id + self.locations = locations + self.categories = categories + self.retention_policy = retention_policy diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_search_rule_resource.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_search_rule_resource.py new file mode 100644 index 000000000000..4bf59a5c8ca8 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_search_rule_resource.py @@ -0,0 +1,88 @@ +# 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 .resource import Resource + + +class LogSearchRuleResource(Resource): + """The Log Search Rule resource. + + 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] + :param description: The description of the Log Search rule. + :type description: str + :param enabled: The flag which indicates whether the Log Search rule is + enabled. Value should be true or false. Possible values include: 'true', + 'false' + :type enabled: str or ~azure.mgmt.monitor.models.Enabled + :ivar last_updated_time: Last time the rule was updated in IS08601 format. + :vartype last_updated_time: datetime + :ivar provisioning_state: Provisioning state of the scheduled query rule. + Possible values include: 'Succeeded', 'Deploying', 'Canceled', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.monitor.models.ProvisioningState + :param source: Required. Data Source against which rule will Query Data + :type source: ~azure.mgmt.monitor.models.Source + :param schedule: Schedule (Frequency, Time Window) for rule. Required for + action type - AlertingAction + :type schedule: ~azure.mgmt.monitor.models.Schedule + :param action: Required. Action needs to be taken on rule execution. + :type action: ~azure.mgmt.monitor.models.Action + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'last_updated_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'source': {'required': True}, + 'action': {'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}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'str'}, + 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'Source'}, + 'schedule': {'key': 'properties.schedule', 'type': 'Schedule'}, + 'action': {'key': 'properties.action', 'type': 'Action'}, + } + + def __init__(self, **kwargs): + super(LogSearchRuleResource, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.enabled = kwargs.get('enabled', None) + self.last_updated_time = None + self.provisioning_state = None + self.source = kwargs.get('source', None) + self.schedule = kwargs.get('schedule', None) + self.action = kwargs.get('action', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_search_rule_resource_paged.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_search_rule_resource_paged.py new file mode 100644 index 000000000000..fbec51381f06 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_search_rule_resource_paged.py @@ -0,0 +1,27 @@ +# 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 LogSearchRuleResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`LogSearchRuleResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[LogSearchRuleResource]'} + } + + def __init__(self, *args, **kwargs): + + super(LogSearchRuleResourcePaged, self).__init__(*args, **kwargs) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_search_rule_resource_patch.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_search_rule_resource_patch.py new file mode 100644 index 000000000000..350f17ce36ac --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_search_rule_resource_patch.py @@ -0,0 +1,34 @@ +# 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 + + +class LogSearchRuleResourcePatch(Model): + """The log search rule resource for patch operations. + + :param tags: Resource tags + :type tags: dict[str, str] + :param enabled: The flag which indicates whether the Log Search rule is + enabled. Value should be true or false. Possible values include: 'true', + 'false' + :type enabled: str or ~azure.mgmt.monitor.models.Enabled + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'enabled': {'key': 'properties.enabled', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LogSearchRuleResourcePatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.enabled = kwargs.get('enabled', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_search_rule_resource_patch_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_search_rule_resource_patch_py3.py new file mode 100644 index 000000000000..010407469673 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_search_rule_resource_patch_py3.py @@ -0,0 +1,34 @@ +# 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 + + +class LogSearchRuleResourcePatch(Model): + """The log search rule resource for patch operations. + + :param tags: Resource tags + :type tags: dict[str, str] + :param enabled: The flag which indicates whether the Log Search rule is + enabled. Value should be true or false. Possible values include: 'true', + 'false' + :type enabled: str or ~azure.mgmt.monitor.models.Enabled + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'enabled': {'key': 'properties.enabled', 'type': 'str'}, + } + + def __init__(self, *, tags=None, enabled=None, **kwargs) -> None: + super(LogSearchRuleResourcePatch, self).__init__(**kwargs) + self.tags = tags + self.enabled = enabled diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_search_rule_resource_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_search_rule_resource_py3.py new file mode 100644 index 000000000000..b6e1d161c351 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_search_rule_resource_py3.py @@ -0,0 +1,88 @@ +# 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 .resource_py3 import Resource + + +class LogSearchRuleResource(Resource): + """The Log Search Rule resource. + + 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] + :param description: The description of the Log Search rule. + :type description: str + :param enabled: The flag which indicates whether the Log Search rule is + enabled. Value should be true or false. Possible values include: 'true', + 'false' + :type enabled: str or ~azure.mgmt.monitor.models.Enabled + :ivar last_updated_time: Last time the rule was updated in IS08601 format. + :vartype last_updated_time: datetime + :ivar provisioning_state: Provisioning state of the scheduled query rule. + Possible values include: 'Succeeded', 'Deploying', 'Canceled', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.monitor.models.ProvisioningState + :param source: Required. Data Source against which rule will Query Data + :type source: ~azure.mgmt.monitor.models.Source + :param schedule: Schedule (Frequency, Time Window) for rule. Required for + action type - AlertingAction + :type schedule: ~azure.mgmt.monitor.models.Schedule + :param action: Required. Action needs to be taken on rule execution. + :type action: ~azure.mgmt.monitor.models.Action + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'last_updated_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'source': {'required': True}, + 'action': {'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}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'str'}, + 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'Source'}, + 'schedule': {'key': 'properties.schedule', 'type': 'Schedule'}, + 'action': {'key': 'properties.action', 'type': 'Action'}, + } + + def __init__(self, *, location: str, source, action, tags=None, description: str=None, enabled=None, schedule=None, **kwargs) -> None: + super(LogSearchRuleResource, self).__init__(location=location, tags=tags, **kwargs) + self.description = description + self.enabled = enabled + self.last_updated_time = None + self.provisioning_state = None + self.source = source + self.schedule = schedule + self.action = action diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_settings.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_settings.py new file mode 100644 index 000000000000..fa6e2a4103da --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_settings.py @@ -0,0 +1,46 @@ +# 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 + + +class LogSettings(Model): + """Part of MultiTenantDiagnosticSettings. Specifies the settings for a + particular log. + + All required parameters must be populated in order to send to Azure. + + :param category: Name of a Diagnostic Log category for a resource type + this setting is applied to. To obtain the list of Diagnostic Log + categories for a resource, first perform a GET diagnostic settings + operation. + :type category: str + :param enabled: Required. a value indicating whether this log is enabled. + :type enabled: bool + :param retention_policy: the retention policy for this log. + :type retention_policy: ~azure.mgmt.monitor.models.RetentionPolicy + """ + + _validation = { + 'enabled': {'required': True}, + } + + _attribute_map = { + 'category': {'key': 'category', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, + } + + def __init__(self, **kwargs): + super(LogSettings, self).__init__(**kwargs) + self.category = kwargs.get('category', None) + self.enabled = kwargs.get('enabled', None) + self.retention_policy = kwargs.get('retention_policy', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_settings_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_settings_py3.py new file mode 100644 index 000000000000..a1b7ac84dee6 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_settings_py3.py @@ -0,0 +1,46 @@ +# 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 + + +class LogSettings(Model): + """Part of MultiTenantDiagnosticSettings. Specifies the settings for a + particular log. + + All required parameters must be populated in order to send to Azure. + + :param category: Name of a Diagnostic Log category for a resource type + this setting is applied to. To obtain the list of Diagnostic Log + categories for a resource, first perform a GET diagnostic settings + operation. + :type category: str + :param enabled: Required. a value indicating whether this log is enabled. + :type enabled: bool + :param retention_policy: the retention policy for this log. + :type retention_policy: ~azure.mgmt.monitor.models.RetentionPolicy + """ + + _validation = { + 'enabled': {'required': True}, + } + + _attribute_map = { + 'category': {'key': 'category', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, + } + + def __init__(self, *, enabled: bool, category: str=None, retention_policy=None, **kwargs) -> None: + super(LogSettings, self).__init__(**kwargs) + self.category = category + self.enabled = enabled + self.retention_policy = retention_policy diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_to_metric_action.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_to_metric_action.py new file mode 100644 index 000000000000..340f791d7963 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_to_metric_action.py @@ -0,0 +1,39 @@ +# 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 .action import Action + + +class LogToMetricAction(Action): + """Specify action need to be taken when rule type is converting log to metric. + + All required parameters must be populated in order to send to Azure. + + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param criteria: Required. Criteria of Metric + :type criteria: list[~azure.mgmt.monitor.models.Criteria] + """ + + _validation = { + 'odatatype': {'required': True}, + 'criteria': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'criteria': {'key': 'criteria', 'type': '[Criteria]'}, + } + + def __init__(self, **kwargs): + super(LogToMetricAction, self).__init__(**kwargs) + self.criteria = kwargs.get('criteria', None) + self.odatatype = 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_to_metric_action_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_to_metric_action_py3.py new file mode 100644 index 000000000000..80070b506458 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/log_to_metric_action_py3.py @@ -0,0 +1,39 @@ +# 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 .action_py3 import Action + + +class LogToMetricAction(Action): + """Specify action need to be taken when rule type is converting log to metric. + + All required parameters must be populated in order to send to Azure. + + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param criteria: Required. Criteria of Metric + :type criteria: list[~azure.mgmt.monitor.models.Criteria] + """ + + _validation = { + 'odatatype': {'required': True}, + 'criteria': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'criteria': {'key': 'criteria', 'type': '[Criteria]'}, + } + + def __init__(self, *, criteria, **kwargs) -> None: + super(LogToMetricAction, self).__init__(**kwargs) + self.criteria = criteria + self.odatatype = 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/logic_app_receiver.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/logic_app_receiver.py new file mode 100644 index 000000000000..56863d601e49 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/logic_app_receiver.py @@ -0,0 +1,53 @@ +# 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 + + +class LogicAppReceiver(Model): + """A logic app receiver. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the logic app receiver. Names must be + unique across all receivers within an action group. + :type name: str + :param resource_id: Required. The azure resource id of the logic app + receiver. + :type resource_id: str + :param callback_url: Required. The callback url where http request sent + to. + :type callback_url: str + :param use_common_alert_schema: Required. Indicates whether to use common + alert schema. + :type use_common_alert_schema: bool + """ + + _validation = { + 'name': {'required': True}, + 'resource_id': {'required': True}, + 'callback_url': {'required': True}, + 'use_common_alert_schema': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'callback_url': {'key': 'callbackUrl', 'type': 'str'}, + 'use_common_alert_schema': {'key': 'useCommonAlertSchema', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(LogicAppReceiver, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.resource_id = kwargs.get('resource_id', None) + self.callback_url = kwargs.get('callback_url', None) + self.use_common_alert_schema = kwargs.get('use_common_alert_schema', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/logic_app_receiver_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/logic_app_receiver_py3.py new file mode 100644 index 000000000000..6a46bbdaf721 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/logic_app_receiver_py3.py @@ -0,0 +1,53 @@ +# 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 + + +class LogicAppReceiver(Model): + """A logic app receiver. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the logic app receiver. Names must be + unique across all receivers within an action group. + :type name: str + :param resource_id: Required. The azure resource id of the logic app + receiver. + :type resource_id: str + :param callback_url: Required. The callback url where http request sent + to. + :type callback_url: str + :param use_common_alert_schema: Required. Indicates whether to use common + alert schema. + :type use_common_alert_schema: bool + """ + + _validation = { + 'name': {'required': True}, + 'resource_id': {'required': True}, + 'callback_url': {'required': True}, + 'use_common_alert_schema': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'callback_url': {'key': 'callbackUrl', 'type': 'str'}, + 'use_common_alert_schema': {'key': 'useCommonAlertSchema', 'type': 'bool'}, + } + + def __init__(self, *, name: str, resource_id: str, callback_url: str, use_common_alert_schema: bool, **kwargs) -> None: + super(LogicAppReceiver, self).__init__(**kwargs) + self.name = name + self.resource_id = resource_id + self.callback_url = callback_url + self.use_common_alert_schema = use_common_alert_schema diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/management_event_aggregation_condition.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/management_event_aggregation_condition.py new file mode 100644 index 000000000000..1bbdf560448d --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/management_event_aggregation_condition.py @@ -0,0 +1,39 @@ +# 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 + + +class ManagementEventAggregationCondition(Model): + """How the data that is collected should be combined over time. + + :param operator: the condition operator. Possible values include: + 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' + :type operator: str or ~azure.mgmt.monitor.models.ConditionOperator + :param threshold: The threshold value that activates the alert. + :type threshold: float + :param window_size: the period of time (in ISO 8601 duration format) that + is used to monitor alert activity based on the threshold. If specified + then it must be between 5 minutes and 1 day. + :type window_size: timedelta + """ + + _attribute_map = { + 'operator': {'key': 'operator', 'type': 'ConditionOperator'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + 'window_size': {'key': 'windowSize', 'type': 'duration'}, + } + + def __init__(self, **kwargs): + super(ManagementEventAggregationCondition, self).__init__(**kwargs) + self.operator = kwargs.get('operator', None) + self.threshold = kwargs.get('threshold', None) + self.window_size = kwargs.get('window_size', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/management_event_aggregation_condition_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/management_event_aggregation_condition_py3.py new file mode 100644 index 000000000000..4591b5292d5e --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/management_event_aggregation_condition_py3.py @@ -0,0 +1,39 @@ +# 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 + + +class ManagementEventAggregationCondition(Model): + """How the data that is collected should be combined over time. + + :param operator: the condition operator. Possible values include: + 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' + :type operator: str or ~azure.mgmt.monitor.models.ConditionOperator + :param threshold: The threshold value that activates the alert. + :type threshold: float + :param window_size: the period of time (in ISO 8601 duration format) that + is used to monitor alert activity based on the threshold. If specified + then it must be between 5 minutes and 1 day. + :type window_size: timedelta + """ + + _attribute_map = { + 'operator': {'key': 'operator', 'type': 'ConditionOperator'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + 'window_size': {'key': 'windowSize', 'type': 'duration'}, + } + + def __init__(self, *, operator=None, threshold: float=None, window_size=None, **kwargs) -> None: + super(ManagementEventAggregationCondition, self).__init__(**kwargs) + self.operator = operator + self.threshold = threshold + self.window_size = window_size diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/management_event_rule_condition.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/management_event_rule_condition.py new file mode 100644 index 000000000000..5aead2a65738 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/management_event_rule_condition.py @@ -0,0 +1,46 @@ +# 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 .rule_condition import RuleCondition + + +class ManagementEventRuleCondition(RuleCondition): + """A management event rule condition. + + All required parameters must be populated in order to send to Azure. + + :param data_source: the resource from which the rule collects its data. + For this type dataSource will always be of type RuleMetricDataSource. + :type data_source: ~azure.mgmt.monitor.models.RuleDataSource + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param aggregation: How the data that is collected should be combined over + time and when the alert is activated. Note that for management event + alerts aggregation is optional – if it is not provided then any event will + cause the alert to activate. + :type aggregation: + ~azure.mgmt.monitor.models.ManagementEventAggregationCondition + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'data_source': {'key': 'dataSource', 'type': 'RuleDataSource'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'aggregation': {'key': 'aggregation', 'type': 'ManagementEventAggregationCondition'}, + } + + def __init__(self, **kwargs): + super(ManagementEventRuleCondition, self).__init__(**kwargs) + self.aggregation = kwargs.get('aggregation', None) + self.odatatype = 'Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/management_event_rule_condition_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/management_event_rule_condition_py3.py new file mode 100644 index 000000000000..6fb5cdb009f7 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/management_event_rule_condition_py3.py @@ -0,0 +1,46 @@ +# 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 .rule_condition_py3 import RuleCondition + + +class ManagementEventRuleCondition(RuleCondition): + """A management event rule condition. + + All required parameters must be populated in order to send to Azure. + + :param data_source: the resource from which the rule collects its data. + For this type dataSource will always be of type RuleMetricDataSource. + :type data_source: ~azure.mgmt.monitor.models.RuleDataSource + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param aggregation: How the data that is collected should be combined over + time and when the alert is activated. Note that for management event + alerts aggregation is optional – if it is not provided then any event will + cause the alert to activate. + :type aggregation: + ~azure.mgmt.monitor.models.ManagementEventAggregationCondition + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'data_source': {'key': 'dataSource', 'type': 'RuleDataSource'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'aggregation': {'key': 'aggregation', 'type': 'ManagementEventAggregationCondition'}, + } + + def __init__(self, *, data_source=None, aggregation=None, **kwargs) -> None: + super(ManagementEventRuleCondition, self).__init__(data_source=data_source, **kwargs) + self.aggregation = aggregation + self.odatatype = 'Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metadata_value.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metadata_value.py new file mode 100644 index 000000000000..4ce548907f00 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metadata_value.py @@ -0,0 +1,32 @@ +# 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 + + +class MetadataValue(Model): + """Represents a metric metadata value. + + :param name: the name of the metadata. + :type name: ~azure.mgmt.monitor.models.LocalizableString + :param value: the value of the metadata. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'LocalizableString'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetadataValue, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metadata_value_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metadata_value_py3.py new file mode 100644 index 000000000000..9e23ac9e985a --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metadata_value_py3.py @@ -0,0 +1,32 @@ +# 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 + + +class MetadataValue(Model): + """Represents a metric metadata value. + + :param name: the name of the metadata. + :type name: ~azure.mgmt.monitor.models.LocalizableString + :param value: the value of the metadata. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'LocalizableString'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name=None, value: str=None, **kwargs) -> None: + super(MetadataValue, self).__init__(**kwargs) + self.name = name + self.value = value diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric.py new file mode 100644 index 000000000000..03cad7fe40ed --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric.py @@ -0,0 +1,58 @@ +# 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 + + +class Metric(Model): + """The result data of a query. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. the metric Id. + :type id: str + :param type: Required. the resource type of the metric resource. + :type type: str + :param name: Required. the name and the display name of the metric, i.e. + it is localizable string. + :type name: ~azure.mgmt.monitor.models.LocalizableString + :param unit: Required. the unit of the metric. Possible values include: + 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', + 'Percent', 'MilliSeconds', 'ByteSeconds', 'Unspecified' + :type unit: str or ~azure.mgmt.monitor.models.Unit + :param timeseries: Required. the time series returned when a data query is + performed. + :type timeseries: list[~azure.mgmt.monitor.models.TimeSeriesElement] + """ + + _validation = { + 'id': {'required': True}, + 'type': {'required': True}, + 'name': {'required': True}, + 'unit': {'required': True}, + 'timeseries': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'LocalizableString'}, + 'unit': {'key': 'unit', 'type': 'Unit'}, + 'timeseries': {'key': 'timeseries', 'type': '[TimeSeriesElement]'}, + } + + def __init__(self, **kwargs): + super(Metric, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) + self.unit = kwargs.get('unit', None) + self.timeseries = kwargs.get('timeseries', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_action.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_action.py new file mode 100644 index 000000000000..e4d2bb01a9a9 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_action.py @@ -0,0 +1,32 @@ +# 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 + + +class MetricAlertAction(Model): + """An alert action. + + :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] + """ + + _attribute_map = { + 'action_group_id': {'key': 'actionGroupId', 'type': 'str'}, + 'webhook_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) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_action_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_action_py3.py new file mode 100644 index 000000000000..e2bdeaf22ea7 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_action_py3.py @@ -0,0 +1,32 @@ +# 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 + + +class MetricAlertAction(Model): + """An alert action. + + :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] + """ + + _attribute_map = { + 'action_group_id': {'key': 'actionGroupId', 'type': 'str'}, + 'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'}, + } + + def __init__(self, *, action_group_id: str=None, webhook_properties=None, **kwargs) -> None: + super(MetricAlertAction, self).__init__(**kwargs) + self.action_group_id = action_group_id + self.webhook_properties = webhook_properties diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_criteria.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_criteria.py new file mode 100644 index 000000000000..f9f8acd7ccb3 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_criteria.py @@ -0,0 +1,47 @@ +# 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 + + +class MetricAlertCriteria(Model): + """The rule criteria that defines the conditions of the alert rule. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: MetricAlertSingleResourceMultipleMetricCriteria, + MetricAlertMultipleResourceMultipleMetricCriteria + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param odatatype: Required. Constant filled by server. + :type odatatype: str + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + } + + _subtype_map = { + 'odatatype': {'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria': 'MetricAlertSingleResourceMultipleMetricCriteria', 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria': 'MetricAlertMultipleResourceMultipleMetricCriteria'} + } + + def __init__(self, **kwargs): + super(MetricAlertCriteria, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.odatatype = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_criteria_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_criteria_py3.py new file mode 100644 index 000000000000..7f03ef71dd0e --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_criteria_py3.py @@ -0,0 +1,47 @@ +# 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 + + +class MetricAlertCriteria(Model): + """The rule criteria that defines the conditions of the alert rule. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: MetricAlertSingleResourceMultipleMetricCriteria, + MetricAlertMultipleResourceMultipleMetricCriteria + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param odatatype: Required. Constant filled by server. + :type odatatype: str + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + } + + _subtype_map = { + 'odatatype': {'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria': 'MetricAlertSingleResourceMultipleMetricCriteria', 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria': 'MetricAlertMultipleResourceMultipleMetricCriteria'} + } + + def __init__(self, *, additional_properties=None, **kwargs) -> None: + super(MetricAlertCriteria, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.odatatype = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_multiple_resource_multiple_metric_criteria.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_multiple_resource_multiple_metric_criteria.py new file mode 100644 index 000000000000..62aa341a955c --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_multiple_resource_multiple_metric_criteria.py @@ -0,0 +1,44 @@ +# 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 .metric_alert_criteria import MetricAlertCriteria + + +class MetricAlertMultipleResourceMultipleMetricCriteria(MetricAlertCriteria): + """Specifies the metric alert criteria for multiple resource that has multiple + metric criteria. + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param all_of: the list of multiple metric criteria for this 'all of' + operation. + :type all_of: list[~azure.mgmt.monitor.models.MultiMetricCriteria] + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'all_of': {'key': 'allOf', 'type': '[MultiMetricCriteria]'}, + } + + def __init__(self, **kwargs): + super(MetricAlertMultipleResourceMultipleMetricCriteria, self).__init__(**kwargs) + self.all_of = kwargs.get('all_of', None) + self.odatatype = 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_multiple_resource_multiple_metric_criteria_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_multiple_resource_multiple_metric_criteria_py3.py new file mode 100644 index 000000000000..5d9b598cf5bd --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_multiple_resource_multiple_metric_criteria_py3.py @@ -0,0 +1,44 @@ +# 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 .metric_alert_criteria_py3 import MetricAlertCriteria + + +class MetricAlertMultipleResourceMultipleMetricCriteria(MetricAlertCriteria): + """Specifies the metric alert criteria for multiple resource that has multiple + metric criteria. + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param all_of: the list of multiple metric criteria for this 'all of' + operation. + :type all_of: list[~azure.mgmt.monitor.models.MultiMetricCriteria] + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'all_of': {'key': 'allOf', 'type': '[MultiMetricCriteria]'}, + } + + def __init__(self, *, additional_properties=None, all_of=None, **kwargs) -> None: + super(MetricAlertMultipleResourceMultipleMetricCriteria, self).__init__(additional_properties=additional_properties, **kwargs) + self.all_of = all_of + self.odatatype = 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_resource.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_resource.py new file mode 100644 index 000000000000..34cf760db014 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_resource.py @@ -0,0 +1,118 @@ +# 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 .resource import Resource + + +class MetricAlertResource(Resource): + """The metric alert resource. + + 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] + :param description: Required. the description of the metric alert that + will be included in the alert email. + :type description: str + :param severity: Required. Alert severity {0, 1, 2, 3, 4} + :type severity: int + :param enabled: Required. the flag that indicates whether the metric alert + is enabled. + :type enabled: bool + :param scopes: the list of resource id's that this metric alert is scoped + to. + :type scopes: list[str] + :param evaluation_frequency: Required. how often the metric alert is + evaluated represented in ISO 8601 duration format. + :type evaluation_frequency: timedelta + :param window_size: Required. the period of time (in ISO 8601 duration + format) that is used to monitor alert activity based on the threshold. + :type window_size: timedelta + :param target_resource_type: the resource type of the target resource(s) + on which the alert is created/updated. Mandatory for + MultipleResourceMultipleMetricCriteria. + :type target_resource_type: str + :param target_resource_region: the region of the target resource(s) on + which the alert is created/updated. Mandatory for + MultipleResourceMultipleMetricCriteria. + :type target_resource_region: str + :param criteria: Required. defines the specific alert criteria + information. + :type criteria: ~azure.mgmt.monitor.models.MetricAlertCriteria + :param auto_mitigate: the flag that indicates whether the alert should be + auto resolved or not. + :type auto_mitigate: bool + :param actions: the array of actions that are performed when the alert + rule becomes active, and when an alert condition is resolved. + :type actions: list[~azure.mgmt.monitor.models.MetricAlertAction] + :ivar last_updated_time: Last time the rule was updated in ISO8601 format. + :vartype last_updated_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'description': {'required': True}, + 'severity': {'required': True}, + 'enabled': {'required': True}, + 'evaluation_frequency': {'required': True}, + 'window_size': {'required': True}, + 'criteria': {'required': True}, + 'last_updated_time': {'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}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'int'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'}, + 'window_size': {'key': 'properties.windowSize', 'type': 'duration'}, + 'target_resource_type': {'key': 'properties.targetResourceType', 'type': 'str'}, + 'target_resource_region': {'key': 'properties.targetResourceRegion', 'type': 'str'}, + 'criteria': {'key': 'properties.criteria', 'type': 'MetricAlertCriteria'}, + 'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'}, + 'actions': {'key': 'properties.actions', 'type': '[MetricAlertAction]'}, + 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(MetricAlertResource, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.severity = kwargs.get('severity', None) + self.enabled = kwargs.get('enabled', None) + self.scopes = kwargs.get('scopes', None) + self.evaluation_frequency = kwargs.get('evaluation_frequency', None) + self.window_size = kwargs.get('window_size', None) + self.target_resource_type = kwargs.get('target_resource_type', None) + self.target_resource_region = kwargs.get('target_resource_region', None) + self.criteria = kwargs.get('criteria', None) + self.auto_mitigate = kwargs.get('auto_mitigate', None) + self.actions = kwargs.get('actions', None) + self.last_updated_time = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_resource_paged.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_resource_paged.py new file mode 100644 index 000000000000..8ad3fb071965 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_resource_paged.py @@ -0,0 +1,27 @@ +# 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 MetricAlertResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`MetricAlertResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[MetricAlertResource]'} + } + + def __init__(self, *args, **kwargs): + + super(MetricAlertResourcePaged, self).__init__(*args, **kwargs) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_resource_patch.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_resource_patch.py new file mode 100644 index 000000000000..d87f339743ae --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_resource_patch.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MetricAlertResourcePatch(Model): + """The metric alert resource for patch operations. + + 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 tags: Resource tags + :type tags: dict[str, str] + :param description: Required. the description of the metric alert that + will be included in the alert email. + :type description: str + :param severity: Required. Alert severity {0, 1, 2, 3, 4} + :type severity: int + :param enabled: Required. the flag that indicates whether the metric alert + is enabled. + :type enabled: bool + :param scopes: the list of resource id's that this metric alert is scoped + to. + :type scopes: list[str] + :param evaluation_frequency: Required. how often the metric alert is + evaluated represented in ISO 8601 duration format. + :type evaluation_frequency: timedelta + :param window_size: Required. the period of time (in ISO 8601 duration + format) that is used to monitor alert activity based on the threshold. + :type window_size: timedelta + :param target_resource_type: the resource type of the target resource(s) + on which the alert is created/updated. Mandatory for + MultipleResourceMultipleMetricCriteria. + :type target_resource_type: str + :param target_resource_region: the region of the target resource(s) on + which the alert is created/updated. Mandatory for + MultipleResourceMultipleMetricCriteria. + :type target_resource_region: str + :param criteria: Required. defines the specific alert criteria + information. + :type criteria: ~azure.mgmt.monitor.models.MetricAlertCriteria + :param auto_mitigate: the flag that indicates whether the alert should be + auto resolved or not. + :type auto_mitigate: bool + :param actions: the array of actions that are performed when the alert + rule becomes active, and when an alert condition is resolved. + :type actions: list[~azure.mgmt.monitor.models.MetricAlertAction] + :ivar last_updated_time: Last time the rule was updated in ISO8601 format. + :vartype last_updated_time: datetime + """ + + _validation = { + 'description': {'required': True}, + 'severity': {'required': True}, + 'enabled': {'required': True}, + 'evaluation_frequency': {'required': True}, + 'window_size': {'required': True}, + 'criteria': {'required': True}, + 'last_updated_time': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'int'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'}, + 'window_size': {'key': 'properties.windowSize', 'type': 'duration'}, + 'target_resource_type': {'key': 'properties.targetResourceType', 'type': 'str'}, + 'target_resource_region': {'key': 'properties.targetResourceRegion', 'type': 'str'}, + 'criteria': {'key': 'properties.criteria', 'type': 'MetricAlertCriteria'}, + 'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'}, + 'actions': {'key': 'properties.actions', 'type': '[MetricAlertAction]'}, + 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(MetricAlertResourcePatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.description = kwargs.get('description', None) + self.severity = kwargs.get('severity', None) + self.enabled = kwargs.get('enabled', None) + self.scopes = kwargs.get('scopes', None) + self.evaluation_frequency = kwargs.get('evaluation_frequency', None) + self.window_size = kwargs.get('window_size', None) + self.target_resource_type = kwargs.get('target_resource_type', None) + self.target_resource_region = kwargs.get('target_resource_region', None) + self.criteria = kwargs.get('criteria', None) + self.auto_mitigate = kwargs.get('auto_mitigate', None) + self.actions = kwargs.get('actions', None) + self.last_updated_time = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_resource_patch_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_resource_patch_py3.py new file mode 100644 index 000000000000..9a0728a74a81 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_resource_patch_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MetricAlertResourcePatch(Model): + """The metric alert resource for patch operations. + + 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 tags: Resource tags + :type tags: dict[str, str] + :param description: Required. the description of the metric alert that + will be included in the alert email. + :type description: str + :param severity: Required. Alert severity {0, 1, 2, 3, 4} + :type severity: int + :param enabled: Required. the flag that indicates whether the metric alert + is enabled. + :type enabled: bool + :param scopes: the list of resource id's that this metric alert is scoped + to. + :type scopes: list[str] + :param evaluation_frequency: Required. how often the metric alert is + evaluated represented in ISO 8601 duration format. + :type evaluation_frequency: timedelta + :param window_size: Required. the period of time (in ISO 8601 duration + format) that is used to monitor alert activity based on the threshold. + :type window_size: timedelta + :param target_resource_type: the resource type of the target resource(s) + on which the alert is created/updated. Mandatory for + MultipleResourceMultipleMetricCriteria. + :type target_resource_type: str + :param target_resource_region: the region of the target resource(s) on + which the alert is created/updated. Mandatory for + MultipleResourceMultipleMetricCriteria. + :type target_resource_region: str + :param criteria: Required. defines the specific alert criteria + information. + :type criteria: ~azure.mgmt.monitor.models.MetricAlertCriteria + :param auto_mitigate: the flag that indicates whether the alert should be + auto resolved or not. + :type auto_mitigate: bool + :param actions: the array of actions that are performed when the alert + rule becomes active, and when an alert condition is resolved. + :type actions: list[~azure.mgmt.monitor.models.MetricAlertAction] + :ivar last_updated_time: Last time the rule was updated in ISO8601 format. + :vartype last_updated_time: datetime + """ + + _validation = { + 'description': {'required': True}, + 'severity': {'required': True}, + 'enabled': {'required': True}, + 'evaluation_frequency': {'required': True}, + 'window_size': {'required': True}, + 'criteria': {'required': True}, + 'last_updated_time': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'int'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'}, + 'window_size': {'key': 'properties.windowSize', 'type': 'duration'}, + 'target_resource_type': {'key': 'properties.targetResourceType', 'type': 'str'}, + 'target_resource_region': {'key': 'properties.targetResourceRegion', 'type': 'str'}, + 'criteria': {'key': 'properties.criteria', 'type': 'MetricAlertCriteria'}, + 'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'}, + 'actions': {'key': 'properties.actions', 'type': '[MetricAlertAction]'}, + 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, description: str, severity: int, enabled: bool, evaluation_frequency, window_size, criteria, tags=None, scopes=None, target_resource_type: str=None, target_resource_region: str=None, auto_mitigate: bool=None, actions=None, **kwargs) -> None: + super(MetricAlertResourcePatch, self).__init__(**kwargs) + self.tags = tags + self.description = description + self.severity = severity + self.enabled = enabled + self.scopes = scopes + self.evaluation_frequency = evaluation_frequency + self.window_size = window_size + self.target_resource_type = target_resource_type + self.target_resource_region = target_resource_region + self.criteria = criteria + self.auto_mitigate = auto_mitigate + self.actions = actions + self.last_updated_time = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_resource_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_resource_py3.py new file mode 100644 index 000000000000..fe32ef5bb1f1 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_resource_py3.py @@ -0,0 +1,118 @@ +# 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 .resource_py3 import Resource + + +class MetricAlertResource(Resource): + """The metric alert resource. + + 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] + :param description: Required. the description of the metric alert that + will be included in the alert email. + :type description: str + :param severity: Required. Alert severity {0, 1, 2, 3, 4} + :type severity: int + :param enabled: Required. the flag that indicates whether the metric alert + is enabled. + :type enabled: bool + :param scopes: the list of resource id's that this metric alert is scoped + to. + :type scopes: list[str] + :param evaluation_frequency: Required. how often the metric alert is + evaluated represented in ISO 8601 duration format. + :type evaluation_frequency: timedelta + :param window_size: Required. the period of time (in ISO 8601 duration + format) that is used to monitor alert activity based on the threshold. + :type window_size: timedelta + :param target_resource_type: the resource type of the target resource(s) + on which the alert is created/updated. Mandatory for + MultipleResourceMultipleMetricCriteria. + :type target_resource_type: str + :param target_resource_region: the region of the target resource(s) on + which the alert is created/updated. Mandatory for + MultipleResourceMultipleMetricCriteria. + :type target_resource_region: str + :param criteria: Required. defines the specific alert criteria + information. + :type criteria: ~azure.mgmt.monitor.models.MetricAlertCriteria + :param auto_mitigate: the flag that indicates whether the alert should be + auto resolved or not. + :type auto_mitigate: bool + :param actions: the array of actions that are performed when the alert + rule becomes active, and when an alert condition is resolved. + :type actions: list[~azure.mgmt.monitor.models.MetricAlertAction] + :ivar last_updated_time: Last time the rule was updated in ISO8601 format. + :vartype last_updated_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'description': {'required': True}, + 'severity': {'required': True}, + 'enabled': {'required': True}, + 'evaluation_frequency': {'required': True}, + 'window_size': {'required': True}, + 'criteria': {'required': True}, + 'last_updated_time': {'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}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'int'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'}, + 'window_size': {'key': 'properties.windowSize', 'type': 'duration'}, + 'target_resource_type': {'key': 'properties.targetResourceType', 'type': 'str'}, + 'target_resource_region': {'key': 'properties.targetResourceRegion', 'type': 'str'}, + 'criteria': {'key': 'properties.criteria', 'type': 'MetricAlertCriteria'}, + 'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'}, + 'actions': {'key': 'properties.actions', 'type': '[MetricAlertAction]'}, + 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, location: str, description: str, severity: int, enabled: bool, evaluation_frequency, window_size, criteria, tags=None, scopes=None, target_resource_type: str=None, target_resource_region: str=None, auto_mitigate: bool=None, actions=None, **kwargs) -> None: + super(MetricAlertResource, self).__init__(location=location, tags=tags, **kwargs) + self.description = description + self.severity = severity + self.enabled = enabled + self.scopes = scopes + self.evaluation_frequency = evaluation_frequency + self.window_size = window_size + self.target_resource_type = target_resource_type + self.target_resource_region = target_resource_region + self.criteria = criteria + self.auto_mitigate = auto_mitigate + self.actions = actions + self.last_updated_time = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_single_resource_multiple_metric_criteria.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_single_resource_multiple_metric_criteria.py new file mode 100644 index 000000000000..ccc84e1991ca --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_single_resource_multiple_metric_criteria.py @@ -0,0 +1,43 @@ +# 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 .metric_alert_criteria import MetricAlertCriteria + + +class MetricAlertSingleResourceMultipleMetricCriteria(MetricAlertCriteria): + """Specifies the metric alert criteria for a single resource that has multiple + metric criteria. + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param all_of: The list of metric criteria for this 'all of' operation. + :type all_of: list[~azure.mgmt.monitor.models.MetricCriteria] + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'all_of': {'key': 'allOf', 'type': '[MetricCriteria]'}, + } + + def __init__(self, **kwargs): + super(MetricAlertSingleResourceMultipleMetricCriteria, self).__init__(**kwargs) + self.all_of = kwargs.get('all_of', None) + self.odatatype = 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_single_resource_multiple_metric_criteria_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_single_resource_multiple_metric_criteria_py3.py new file mode 100644 index 000000000000..7e74e7a90272 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_single_resource_multiple_metric_criteria_py3.py @@ -0,0 +1,43 @@ +# 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 .metric_alert_criteria_py3 import MetricAlertCriteria + + +class MetricAlertSingleResourceMultipleMetricCriteria(MetricAlertCriteria): + """Specifies the metric alert criteria for a single resource that has multiple + metric criteria. + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param all_of: The list of metric criteria for this 'all of' operation. + :type all_of: list[~azure.mgmt.monitor.models.MetricCriteria] + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'all_of': {'key': 'allOf', 'type': '[MetricCriteria]'}, + } + + def __init__(self, *, additional_properties=None, all_of=None, **kwargs) -> None: + super(MetricAlertSingleResourceMultipleMetricCriteria, self).__init__(additional_properties=additional_properties, **kwargs) + self.all_of = all_of + self.odatatype = 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_status.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_status.py new file mode 100644 index 000000000000..89a6928343f2 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_status.py @@ -0,0 +1,40 @@ +# 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 + + +class MetricAlertStatus(Model): + """An alert status. + + :param name: The status name. + :type name: str + :param id: The alert rule arm id. + :type id: str + :param type: The extended resource type name. + :type type: str + :param properties: The alert status properties of the metric alert status. + :type properties: ~azure.mgmt.monitor.models.MetricAlertStatusProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'MetricAlertStatusProperties'}, + } + + def __init__(self, **kwargs): + super(MetricAlertStatus, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.type = kwargs.get('type', None) + self.properties = kwargs.get('properties', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_status_collection.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_status_collection.py new file mode 100644 index 000000000000..f893590e2015 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_status_collection.py @@ -0,0 +1,28 @@ +# 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 + + +class MetricAlertStatusCollection(Model): + """Represents a collection of alert rule resources. + + :param value: the values for the alert rule resources. + :type value: list[~azure.mgmt.monitor.models.MetricAlertStatus] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MetricAlertStatus]'}, + } + + def __init__(self, **kwargs): + super(MetricAlertStatusCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_status_collection_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_status_collection_py3.py new file mode 100644 index 000000000000..06c21ce2b3cc --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_status_collection_py3.py @@ -0,0 +1,28 @@ +# 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 + + +class MetricAlertStatusCollection(Model): + """Represents a collection of alert rule resources. + + :param value: the values for the alert rule resources. + :type value: list[~azure.mgmt.monitor.models.MetricAlertStatus] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MetricAlertStatus]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(MetricAlertStatusCollection, self).__init__(**kwargs) + self.value = value diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_status_properties.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_status_properties.py new file mode 100644 index 000000000000..a0893812d8bd --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_status_properties.py @@ -0,0 +1,36 @@ +# 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 + + +class MetricAlertStatusProperties(Model): + """An alert status properties. + + :param dimensions: An object describing the type of the dimensions. + :type dimensions: dict[str, str] + :param status: status value + :type status: str + :param timestamp: UTC time when the status was checked. + :type timestamp: datetime + """ + + _attribute_map = { + 'dimensions': {'key': 'dimensions', 'type': '{str}'}, + 'status': {'key': 'status', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(MetricAlertStatusProperties, self).__init__(**kwargs) + self.dimensions = kwargs.get('dimensions', None) + self.status = kwargs.get('status', None) + self.timestamp = kwargs.get('timestamp', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_status_properties_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_status_properties_py3.py new file mode 100644 index 000000000000..5f5896ac6361 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_status_properties_py3.py @@ -0,0 +1,36 @@ +# 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 + + +class MetricAlertStatusProperties(Model): + """An alert status properties. + + :param dimensions: An object describing the type of the dimensions. + :type dimensions: dict[str, str] + :param status: status value + :type status: str + :param timestamp: UTC time when the status was checked. + :type timestamp: datetime + """ + + _attribute_map = { + 'dimensions': {'key': 'dimensions', 'type': '{str}'}, + 'status': {'key': 'status', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + } + + def __init__(self, *, dimensions=None, status: str=None, timestamp=None, **kwargs) -> None: + super(MetricAlertStatusProperties, self).__init__(**kwargs) + self.dimensions = dimensions + self.status = status + self.timestamp = timestamp diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_status_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_status_py3.py new file mode 100644 index 000000000000..e6b7f3062534 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_status_py3.py @@ -0,0 +1,40 @@ +# 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 + + +class MetricAlertStatus(Model): + """An alert status. + + :param name: The status name. + :type name: str + :param id: The alert rule arm id. + :type id: str + :param type: The extended resource type name. + :type type: str + :param properties: The alert status properties of the metric alert status. + :type properties: ~azure.mgmt.monitor.models.MetricAlertStatusProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'MetricAlertStatusProperties'}, + } + + def __init__(self, *, name: str=None, id: str=None, type: str=None, properties=None, **kwargs) -> None: + super(MetricAlertStatus, self).__init__(**kwargs) + self.name = name + self.id = id + self.type = type + self.properties = properties diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_availability.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_availability.py new file mode 100644 index 000000000000..a50838988a18 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_availability.py @@ -0,0 +1,35 @@ +# 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 + + +class MetricAvailability(Model): + """Metric availability specifies the time grain (aggregation interval or + frequency) and the retention period for that time grain. + + :param time_grain: the time grain specifies the aggregation interval for + the metric. Expressed as a duration 'PT1M', 'P1D', etc. + :type time_grain: timedelta + :param retention: the retention period for the metric at the specified + timegrain. Expressed as a duration 'PT1M', 'P1D', etc. + :type retention: timedelta + """ + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'duration'}, + 'retention': {'key': 'retention', 'type': 'duration'}, + } + + def __init__(self, **kwargs): + super(MetricAvailability, self).__init__(**kwargs) + self.time_grain = kwargs.get('time_grain', None) + self.retention = kwargs.get('retention', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_availability_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_availability_py3.py new file mode 100644 index 000000000000..32f1d11c91f7 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_availability_py3.py @@ -0,0 +1,35 @@ +# 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 + + +class MetricAvailability(Model): + """Metric availability specifies the time grain (aggregation interval or + frequency) and the retention period for that time grain. + + :param time_grain: the time grain specifies the aggregation interval for + the metric. Expressed as a duration 'PT1M', 'P1D', etc. + :type time_grain: timedelta + :param retention: the retention period for the metric at the specified + timegrain. Expressed as a duration 'PT1M', 'P1D', etc. + :type retention: timedelta + """ + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'duration'}, + 'retention': {'key': 'retention', 'type': 'duration'}, + } + + def __init__(self, *, time_grain=None, retention=None, **kwargs) -> None: + super(MetricAvailability, self).__init__(**kwargs) + self.time_grain = time_grain + self.retention = retention diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_criteria.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_criteria.py new file mode 100644 index 000000000000..aff905946ee3 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_criteria.py @@ -0,0 +1,67 @@ +# 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 .multi_metric_criteria import MultiMetricCriteria + + +class MetricCriteria(MultiMetricCriteria): + """Criterion to filter metrics. + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param name: Required. Name of the criteria. + :type name: str + :param metric_name: Required. Name of the metric. + :type metric_name: str + :param metric_namespace: Namespace of the metric. + :type metric_namespace: str + :param time_aggregation: Required. the criteria time aggregation types. + :type time_aggregation: object + :param dimensions: List of dimension conditions. + :type dimensions: list[~azure.mgmt.monitor.models.MetricDimension] + :param criterion_type: Required. Constant filled by server. + :type criterion_type: str + :param operator: Required. the criteria operator. + :type operator: object + :param threshold: Required. the criteria threshold value that activates + the alert. + :type threshold: float + """ + + _validation = { + 'name': {'required': True}, + 'metric_name': {'required': True}, + 'time_aggregation': {'required': True}, + 'criterion_type': {'required': True}, + 'operator': {'required': True}, + 'threshold': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'metric_name': {'key': 'metricName', 'type': 'str'}, + 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, + 'time_aggregation': {'key': 'timeAggregation', 'type': 'object'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + 'criterion_type': {'key': 'criterionType', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'object'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(MetricCriteria, self).__init__(**kwargs) + self.operator = kwargs.get('operator', None) + self.threshold = kwargs.get('threshold', None) + self.criterion_type = 'StaticThresholdCriterion' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_criteria_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_criteria_py3.py new file mode 100644 index 000000000000..86029593f200 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_criteria_py3.py @@ -0,0 +1,67 @@ +# 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 .multi_metric_criteria_py3 import MultiMetricCriteria + + +class MetricCriteria(MultiMetricCriteria): + """Criterion to filter metrics. + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param name: Required. Name of the criteria. + :type name: str + :param metric_name: Required. Name of the metric. + :type metric_name: str + :param metric_namespace: Namespace of the metric. + :type metric_namespace: str + :param time_aggregation: Required. the criteria time aggregation types. + :type time_aggregation: object + :param dimensions: List of dimension conditions. + :type dimensions: list[~azure.mgmt.monitor.models.MetricDimension] + :param criterion_type: Required. Constant filled by server. + :type criterion_type: str + :param operator: Required. the criteria operator. + :type operator: object + :param threshold: Required. the criteria threshold value that activates + the alert. + :type threshold: float + """ + + _validation = { + 'name': {'required': True}, + 'metric_name': {'required': True}, + 'time_aggregation': {'required': True}, + 'criterion_type': {'required': True}, + 'operator': {'required': True}, + 'threshold': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'metric_name': {'key': 'metricName', 'type': 'str'}, + 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, + 'time_aggregation': {'key': 'timeAggregation', 'type': 'object'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + 'criterion_type': {'key': 'criterionType', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'object'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + } + + def __init__(self, *, name: str, metric_name: str, time_aggregation, operator, threshold: float, additional_properties=None, metric_namespace: str=None, dimensions=None, **kwargs) -> None: + super(MetricCriteria, self).__init__(additional_properties=additional_properties, name=name, metric_name=metric_name, metric_namespace=metric_namespace, time_aggregation=time_aggregation, dimensions=dimensions, **kwargs) + self.operator = operator + self.threshold = threshold + self.criterion_type = 'StaticThresholdCriterion' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_definition.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_definition.py new file mode 100644 index 000000000000..97eab75a1a21 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_definition.py @@ -0,0 +1,77 @@ +# 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 + + +class MetricDefinition(Model): + """Metric definition class specifies the metadata for a metric. + + :param is_dimension_required: Flag to indicate whether the dimension is + required. + :type is_dimension_required: bool + :param resource_id: the resource identifier of the resource that emitted + the metric. + :type resource_id: str + :param namespace: the namespace the metric belongs to. + :type namespace: str + :param name: the name and the display name of the metric, i.e. it is a + localizable string. + :type name: ~azure.mgmt.monitor.models.LocalizableString + :param unit: the unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', 'Percent', + 'MilliSeconds', 'ByteSeconds', 'Unspecified' + :type unit: str or ~azure.mgmt.monitor.models.Unit + :param primary_aggregation_type: the primary aggregation type value + defining how to use the values for display. Possible values include: + 'None', 'Average', 'Count', 'Minimum', 'Maximum', 'Total' + :type primary_aggregation_type: str or + ~azure.mgmt.monitor.models.AggregationType + :param supported_aggregation_types: the collection of what aggregation + types are supported. + :type supported_aggregation_types: list[str or + ~azure.mgmt.monitor.models.AggregationType] + :param metric_availabilities: the collection of what aggregation intervals + are available to be queried. + :type metric_availabilities: + list[~azure.mgmt.monitor.models.MetricAvailability] + :param id: the resource identifier of the metric definition. + :type id: str + :param dimensions: the name and the display name of the dimension, i.e. it + is a localizable string. + :type dimensions: list[~azure.mgmt.monitor.models.LocalizableString] + """ + + _attribute_map = { + 'is_dimension_required': {'key': 'isDimensionRequired', 'type': 'bool'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'LocalizableString'}, + 'unit': {'key': 'unit', 'type': 'Unit'}, + 'primary_aggregation_type': {'key': 'primaryAggregationType', 'type': 'AggregationType'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[AggregationType]'}, + 'metric_availabilities': {'key': 'metricAvailabilities', 'type': '[MetricAvailability]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[LocalizableString]'}, + } + + def __init__(self, **kwargs): + super(MetricDefinition, self).__init__(**kwargs) + self.is_dimension_required = kwargs.get('is_dimension_required', None) + self.resource_id = kwargs.get('resource_id', None) + self.namespace = kwargs.get('namespace', None) + self.name = kwargs.get('name', None) + self.unit = kwargs.get('unit', None) + self.primary_aggregation_type = kwargs.get('primary_aggregation_type', None) + self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) + self.metric_availabilities = kwargs.get('metric_availabilities', None) + self.id = kwargs.get('id', None) + self.dimensions = kwargs.get('dimensions', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_definition_paged.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_definition_paged.py new file mode 100644 index 000000000000..14f00a1ba9bd --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_definition_paged.py @@ -0,0 +1,27 @@ +# 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 MetricDefinitionPaged(Paged): + """ + A paging container for iterating over a list of :class:`MetricDefinition ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[MetricDefinition]'} + } + + def __init__(self, *args, **kwargs): + + super(MetricDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_definition_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_definition_py3.py new file mode 100644 index 000000000000..72fdb488255f --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_definition_py3.py @@ -0,0 +1,77 @@ +# 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 + + +class MetricDefinition(Model): + """Metric definition class specifies the metadata for a metric. + + :param is_dimension_required: Flag to indicate whether the dimension is + required. + :type is_dimension_required: bool + :param resource_id: the resource identifier of the resource that emitted + the metric. + :type resource_id: str + :param namespace: the namespace the metric belongs to. + :type namespace: str + :param name: the name and the display name of the metric, i.e. it is a + localizable string. + :type name: ~azure.mgmt.monitor.models.LocalizableString + :param unit: the unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', 'Percent', + 'MilliSeconds', 'ByteSeconds', 'Unspecified' + :type unit: str or ~azure.mgmt.monitor.models.Unit + :param primary_aggregation_type: the primary aggregation type value + defining how to use the values for display. Possible values include: + 'None', 'Average', 'Count', 'Minimum', 'Maximum', 'Total' + :type primary_aggregation_type: str or + ~azure.mgmt.monitor.models.AggregationType + :param supported_aggregation_types: the collection of what aggregation + types are supported. + :type supported_aggregation_types: list[str or + ~azure.mgmt.monitor.models.AggregationType] + :param metric_availabilities: the collection of what aggregation intervals + are available to be queried. + :type metric_availabilities: + list[~azure.mgmt.monitor.models.MetricAvailability] + :param id: the resource identifier of the metric definition. + :type id: str + :param dimensions: the name and the display name of the dimension, i.e. it + is a localizable string. + :type dimensions: list[~azure.mgmt.monitor.models.LocalizableString] + """ + + _attribute_map = { + 'is_dimension_required': {'key': 'isDimensionRequired', 'type': 'bool'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'LocalizableString'}, + 'unit': {'key': 'unit', 'type': 'Unit'}, + 'primary_aggregation_type': {'key': 'primaryAggregationType', 'type': 'AggregationType'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[AggregationType]'}, + 'metric_availabilities': {'key': 'metricAvailabilities', 'type': '[MetricAvailability]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[LocalizableString]'}, + } + + def __init__(self, *, is_dimension_required: bool=None, resource_id: str=None, namespace: str=None, name=None, unit=None, primary_aggregation_type=None, supported_aggregation_types=None, metric_availabilities=None, id: str=None, dimensions=None, **kwargs) -> None: + super(MetricDefinition, self).__init__(**kwargs) + self.is_dimension_required = is_dimension_required + self.resource_id = resource_id + self.namespace = namespace + self.name = name + self.unit = unit + self.primary_aggregation_type = primary_aggregation_type + self.supported_aggregation_types = supported_aggregation_types + self.metric_availabilities = metric_availabilities + self.id = id + self.dimensions = dimensions diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_dimension.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_dimension.py new file mode 100644 index 000000000000..54e286156ce6 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_dimension.py @@ -0,0 +1,45 @@ +# 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 + + +class MetricDimension(Model): + """Specifies a metric dimension. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the dimension. + :type name: str + :param operator: Required. the dimension operator. Only 'Include' and + 'Exclude' are supported + :type operator: str + :param values: Required. list of dimension values. + :type values: list[str] + """ + + _validation = { + 'name': {'required': True}, + 'operator': {'required': True}, + 'values': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(MetricDimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.operator = kwargs.get('operator', None) + self.values = kwargs.get('values', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_dimension_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_dimension_py3.py new file mode 100644 index 000000000000..d25bac118b87 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_dimension_py3.py @@ -0,0 +1,45 @@ +# 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 + + +class MetricDimension(Model): + """Specifies a metric dimension. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the dimension. + :type name: str + :param operator: Required. the dimension operator. Only 'Include' and + 'Exclude' are supported + :type operator: str + :param values: Required. list of dimension values. + :type values: list[str] + """ + + _validation = { + 'name': {'required': True}, + 'operator': {'required': True}, + 'values': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + def __init__(self, *, name: str, operator: str, values, **kwargs) -> None: + super(MetricDimension, self).__init__(**kwargs) + self.name = name + self.operator = operator + self.values = values diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_namespace.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_namespace.py new file mode 100644 index 000000000000..f550b7b247d4 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_namespace.py @@ -0,0 +1,41 @@ +# 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 + + +class MetricNamespace(Model): + """Metric namespace class specifies the metadata for a metric namespace. + + :param id: The ID of the metricNamespace. + :type id: str + :param type: The type of the namespace. + :type type: str + :param name: The name of the namespace. + :type name: str + :param properties: Properties which include the fully qualified namespace + name. + :type properties: ~azure.mgmt.monitor.models.MetricNamespaceName + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'MetricNamespaceName'}, + } + + def __init__(self, **kwargs): + super(MetricNamespace, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_namespace_name.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_namespace_name.py new file mode 100644 index 000000000000..504355e9d43e --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_namespace_name.py @@ -0,0 +1,28 @@ +# 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 + + +class MetricNamespaceName(Model): + """The fully qualified metric namespace name. + + :param metric_namespace_name: The metric namespace name. + :type metric_namespace_name: str + """ + + _attribute_map = { + 'metric_namespace_name': {'key': 'metricNamespaceName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricNamespaceName, self).__init__(**kwargs) + self.metric_namespace_name = kwargs.get('metric_namespace_name', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_namespace_name_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_namespace_name_py3.py new file mode 100644 index 000000000000..b4fe63755fcb --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_namespace_name_py3.py @@ -0,0 +1,28 @@ +# 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 + + +class MetricNamespaceName(Model): + """The fully qualified metric namespace name. + + :param metric_namespace_name: The metric namespace name. + :type metric_namespace_name: str + """ + + _attribute_map = { + 'metric_namespace_name': {'key': 'metricNamespaceName', 'type': 'str'}, + } + + def __init__(self, *, metric_namespace_name: str=None, **kwargs) -> None: + super(MetricNamespaceName, self).__init__(**kwargs) + self.metric_namespace_name = metric_namespace_name diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_namespace_paged.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_namespace_paged.py new file mode 100644 index 000000000000..9c3a60df700f --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_namespace_paged.py @@ -0,0 +1,27 @@ +# 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 MetricNamespacePaged(Paged): + """ + A paging container for iterating over a list of :class:`MetricNamespace ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[MetricNamespace]'} + } + + def __init__(self, *args, **kwargs): + + super(MetricNamespacePaged, self).__init__(*args, **kwargs) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_namespace_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_namespace_py3.py new file mode 100644 index 000000000000..6f81045b10e3 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_namespace_py3.py @@ -0,0 +1,41 @@ +# 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 + + +class MetricNamespace(Model): + """Metric namespace class specifies the metadata for a metric namespace. + + :param id: The ID of the metricNamespace. + :type id: str + :param type: The type of the namespace. + :type type: str + :param name: The name of the namespace. + :type name: str + :param properties: Properties which include the fully qualified namespace + name. + :type properties: ~azure.mgmt.monitor.models.MetricNamespaceName + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'MetricNamespaceName'}, + } + + def __init__(self, *, id: str=None, type: str=None, name: str=None, properties=None, **kwargs) -> None: + super(MetricNamespace, self).__init__(**kwargs) + self.id = id + self.type = type + self.name = name + self.properties = properties diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_py3.py new file mode 100644 index 000000000000..fde8b416e98f --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_py3.py @@ -0,0 +1,58 @@ +# 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 + + +class Metric(Model): + """The result data of a query. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. the metric Id. + :type id: str + :param type: Required. the resource type of the metric resource. + :type type: str + :param name: Required. the name and the display name of the metric, i.e. + it is localizable string. + :type name: ~azure.mgmt.monitor.models.LocalizableString + :param unit: Required. the unit of the metric. Possible values include: + 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', + 'Percent', 'MilliSeconds', 'ByteSeconds', 'Unspecified' + :type unit: str or ~azure.mgmt.monitor.models.Unit + :param timeseries: Required. the time series returned when a data query is + performed. + :type timeseries: list[~azure.mgmt.monitor.models.TimeSeriesElement] + """ + + _validation = { + 'id': {'required': True}, + 'type': {'required': True}, + 'name': {'required': True}, + 'unit': {'required': True}, + 'timeseries': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'LocalizableString'}, + 'unit': {'key': 'unit', 'type': 'Unit'}, + 'timeseries': {'key': 'timeseries', 'type': '[TimeSeriesElement]'}, + } + + def __init__(self, *, id: str, type: str, name, unit, timeseries, **kwargs) -> None: + super(Metric, self).__init__(**kwargs) + self.id = id + self.type = type + self.name = name + self.unit = unit + self.timeseries = timeseries diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_settings.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_settings.py new file mode 100644 index 000000000000..e62931905b34 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_settings.py @@ -0,0 +1,51 @@ +# 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 + + +class MetricSettings(Model): + """Part of MultiTenantDiagnosticSettings. Specifies the settings for a + particular metric. + + All required parameters must be populated in order to send to Azure. + + :param time_grain: the timegrain of the metric in ISO8601 format. + :type time_grain: timedelta + :param category: Name of a Diagnostic Metric category for a resource type + this setting is applied to. To obtain the list of Diagnostic metric + categories for a resource, first perform a GET diagnostic settings + operation. + :type category: str + :param enabled: Required. a value indicating whether this category is + enabled. + :type enabled: bool + :param retention_policy: the retention policy for this category. + :type retention_policy: ~azure.mgmt.monitor.models.RetentionPolicy + """ + + _validation = { + 'enabled': {'required': True}, + } + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'duration'}, + 'category': {'key': 'category', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, + } + + def __init__(self, **kwargs): + super(MetricSettings, self).__init__(**kwargs) + self.time_grain = kwargs.get('time_grain', None) + self.category = kwargs.get('category', None) + self.enabled = kwargs.get('enabled', None) + self.retention_policy = kwargs.get('retention_policy', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_settings_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_settings_py3.py new file mode 100644 index 000000000000..1fc0eb1ddb20 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_settings_py3.py @@ -0,0 +1,51 @@ +# 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 + + +class MetricSettings(Model): + """Part of MultiTenantDiagnosticSettings. Specifies the settings for a + particular metric. + + All required parameters must be populated in order to send to Azure. + + :param time_grain: the timegrain of the metric in ISO8601 format. + :type time_grain: timedelta + :param category: Name of a Diagnostic Metric category for a resource type + this setting is applied to. To obtain the list of Diagnostic metric + categories for a resource, first perform a GET diagnostic settings + operation. + :type category: str + :param enabled: Required. a value indicating whether this category is + enabled. + :type enabled: bool + :param retention_policy: the retention policy for this category. + :type retention_policy: ~azure.mgmt.monitor.models.RetentionPolicy + """ + + _validation = { + 'enabled': {'required': True}, + } + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'duration'}, + 'category': {'key': 'category', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, + } + + def __init__(self, *, enabled: bool, time_grain=None, category: str=None, retention_policy=None, **kwargs) -> None: + super(MetricSettings, self).__init__(**kwargs) + self.time_grain = time_grain + self.category = category + self.enabled = enabled + self.retention_policy = retention_policy diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_single_dimension.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_single_dimension.py new file mode 100644 index 000000000000..08a0325e291b --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_single_dimension.py @@ -0,0 +1,39 @@ +# 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 + + +class MetricSingleDimension(Model): + """The metric dimension name and value. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the dimension. + :type name: str + :param value: Required. Value of the dimension. + :type value: str + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricSingleDimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_single_dimension_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_single_dimension_py3.py new file mode 100644 index 000000000000..ec1ef70360a1 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_single_dimension_py3.py @@ -0,0 +1,39 @@ +# 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 + + +class MetricSingleDimension(Model): + """The metric dimension name and value. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the dimension. + :type name: str + :param value: Required. Value of the dimension. + :type value: str + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name: str, value: str, **kwargs) -> None: + super(MetricSingleDimension, self).__init__(**kwargs) + self.name = name + self.value = value diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_trigger.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_trigger.py new file mode 100644 index 000000000000..8163abe26bac --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_trigger.py @@ -0,0 +1,85 @@ +# 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 + + +class MetricTrigger(Model): + """The trigger that results in a scaling action. + + All required parameters must be populated in order to send to Azure. + + :param metric_name: Required. the name of the metric that defines what the + rule monitors. + :type metric_name: str + :param metric_resource_uri: Required. the resource identifier of the + resource the rule monitors. + :type metric_resource_uri: str + :param time_grain: Required. the granularity of metrics the rule monitors. + Must be one of the predefined values returned from metric definitions for + the metric. Must be between 12 hours and 1 minute. + :type time_grain: timedelta + :param statistic: Required. the metric statistic type. How the metrics + from multiple instances are combined. Possible values include: 'Average', + 'Min', 'Max', 'Sum' + :type statistic: str or ~azure.mgmt.monitor.models.MetricStatisticType + :param time_window: Required. the range of time in which instance data is + collected. This value must be greater than the delay in metric collection, + which can vary from resource-to-resource. Must be between 12 hours and 5 + minutes. + :type time_window: timedelta + :param time_aggregation: Required. time aggregation type. How the data + that is collected should be combined over time. The default value is + Average. Possible values include: 'Average', 'Minimum', 'Maximum', + 'Total', 'Count', 'Last' + :type time_aggregation: str or + ~azure.mgmt.monitor.models.TimeAggregationType + :param operator: Required. the operator that is used to compare the metric + data and the threshold. Possible values include: 'Equals', 'NotEquals', + 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' + :type operator: str or ~azure.mgmt.monitor.models.ComparisonOperationType + :param threshold: Required. the threshold of the metric that triggers the + scale action. + :type threshold: float + """ + + _validation = { + 'metric_name': {'required': True}, + 'metric_resource_uri': {'required': True}, + 'time_grain': {'required': True}, + 'statistic': {'required': True}, + 'time_window': {'required': True}, + 'time_aggregation': {'required': True}, + 'operator': {'required': True}, + 'threshold': {'required': True}, + } + + _attribute_map = { + 'metric_name': {'key': 'metricName', 'type': 'str'}, + 'metric_resource_uri': {'key': 'metricResourceUri', 'type': 'str'}, + 'time_grain': {'key': 'timeGrain', 'type': 'duration'}, + 'statistic': {'key': 'statistic', 'type': 'MetricStatisticType'}, + 'time_window': {'key': 'timeWindow', 'type': 'duration'}, + 'time_aggregation': {'key': 'timeAggregation', 'type': 'TimeAggregationType'}, + 'operator': {'key': 'operator', 'type': 'ComparisonOperationType'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(MetricTrigger, self).__init__(**kwargs) + self.metric_name = kwargs.get('metric_name', None) + self.metric_resource_uri = kwargs.get('metric_resource_uri', None) + self.time_grain = kwargs.get('time_grain', None) + self.statistic = kwargs.get('statistic', None) + self.time_window = kwargs.get('time_window', None) + self.time_aggregation = kwargs.get('time_aggregation', None) + self.operator = kwargs.get('operator', None) + self.threshold = kwargs.get('threshold', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_trigger_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_trigger_py3.py new file mode 100644 index 000000000000..f4fe3daf85d7 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_trigger_py3.py @@ -0,0 +1,85 @@ +# 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 + + +class MetricTrigger(Model): + """The trigger that results in a scaling action. + + All required parameters must be populated in order to send to Azure. + + :param metric_name: Required. the name of the metric that defines what the + rule monitors. + :type metric_name: str + :param metric_resource_uri: Required. the resource identifier of the + resource the rule monitors. + :type metric_resource_uri: str + :param time_grain: Required. the granularity of metrics the rule monitors. + Must be one of the predefined values returned from metric definitions for + the metric. Must be between 12 hours and 1 minute. + :type time_grain: timedelta + :param statistic: Required. the metric statistic type. How the metrics + from multiple instances are combined. Possible values include: 'Average', + 'Min', 'Max', 'Sum' + :type statistic: str or ~azure.mgmt.monitor.models.MetricStatisticType + :param time_window: Required. the range of time in which instance data is + collected. This value must be greater than the delay in metric collection, + which can vary from resource-to-resource. Must be between 12 hours and 5 + minutes. + :type time_window: timedelta + :param time_aggregation: Required. time aggregation type. How the data + that is collected should be combined over time. The default value is + Average. Possible values include: 'Average', 'Minimum', 'Maximum', + 'Total', 'Count', 'Last' + :type time_aggregation: str or + ~azure.mgmt.monitor.models.TimeAggregationType + :param operator: Required. the operator that is used to compare the metric + data and the threshold. Possible values include: 'Equals', 'NotEquals', + 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' + :type operator: str or ~azure.mgmt.monitor.models.ComparisonOperationType + :param threshold: Required. the threshold of the metric that triggers the + scale action. + :type threshold: float + """ + + _validation = { + 'metric_name': {'required': True}, + 'metric_resource_uri': {'required': True}, + 'time_grain': {'required': True}, + 'statistic': {'required': True}, + 'time_window': {'required': True}, + 'time_aggregation': {'required': True}, + 'operator': {'required': True}, + 'threshold': {'required': True}, + } + + _attribute_map = { + 'metric_name': {'key': 'metricName', 'type': 'str'}, + 'metric_resource_uri': {'key': 'metricResourceUri', 'type': 'str'}, + 'time_grain': {'key': 'timeGrain', 'type': 'duration'}, + 'statistic': {'key': 'statistic', 'type': 'MetricStatisticType'}, + 'time_window': {'key': 'timeWindow', 'type': 'duration'}, + 'time_aggregation': {'key': 'timeAggregation', 'type': 'TimeAggregationType'}, + 'operator': {'key': 'operator', 'type': 'ComparisonOperationType'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + } + + def __init__(self, *, metric_name: str, metric_resource_uri: str, time_grain, statistic, time_window, time_aggregation, operator, threshold: float, **kwargs) -> None: + super(MetricTrigger, self).__init__(**kwargs) + self.metric_name = metric_name + self.metric_resource_uri = metric_resource_uri + self.time_grain = time_grain + self.statistic = statistic + self.time_window = time_window + self.time_aggregation = time_aggregation + self.operator = operator + self.threshold = threshold diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_value.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_value.py new file mode 100644 index 000000000000..80af772b92be --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_value.py @@ -0,0 +1,56 @@ +# 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 + + +class MetricValue(Model): + """Represents a metric value. + + All required parameters must be populated in order to send to Azure. + + :param time_stamp: Required. the timestamp for the metric value in ISO + 8601 format. + :type time_stamp: datetime + :param average: the average value in the time range. + :type average: float + :param minimum: the least value in the time range. + :type minimum: float + :param maximum: the greatest value in the time range. + :type maximum: float + :param total: the sum of all of the values in the time range. + :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 + """ + + _validation = { + 'time_stamp': {'required': True}, + } + + _attribute_map = { + 'time_stamp': {'key': 'timeStamp', 'type': 'iso-8601'}, + 'average': {'key': 'average', 'type': 'float'}, + 'minimum': {'key': 'minimum', 'type': 'float'}, + 'maximum': {'key': 'maximum', 'type': 'float'}, + 'total': {'key': 'total', 'type': 'float'}, + 'count': {'key': 'count', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(MetricValue, self).__init__(**kwargs) + self.time_stamp = kwargs.get('time_stamp', None) + self.average = kwargs.get('average', None) + self.minimum = kwargs.get('minimum', None) + self.maximum = kwargs.get('maximum', None) + self.total = kwargs.get('total', None) + self.count = kwargs.get('count', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_value_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_value_py3.py new file mode 100644 index 000000000000..c6c65186df25 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_value_py3.py @@ -0,0 +1,56 @@ +# 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 + + +class MetricValue(Model): + """Represents a metric value. + + All required parameters must be populated in order to send to Azure. + + :param time_stamp: Required. the timestamp for the metric value in ISO + 8601 format. + :type time_stamp: datetime + :param average: the average value in the time range. + :type average: float + :param minimum: the least value in the time range. + :type minimum: float + :param maximum: the greatest value in the time range. + :type maximum: float + :param total: the sum of all of the values in the time range. + :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 + """ + + _validation = { + 'time_stamp': {'required': True}, + } + + _attribute_map = { + 'time_stamp': {'key': 'timeStamp', 'type': 'iso-8601'}, + 'average': {'key': 'average', 'type': 'float'}, + 'minimum': {'key': 'minimum', 'type': 'float'}, + 'maximum': {'key': 'maximum', 'type': 'float'}, + 'total': {'key': 'total', 'type': 'float'}, + 'count': {'key': 'count', 'type': 'long'}, + } + + def __init__(self, *, time_stamp, average: float=None, minimum: float=None, maximum: float=None, total: float=None, count: int=None, **kwargs) -> None: + super(MetricValue, self).__init__(**kwargs) + self.time_stamp = time_stamp + self.average = average + self.minimum = minimum + self.maximum = maximum + self.total = total + self.count = count diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/monitor_management_client_enums.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/monitor_management_client_enums.py new file mode 100644 index 000000000000..a217cf604e42 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/monitor_management_client_enums.py @@ -0,0 +1,202 @@ +# 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 enum import Enum + + +class MetricStatisticType(str, Enum): + + average = "Average" + min = "Min" + max = "Max" + sum = "Sum" + + +class TimeAggregationType(str, Enum): + + average = "Average" + minimum = "Minimum" + maximum = "Maximum" + total = "Total" + count = "Count" + last = "Last" + + +class ComparisonOperationType(str, Enum): + + equals = "Equals" + not_equals = "NotEquals" + greater_than = "GreaterThan" + greater_than_or_equal = "GreaterThanOrEqual" + less_than = "LessThan" + less_than_or_equal = "LessThanOrEqual" + + +class ScaleDirection(str, Enum): + + none = "None" + increase = "Increase" + decrease = "Decrease" + + +class ScaleType(str, Enum): + + change_count = "ChangeCount" + percent_change_count = "PercentChangeCount" + exact_count = "ExactCount" + + +class RecurrenceFrequency(str, Enum): + + none = "None" + second = "Second" + minute = "Minute" + hour = "Hour" + day = "Day" + week = "Week" + month = "Month" + year = "Year" + + +class ConditionOperator(str, Enum): + + greater_than = "GreaterThan" + greater_than_or_equal = "GreaterThanOrEqual" + less_than = "LessThan" + less_than_or_equal = "LessThanOrEqual" + + +class TimeAggregationOperator(str, Enum): + + average = "Average" + minimum = "Minimum" + maximum = "Maximum" + total = "Total" + last = "Last" + + +class CategoryType(str, Enum): + + metrics = "Metrics" + logs = "Logs" + + +class ReceiverStatus(str, Enum): + + not_specified = "NotSpecified" + enabled = "Enabled" + disabled = "Disabled" + + +class EventLevel(str, Enum): + + critical = "Critical" + error = "Error" + warning = "Warning" + informational = "Informational" + verbose = "Verbose" + + +class Unit(str, Enum): + + count = "Count" + bytes = "Bytes" + seconds = "Seconds" + count_per_second = "CountPerSecond" + bytes_per_second = "BytesPerSecond" + percent = "Percent" + milli_seconds = "MilliSeconds" + byte_seconds = "ByteSeconds" + unspecified = "Unspecified" + + +class AggregationType(str, Enum): + + none = "None" + average = "Average" + count = "Count" + minimum = "Minimum" + maximum = "Maximum" + total = "Total" + + +class Sensitivity(str, Enum): + + low = "Low" + medium = "Medium" + high = "High" + + +class BaselineSensitivity(str, Enum): + + low = "Low" + medium = "Medium" + high = "High" + + +class Enabled(str, Enum): + + true = "true" + false = "false" + + +class ProvisioningState(str, Enum): + + succeeded = "Succeeded" + deploying = "Deploying" + canceled = "Canceled" + failed = "Failed" + + +class QueryType(str, Enum): + + result_count = "ResultCount" + + +class ConditionalOperator(str, Enum): + + greater_than = "GreaterThan" + less_than = "LessThan" + equal = "Equal" + + +class MetricTriggerType(str, Enum): + + consecutive = "Consecutive" + total = "Total" + + +class AlertSeverity(str, Enum): + + zero = "0" + one = "1" + two = "2" + three = "3" + four = "4" + + +class OnboardingStatus(str, Enum): + + onboarded = "onboarded" + not_onboarded = "notOnboarded" + unknown = "unknown" + + +class DataStatus(str, Enum): + + present = "present" + not_present = "notPresent" + + +class ResultType(str, Enum): + + data = "Data" + metadata = "Metadata" diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/multi_metric_criteria.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/multi_metric_criteria.py new file mode 100644 index 000000000000..1547f135843c --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/multi_metric_criteria.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.serialization import Model + + +class MultiMetricCriteria(Model): + """The types of conditions for a multi resource alert. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: MetricCriteria, DynamicMetricCriteria + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param name: Required. Name of the criteria. + :type name: str + :param metric_name: Required. Name of the metric. + :type metric_name: str + :param metric_namespace: Namespace of the metric. + :type metric_namespace: str + :param time_aggregation: Required. the criteria time aggregation types. + :type time_aggregation: object + :param dimensions: List of dimension conditions. + :type dimensions: list[~azure.mgmt.monitor.models.MetricDimension] + :param criterion_type: Required. Constant filled by server. + :type criterion_type: str + """ + + _validation = { + 'name': {'required': True}, + 'metric_name': {'required': True}, + 'time_aggregation': {'required': True}, + 'criterion_type': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'metric_name': {'key': 'metricName', 'type': 'str'}, + 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, + 'time_aggregation': {'key': 'timeAggregation', 'type': 'object'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + 'criterion_type': {'key': 'criterionType', 'type': 'str'}, + } + + _subtype_map = { + 'criterion_type': {'StaticThresholdCriterion': 'MetricCriteria', 'DynamicThresholdCriterion': 'DynamicMetricCriteria'} + } + + def __init__(self, **kwargs): + super(MultiMetricCriteria, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.name = kwargs.get('name', None) + self.metric_name = kwargs.get('metric_name', None) + self.metric_namespace = kwargs.get('metric_namespace', None) + self.time_aggregation = kwargs.get('time_aggregation', None) + self.dimensions = kwargs.get('dimensions', None) + self.criterion_type = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/multi_metric_criteria_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/multi_metric_criteria_py3.py new file mode 100644 index 000000000000..d168ae9c3949 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/multi_metric_criteria_py3.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.serialization import Model + + +class MultiMetricCriteria(Model): + """The types of conditions for a multi resource alert. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: MetricCriteria, DynamicMetricCriteria + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param name: Required. Name of the criteria. + :type name: str + :param metric_name: Required. Name of the metric. + :type metric_name: str + :param metric_namespace: Namespace of the metric. + :type metric_namespace: str + :param time_aggregation: Required. the criteria time aggregation types. + :type time_aggregation: object + :param dimensions: List of dimension conditions. + :type dimensions: list[~azure.mgmt.monitor.models.MetricDimension] + :param criterion_type: Required. Constant filled by server. + :type criterion_type: str + """ + + _validation = { + 'name': {'required': True}, + 'metric_name': {'required': True}, + 'time_aggregation': {'required': True}, + 'criterion_type': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'metric_name': {'key': 'metricName', 'type': 'str'}, + 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, + 'time_aggregation': {'key': 'timeAggregation', 'type': 'object'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + 'criterion_type': {'key': 'criterionType', 'type': 'str'}, + } + + _subtype_map = { + 'criterion_type': {'StaticThresholdCriterion': 'MetricCriteria', 'DynamicThresholdCriterion': 'DynamicMetricCriteria'} + } + + def __init__(self, *, name: str, metric_name: str, time_aggregation, additional_properties=None, metric_namespace: str=None, dimensions=None, **kwargs) -> None: + super(MultiMetricCriteria, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.name = name + self.metric_name = metric_name + self.metric_namespace = metric_namespace + self.time_aggregation = time_aggregation + self.dimensions = dimensions + self.criterion_type = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/operation.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/operation.py new file mode 100644 index 000000000000..0a5d8d878f02 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/operation.py @@ -0,0 +1,32 @@ +# 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 + + +class Operation(Model): + """Microsoft Insights API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.monitor.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_display.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_display.py new file mode 100644 index 000000000000..55dcaf3793ab --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_display.py @@ -0,0 +1,37 @@ +# 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 + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft.Insights + :type provider: str + :param resource: Resource on which the operation is performed: AlertRules, + Autoscale, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_display_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_display_py3.py new file mode 100644 index 000000000000..22b9a326e4a0 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_display_py3.py @@ -0,0 +1,37 @@ +# 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 + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft.Insights + :type provider: str + :param resource: Resource on which the operation is performed: AlertRules, + Autoscale, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_list_result.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_list_result.py new file mode 100644 index 000000000000..6e7d1a8e5bce --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_list_result.py @@ -0,0 +1,35 @@ +# 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 + + +class OperationListResult(Model): + """Result of the request to list Microsoft.Insights operations. It contains a + list of operations and a URL link to get the next set of results. + + :param value: List of operations supported by the Microsoft.Insights + provider. + :type value: list[~azure.mgmt.monitor.models.Operation] + :param next_link: URL to get the next set of operation list results if + there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_list_result_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_list_result_py3.py new file mode 100644 index 000000000000..8221d9c7a75d --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_list_result_py3.py @@ -0,0 +1,35 @@ +# 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 + + +class OperationListResult(Model): + """Result of the request to list Microsoft.Insights operations. It contains a + list of operations and a URL link to get the next set of results. + + :param value: List of operations supported by the Microsoft.Insights + provider. + :type value: list[~azure.mgmt.monitor.models.Operation] + :param next_link: URL to get the next set of operation list results if + there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(OperationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_py3.py new file mode 100644 index 000000000000..918a7f985873 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_py3.py @@ -0,0 +1,32 @@ +# 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 + + +class Operation(Model): + """Microsoft Insights API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.monitor.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/proxy_only_resource.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/proxy_only_resource.py new file mode 100644 index 000000000000..9db3e9cb46e5 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/proxy_only_resource.py @@ -0,0 +1,45 @@ +# 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 + + +class ProxyOnlyResource(Model): + """A proxy only azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: 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'}, + } + + def __init__(self, **kwargs): + super(ProxyOnlyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/proxy_only_resource_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/proxy_only_resource_py3.py new file mode 100644 index 000000000000..4ba894b76537 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/proxy_only_resource_py3.py @@ -0,0 +1,45 @@ +# 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 + + +class ProxyOnlyResource(Model): + """A proxy only azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: 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'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyOnlyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/proxy_resource.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/proxy_resource.py new file mode 100644 index 000000000000..91deff28bac8 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/proxy_resource.py @@ -0,0 +1,45 @@ +# 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 + + +class ProxyResource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: 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'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/proxy_resource_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/proxy_resource_py3.py new file mode 100644 index 000000000000..1ffcbec36014 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/proxy_resource_py3.py @@ -0,0 +1,45 @@ +# 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 + + +class ProxyResource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: 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'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/recurrence.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/recurrence.py new file mode 100644 index 000000000000..02da42a83b77 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/recurrence.py @@ -0,0 +1,47 @@ +# 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 + + +class Recurrence(Model): + """The repeating times at which this profile begins. This element is not used + if the FixedDate element is used. + + All required parameters must be populated in order to send to Azure. + + :param frequency: Required. the recurrence frequency. How often the + schedule profile should take effect. This value must be Week, meaning each + week will have the same set of profiles. For example, to set a daily + schedule, set **schedule** to every day of the week. The frequency + property specifies that the schedule is repeated weekly. Possible values + include: 'None', 'Second', 'Minute', 'Hour', 'Day', 'Week', 'Month', + 'Year' + :type frequency: str or ~azure.mgmt.monitor.models.RecurrenceFrequency + :param schedule: Required. the scheduling constraints for when the profile + begins. + :type schedule: ~azure.mgmt.monitor.models.RecurrentSchedule + """ + + _validation = { + 'frequency': {'required': True}, + 'schedule': {'required': True}, + } + + _attribute_map = { + 'frequency': {'key': 'frequency', 'type': 'RecurrenceFrequency'}, + 'schedule': {'key': 'schedule', 'type': 'RecurrentSchedule'}, + } + + def __init__(self, **kwargs): + super(Recurrence, self).__init__(**kwargs) + self.frequency = kwargs.get('frequency', None) + self.schedule = kwargs.get('schedule', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/recurrence_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/recurrence_py3.py new file mode 100644 index 000000000000..7e6ada9974a0 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/recurrence_py3.py @@ -0,0 +1,47 @@ +# 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 + + +class Recurrence(Model): + """The repeating times at which this profile begins. This element is not used + if the FixedDate element is used. + + All required parameters must be populated in order to send to Azure. + + :param frequency: Required. the recurrence frequency. How often the + schedule profile should take effect. This value must be Week, meaning each + week will have the same set of profiles. For example, to set a daily + schedule, set **schedule** to every day of the week. The frequency + property specifies that the schedule is repeated weekly. Possible values + include: 'None', 'Second', 'Minute', 'Hour', 'Day', 'Week', 'Month', + 'Year' + :type frequency: str or ~azure.mgmt.monitor.models.RecurrenceFrequency + :param schedule: Required. the scheduling constraints for when the profile + begins. + :type schedule: ~azure.mgmt.monitor.models.RecurrentSchedule + """ + + _validation = { + 'frequency': {'required': True}, + 'schedule': {'required': True}, + } + + _attribute_map = { + 'frequency': {'key': 'frequency', 'type': 'RecurrenceFrequency'}, + 'schedule': {'key': 'schedule', 'type': 'RecurrentSchedule'}, + } + + def __init__(self, *, frequency, schedule, **kwargs) -> None: + super(Recurrence, self).__init__(**kwargs) + self.frequency = frequency + self.schedule = schedule diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/recurrent_schedule.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/recurrent_schedule.py new file mode 100644 index 000000000000..e66d518f4f0b --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/recurrent_schedule.py @@ -0,0 +1,90 @@ +# 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 + + +class RecurrentSchedule(Model): + """The scheduling constraints for when the profile begins. + + All required parameters must be populated in order to send to Azure. + + :param time_zone: Required. the timezone for the hours of the profile. + Some examples of valid time zones are: Dateline Standard Time, UTC-11, + Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time + (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain + Standard Time (Mexico), Mountain Standard Time, Central America Standard + Time, Central Standard Time, Central Standard Time (Mexico), Canada + Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US + Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, + Atlantic Standard Time, Central Brazilian Standard Time, SA Western + Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. + South America Standard Time, Argentina Standard Time, SA Eastern Standard + Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard + Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde + Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich + Standard Time, W. Europe Standard Time, Central Europe Standard Time, + Romance Standard Time, Central European Standard Time, W. Central Africa + Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard + Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, + E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, + Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, + Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus + Standard Time, Russian Standard Time, E. Africa Standard Time, Iran + Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia + Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus + Standard Time, Afghanistan Standard Time, West Asia Standard Time, + Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, + Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, + Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard + Time, SE Asia Standard Time, North Asia Standard Time, China Standard + Time, North Asia East Standard Time, Singapore Standard Time, W. Australia + Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo + Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia + Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS + Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, + Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, + Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard + Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard + Time, Samoa Standard Time, Line Islands Standard Time + :type time_zone: str + :param days: Required. the collection of days that the profile takes + effect on. Possible values are Sunday through Saturday. + :type days: list[str] + :param hours: Required. A collection of hours that the profile takes + effect on. Values supported are 0 to 23 on the 24-hour clock (AM/PM times + are not supported). + :type hours: list[int] + :param minutes: Required. A collection of minutes at which the profile + takes effect at. + :type minutes: list[int] + """ + + _validation = { + 'time_zone': {'required': True}, + 'days': {'required': True}, + 'hours': {'required': True}, + 'minutes': {'required': True}, + } + + _attribute_map = { + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + 'days': {'key': 'days', 'type': '[str]'}, + 'hours': {'key': 'hours', 'type': '[int]'}, + 'minutes': {'key': 'minutes', 'type': '[int]'}, + } + + def __init__(self, **kwargs): + super(RecurrentSchedule, self).__init__(**kwargs) + self.time_zone = kwargs.get('time_zone', None) + self.days = kwargs.get('days', None) + self.hours = kwargs.get('hours', None) + self.minutes = kwargs.get('minutes', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/recurrent_schedule_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/recurrent_schedule_py3.py new file mode 100644 index 000000000000..5bf427ace082 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/recurrent_schedule_py3.py @@ -0,0 +1,90 @@ +# 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 + + +class RecurrentSchedule(Model): + """The scheduling constraints for when the profile begins. + + All required parameters must be populated in order to send to Azure. + + :param time_zone: Required. the timezone for the hours of the profile. + Some examples of valid time zones are: Dateline Standard Time, UTC-11, + Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time + (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain + Standard Time (Mexico), Mountain Standard Time, Central America Standard + Time, Central Standard Time, Central Standard Time (Mexico), Canada + Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US + Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, + Atlantic Standard Time, Central Brazilian Standard Time, SA Western + Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. + South America Standard Time, Argentina Standard Time, SA Eastern Standard + Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard + Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde + Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich + Standard Time, W. Europe Standard Time, Central Europe Standard Time, + Romance Standard Time, Central European Standard Time, W. Central Africa + Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard + Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, + E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, + Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, + Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus + Standard Time, Russian Standard Time, E. Africa Standard Time, Iran + Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia + Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus + Standard Time, Afghanistan Standard Time, West Asia Standard Time, + Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, + Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, + Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard + Time, SE Asia Standard Time, North Asia Standard Time, China Standard + Time, North Asia East Standard Time, Singapore Standard Time, W. Australia + Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo + Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia + Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS + Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, + Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, + Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard + Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard + Time, Samoa Standard Time, Line Islands Standard Time + :type time_zone: str + :param days: Required. the collection of days that the profile takes + effect on. Possible values are Sunday through Saturday. + :type days: list[str] + :param hours: Required. A collection of hours that the profile takes + effect on. Values supported are 0 to 23 on the 24-hour clock (AM/PM times + are not supported). + :type hours: list[int] + :param minutes: Required. A collection of minutes at which the profile + takes effect at. + :type minutes: list[int] + """ + + _validation = { + 'time_zone': {'required': True}, + 'days': {'required': True}, + 'hours': {'required': True}, + 'minutes': {'required': True}, + } + + _attribute_map = { + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + 'days': {'key': 'days', 'type': '[str]'}, + 'hours': {'key': 'hours', 'type': '[int]'}, + 'minutes': {'key': 'minutes', 'type': '[int]'}, + } + + def __init__(self, *, time_zone: str, days, hours, minutes, **kwargs) -> None: + super(RecurrentSchedule, self).__init__(**kwargs) + self.time_zone = time_zone + self.days = days + self.hours = hours + self.minutes = minutes diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/resource.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/resource.py new file mode 100644 index 000000000000..a081f9d31754 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/resource.py @@ -0,0 +1,56 @@ +# 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 + + +class Resource(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(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/resource_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/resource_py3.py new file mode 100644 index 000000000000..8411fb563e05 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/resource_py3.py @@ -0,0 +1,56 @@ +# 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 + + +class Resource(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(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/response.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/response.py new file mode 100644 index 000000000000..ec0ca03508fc --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/response.py @@ -0,0 +1,64 @@ +# 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 + + +class Response(Model): + """The response to a metrics query. + + All required parameters must be populated in order to send to Azure. + + :param cost: The integer value representing the cost of the query, for + data case. + :type cost: float + :param timespan: Required. The timespan for which the data was retrieved. + Its value consists of two datetimes concatenated, separated by '/'. This + may be adjusted in the future and returned back from what was originally + requested. + :type timespan: str + :param interval: The interval (window size) for which the metric data was + returned in. This may be adjusted in the future and returned back from + what was originally requested. This is not present if a metadata request + was made. + :type interval: timedelta + :param namespace: The namespace of the metrics been queried + :type namespace: str + :param resourceregion: The region of the resource been queried for + metrics. + :type resourceregion: str + :param value: Required. the value of the collection. + :type value: list[~azure.mgmt.monitor.models.Metric] + """ + + _validation = { + 'cost': {'minimum': 0}, + 'timespan': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'cost': {'key': 'cost', 'type': 'float'}, + 'timespan': {'key': 'timespan', 'type': 'str'}, + 'interval': {'key': 'interval', 'type': 'duration'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'resourceregion': {'key': 'resourceregion', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Metric]'}, + } + + def __init__(self, **kwargs): + super(Response, self).__init__(**kwargs) + self.cost = kwargs.get('cost', None) + self.timespan = kwargs.get('timespan', None) + self.interval = kwargs.get('interval', None) + self.namespace = kwargs.get('namespace', None) + self.resourceregion = kwargs.get('resourceregion', None) + self.value = kwargs.get('value', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/response_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/response_py3.py new file mode 100644 index 000000000000..4f8130767bd1 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/response_py3.py @@ -0,0 +1,64 @@ +# 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 + + +class Response(Model): + """The response to a metrics query. + + All required parameters must be populated in order to send to Azure. + + :param cost: The integer value representing the cost of the query, for + data case. + :type cost: float + :param timespan: Required. The timespan for which the data was retrieved. + Its value consists of two datetimes concatenated, separated by '/'. This + may be adjusted in the future and returned back from what was originally + requested. + :type timespan: str + :param interval: The interval (window size) for which the metric data was + returned in. This may be adjusted in the future and returned back from + what was originally requested. This is not present if a metadata request + was made. + :type interval: timedelta + :param namespace: The namespace of the metrics been queried + :type namespace: str + :param resourceregion: The region of the resource been queried for + metrics. + :type resourceregion: str + :param value: Required. the value of the collection. + :type value: list[~azure.mgmt.monitor.models.Metric] + """ + + _validation = { + 'cost': {'minimum': 0}, + 'timespan': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'cost': {'key': 'cost', 'type': 'float'}, + 'timespan': {'key': 'timespan', 'type': 'str'}, + 'interval': {'key': 'interval', 'type': 'duration'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'resourceregion': {'key': 'resourceregion', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Metric]'}, + } + + def __init__(self, *, timespan: str, value, cost: float=None, interval=None, namespace: str=None, resourceregion: str=None, **kwargs) -> None: + super(Response, self).__init__(**kwargs) + self.cost = cost + self.timespan = timespan + self.interval = interval + self.namespace = namespace + self.resourceregion = resourceregion + self.value = value diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/response_with_error.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/response_with_error.py new file mode 100644 index 000000000000..08c684bef0cf --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/response_with_error.py @@ -0,0 +1,47 @@ +# 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 ResponseWithError(Model): + """An error response from the API. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. Error information. + :type error: ~azure.mgmt.monitor.models.Error + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, **kwargs): + super(ResponseWithError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ResponseWithErrorException(HttpOperationError): + """Server responsed with exception of type: 'ResponseWithError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ResponseWithErrorException, self).__init__(deserialize, response, 'ResponseWithError', *args) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/response_with_error_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/response_with_error_py3.py new file mode 100644 index 000000000000..c3a89226d2fb --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/response_with_error_py3.py @@ -0,0 +1,47 @@ +# 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 ResponseWithError(Model): + """An error response from the API. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. Error information. + :type error: ~azure.mgmt.monitor.models.Error + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, *, error, **kwargs) -> None: + super(ResponseWithError, self).__init__(**kwargs) + self.error = error + + +class ResponseWithErrorException(HttpOperationError): + """Server responsed with exception of type: 'ResponseWithError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ResponseWithErrorException, self).__init__(deserialize, response, 'ResponseWithError', *args) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/retention_policy.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/retention_policy.py new file mode 100644 index 000000000000..cca287401ccd --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/retention_policy.py @@ -0,0 +1,41 @@ +# 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 + + +class RetentionPolicy(Model): + """Specifies the retention policy for the log. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. a value indicating whether the retention policy + is enabled. + :type enabled: bool + :param days: Required. the number of days for the retention in days. A + value of 0 will retain the events indefinitely. + :type days: int + """ + + _validation = { + 'enabled': {'required': True}, + 'days': {'required': True, 'minimum': 0}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(RetentionPolicy, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.days = kwargs.get('days', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/retention_policy_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/retention_policy_py3.py new file mode 100644 index 000000000000..ffc9a5fbaab0 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/retention_policy_py3.py @@ -0,0 +1,41 @@ +# 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 + + +class RetentionPolicy(Model): + """Specifies the retention policy for the log. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. a value indicating whether the retention policy + is enabled. + :type enabled: bool + :param days: Required. the number of days for the retention in days. A + value of 0 will retain the events indefinitely. + :type days: int + """ + + _validation = { + 'enabled': {'required': True}, + 'days': {'required': True, 'minimum': 0}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + } + + def __init__(self, *, enabled: bool, days: int, **kwargs) -> None: + super(RetentionPolicy, self).__init__(**kwargs) + self.enabled = enabled + self.days = days diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_action.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_action.py new file mode 100644 index 000000000000..3fbc729ef113 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_action.py @@ -0,0 +1,42 @@ +# 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 + + +class RuleAction(Model): + """The action that is performed when the alert rule becomes active, and when + an alert condition is resolved. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: RuleEmailAction, RuleWebhookAction + + All required parameters must be populated in order to send to Azure. + + :param odatatype: Required. Constant filled by server. + :type odatatype: str + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + } + + _subtype_map = { + 'odatatype': {'Microsoft.Azure.Management.Insights.Models.RuleEmailAction': 'RuleEmailAction', 'Microsoft.Azure.Management.Insights.Models.RuleWebhookAction': 'RuleWebhookAction'} + } + + def __init__(self, **kwargs): + super(RuleAction, self).__init__(**kwargs) + self.odatatype = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_action_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_action_py3.py new file mode 100644 index 000000000000..32207256e690 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_action_py3.py @@ -0,0 +1,42 @@ +# 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 + + +class RuleAction(Model): + """The action that is performed when the alert rule becomes active, and when + an alert condition is resolved. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: RuleEmailAction, RuleWebhookAction + + All required parameters must be populated in order to send to Azure. + + :param odatatype: Required. Constant filled by server. + :type odatatype: str + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + } + + _subtype_map = { + 'odatatype': {'Microsoft.Azure.Management.Insights.Models.RuleEmailAction': 'RuleEmailAction', 'Microsoft.Azure.Management.Insights.Models.RuleWebhookAction': 'RuleWebhookAction'} + } + + def __init__(self, **kwargs) -> None: + super(RuleAction, self).__init__(**kwargs) + self.odatatype = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_condition.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_condition.py new file mode 100644 index 000000000000..e6dcfefd8409 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_condition.py @@ -0,0 +1,47 @@ +# 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 + + +class RuleCondition(Model): + """The condition that results in the alert rule being activated. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ThresholdRuleCondition, LocationThresholdRuleCondition, + ManagementEventRuleCondition + + All required parameters must be populated in order to send to Azure. + + :param data_source: the resource from which the rule collects its data. + For this type dataSource will always be of type RuleMetricDataSource. + :type data_source: ~azure.mgmt.monitor.models.RuleDataSource + :param odatatype: Required. Constant filled by server. + :type odatatype: str + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'data_source': {'key': 'dataSource', 'type': 'RuleDataSource'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + } + + _subtype_map = { + 'odatatype': {'Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition': 'ThresholdRuleCondition', 'Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition': 'LocationThresholdRuleCondition', 'Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition': 'ManagementEventRuleCondition'} + } + + def __init__(self, **kwargs): + super(RuleCondition, self).__init__(**kwargs) + self.data_source = kwargs.get('data_source', None) + self.odatatype = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_condition_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_condition_py3.py new file mode 100644 index 000000000000..6e97fff6db18 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_condition_py3.py @@ -0,0 +1,47 @@ +# 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 + + +class RuleCondition(Model): + """The condition that results in the alert rule being activated. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ThresholdRuleCondition, LocationThresholdRuleCondition, + ManagementEventRuleCondition + + All required parameters must be populated in order to send to Azure. + + :param data_source: the resource from which the rule collects its data. + For this type dataSource will always be of type RuleMetricDataSource. + :type data_source: ~azure.mgmt.monitor.models.RuleDataSource + :param odatatype: Required. Constant filled by server. + :type odatatype: str + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'data_source': {'key': 'dataSource', 'type': 'RuleDataSource'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + } + + _subtype_map = { + 'odatatype': {'Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition': 'ThresholdRuleCondition', 'Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition': 'LocationThresholdRuleCondition', 'Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition': 'ManagementEventRuleCondition'} + } + + def __init__(self, *, data_source=None, **kwargs) -> None: + super(RuleCondition, self).__init__(**kwargs) + self.data_source = data_source + self.odatatype = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_data_source.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_data_source.py new file mode 100644 index 000000000000..bd87a54ca8a9 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_data_source.py @@ -0,0 +1,46 @@ +# 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 + + +class RuleDataSource(Model): + """The resource from which the rule collects its data. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: RuleMetricDataSource, RuleManagementEventDataSource + + All required parameters must be populated in order to send to Azure. + + :param resource_uri: the resource identifier of the resource the rule + monitors. **NOTE**: this property cannot be updated for an existing rule. + :type resource_uri: str + :param odatatype: Required. Constant filled by server. + :type odatatype: str + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + } + + _subtype_map = { + 'odatatype': {'Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource': 'RuleMetricDataSource', 'Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource': 'RuleManagementEventDataSource'} + } + + def __init__(self, **kwargs): + super(RuleDataSource, self).__init__(**kwargs) + self.resource_uri = kwargs.get('resource_uri', None) + self.odatatype = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_data_source_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_data_source_py3.py new file mode 100644 index 000000000000..5b5971d7ad4e --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_data_source_py3.py @@ -0,0 +1,46 @@ +# 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 + + +class RuleDataSource(Model): + """The resource from which the rule collects its data. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: RuleMetricDataSource, RuleManagementEventDataSource + + All required parameters must be populated in order to send to Azure. + + :param resource_uri: the resource identifier of the resource the rule + monitors. **NOTE**: this property cannot be updated for an existing rule. + :type resource_uri: str + :param odatatype: Required. Constant filled by server. + :type odatatype: str + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + } + + _subtype_map = { + 'odatatype': {'Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource': 'RuleMetricDataSource', 'Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource': 'RuleManagementEventDataSource'} + } + + def __init__(self, *, resource_uri: str=None, **kwargs) -> None: + super(RuleDataSource, self).__init__(**kwargs) + self.resource_uri = resource_uri + self.odatatype = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_email_action.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_email_action.py new file mode 100644 index 000000000000..d22d3ce52458 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_email_action.py @@ -0,0 +1,46 @@ +# 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 .rule_action import RuleAction + + +class RuleEmailAction(RuleAction): + """Specifies the action to send email when the rule condition is evaluated. + The discriminator is always RuleEmailAction in this case. + + All required parameters must be populated in order to send to Azure. + + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param send_to_service_owners: Whether the administrators (service and + co-administrators) of the service should be notified when the alert is + activated. + :type send_to_service_owners: bool + :param custom_emails: the list of administrator's custom email addresses + to notify of the activation of the alert. + :type custom_emails: list[str] + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'send_to_service_owners': {'key': 'sendToServiceOwners', 'type': 'bool'}, + 'custom_emails': {'key': 'customEmails', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(RuleEmailAction, self).__init__(**kwargs) + self.send_to_service_owners = kwargs.get('send_to_service_owners', None) + self.custom_emails = kwargs.get('custom_emails', None) + self.odatatype = 'Microsoft.Azure.Management.Insights.Models.RuleEmailAction' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_email_action_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_email_action_py3.py new file mode 100644 index 000000000000..4c871a13da37 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_email_action_py3.py @@ -0,0 +1,46 @@ +# 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 .rule_action_py3 import RuleAction + + +class RuleEmailAction(RuleAction): + """Specifies the action to send email when the rule condition is evaluated. + The discriminator is always RuleEmailAction in this case. + + All required parameters must be populated in order to send to Azure. + + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param send_to_service_owners: Whether the administrators (service and + co-administrators) of the service should be notified when the alert is + activated. + :type send_to_service_owners: bool + :param custom_emails: the list of administrator's custom email addresses + to notify of the activation of the alert. + :type custom_emails: list[str] + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'send_to_service_owners': {'key': 'sendToServiceOwners', 'type': 'bool'}, + 'custom_emails': {'key': 'customEmails', 'type': '[str]'}, + } + + def __init__(self, *, send_to_service_owners: bool=None, custom_emails=None, **kwargs) -> None: + super(RuleEmailAction, self).__init__(**kwargs) + self.send_to_service_owners = send_to_service_owners + self.custom_emails = custom_emails + self.odatatype = 'Microsoft.Azure.Management.Insights.Models.RuleEmailAction' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_management_event_claims_data_source.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_management_event_claims_data_source.py new file mode 100644 index 000000000000..1f31cdbcc3a7 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_management_event_claims_data_source.py @@ -0,0 +1,28 @@ +# 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 + + +class RuleManagementEventClaimsDataSource(Model): + """The claims for a rule management event data source. + + :param email_address: the email address. + :type email_address: str + """ + + _attribute_map = { + 'email_address': {'key': 'emailAddress', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RuleManagementEventClaimsDataSource, self).__init__(**kwargs) + self.email_address = kwargs.get('email_address', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_management_event_claims_data_source_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_management_event_claims_data_source_py3.py new file mode 100644 index 000000000000..86f5d6e66e68 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_management_event_claims_data_source_py3.py @@ -0,0 +1,28 @@ +# 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 + + +class RuleManagementEventClaimsDataSource(Model): + """The claims for a rule management event data source. + + :param email_address: the email address. + :type email_address: str + """ + + _attribute_map = { + 'email_address': {'key': 'emailAddress', 'type': 'str'}, + } + + def __init__(self, *, email_address: str=None, **kwargs) -> None: + super(RuleManagementEventClaimsDataSource, self).__init__(**kwargs) + self.email_address = email_address diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_management_event_data_source.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_management_event_data_source.py new file mode 100644 index 000000000000..01afeb1b0784 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_management_event_data_source.py @@ -0,0 +1,78 @@ +# 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 .rule_data_source import RuleDataSource + + +class RuleManagementEventDataSource(RuleDataSource): + """A rule management event data source. The discriminator fields is always + RuleManagementEventDataSource in this case. + + All required parameters must be populated in order to send to Azure. + + :param resource_uri: the resource identifier of the resource the rule + monitors. **NOTE**: this property cannot be updated for an existing rule. + :type resource_uri: str + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param event_name: the event name. + :type event_name: str + :param event_source: the event source. + :type event_source: str + :param level: the level. + :type level: str + :param operation_name: The name of the operation that should be checked + for. If no name is provided, any operation will match. + :type operation_name: str + :param resource_group_name: the resource group name. + :type resource_group_name: str + :param resource_provider_name: the resource provider name. + :type resource_provider_name: str + :param status: The status of the operation that should be checked for. If + no status is provided, any status will match. + :type status: str + :param sub_status: the substatus. + :type sub_status: str + :param claims: the claims. + :type claims: + ~azure.mgmt.monitor.models.RuleManagementEventClaimsDataSource + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'event_name': {'key': 'eventName', 'type': 'str'}, + 'event_source': {'key': 'eventSource', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'operation_name': {'key': 'operationName', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'resource_provider_name': {'key': 'resourceProviderName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'sub_status': {'key': 'subStatus', 'type': 'str'}, + 'claims': {'key': 'claims', 'type': 'RuleManagementEventClaimsDataSource'}, + } + + def __init__(self, **kwargs): + super(RuleManagementEventDataSource, self).__init__(**kwargs) + self.event_name = kwargs.get('event_name', None) + self.event_source = kwargs.get('event_source', None) + self.level = kwargs.get('level', None) + self.operation_name = kwargs.get('operation_name', None) + self.resource_group_name = kwargs.get('resource_group_name', None) + self.resource_provider_name = kwargs.get('resource_provider_name', None) + self.status = kwargs.get('status', None) + self.sub_status = kwargs.get('sub_status', None) + self.claims = kwargs.get('claims', None) + self.odatatype = 'Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_management_event_data_source_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_management_event_data_source_py3.py new file mode 100644 index 000000000000..83398e8909b4 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_management_event_data_source_py3.py @@ -0,0 +1,78 @@ +# 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 .rule_data_source_py3 import RuleDataSource + + +class RuleManagementEventDataSource(RuleDataSource): + """A rule management event data source. The discriminator fields is always + RuleManagementEventDataSource in this case. + + All required parameters must be populated in order to send to Azure. + + :param resource_uri: the resource identifier of the resource the rule + monitors. **NOTE**: this property cannot be updated for an existing rule. + :type resource_uri: str + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param event_name: the event name. + :type event_name: str + :param event_source: the event source. + :type event_source: str + :param level: the level. + :type level: str + :param operation_name: The name of the operation that should be checked + for. If no name is provided, any operation will match. + :type operation_name: str + :param resource_group_name: the resource group name. + :type resource_group_name: str + :param resource_provider_name: the resource provider name. + :type resource_provider_name: str + :param status: The status of the operation that should be checked for. If + no status is provided, any status will match. + :type status: str + :param sub_status: the substatus. + :type sub_status: str + :param claims: the claims. + :type claims: + ~azure.mgmt.monitor.models.RuleManagementEventClaimsDataSource + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'event_name': {'key': 'eventName', 'type': 'str'}, + 'event_source': {'key': 'eventSource', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'operation_name': {'key': 'operationName', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'resource_provider_name': {'key': 'resourceProviderName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'sub_status': {'key': 'subStatus', 'type': 'str'}, + 'claims': {'key': 'claims', 'type': 'RuleManagementEventClaimsDataSource'}, + } + + def __init__(self, *, resource_uri: str=None, event_name: str=None, event_source: str=None, level: str=None, operation_name: str=None, resource_group_name: str=None, resource_provider_name: str=None, status: str=None, sub_status: str=None, claims=None, **kwargs) -> None: + super(RuleManagementEventDataSource, self).__init__(resource_uri=resource_uri, **kwargs) + self.event_name = event_name + self.event_source = event_source + self.level = level + self.operation_name = operation_name + self.resource_group_name = resource_group_name + self.resource_provider_name = resource_provider_name + self.status = status + self.sub_status = sub_status + self.claims = claims + self.odatatype = 'Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_metric_data_source.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_metric_data_source.py new file mode 100644 index 000000000000..472762df29c4 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_metric_data_source.py @@ -0,0 +1,44 @@ +# 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 .rule_data_source import RuleDataSource + + +class RuleMetricDataSource(RuleDataSource): + """A rule metric data source. The discriminator value is always + RuleMetricDataSource in this case. + + All required parameters must be populated in order to send to Azure. + + :param resource_uri: the resource identifier of the resource the rule + monitors. **NOTE**: this property cannot be updated for an existing rule. + :type resource_uri: str + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param metric_name: the name of the metric that defines what the rule + monitors. + :type metric_name: str + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'metric_name': {'key': 'metricName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RuleMetricDataSource, self).__init__(**kwargs) + self.metric_name = kwargs.get('metric_name', None) + self.odatatype = 'Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_metric_data_source_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_metric_data_source_py3.py new file mode 100644 index 000000000000..ad28d6387bb5 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_metric_data_source_py3.py @@ -0,0 +1,44 @@ +# 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 .rule_data_source_py3 import RuleDataSource + + +class RuleMetricDataSource(RuleDataSource): + """A rule metric data source. The discriminator value is always + RuleMetricDataSource in this case. + + All required parameters must be populated in order to send to Azure. + + :param resource_uri: the resource identifier of the resource the rule + monitors. **NOTE**: this property cannot be updated for an existing rule. + :type resource_uri: str + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param metric_name: the name of the metric that defines what the rule + monitors. + :type metric_name: str + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'metric_name': {'key': 'metricName', 'type': 'str'}, + } + + def __init__(self, *, resource_uri: str=None, metric_name: str=None, **kwargs) -> None: + super(RuleMetricDataSource, self).__init__(resource_uri=resource_uri, **kwargs) + self.metric_name = metric_name + self.odatatype = 'Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_webhook_action.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_webhook_action.py new file mode 100644 index 000000000000..88a3ef2004c6 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_webhook_action.py @@ -0,0 +1,45 @@ +# 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 .rule_action import RuleAction + + +class RuleWebhookAction(RuleAction): + """Specifies the action to post to service when the rule condition is + evaluated. The discriminator is always RuleWebhookAction in this case. + + All required parameters must be populated in order to send to Azure. + + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param service_uri: the service uri to Post the notification when the + alert activates or resolves. + :type service_uri: str + :param properties: the dictionary of custom properties to include with the + post operation. These data are appended to the webhook payload. + :type properties: dict[str, str] + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'service_uri': {'key': 'serviceUri', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(RuleWebhookAction, self).__init__(**kwargs) + self.service_uri = kwargs.get('service_uri', None) + self.properties = kwargs.get('properties', None) + self.odatatype = 'Microsoft.Azure.Management.Insights.Models.RuleWebhookAction' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_webhook_action_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_webhook_action_py3.py new file mode 100644 index 000000000000..4f0803555d93 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_webhook_action_py3.py @@ -0,0 +1,45 @@ +# 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 .rule_action_py3 import RuleAction + + +class RuleWebhookAction(RuleAction): + """Specifies the action to post to service when the rule condition is + evaluated. The discriminator is always RuleWebhookAction in this case. + + All required parameters must be populated in order to send to Azure. + + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param service_uri: the service uri to Post the notification when the + alert activates or resolves. + :type service_uri: str + :param properties: the dictionary of custom properties to include with the + post operation. These data are appended to the webhook payload. + :type properties: dict[str, str] + """ + + _validation = { + 'odatatype': {'required': True}, + } + + _attribute_map = { + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'service_uri': {'key': 'serviceUri', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__(self, *, service_uri: str=None, properties=None, **kwargs) -> None: + super(RuleWebhookAction, self).__init__(**kwargs) + self.service_uri = service_uri + self.properties = properties + self.odatatype = 'Microsoft.Azure.Management.Insights.Models.RuleWebhookAction' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_action.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_action.py new file mode 100644 index 000000000000..353e37d1ead5 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_action.py @@ -0,0 +1,56 @@ +# 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 + + +class ScaleAction(Model): + """The parameters for the scaling action. + + All required parameters must be populated in order to send to Azure. + + :param direction: Required. the scale direction. Whether the scaling + action increases or decreases the number of instances. Possible values + include: 'None', 'Increase', 'Decrease' + :type direction: str or ~azure.mgmt.monitor.models.ScaleDirection + :param type: Required. the type of action that should occur when the scale + rule fires. Possible values include: 'ChangeCount', 'PercentChangeCount', + 'ExactCount' + :type type: str or ~azure.mgmt.monitor.models.ScaleType + :param value: the number of instances that are involved in the scaling + action. This value must be 1 or greater. The default value is 1. Default + value: "1" . + :type value: str + :param cooldown: Required. the amount of time to wait since the last + scaling action before this action occurs. It must be between 1 week and 1 + minute in ISO 8601 format. + :type cooldown: timedelta + """ + + _validation = { + 'direction': {'required': True}, + 'type': {'required': True}, + 'cooldown': {'required': True}, + } + + _attribute_map = { + 'direction': {'key': 'direction', 'type': 'ScaleDirection'}, + 'type': {'key': 'type', 'type': 'ScaleType'}, + 'value': {'key': 'value', 'type': 'str'}, + 'cooldown': {'key': 'cooldown', 'type': 'duration'}, + } + + def __init__(self, **kwargs): + super(ScaleAction, self).__init__(**kwargs) + self.direction = kwargs.get('direction', None) + self.type = kwargs.get('type', None) + self.value = kwargs.get('value', "1") + self.cooldown = kwargs.get('cooldown', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_action_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_action_py3.py new file mode 100644 index 000000000000..0e1d4639879e --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_action_py3.py @@ -0,0 +1,56 @@ +# 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 + + +class ScaleAction(Model): + """The parameters for the scaling action. + + All required parameters must be populated in order to send to Azure. + + :param direction: Required. the scale direction. Whether the scaling + action increases or decreases the number of instances. Possible values + include: 'None', 'Increase', 'Decrease' + :type direction: str or ~azure.mgmt.monitor.models.ScaleDirection + :param type: Required. the type of action that should occur when the scale + rule fires. Possible values include: 'ChangeCount', 'PercentChangeCount', + 'ExactCount' + :type type: str or ~azure.mgmt.monitor.models.ScaleType + :param value: the number of instances that are involved in the scaling + action. This value must be 1 or greater. The default value is 1. Default + value: "1" . + :type value: str + :param cooldown: Required. the amount of time to wait since the last + scaling action before this action occurs. It must be between 1 week and 1 + minute in ISO 8601 format. + :type cooldown: timedelta + """ + + _validation = { + 'direction': {'required': True}, + 'type': {'required': True}, + 'cooldown': {'required': True}, + } + + _attribute_map = { + 'direction': {'key': 'direction', 'type': 'ScaleDirection'}, + 'type': {'key': 'type', 'type': 'ScaleType'}, + 'value': {'key': 'value', 'type': 'str'}, + 'cooldown': {'key': 'cooldown', 'type': 'duration'}, + } + + def __init__(self, *, direction, type, cooldown, value: str="1", **kwargs) -> None: + super(ScaleAction, self).__init__(**kwargs) + self.direction = direction + self.type = type + self.value = value + self.cooldown = cooldown diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_capacity.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_capacity.py new file mode 100644 index 000000000000..3e3e0a228333 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_capacity.py @@ -0,0 +1,49 @@ +# 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 + + +class ScaleCapacity(Model): + """The number of instances that can be used during this profile. + + All required parameters must be populated in order to send to Azure. + + :param minimum: Required. the minimum number of instances for the + resource. + :type minimum: str + :param maximum: Required. the maximum number of instances for the + resource. The actual maximum number of instances is limited by the cores + that are available in the subscription. + :type maximum: str + :param default: Required. the number of instances that will be set if + metrics are not available for evaluation. The default is only used if the + current instance count is lower than the default. + :type default: str + """ + + _validation = { + 'minimum': {'required': True}, + 'maximum': {'required': True}, + 'default': {'required': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'str'}, + 'maximum': {'key': 'maximum', 'type': 'str'}, + 'default': {'key': 'default', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ScaleCapacity, self).__init__(**kwargs) + self.minimum = kwargs.get('minimum', None) + self.maximum = kwargs.get('maximum', None) + self.default = kwargs.get('default', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_capacity_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_capacity_py3.py new file mode 100644 index 000000000000..c69b76c8a4d3 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_capacity_py3.py @@ -0,0 +1,49 @@ +# 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 + + +class ScaleCapacity(Model): + """The number of instances that can be used during this profile. + + All required parameters must be populated in order to send to Azure. + + :param minimum: Required. the minimum number of instances for the + resource. + :type minimum: str + :param maximum: Required. the maximum number of instances for the + resource. The actual maximum number of instances is limited by the cores + that are available in the subscription. + :type maximum: str + :param default: Required. the number of instances that will be set if + metrics are not available for evaluation. The default is only used if the + current instance count is lower than the default. + :type default: str + """ + + _validation = { + 'minimum': {'required': True}, + 'maximum': {'required': True}, + 'default': {'required': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'str'}, + 'maximum': {'key': 'maximum', 'type': 'str'}, + 'default': {'key': 'default', 'type': 'str'}, + } + + def __init__(self, *, minimum: str, maximum: str, default: str, **kwargs) -> None: + super(ScaleCapacity, self).__init__(**kwargs) + self.minimum = minimum + self.maximum = maximum + self.default = default diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_rule.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_rule.py new file mode 100644 index 000000000000..ef2cc94480d2 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_rule.py @@ -0,0 +1,40 @@ +# 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 + + +class ScaleRule(Model): + """A rule that provide the triggers and parameters for the scaling action. + + All required parameters must be populated in order to send to Azure. + + :param metric_trigger: Required. the trigger that results in a scaling + action. + :type metric_trigger: ~azure.mgmt.monitor.models.MetricTrigger + :param scale_action: Required. the parameters for the scaling action. + :type scale_action: ~azure.mgmt.monitor.models.ScaleAction + """ + + _validation = { + 'metric_trigger': {'required': True}, + 'scale_action': {'required': True}, + } + + _attribute_map = { + 'metric_trigger': {'key': 'metricTrigger', 'type': 'MetricTrigger'}, + 'scale_action': {'key': 'scaleAction', 'type': 'ScaleAction'}, + } + + def __init__(self, **kwargs): + super(ScaleRule, self).__init__(**kwargs) + self.metric_trigger = kwargs.get('metric_trigger', None) + self.scale_action = kwargs.get('scale_action', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_rule_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_rule_py3.py new file mode 100644 index 000000000000..2fe2640f9f4d --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_rule_py3.py @@ -0,0 +1,40 @@ +# 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 + + +class ScaleRule(Model): + """A rule that provide the triggers and parameters for the scaling action. + + All required parameters must be populated in order to send to Azure. + + :param metric_trigger: Required. the trigger that results in a scaling + action. + :type metric_trigger: ~azure.mgmt.monitor.models.MetricTrigger + :param scale_action: Required. the parameters for the scaling action. + :type scale_action: ~azure.mgmt.monitor.models.ScaleAction + """ + + _validation = { + 'metric_trigger': {'required': True}, + 'scale_action': {'required': True}, + } + + _attribute_map = { + 'metric_trigger': {'key': 'metricTrigger', 'type': 'MetricTrigger'}, + 'scale_action': {'key': 'scaleAction', 'type': 'ScaleAction'}, + } + + def __init__(self, *, metric_trigger, scale_action, **kwargs) -> None: + super(ScaleRule, self).__init__(**kwargs) + self.metric_trigger = metric_trigger + self.scale_action = scale_action diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/schedule.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/schedule.py new file mode 100644 index 000000000000..1ddff6b7910d --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/schedule.py @@ -0,0 +1,42 @@ +# 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 + + +class Schedule(Model): + """Defines how often to run the search and the time interval. + + All required parameters must be populated in order to send to Azure. + + :param frequency_in_minutes: Required. frequency (in minutes) at which + rule condition should be evaluated. + :type frequency_in_minutes: int + :param time_window_in_minutes: Required. Time window for which data needs + to be fetched for query (should be greater than or equal to + frequencyInMinutes). + :type time_window_in_minutes: int + """ + + _validation = { + 'frequency_in_minutes': {'required': True}, + 'time_window_in_minutes': {'required': True}, + } + + _attribute_map = { + 'frequency_in_minutes': {'key': 'frequencyInMinutes', 'type': 'int'}, + 'time_window_in_minutes': {'key': 'timeWindowInMinutes', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Schedule, self).__init__(**kwargs) + self.frequency_in_minutes = kwargs.get('frequency_in_minutes', None) + self.time_window_in_minutes = kwargs.get('time_window_in_minutes', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/schedule_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/schedule_py3.py new file mode 100644 index 000000000000..a1f87d04605a --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/schedule_py3.py @@ -0,0 +1,42 @@ +# 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 + + +class Schedule(Model): + """Defines how often to run the search and the time interval. + + All required parameters must be populated in order to send to Azure. + + :param frequency_in_minutes: Required. frequency (in minutes) at which + rule condition should be evaluated. + :type frequency_in_minutes: int + :param time_window_in_minutes: Required. Time window for which data needs + to be fetched for query (should be greater than or equal to + frequencyInMinutes). + :type time_window_in_minutes: int + """ + + _validation = { + 'frequency_in_minutes': {'required': True}, + 'time_window_in_minutes': {'required': True}, + } + + _attribute_map = { + 'frequency_in_minutes': {'key': 'frequencyInMinutes', 'type': 'int'}, + 'time_window_in_minutes': {'key': 'timeWindowInMinutes', 'type': 'int'}, + } + + def __init__(self, *, frequency_in_minutes: int, time_window_in_minutes: int, **kwargs) -> None: + super(Schedule, self).__init__(**kwargs) + self.frequency_in_minutes = frequency_in_minutes + self.time_window_in_minutes = time_window_in_minutes diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/sender_authorization.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/sender_authorization.py new file mode 100644 index 000000000000..f4f08cb4f5ac --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/sender_authorization.py @@ -0,0 +1,39 @@ +# 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 + + +class SenderAuthorization(Model): + """the authorization used by the user who has performed the operation that led + to this event. This captures the RBAC properties of the event. These + usually include the 'action', 'role' and the 'scope'. + + :param action: the permissible actions. For instance: + microsoft.support/supporttickets/write + :type action: str + :param role: the role of the user. For instance: Subscription Admin + :type role: str + :param scope: the scope. + :type scope: str + """ + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'role': {'key': 'role', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SenderAuthorization, self).__init__(**kwargs) + self.action = kwargs.get('action', None) + self.role = kwargs.get('role', None) + self.scope = kwargs.get('scope', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/sender_authorization_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/sender_authorization_py3.py new file mode 100644 index 000000000000..fc908dab0e93 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/sender_authorization_py3.py @@ -0,0 +1,39 @@ +# 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 + + +class SenderAuthorization(Model): + """the authorization used by the user who has performed the operation that led + to this event. This captures the RBAC properties of the event. These + usually include the 'action', 'role' and the 'scope'. + + :param action: the permissible actions. For instance: + microsoft.support/supporttickets/write + :type action: str + :param role: the role of the user. For instance: Subscription Admin + :type role: str + :param scope: the scope. + :type scope: str + """ + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'role': {'key': 'role', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'}, + } + + def __init__(self, *, action: str=None, role: str=None, scope: str=None, **kwargs) -> None: + super(SenderAuthorization, self).__init__(**kwargs) + self.action = action + self.role = role + self.scope = scope diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/single_baseline.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/single_baseline.py new file mode 100644 index 000000000000..4f7c9ca7fa7e --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/single_baseline.py @@ -0,0 +1,45 @@ +# 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 + + +class SingleBaseline(Model): + """The baseline values for a single sensitivity value. + + All required parameters must be populated in order to send to Azure. + + :param sensitivity: Required. the sensitivity of the baseline. Possible + values include: 'Low', 'Medium', 'High' + :type sensitivity: str or ~azure.mgmt.monitor.models.BaselineSensitivity + :param low_thresholds: Required. The low thresholds of the baseline. + :type low_thresholds: list[float] + :param high_thresholds: Required. The high thresholds of the baseline. + :type high_thresholds: list[float] + """ + + _validation = { + 'sensitivity': {'required': True}, + 'low_thresholds': {'required': True}, + 'high_thresholds': {'required': True}, + } + + _attribute_map = { + 'sensitivity': {'key': 'sensitivity', 'type': 'str'}, + 'low_thresholds': {'key': 'lowThresholds', 'type': '[float]'}, + 'high_thresholds': {'key': 'highThresholds', 'type': '[float]'}, + } + + def __init__(self, **kwargs): + super(SingleBaseline, self).__init__(**kwargs) + self.sensitivity = kwargs.get('sensitivity', None) + self.low_thresholds = kwargs.get('low_thresholds', None) + self.high_thresholds = kwargs.get('high_thresholds', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/single_baseline_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/single_baseline_py3.py new file mode 100644 index 000000000000..392b1dd980ae --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/single_baseline_py3.py @@ -0,0 +1,45 @@ +# 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 + + +class SingleBaseline(Model): + """The baseline values for a single sensitivity value. + + All required parameters must be populated in order to send to Azure. + + :param sensitivity: Required. the sensitivity of the baseline. Possible + values include: 'Low', 'Medium', 'High' + :type sensitivity: str or ~azure.mgmt.monitor.models.BaselineSensitivity + :param low_thresholds: Required. The low thresholds of the baseline. + :type low_thresholds: list[float] + :param high_thresholds: Required. The high thresholds of the baseline. + :type high_thresholds: list[float] + """ + + _validation = { + 'sensitivity': {'required': True}, + 'low_thresholds': {'required': True}, + 'high_thresholds': {'required': True}, + } + + _attribute_map = { + 'sensitivity': {'key': 'sensitivity', 'type': 'str'}, + 'low_thresholds': {'key': 'lowThresholds', 'type': '[float]'}, + 'high_thresholds': {'key': 'highThresholds', 'type': '[float]'}, + } + + def __init__(self, *, sensitivity, low_thresholds, high_thresholds, **kwargs) -> None: + super(SingleBaseline, self).__init__(**kwargs) + self.sensitivity = sensitivity + self.low_thresholds = low_thresholds + self.high_thresholds = high_thresholds diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/single_metric_baseline.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/single_metric_baseline.py new file mode 100644 index 000000000000..041bafa0050a --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/single_metric_baseline.py @@ -0,0 +1,71 @@ +# 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 + + +class SingleMetricBaseline(Model): + """The baseline results of a single metric. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The metric baseline Id. + :type id: str + :param type: Required. The resource type of the metric baseline resource. + :type type: str + :param name: Required. The name of the metric for which the baselines were + retrieved. + :type name: str + :param timespan: Required. The timespan for which the data was retrieved. + Its value consists of two datetimes concatenated, separated by '/'. This + may be adjusted in the future and returned back from what was originally + requested. + :type timespan: str + :param interval: Required. The interval (window size) for which the metric + data was returned in. This may be adjusted in the future and returned + back from what was originally requested. This is not present if a + metadata request was made. + :type interval: timedelta + :param namespace: The namespace of the metrics been queried. + :type namespace: str + :param baselines: Required. The baseline for each time series that was + queried. + :type baselines: list[~azure.mgmt.monitor.models.TimeSeriesBaseline] + """ + + _validation = { + 'id': {'required': True}, + 'type': {'required': True}, + 'name': {'required': True}, + 'timespan': {'required': True}, + 'interval': {'required': True}, + 'baselines': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'timespan': {'key': 'properties.timespan', 'type': 'str'}, + 'interval': {'key': 'properties.interval', 'type': 'duration'}, + 'namespace': {'key': 'properties.namespace', 'type': 'str'}, + 'baselines': {'key': 'properties.baselines', 'type': '[TimeSeriesBaseline]'}, + } + + def __init__(self, **kwargs): + super(SingleMetricBaseline, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) + self.timespan = kwargs.get('timespan', None) + self.interval = kwargs.get('interval', None) + self.namespace = kwargs.get('namespace', None) + self.baselines = kwargs.get('baselines', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/single_metric_baseline_paged.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/single_metric_baseline_paged.py new file mode 100644 index 000000000000..83214fd5f7f7 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/single_metric_baseline_paged.py @@ -0,0 +1,27 @@ +# 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 SingleMetricBaselinePaged(Paged): + """ + A paging container for iterating over a list of :class:`SingleMetricBaseline ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SingleMetricBaseline]'} + } + + def __init__(self, *args, **kwargs): + + super(SingleMetricBaselinePaged, self).__init__(*args, **kwargs) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/single_metric_baseline_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/single_metric_baseline_py3.py new file mode 100644 index 000000000000..1b24686b90b2 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/single_metric_baseline_py3.py @@ -0,0 +1,71 @@ +# 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 + + +class SingleMetricBaseline(Model): + """The baseline results of a single metric. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The metric baseline Id. + :type id: str + :param type: Required. The resource type of the metric baseline resource. + :type type: str + :param name: Required. The name of the metric for which the baselines were + retrieved. + :type name: str + :param timespan: Required. The timespan for which the data was retrieved. + Its value consists of two datetimes concatenated, separated by '/'. This + may be adjusted in the future and returned back from what was originally + requested. + :type timespan: str + :param interval: Required. The interval (window size) for which the metric + data was returned in. This may be adjusted in the future and returned + back from what was originally requested. This is not present if a + metadata request was made. + :type interval: timedelta + :param namespace: The namespace of the metrics been queried. + :type namespace: str + :param baselines: Required. The baseline for each time series that was + queried. + :type baselines: list[~azure.mgmt.monitor.models.TimeSeriesBaseline] + """ + + _validation = { + 'id': {'required': True}, + 'type': {'required': True}, + 'name': {'required': True}, + 'timespan': {'required': True}, + 'interval': {'required': True}, + 'baselines': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'timespan': {'key': 'properties.timespan', 'type': 'str'}, + 'interval': {'key': 'properties.interval', 'type': 'duration'}, + 'namespace': {'key': 'properties.namespace', 'type': 'str'}, + 'baselines': {'key': 'properties.baselines', 'type': '[TimeSeriesBaseline]'}, + } + + def __init__(self, *, id: str, type: str, name: str, timespan: str, interval, baselines, namespace: str=None, **kwargs) -> None: + super(SingleMetricBaseline, self).__init__(**kwargs) + self.id = id + self.type = type + self.name = name + self.timespan = timespan + self.interval = interval + self.namespace = namespace + self.baselines = baselines diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/sms_receiver.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/sms_receiver.py new file mode 100644 index 000000000000..98c399ffde50 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/sms_receiver.py @@ -0,0 +1,54 @@ +# 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 + + +class SmsReceiver(Model): + """An SMS receiver. + + 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 name: Required. The name of the SMS receiver. Names must be unique + across all receivers within an action group. + :type name: str + :param country_code: Required. The country code of the SMS receiver. + :type country_code: str + :param phone_number: Required. The phone number of the SMS receiver. + :type phone_number: str + :ivar status: The status of the receiver. Possible values include: + 'NotSpecified', 'Enabled', 'Disabled' + :vartype status: str or ~azure.mgmt.monitor.models.ReceiverStatus + """ + + _validation = { + 'name': {'required': True}, + 'country_code': {'required': True}, + 'phone_number': {'required': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'phone_number': {'key': 'phoneNumber', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'ReceiverStatus'}, + } + + def __init__(self, **kwargs): + super(SmsReceiver, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.country_code = kwargs.get('country_code', None) + self.phone_number = kwargs.get('phone_number', None) + self.status = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/sms_receiver_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/sms_receiver_py3.py new file mode 100644 index 000000000000..036ad0520bff --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/sms_receiver_py3.py @@ -0,0 +1,54 @@ +# 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 + + +class SmsReceiver(Model): + """An SMS receiver. + + 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 name: Required. The name of the SMS receiver. Names must be unique + across all receivers within an action group. + :type name: str + :param country_code: Required. The country code of the SMS receiver. + :type country_code: str + :param phone_number: Required. The phone number of the SMS receiver. + :type phone_number: str + :ivar status: The status of the receiver. Possible values include: + 'NotSpecified', 'Enabled', 'Disabled' + :vartype status: str or ~azure.mgmt.monitor.models.ReceiverStatus + """ + + _validation = { + 'name': {'required': True}, + 'country_code': {'required': True}, + 'phone_number': {'required': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'phone_number': {'key': 'phoneNumber', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'ReceiverStatus'}, + } + + def __init__(self, *, name: str, country_code: str, phone_number: str, **kwargs) -> None: + super(SmsReceiver, self).__init__(**kwargs) + self.name = name + self.country_code = country_code + self.phone_number = phone_number + self.status = None diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/source.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/source.py new file mode 100644 index 000000000000..b36c44a8fc20 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/source.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 msrest.serialization import Model + + +class Source(Model): + """Specifies the log search query. + + All required parameters must be populated in order to send to Azure. + + :param query: Log search query. Required for action type - AlertingAction + :type query: str + :param authorized_resources: List of Resource referred into query + :type authorized_resources: list[str] + :param data_source_id: Required. The resource uri over which log search + query is to be run. + :type data_source_id: str + :param query_type: Set value to 'ResultCount'. Possible values include: + 'ResultCount' + :type query_type: str or ~azure.mgmt.monitor.models.QueryType + """ + + _validation = { + 'data_source_id': {'required': True}, + } + + _attribute_map = { + 'query': {'key': 'query', 'type': 'str'}, + 'authorized_resources': {'key': 'authorizedResources', 'type': '[str]'}, + 'data_source_id': {'key': 'dataSourceId', 'type': 'str'}, + 'query_type': {'key': 'queryType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Source, self).__init__(**kwargs) + self.query = kwargs.get('query', None) + self.authorized_resources = kwargs.get('authorized_resources', None) + self.data_source_id = kwargs.get('data_source_id', None) + self.query_type = kwargs.get('query_type', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/source_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/source_py3.py new file mode 100644 index 000000000000..ef333528e077 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/source_py3.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 msrest.serialization import Model + + +class Source(Model): + """Specifies the log search query. + + All required parameters must be populated in order to send to Azure. + + :param query: Log search query. Required for action type - AlertingAction + :type query: str + :param authorized_resources: List of Resource referred into query + :type authorized_resources: list[str] + :param data_source_id: Required. The resource uri over which log search + query is to be run. + :type data_source_id: str + :param query_type: Set value to 'ResultCount'. Possible values include: + 'ResultCount' + :type query_type: str or ~azure.mgmt.monitor.models.QueryType + """ + + _validation = { + 'data_source_id': {'required': True}, + } + + _attribute_map = { + 'query': {'key': 'query', 'type': 'str'}, + 'authorized_resources': {'key': 'authorizedResources', 'type': '[str]'}, + 'data_source_id': {'key': 'dataSourceId', 'type': 'str'}, + 'query_type': {'key': 'queryType', 'type': 'str'}, + } + + def __init__(self, *, data_source_id: str, query: str=None, authorized_resources=None, query_type=None, **kwargs) -> None: + super(Source, self).__init__(**kwargs) + self.query = query + self.authorized_resources = authorized_resources + self.data_source_id = data_source_id + self.query_type = query_type diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/threshold_rule_condition.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/threshold_rule_condition.py new file mode 100644 index 000000000000..9afb3402def0 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/threshold_rule_condition.py @@ -0,0 +1,64 @@ +# 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 .rule_condition import RuleCondition + + +class ThresholdRuleCondition(RuleCondition): + """A rule condition based on a metric crossing a threshold. + + All required parameters must be populated in order to send to Azure. + + :param data_source: the resource from which the rule collects its data. + For this type dataSource will always be of type RuleMetricDataSource. + :type data_source: ~azure.mgmt.monitor.models.RuleDataSource + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param operator: Required. the operator used to compare the data and the + threshold. Possible values include: 'GreaterThan', 'GreaterThanOrEqual', + 'LessThan', 'LessThanOrEqual' + :type operator: str or ~azure.mgmt.monitor.models.ConditionOperator + :param threshold: Required. the threshold value that activates the alert. + :type threshold: float + :param window_size: the period of time (in ISO 8601 duration format) that + is used to monitor alert activity based on the threshold. If specified + then it must be between 5 minutes and 1 day. + :type window_size: timedelta + :param time_aggregation: the time aggregation operator. How the data that + are collected should be combined over time. The default value is the + PrimaryAggregationType of the Metric. Possible values include: 'Average', + 'Minimum', 'Maximum', 'Total', 'Last' + :type time_aggregation: str or + ~azure.mgmt.monitor.models.TimeAggregationOperator + """ + + _validation = { + 'odatatype': {'required': True}, + 'operator': {'required': True}, + 'threshold': {'required': True}, + } + + _attribute_map = { + 'data_source': {'key': 'dataSource', 'type': 'RuleDataSource'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'ConditionOperator'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + 'window_size': {'key': 'windowSize', 'type': 'duration'}, + 'time_aggregation': {'key': 'timeAggregation', 'type': 'TimeAggregationOperator'}, + } + + def __init__(self, **kwargs): + super(ThresholdRuleCondition, self).__init__(**kwargs) + self.operator = kwargs.get('operator', None) + self.threshold = kwargs.get('threshold', None) + self.window_size = kwargs.get('window_size', None) + self.time_aggregation = kwargs.get('time_aggregation', None) + self.odatatype = 'Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/threshold_rule_condition_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/threshold_rule_condition_py3.py new file mode 100644 index 000000000000..8fbff1f8930e --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/threshold_rule_condition_py3.py @@ -0,0 +1,64 @@ +# 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 .rule_condition_py3 import RuleCondition + + +class ThresholdRuleCondition(RuleCondition): + """A rule condition based on a metric crossing a threshold. + + All required parameters must be populated in order to send to Azure. + + :param data_source: the resource from which the rule collects its data. + For this type dataSource will always be of type RuleMetricDataSource. + :type data_source: ~azure.mgmt.monitor.models.RuleDataSource + :param odatatype: Required. Constant filled by server. + :type odatatype: str + :param operator: Required. the operator used to compare the data and the + threshold. Possible values include: 'GreaterThan', 'GreaterThanOrEqual', + 'LessThan', 'LessThanOrEqual' + :type operator: str or ~azure.mgmt.monitor.models.ConditionOperator + :param threshold: Required. the threshold value that activates the alert. + :type threshold: float + :param window_size: the period of time (in ISO 8601 duration format) that + is used to monitor alert activity based on the threshold. If specified + then it must be between 5 minutes and 1 day. + :type window_size: timedelta + :param time_aggregation: the time aggregation operator. How the data that + are collected should be combined over time. The default value is the + PrimaryAggregationType of the Metric. Possible values include: 'Average', + 'Minimum', 'Maximum', 'Total', 'Last' + :type time_aggregation: str or + ~azure.mgmt.monitor.models.TimeAggregationOperator + """ + + _validation = { + 'odatatype': {'required': True}, + 'operator': {'required': True}, + 'threshold': {'required': True}, + } + + _attribute_map = { + 'data_source': {'key': 'dataSource', 'type': 'RuleDataSource'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'ConditionOperator'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + 'window_size': {'key': 'windowSize', 'type': 'duration'}, + 'time_aggregation': {'key': 'timeAggregation', 'type': 'TimeAggregationOperator'}, + } + + def __init__(self, *, operator, threshold: float, data_source=None, window_size=None, time_aggregation=None, **kwargs) -> None: + super(ThresholdRuleCondition, self).__init__(data_source=data_source, **kwargs) + self.operator = operator + self.threshold = threshold + self.window_size = window_size + self.time_aggregation = time_aggregation + self.odatatype = 'Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition' diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_baseline.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_baseline.py new file mode 100644 index 000000000000..0218b00125d9 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_baseline.py @@ -0,0 +1,52 @@ +# 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 + + +class TimeSeriesBaseline(Model): + """The baseline values for a single time series. + + All required parameters must be populated in order to send to Azure. + + :param aggregation: Required. The aggregation type of the metric. + :type aggregation: str + :param dimensions: The dimensions of this time series. + :type dimensions: list[~azure.mgmt.monitor.models.MetricSingleDimension] + :param timestamps: Required. The list of timestamps of the baselines. + :type timestamps: list[datetime] + :param data: Required. The baseline values for each sensitivity. + :type data: list[~azure.mgmt.monitor.models.SingleBaseline] + :param metadata: The baseline metadata values. + :type metadata: list[~azure.mgmt.monitor.models.BaselineMetadata] + """ + + _validation = { + 'aggregation': {'required': True}, + 'timestamps': {'required': True}, + 'data': {'required': True}, + } + + _attribute_map = { + 'aggregation': {'key': 'aggregation', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricSingleDimension]'}, + 'timestamps': {'key': 'timestamps', 'type': '[iso-8601]'}, + 'data': {'key': 'data', 'type': '[SingleBaseline]'}, + 'metadata': {'key': 'metadata', 'type': '[BaselineMetadata]'}, + } + + def __init__(self, **kwargs): + super(TimeSeriesBaseline, self).__init__(**kwargs) + self.aggregation = kwargs.get('aggregation', None) + self.dimensions = kwargs.get('dimensions', None) + self.timestamps = kwargs.get('timestamps', None) + self.data = kwargs.get('data', None) + self.metadata = kwargs.get('metadata', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_baseline_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_baseline_py3.py new file mode 100644 index 000000000000..7f3fe632864f --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_baseline_py3.py @@ -0,0 +1,52 @@ +# 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 + + +class TimeSeriesBaseline(Model): + """The baseline values for a single time series. + + All required parameters must be populated in order to send to Azure. + + :param aggregation: Required. The aggregation type of the metric. + :type aggregation: str + :param dimensions: The dimensions of this time series. + :type dimensions: list[~azure.mgmt.monitor.models.MetricSingleDimension] + :param timestamps: Required. The list of timestamps of the baselines. + :type timestamps: list[datetime] + :param data: Required. The baseline values for each sensitivity. + :type data: list[~azure.mgmt.monitor.models.SingleBaseline] + :param metadata: The baseline metadata values. + :type metadata: list[~azure.mgmt.monitor.models.BaselineMetadata] + """ + + _validation = { + 'aggregation': {'required': True}, + 'timestamps': {'required': True}, + 'data': {'required': True}, + } + + _attribute_map = { + 'aggregation': {'key': 'aggregation', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricSingleDimension]'}, + 'timestamps': {'key': 'timestamps', 'type': '[iso-8601]'}, + 'data': {'key': 'data', 'type': '[SingleBaseline]'}, + 'metadata': {'key': 'metadata', 'type': '[BaselineMetadata]'}, + } + + def __init__(self, *, aggregation: str, timestamps, data, dimensions=None, metadata=None, **kwargs) -> None: + super(TimeSeriesBaseline, self).__init__(**kwargs) + self.aggregation = aggregation + self.dimensions = dimensions + self.timestamps = timestamps + self.data = data + self.metadata = metadata diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_element.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_element.py new file mode 100644 index 000000000000..6d7851c0962e --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_element.py @@ -0,0 +1,35 @@ +# 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 + + +class TimeSeriesElement(Model): + """A time series result type. The discriminator value is always TimeSeries in + this case. + + :param metadatavalues: the metadata values returned if $filter was + specified in the call. + :type metadatavalues: list[~azure.mgmt.monitor.models.MetadataValue] + :param data: An array of data points representing the metric values. This + is only returned if a result type of data is specified. + :type data: list[~azure.mgmt.monitor.models.MetricValue] + """ + + _attribute_map = { + 'metadatavalues': {'key': 'metadatavalues', 'type': '[MetadataValue]'}, + 'data': {'key': 'data', 'type': '[MetricValue]'}, + } + + def __init__(self, **kwargs): + super(TimeSeriesElement, self).__init__(**kwargs) + self.metadatavalues = kwargs.get('metadatavalues', None) + self.data = kwargs.get('data', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_element_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_element_py3.py new file mode 100644 index 000000000000..98afc2d1ce05 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_element_py3.py @@ -0,0 +1,35 @@ +# 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 + + +class TimeSeriesElement(Model): + """A time series result type. The discriminator value is always TimeSeries in + this case. + + :param metadatavalues: the metadata values returned if $filter was + specified in the call. + :type metadatavalues: list[~azure.mgmt.monitor.models.MetadataValue] + :param data: An array of data points representing the metric values. This + is only returned if a result type of data is specified. + :type data: list[~azure.mgmt.monitor.models.MetricValue] + """ + + _attribute_map = { + 'metadatavalues': {'key': 'metadatavalues', 'type': '[MetadataValue]'}, + 'data': {'key': 'data', 'type': '[MetricValue]'}, + } + + def __init__(self, *, metadatavalues=None, data=None, **kwargs) -> None: + super(TimeSeriesElement, self).__init__(**kwargs) + self.metadatavalues = metadatavalues + self.data = data diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_information.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_information.py new file mode 100644 index 000000000000..ab1e8d790d8a --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_information.py @@ -0,0 +1,44 @@ +# 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 + + +class TimeSeriesInformation(Model): + """The time series info needed for calculating the baseline. + + All required parameters must be populated in order to send to Azure. + + :param sensitivities: Required. the list of sensitivities for calculating + the baseline. + :type sensitivities: list[str] + :param values: Required. The metric values to calculate the baseline. + :type values: list[float] + :param timestamps: the array of timestamps of the baselines. + :type timestamps: list[datetime] + """ + + _validation = { + 'sensitivities': {'required': True}, + 'values': {'required': True}, + } + + _attribute_map = { + 'sensitivities': {'key': 'sensitivities', 'type': '[str]'}, + 'values': {'key': 'values', 'type': '[float]'}, + 'timestamps': {'key': 'timestamps', 'type': '[iso-8601]'}, + } + + def __init__(self, **kwargs): + super(TimeSeriesInformation, self).__init__(**kwargs) + self.sensitivities = kwargs.get('sensitivities', None) + self.values = kwargs.get('values', None) + self.timestamps = kwargs.get('timestamps', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_information_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_information_py3.py new file mode 100644 index 000000000000..1a00c52ce44a --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_information_py3.py @@ -0,0 +1,44 @@ +# 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 + + +class TimeSeriesInformation(Model): + """The time series info needed for calculating the baseline. + + All required parameters must be populated in order to send to Azure. + + :param sensitivities: Required. the list of sensitivities for calculating + the baseline. + :type sensitivities: list[str] + :param values: Required. The metric values to calculate the baseline. + :type values: list[float] + :param timestamps: the array of timestamps of the baselines. + :type timestamps: list[datetime] + """ + + _validation = { + 'sensitivities': {'required': True}, + 'values': {'required': True}, + } + + _attribute_map = { + 'sensitivities': {'key': 'sensitivities', 'type': '[str]'}, + 'values': {'key': 'values', 'type': '[float]'}, + 'timestamps': {'key': 'timestamps', 'type': '[iso-8601]'}, + } + + def __init__(self, *, sensitivities, values, timestamps=None, **kwargs) -> None: + super(TimeSeriesInformation, self).__init__(**kwargs) + self.sensitivities = sensitivities + self.values = values + self.timestamps = timestamps diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_window.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_window.py new file mode 100644 index 000000000000..baf89c578fa2 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_window.py @@ -0,0 +1,80 @@ +# 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 + + +class TimeWindow(Model): + """A specific date-time for the profile. + + All required parameters must be populated in order to send to Azure. + + :param time_zone: the timezone of the start and end times for the profile. + Some examples of valid time zones are: Dateline Standard Time, UTC-11, + Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time + (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain + Standard Time (Mexico), Mountain Standard Time, Central America Standard + Time, Central Standard Time, Central Standard Time (Mexico), Canada + Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US + Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, + Atlantic Standard Time, Central Brazilian Standard Time, SA Western + Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. + South America Standard Time, Argentina Standard Time, SA Eastern Standard + Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard + Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde + Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich + Standard Time, W. Europe Standard Time, Central Europe Standard Time, + Romance Standard Time, Central European Standard Time, W. Central Africa + Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard + Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, + E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, + Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, + Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus + Standard Time, Russian Standard Time, E. Africa Standard Time, Iran + Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia + Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus + Standard Time, Afghanistan Standard Time, West Asia Standard Time, + Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, + Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, + Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard + Time, SE Asia Standard Time, North Asia Standard Time, China Standard + Time, North Asia East Standard Time, Singapore Standard Time, W. Australia + Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo + Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia + Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS + Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, + Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, + Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard + Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard + Time, Samoa Standard Time, Line Islands Standard Time + :type time_zone: str + :param start: Required. the start time for the profile in ISO 8601 format. + :type start: datetime + :param end: Required. the end time for the profile in ISO 8601 format. + :type end: datetime + """ + + _validation = { + 'start': {'required': True}, + 'end': {'required': True}, + } + + _attribute_map = { + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + 'start': {'key': 'start', 'type': 'iso-8601'}, + 'end': {'key': 'end', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(TimeWindow, self).__init__(**kwargs) + self.time_zone = kwargs.get('time_zone', None) + self.start = kwargs.get('start', None) + self.end = kwargs.get('end', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_window_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_window_py3.py new file mode 100644 index 000000000000..07c9c81fade8 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/time_window_py3.py @@ -0,0 +1,80 @@ +# 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 + + +class TimeWindow(Model): + """A specific date-time for the profile. + + All required parameters must be populated in order to send to Azure. + + :param time_zone: the timezone of the start and end times for the profile. + Some examples of valid time zones are: Dateline Standard Time, UTC-11, + Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time + (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain + Standard Time (Mexico), Mountain Standard Time, Central America Standard + Time, Central Standard Time, Central Standard Time (Mexico), Canada + Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US + Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, + Atlantic Standard Time, Central Brazilian Standard Time, SA Western + Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. + South America Standard Time, Argentina Standard Time, SA Eastern Standard + Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard + Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde + Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich + Standard Time, W. Europe Standard Time, Central Europe Standard Time, + Romance Standard Time, Central European Standard Time, W. Central Africa + Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard + Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, + E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, + Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, + Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus + Standard Time, Russian Standard Time, E. Africa Standard Time, Iran + Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia + Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus + Standard Time, Afghanistan Standard Time, West Asia Standard Time, + Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, + Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, + Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard + Time, SE Asia Standard Time, North Asia Standard Time, China Standard + Time, North Asia East Standard Time, Singapore Standard Time, W. Australia + Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo + Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia + Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS + Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, + Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, + Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard + Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard + Time, Samoa Standard Time, Line Islands Standard Time + :type time_zone: str + :param start: Required. the start time for the profile in ISO 8601 format. + :type start: datetime + :param end: Required. the end time for the profile in ISO 8601 format. + :type end: datetime + """ + + _validation = { + 'start': {'required': True}, + 'end': {'required': True}, + } + + _attribute_map = { + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + 'start': {'key': 'start', 'type': 'iso-8601'}, + 'end': {'key': 'end', 'type': 'iso-8601'}, + } + + def __init__(self, *, start, end, time_zone: str=None, **kwargs) -> None: + super(TimeWindow, self).__init__(**kwargs) + self.time_zone = time_zone + self.start = start + self.end = end diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/trigger_condition.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/trigger_condition.py new file mode 100644 index 000000000000..e89fdc8c18f1 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/trigger_condition.py @@ -0,0 +1,47 @@ +# 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 + + +class TriggerCondition(Model): + """The condition that results in the Log Search rule. + + All required parameters must be populated in order to send to Azure. + + :param threshold_operator: Required. Evaluation operation for rule - + 'GreaterThan' or 'LessThan. Possible values include: 'GreaterThan', + 'LessThan', 'Equal' + :type threshold_operator: str or + ~azure.mgmt.monitor.models.ConditionalOperator + :param threshold: Required. Result or count threshold based on which rule + should be triggered. + :type threshold: float + :param metric_trigger: Trigger condition for metric query rule + :type metric_trigger: ~azure.mgmt.monitor.models.LogMetricTrigger + """ + + _validation = { + 'threshold_operator': {'required': True}, + 'threshold': {'required': True}, + } + + _attribute_map = { + 'threshold_operator': {'key': 'thresholdOperator', 'type': 'str'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + 'metric_trigger': {'key': 'metricTrigger', 'type': 'LogMetricTrigger'}, + } + + def __init__(self, **kwargs): + super(TriggerCondition, self).__init__(**kwargs) + self.threshold_operator = kwargs.get('threshold_operator', None) + self.threshold = kwargs.get('threshold', None) + self.metric_trigger = kwargs.get('metric_trigger', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/trigger_condition_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/trigger_condition_py3.py new file mode 100644 index 000000000000..b21e39d9a53e --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/trigger_condition_py3.py @@ -0,0 +1,47 @@ +# 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 + + +class TriggerCondition(Model): + """The condition that results in the Log Search rule. + + All required parameters must be populated in order to send to Azure. + + :param threshold_operator: Required. Evaluation operation for rule - + 'GreaterThan' or 'LessThan. Possible values include: 'GreaterThan', + 'LessThan', 'Equal' + :type threshold_operator: str or + ~azure.mgmt.monitor.models.ConditionalOperator + :param threshold: Required. Result or count threshold based on which rule + should be triggered. + :type threshold: float + :param metric_trigger: Trigger condition for metric query rule + :type metric_trigger: ~azure.mgmt.monitor.models.LogMetricTrigger + """ + + _validation = { + 'threshold_operator': {'required': True}, + 'threshold': {'required': True}, + } + + _attribute_map = { + 'threshold_operator': {'key': 'thresholdOperator', 'type': 'str'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + 'metric_trigger': {'key': 'metricTrigger', 'type': 'LogMetricTrigger'}, + } + + def __init__(self, *, threshold_operator, threshold: float, metric_trigger=None, **kwargs) -> None: + super(TriggerCondition, self).__init__(**kwargs) + self.threshold_operator = threshold_operator + self.threshold = threshold + self.metric_trigger = metric_trigger diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/vm_insights_onboarding_status.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/vm_insights_onboarding_status.py new file mode 100644 index 000000000000..b641f7acb264 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/vm_insights_onboarding_status.py @@ -0,0 +1,72 @@ +# 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 .proxy_resource import ProxyResource + + +class VMInsightsOnboardingStatus(ProxyResource): + """VM Insights onboarding status for a resource. + + 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 resource_id: Required. Azure Resource Manager identifier of the + resource whose onboarding status is being represented. + :type resource_id: str + :param onboarding_status: Required. The onboarding status for the + resource. Note that, a higher level scope, e.g., resource group or + subscription, is considered onboarded if at least one resource under it is + onboarded. Possible values include: 'onboarded', 'notOnboarded', 'unknown' + :type onboarding_status: str or + ~azure.mgmt.monitor.models.OnboardingStatus + :param data_status: Required. The status of VM Insights data from the + resource. When reported as `present` the data array will contain + information about the data containers to which data for the specified + resource is being routed. Possible values include: 'present', 'notPresent' + :type data_status: str or ~azure.mgmt.monitor.models.DataStatus + :param data: Containers that currently store VM Insights data for the + specified resource. + :type data: list[~azure.mgmt.monitor.models.DataContainer] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource_id': {'required': True}, + 'onboarding_status': {'required': True}, + 'data_status': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'onboarding_status': {'key': 'properties.onboardingStatus', 'type': 'str'}, + 'data_status': {'key': 'properties.dataStatus', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': '[DataContainer]'}, + } + + def __init__(self, **kwargs): + super(VMInsightsOnboardingStatus, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.onboarding_status = kwargs.get('onboarding_status', None) + self.data_status = kwargs.get('data_status', None) + self.data = kwargs.get('data', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/vm_insights_onboarding_status_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/vm_insights_onboarding_status_py3.py new file mode 100644 index 000000000000..37c77ecc1a8a --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/vm_insights_onboarding_status_py3.py @@ -0,0 +1,72 @@ +# 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 .proxy_resource_py3 import ProxyResource + + +class VMInsightsOnboardingStatus(ProxyResource): + """VM Insights onboarding status for a resource. + + 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 resource_id: Required. Azure Resource Manager identifier of the + resource whose onboarding status is being represented. + :type resource_id: str + :param onboarding_status: Required. The onboarding status for the + resource. Note that, a higher level scope, e.g., resource group or + subscription, is considered onboarded if at least one resource under it is + onboarded. Possible values include: 'onboarded', 'notOnboarded', 'unknown' + :type onboarding_status: str or + ~azure.mgmt.monitor.models.OnboardingStatus + :param data_status: Required. The status of VM Insights data from the + resource. When reported as `present` the data array will contain + information about the data containers to which data for the specified + resource is being routed. Possible values include: 'present', 'notPresent' + :type data_status: str or ~azure.mgmt.monitor.models.DataStatus + :param data: Containers that currently store VM Insights data for the + specified resource. + :type data: list[~azure.mgmt.monitor.models.DataContainer] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource_id': {'required': True}, + 'onboarding_status': {'required': True}, + 'data_status': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'onboarding_status': {'key': 'properties.onboardingStatus', 'type': 'str'}, + 'data_status': {'key': 'properties.dataStatus', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': '[DataContainer]'}, + } + + def __init__(self, *, resource_id: str, onboarding_status, data_status, data=None, **kwargs) -> None: + super(VMInsightsOnboardingStatus, self).__init__(**kwargs) + self.resource_id = resource_id + self.onboarding_status = onboarding_status + self.data_status = data_status + self.data = data diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/voice_receiver.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/voice_receiver.py new file mode 100644 index 000000000000..0cecd17337d7 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/voice_receiver.py @@ -0,0 +1,45 @@ +# 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 + + +class VoiceReceiver(Model): + """A voice receiver. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the voice receiver. Names must be + unique across all receivers within an action group. + :type name: str + :param country_code: Required. The country code of the voice receiver. + :type country_code: str + :param phone_number: Required. The phone number of the voice receiver. + :type phone_number: str + """ + + _validation = { + 'name': {'required': True}, + 'country_code': {'required': True}, + 'phone_number': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'phone_number': {'key': 'phoneNumber', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VoiceReceiver, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.country_code = kwargs.get('country_code', None) + self.phone_number = kwargs.get('phone_number', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/voice_receiver_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/voice_receiver_py3.py new file mode 100644 index 000000000000..02334b76c479 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/voice_receiver_py3.py @@ -0,0 +1,45 @@ +# 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 + + +class VoiceReceiver(Model): + """A voice receiver. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the voice receiver. Names must be + unique across all receivers within an action group. + :type name: str + :param country_code: Required. The country code of the voice receiver. + :type country_code: str + :param phone_number: Required. The phone number of the voice receiver. + :type phone_number: str + """ + + _validation = { + 'name': {'required': True}, + 'country_code': {'required': True}, + 'phone_number': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'phone_number': {'key': 'phoneNumber', 'type': 'str'}, + } + + def __init__(self, *, name: str, country_code: str, phone_number: str, **kwargs) -> None: + super(VoiceReceiver, self).__init__(**kwargs) + self.name = name + self.country_code = country_code + self.phone_number = phone_number diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/webhook_notification.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/webhook_notification.py new file mode 100644 index 000000000000..85dc8d60763b --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/webhook_notification.py @@ -0,0 +1,32 @@ +# 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 + + +class WebhookNotification(Model): + """Webhook notification of an autoscale event. + + :param service_uri: the service address to receive the notification. + :type service_uri: str + :param properties: a property bag of settings. This value can be empty. + :type properties: dict[str, str] + """ + + _attribute_map = { + 'service_uri': {'key': 'serviceUri', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(WebhookNotification, self).__init__(**kwargs) + self.service_uri = kwargs.get('service_uri', None) + self.properties = kwargs.get('properties', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/webhook_notification_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/webhook_notification_py3.py new file mode 100644 index 000000000000..fef993b16933 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/webhook_notification_py3.py @@ -0,0 +1,32 @@ +# 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 + + +class WebhookNotification(Model): + """Webhook notification of an autoscale event. + + :param service_uri: the service address to receive the notification. + :type service_uri: str + :param properties: a property bag of settings. This value can be empty. + :type properties: dict[str, str] + """ + + _attribute_map = { + 'service_uri': {'key': 'serviceUri', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__(self, *, service_uri: str=None, properties=None, **kwargs) -> None: + super(WebhookNotification, self).__init__(**kwargs) + self.service_uri = service_uri + self.properties = properties diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/webhook_receiver.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/webhook_receiver.py new file mode 100644 index 000000000000..befb2ced1f54 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/webhook_receiver.py @@ -0,0 +1,46 @@ +# 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 + + +class WebhookReceiver(Model): + """A webhook receiver. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the webhook receiver. Names must be + unique across all receivers within an action group. + :type name: str + :param service_uri: Required. The URI where webhooks should be sent. + :type service_uri: str + :param use_common_alert_schema: Required. Indicates whether to use common + alert schema. + :type use_common_alert_schema: bool + """ + + _validation = { + 'name': {'required': True}, + 'service_uri': {'required': True}, + 'use_common_alert_schema': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'service_uri': {'key': 'serviceUri', 'type': 'str'}, + 'use_common_alert_schema': {'key': 'useCommonAlertSchema', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(WebhookReceiver, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.service_uri = kwargs.get('service_uri', None) + self.use_common_alert_schema = kwargs.get('use_common_alert_schema', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/webhook_receiver_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/webhook_receiver_py3.py new file mode 100644 index 000000000000..1fed4f83053b --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/webhook_receiver_py3.py @@ -0,0 +1,46 @@ +# 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 + + +class WebhookReceiver(Model): + """A webhook receiver. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the webhook receiver. Names must be + unique across all receivers within an action group. + :type name: str + :param service_uri: Required. The URI where webhooks should be sent. + :type service_uri: str + :param use_common_alert_schema: Required. Indicates whether to use common + alert schema. + :type use_common_alert_schema: bool + """ + + _validation = { + 'name': {'required': True}, + 'service_uri': {'required': True}, + 'use_common_alert_schema': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'service_uri': {'key': 'serviceUri', 'type': 'str'}, + 'use_common_alert_schema': {'key': 'useCommonAlertSchema', 'type': 'bool'}, + } + + def __init__(self, *, name: str, service_uri: str, use_common_alert_schema: bool, **kwargs) -> None: + super(WebhookReceiver, self).__init__(**kwargs) + self.name = name + self.service_uri = service_uri + self.use_common_alert_schema = use_common_alert_schema diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/workspace_info.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/workspace_info.py new file mode 100644 index 000000000000..23f3cde153ef --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/workspace_info.py @@ -0,0 +1,45 @@ +# 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 + + +class WorkspaceInfo(Model): + """Information about a Log Analytics Workspace. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Azure Resource Manager identifier of the Log + Analytics Workspace. + :type id: str + :param location: Required. Location of the Log Analytics workspace. + :type location: str + :param customer_id: Required. Log Analytics workspace identifier. + :type customer_id: str + """ + + _validation = { + 'id': {'required': True}, + 'location': {'required': True}, + 'customer_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'customer_id': {'key': 'properties.customerId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkspaceInfo, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.location = kwargs.get('location', None) + self.customer_id = kwargs.get('customer_id', None) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/workspace_info_py3.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/workspace_info_py3.py new file mode 100644 index 000000000000..87430b030bd5 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models/workspace_info_py3.py @@ -0,0 +1,45 @@ +# 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 + + +class WorkspaceInfo(Model): + """Information about a Log Analytics Workspace. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Azure Resource Manager identifier of the Log + Analytics Workspace. + :type id: str + :param location: Required. Location of the Log Analytics workspace. + :type location: str + :param customer_id: Required. Log Analytics workspace identifier. + :type customer_id: str + """ + + _validation = { + 'id': {'required': True}, + 'location': {'required': True}, + 'customer_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'customer_id': {'key': 'properties.customerId', 'type': 'str'}, + } + + def __init__(self, *, id: str, location: str, customer_id: str, **kwargs) -> None: + super(WorkspaceInfo, self).__init__(**kwargs) + self.id = id + self.location = location + self.customer_id = customer_id diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/monitor_management_client.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/monitor_management_client.py new file mode 100644 index 000000000000..f5717897c039 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/monitor_management_client.py @@ -0,0 +1,180 @@ +# 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 msrestazure import AzureConfiguration +from .version import VERSION +from .operations.autoscale_settings_operations import AutoscaleSettingsOperations +from .operations.operations import Operations +from .operations.alert_rule_incidents_operations import AlertRuleIncidentsOperations +from .operations.alert_rules_operations import AlertRulesOperations +from .operations.log_profiles_operations import LogProfilesOperations +from .operations.diagnostic_settings_operations import DiagnosticSettingsOperations +from .operations.diagnostic_settings_category_operations import DiagnosticSettingsCategoryOperations +from .operations.action_groups_operations import ActionGroupsOperations +from .operations.activity_log_alerts_operations import ActivityLogAlertsOperations +from .operations.activity_logs_operations import ActivityLogsOperations +from .operations.event_categories_operations import EventCategoriesOperations +from .operations.tenant_activity_logs_operations import TenantActivityLogsOperations +from .operations.metric_definitions_operations import MetricDefinitionsOperations +from .operations.metrics_operations import MetricsOperations +from .operations.metric_baseline_operations import MetricBaselineOperations +from .operations.baselines_operations import BaselinesOperations +from .operations.metric_alerts_operations import MetricAlertsOperations +from .operations.metric_alerts_status_operations import MetricAlertsStatusOperations +from .operations.scheduled_query_rules_operations import ScheduledQueryRulesOperations +from .operations.metric_namespaces_operations import MetricNamespacesOperations +from .operations.vm_insights_operations import VMInsightsOperations +from . import models + + +class MonitorManagementClientConfiguration(AzureConfiguration): + """Configuration for MonitorManagementClient + 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. + :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(MonitorManagementClientConfiguration, self).__init__(base_url) + + 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 + + +class MonitorManagementClient(SDKClient): + """Monitor Management Client + + :ivar config: Configuration for client. + :vartype config: MonitorManagementClientConfiguration + + :ivar autoscale_settings: AutoscaleSettings operations + :vartype autoscale_settings: azure.mgmt.monitor.operations.AutoscaleSettingsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.monitor.operations.Operations + :ivar alert_rule_incidents: AlertRuleIncidents operations + :vartype alert_rule_incidents: azure.mgmt.monitor.operations.AlertRuleIncidentsOperations + :ivar alert_rules: AlertRules operations + :vartype alert_rules: azure.mgmt.monitor.operations.AlertRulesOperations + :ivar log_profiles: LogProfiles operations + :vartype log_profiles: azure.mgmt.monitor.operations.LogProfilesOperations + :ivar diagnostic_settings: DiagnosticSettings operations + :vartype diagnostic_settings: azure.mgmt.monitor.operations.DiagnosticSettingsOperations + :ivar diagnostic_settings_category: DiagnosticSettingsCategory operations + :vartype diagnostic_settings_category: azure.mgmt.monitor.operations.DiagnosticSettingsCategoryOperations + :ivar action_groups: ActionGroups operations + :vartype action_groups: azure.mgmt.monitor.operations.ActionGroupsOperations + :ivar activity_log_alerts: ActivityLogAlerts operations + :vartype activity_log_alerts: azure.mgmt.monitor.operations.ActivityLogAlertsOperations + :ivar activity_logs: ActivityLogs operations + :vartype activity_logs: azure.mgmt.monitor.operations.ActivityLogsOperations + :ivar event_categories: EventCategories operations + :vartype event_categories: azure.mgmt.monitor.operations.EventCategoriesOperations + :ivar tenant_activity_logs: TenantActivityLogs operations + :vartype tenant_activity_logs: azure.mgmt.monitor.operations.TenantActivityLogsOperations + :ivar metric_definitions: MetricDefinitions operations + :vartype metric_definitions: azure.mgmt.monitor.operations.MetricDefinitionsOperations + :ivar metrics: Metrics operations + :vartype metrics: azure.mgmt.monitor.operations.MetricsOperations + :ivar metric_baseline: MetricBaseline operations + :vartype metric_baseline: azure.mgmt.monitor.operations.MetricBaselineOperations + :ivar baselines: Baselines operations + :vartype baselines: azure.mgmt.monitor.operations.BaselinesOperations + :ivar metric_alerts: MetricAlerts operations + :vartype metric_alerts: azure.mgmt.monitor.operations.MetricAlertsOperations + :ivar metric_alerts_status: MetricAlertsStatus operations + :vartype metric_alerts_status: azure.mgmt.monitor.operations.MetricAlertsStatusOperations + :ivar scheduled_query_rules: ScheduledQueryRules operations + :vartype scheduled_query_rules: azure.mgmt.monitor.operations.ScheduledQueryRulesOperations + :ivar metric_namespaces: MetricNamespaces operations + :vartype metric_namespaces: azure.mgmt.monitor.operations.MetricNamespacesOperations + :ivar vm_insights: VMInsights operations + :vartype vm_insights: azure.mgmt.monitor.operations.VMInsightsOperations + + :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. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = MonitorManagementClientConfiguration(credentials, subscription_id, base_url) + super(MonitorManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.autoscale_settings = AutoscaleSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.alert_rule_incidents = AlertRuleIncidentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.alert_rules = AlertRulesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.log_profiles = LogProfilesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.diagnostic_settings = DiagnosticSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.diagnostic_settings_category = DiagnosticSettingsCategoryOperations( + self._client, self.config, self._serialize, self._deserialize) + self.action_groups = ActionGroupsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.activity_log_alerts = ActivityLogAlertsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.activity_logs = ActivityLogsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.event_categories = EventCategoriesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.tenant_activity_logs = TenantActivityLogsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.metric_definitions = MetricDefinitionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.metrics = MetricsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.metric_baseline = MetricBaselineOperations( + self._client, self.config, self._serialize, self._deserialize) + self.baselines = BaselinesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.metric_alerts = MetricAlertsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.metric_alerts_status = MetricAlertsStatusOperations( + self._client, self.config, self._serialize, self._deserialize) + self.scheduled_query_rules = ScheduledQueryRulesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.metric_namespaces = MetricNamespacesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.vm_insights = VMInsightsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/__init__.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/__init__.py new file mode 100644 index 000000000000..6697780b0342 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/__init__.py @@ -0,0 +1,56 @@ +# 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 .autoscale_settings_operations import AutoscaleSettingsOperations +from .operations import Operations +from .alert_rule_incidents_operations import AlertRuleIncidentsOperations +from .alert_rules_operations import AlertRulesOperations +from .log_profiles_operations import LogProfilesOperations +from .diagnostic_settings_operations import DiagnosticSettingsOperations +from .diagnostic_settings_category_operations import DiagnosticSettingsCategoryOperations +from .action_groups_operations import ActionGroupsOperations +from .activity_log_alerts_operations import ActivityLogAlertsOperations +from .activity_logs_operations import ActivityLogsOperations +from .event_categories_operations import EventCategoriesOperations +from .tenant_activity_logs_operations import TenantActivityLogsOperations +from .metric_definitions_operations import MetricDefinitionsOperations +from .metrics_operations import MetricsOperations +from .metric_baseline_operations import MetricBaselineOperations +from .baselines_operations import BaselinesOperations +from .metric_alerts_operations import MetricAlertsOperations +from .metric_alerts_status_operations import MetricAlertsStatusOperations +from .scheduled_query_rules_operations import ScheduledQueryRulesOperations +from .metric_namespaces_operations import MetricNamespacesOperations +from .vm_insights_operations import VMInsightsOperations + +__all__ = [ + 'AutoscaleSettingsOperations', + 'Operations', + 'AlertRuleIncidentsOperations', + 'AlertRulesOperations', + 'LogProfilesOperations', + 'DiagnosticSettingsOperations', + 'DiagnosticSettingsCategoryOperations', + 'ActionGroupsOperations', + 'ActivityLogAlertsOperations', + 'ActivityLogsOperations', + 'EventCategoriesOperations', + 'TenantActivityLogsOperations', + 'MetricDefinitionsOperations', + 'MetricsOperations', + 'MetricBaselineOperations', + 'BaselinesOperations', + 'MetricAlertsOperations', + 'MetricAlertsStatusOperations', + 'ScheduledQueryRulesOperations', + 'MetricNamespacesOperations', + 'VMInsightsOperations', +] diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/action_groups_operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/action_groups_operations.py new file mode 100644 index 000000000000..6029227c4e4a --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/action_groups_operations.py @@ -0,0 +1,484 @@ +# 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 .. import models + + +class ActionGroupsOperations(object): + """ActionGroupsOperations operations. + + :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: Client Api Version. Constant value: "2019-03-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-03-01" + + self.config = config + + def create_or_update( + self, resource_group_name, action_group_name, action_group, custom_headers=None, raw=False, **operation_config): + """Create a new action group or update an existing one. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param action_group_name: The name of the action group. + :type action_group_name: str + :param action_group: The action group to create or use for the update. + :type action_group: ~azure.mgmt.monitor.models.ActionGroupResource + :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: ActionGroupResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.ActionGroupResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # 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(action_group, 'ActionGroupResource') + + # 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, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ActionGroupResource', response) + if response.status_code == 201: + deserialized = self._deserialize('ActionGroupResource', 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/actionGroups/{actionGroupName}'} + + def get( + self, resource_group_name, action_group_name, custom_headers=None, raw=False, **operation_config): + """Get an action group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param action_group_name: The name of the action group. + :type action_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: ActionGroupResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.ActionGroupResource 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'), + 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # 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('ActionGroupResource', 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/actionGroups/{actionGroupName}'} + + def delete( + self, resource_group_name, action_group_name, custom_headers=None, raw=False, **operation_config): + """Delete an action group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param action_group_name: The name of the action group. + :type action_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # 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, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}'} + + def update( + self, resource_group_name, action_group_name, tags=None, enabled=True, custom_headers=None, raw=False, **operation_config): + """Updates an existing action group's tags. To update other fields use the + CreateOrUpdate method. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param action_group_name: The name of the action group. + :type action_group_name: str + :param tags: Resource tags + :type tags: dict[str, str] + :param enabled: Indicates whether this action group is enabled. If an + action group is not enabled, then none of its actions will be + activated. + :type enabled: bool + :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: ActionGroupResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.ActionGroupResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + action_group_patch = models.ActionGroupPatchBody(tags=tags, enabled=enabled) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'actionGroupName': self._serialize.url("action_group_name", action_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') + + # 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(action_group_patch, 'ActionGroupPatchBody') + + # 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('ActionGroupResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}'} + + def list_by_subscription_id( + self, custom_headers=None, raw=False, **operation_config): + """Get a list of all action groups in 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 ActionGroupResource + :rtype: + ~azure.mgmt.monitor.models.ActionGroupResourcePaged[~azure.mgmt.monitor.models.ActionGroupResource] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_subscription_id.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + 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) + 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 + deserialized = models.ActionGroupResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ActionGroupResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_subscription_id.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/actionGroups'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get a list of all action groups in a resource group. + + :param resource_group_name: The name of the resource group. + :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 ActionGroupResource + :rtype: + ~azure.mgmt.monitor.models.ActionGroupResourcePaged[~azure.mgmt.monitor.models.ActionGroupResource] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + 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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + 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) + 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 + deserialized = models.ActionGroupResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ActionGroupResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups'} + + def enable_receiver( + self, resource_group_name, action_group_name, receiver_name, custom_headers=None, raw=False, **operation_config): + """Enable a receiver in an action group. This changes the receiver's + status from Disabled to Enabled. This operation is only supported for + Email or SMS receivers. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param action_group_name: The name of the action group. + :type action_group_name: str + :param receiver_name: The name of the receiver to resubscribe. + :type receiver_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + enable_request = models.EnableRequest(receiver_name=receiver_name) + + # Construct URL + url = self.enable_receiver.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # Construct headers + header_parameters = {} + 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(enable_request, 'EnableRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 409]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + enable_receiver.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}/subscribe'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/activity_log_alerts_operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/activity_log_alerts_operations.py new file mode 100644 index 000000000000..fa5a879120ad --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/activity_log_alerts_operations.py @@ -0,0 +1,424 @@ +# 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 .. import models + + +class ActivityLogAlertsOperations(object): + """ActivityLogAlertsOperations operations. + + :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: Client Api Version. Constant value: "2017-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-04-01" + + self.config = config + + def create_or_update( + self, resource_group_name, activity_log_alert_name, activity_log_alert, custom_headers=None, raw=False, **operation_config): + """Create a new activity log alert or update an existing one. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param activity_log_alert_name: The name of the activity log alert. + :type activity_log_alert_name: str + :param activity_log_alert: The activity log alert to create or use for + the update. + :type activity_log_alert: + ~azure.mgmt.monitor.models.ActivityLogAlertResource + :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: ActivityLogAlertResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.ActivityLogAlertResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'activityLogAlertName': self._serialize.url("activity_log_alert_name", activity_log_alert_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') + + # 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(activity_log_alert, 'ActivityLogAlertResource') + + # 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, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ActivityLogAlertResource', response) + if response.status_code == 201: + deserialized = self._deserialize('ActivityLogAlertResource', 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/activityLogAlerts/{activityLogAlertName}'} + + def get( + self, resource_group_name, activity_log_alert_name, custom_headers=None, raw=False, **operation_config): + """Get an activity log alert. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param activity_log_alert_name: The name of the activity log alert. + :type activity_log_alert_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: ActivityLogAlertResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.ActivityLogAlertResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'activityLogAlertName': self._serialize.url("activity_log_alert_name", activity_log_alert_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') + + # 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('ActivityLogAlertResource', 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/activityLogAlerts/{activityLogAlertName}'} + + def delete( + self, resource_group_name, activity_log_alert_name, custom_headers=None, raw=False, **operation_config): + """Delete an activity log alert. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param activity_log_alert_name: The name of the activity log alert. + :type activity_log_alert_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'activityLogAlertName': self._serialize.url("activity_log_alert_name", activity_log_alert_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') + + # 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, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName}'} + + def update( + self, resource_group_name, activity_log_alert_name, tags=None, enabled=True, custom_headers=None, raw=False, **operation_config): + """Updates an existing ActivityLogAlertResource's tags. To update other + fields use the CreateOrUpdate method. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param activity_log_alert_name: The name of the activity log alert. + :type activity_log_alert_name: str + :param tags: Resource tags + :type tags: dict[str, str] + :param enabled: Indicates whether this activity log alert is enabled. + If an activity log alert is not enabled, then none of its actions will + be activated. + :type enabled: bool + :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: ActivityLogAlertResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.ActivityLogAlertResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + activity_log_alert_patch = models.ActivityLogAlertPatchBody(tags=tags, enabled=enabled) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'activityLogAlertName': self._serialize.url("activity_log_alert_name", activity_log_alert_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') + + # 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(activity_log_alert_patch, 'ActivityLogAlertPatchBody') + + # 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('ActivityLogAlertResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName}'} + + def list_by_subscription_id( + self, custom_headers=None, raw=False, **operation_config): + """Get a list of all activity log alerts in 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 ActivityLogAlertResource + :rtype: + ~azure.mgmt.monitor.models.ActivityLogAlertResourcePaged[~azure.mgmt.monitor.models.ActivityLogAlertResource] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_subscription_id.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + 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) + 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 + deserialized = models.ActivityLogAlertResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ActivityLogAlertResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_subscription_id.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/activityLogAlerts'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get a list of all activity log alerts in a resource group. + + :param resource_group_name: The name of the resource group. + :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 ActivityLogAlertResource + :rtype: + ~azure.mgmt.monitor.models.ActivityLogAlertResourcePaged[~azure.mgmt.monitor.models.ActivityLogAlertResource] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_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') + + 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) + 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 + deserialized = models.ActivityLogAlertResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ActivityLogAlertResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/activity_logs_operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/activity_logs_operations.py new file mode 100644 index 000000000000..eb69376d8ed4 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/activity_logs_operations.py @@ -0,0 +1,132 @@ +# 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 .. import models + + +class ActivityLogsOperations(object): + """ActivityLogsOperations operations. + + :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: Client Api Version. Constant value: "2015-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-04-01" + + self.config = config + + def list( + self, filter=None, 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 + 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 + eq 'resourceGroupName'.
- *List events for resource*: + $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and + eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq + 'resourceURI'.
- *List events for a subscription in a time range*: + $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and + eventTimestamp le '2014-07-20T04:36:37.6407898Z'.
- *List events + for a resource provider*: $filter=eventTimestamp ge + '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + '2014-07-20T04:36:37.6407898Z' and resourceProvider eq + 'resourceProviderName'.
- *List events for a correlation Id*: + $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and + eventTimestamp le '2014-07-20T04:36:37.6407898Z' and correlationId eq + 'correlationID'.

**NOTE**: No other syntax is allowed. + :type filter: str + :param select: Used to fetch events with only the given + properties.
The **$select** argument is a comma separated list of + property names to be returned. Possible values are: *authorization*, + *claims*, *correlationId*, *description*, *eventDataId*, *eventName*, + *eventTimestamp*, *httpRequest*, *level*, *operationId*, + *operationName*, *properties*, *resourceGroupName*, + *resourceProviderName*, *resourceId*, *status*, *submissionTimestamp*, + *subStatus*, *subscriptionId* + :type select: 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 EventData + :rtype: + ~azure.mgmt.monitor.models.EventDataPaged[~azure.mgmt.monitor.models.EventData] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + 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') + } + 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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + + 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) + 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 + deserialized = models.EventDataPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventDataPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/eventtypes/management/values'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/alert_rule_incidents_operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/alert_rule_incidents_operations.py new file mode 100644 index 000000000000..b8f3675c8d8c --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/alert_rule_incidents_operations.py @@ -0,0 +1,172 @@ +# 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 AlertRuleIncidentsOperations(object): + """AlertRuleIncidentsOperations operations. + + :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: Client Api Version. Constant value: "2016-03-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-03-01" + + self.config = config + + def get( + self, resource_group_name, rule_name, incident_name, custom_headers=None, raw=False, **operation_config): + """Gets an incident associated to an alert rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :param incident_name: The name of the incident to retrieve. + :type incident_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: Incident or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.Incident 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'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'incidentName': self._serialize.url("incident_name", incident_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # 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('Incident', 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/alertrules/{ruleName}/incidents/{incidentName}'} + + def list_by_alert_rule( + self, resource_group_name, rule_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of incidents associated to an alert rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_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 Incident + :rtype: + ~azure.mgmt.monitor.models.IncidentPaged[~azure.mgmt.monitor.models.Incident] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_alert_rule.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + 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) + 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 + deserialized = models.IncidentPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.IncidentPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_alert_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}/incidents'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/alert_rules_operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/alert_rules_operations.py new file mode 100644 index 000000000000..932efbdd92c6 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/alert_rules_operations.py @@ -0,0 +1,424 @@ +# 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 AlertRulesOperations(object): + """AlertRulesOperations operations. + + :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: Client Api Version. Constant value: "2016-03-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-03-01" + + self.config = config + + def create_or_update( + self, resource_group_name, rule_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates an alert rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :param parameters: The parameters of the rule to create or update. + :type parameters: ~azure.mgmt.monitor.models.AlertRuleResource + :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: AlertRuleResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.AlertRuleResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # 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, 'AlertRuleResource') + + # 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, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AlertRuleResource', response) + if response.status_code == 201: + deserialized = self._deserialize('AlertRuleResource', 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/alertrules/{ruleName}'} + + def delete( + self, resource_group_name, rule_name, custom_headers=None, raw=False, **operation_config): + """Deletes an alert rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # 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, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}'} + + def get( + self, resource_group_name, rule_name, custom_headers=None, raw=False, **operation_config): + """Gets an alert rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_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: AlertRuleResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.AlertRuleResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # 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('AlertRuleResource', 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/alertrules/{ruleName}'} + + def update( + self, resource_group_name, rule_name, alert_rules_resource, custom_headers=None, raw=False, **operation_config): + """Updates an existing AlertRuleResource. To update other fields use the + CreateOrUpdate method. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :param alert_rules_resource: Parameters supplied to the operation. + :type alert_rules_resource: + ~azure.mgmt.monitor.models.AlertRuleResourcePatch + :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: AlertRuleResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.AlertRuleResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_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') + + # 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(alert_rules_resource, 'AlertRuleResourcePatch') + + # 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, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AlertRuleResource', response) + if response.status_code == 201: + deserialized = self._deserialize('AlertRuleResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """List the alert rules within a resource group. + + :param resource_group_name: The name of the resource group. + :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 AlertRuleResource + :rtype: + ~azure.mgmt.monitor.models.AlertRuleResourcePaged[~azure.mgmt.monitor.models.AlertRuleResource] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + 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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + 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) + 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 + deserialized = models.AlertRuleResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AlertRuleResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """List the alert rules 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 AlertRuleResource + :rtype: + ~azure.mgmt.monitor.models.AlertRuleResourcePaged[~azure.mgmt.monitor.models.AlertRuleResource] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + 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) + 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 + deserialized = models.AlertRuleResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AlertRuleResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/alertrules'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/autoscale_settings_operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/autoscale_settings_operations.py new file mode 100644 index 000000000000..040160a20222 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/autoscale_settings_operations.py @@ -0,0 +1,418 @@ +# 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 .. import models + + +class AutoscaleSettingsOperations(object): + """AutoscaleSettingsOperations operations. + + :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: Client Api Version. Constant value: "2015-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-04-01" + + self.config = config + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists the autoscale settings for a resource group. + + :param resource_group_name: The name of the resource group. + :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 AutoscaleSettingResource + :rtype: + ~azure.mgmt.monitor.models.AutoscaleSettingResourcePaged[~azure.mgmt.monitor.models.AutoscaleSettingResource] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + 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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + 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) + 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 + deserialized = models.AutoscaleSettingResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AutoscaleSettingResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings'} + + def create_or_update( + self, resource_group_name, autoscale_setting_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates an autoscale setting. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param autoscale_setting_name: The autoscale setting name. + :type autoscale_setting_name: str + :param parameters: Parameters supplied to the operation. + :type parameters: ~azure.mgmt.monitor.models.AutoscaleSettingResource + :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: AutoscaleSettingResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.AutoscaleSettingResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'autoscaleSettingName': self._serialize.url("autoscale_setting_name", autoscale_setting_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # 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, 'AutoscaleSettingResource') + + # 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, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AutoscaleSettingResource', response) + if response.status_code == 201: + deserialized = self._deserialize('AutoscaleSettingResource', 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/autoscalesettings/{autoscaleSettingName}'} + + def delete( + self, resource_group_name, autoscale_setting_name, custom_headers=None, raw=False, **operation_config): + """Deletes and autoscale setting. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param autoscale_setting_name: The autoscale setting name. + :type autoscale_setting_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'autoscaleSettingName': self._serialize.url("autoscale_setting_name", autoscale_setting_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # 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, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}'} + + def get( + self, resource_group_name, autoscale_setting_name, custom_headers=None, raw=False, **operation_config): + """Gets an autoscale setting. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param autoscale_setting_name: The autoscale setting name. + :type autoscale_setting_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: AutoscaleSettingResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.AutoscaleSettingResource 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'), + 'autoscaleSettingName': self._serialize.url("autoscale_setting_name", autoscale_setting_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # 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('AutoscaleSettingResource', 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/autoscalesettings/{autoscaleSettingName}'} + + def update( + self, resource_group_name, autoscale_setting_name, autoscale_setting_resource, custom_headers=None, raw=False, **operation_config): + """Updates an existing AutoscaleSettingsResource. To update other fields + use the CreateOrUpdate method. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param autoscale_setting_name: The autoscale setting name. + :type autoscale_setting_name: str + :param autoscale_setting_resource: Parameters supplied to the + operation. + :type autoscale_setting_resource: + ~azure.mgmt.monitor.models.AutoscaleSettingResourcePatch + :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: AutoscaleSettingResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.AutoscaleSettingResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'autoscaleSettingName': self._serialize.url("autoscale_setting_name", autoscale_setting_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') + + # 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(autoscale_setting_resource, 'AutoscaleSettingResourcePatch') + + # 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('AutoscaleSettingResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Lists the autoscale settings for 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 AutoscaleSettingResource + :rtype: + ~azure.mgmt.monitor.models.AutoscaleSettingResourcePaged[~azure.mgmt.monitor.models.AutoscaleSettingResource] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + 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) + 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 + deserialized = models.AutoscaleSettingResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AutoscaleSettingResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/autoscalesettings'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/baselines_operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/baselines_operations.py new file mode 100644 index 000000000000..4e9e9db4363e --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/baselines_operations.py @@ -0,0 +1,150 @@ +# 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 .. import models + + +class BaselinesOperations(object): + """BaselinesOperations operations. + + :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: Client Api Version. Constant value: "2019-03-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-03-01" + + self.config = config + + def list( + self, resource_uri, metricnames=None, metricnamespace=None, timespan=None, interval=None, aggregation=None, sensitivities=None, filter=None, result_type=None, custom_headers=None, raw=False, **operation_config): + """**Lists the metric baseline values for a resource**. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param metricnames: The names of the metrics (comma separated) to + retrieve. + :type metricnames: str + :param metricnamespace: Metric namespace to query metric definitions + for. + :type metricnamespace: str + :param timespan: The timespan of the query. It is a string with the + following format 'startDateTime_ISO/endDateTime_ISO'. + :type timespan: str + :param interval: The interval (i.e. timegrain) of the query. + :type interval: timedelta + :param aggregation: The list of aggregation types (comma separated) to + retrieve. + :type aggregation: str + :param sensitivities: The list of sensitivities (comma separated) to + retrieve. + :type sensitivities: str + :param filter: The **$filter** is used to reduce the set of metric + data returned.
Example:
Metric contains metadata A, B and + C.
- Return all time series of C where A = a1 and B = b1 or + b2
**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq + ‘*’**
- Invalid variant:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C + 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 = + a1
**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + :type filter: str + :param result_type: Allows retrieving only metadata of the baseline. + On data request all information is retrieved. Possible values include: + 'Data', 'Metadata' + :type result_type: str or ~azure.mgmt.monitor.models.ResultType + :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 SingleMetricBaseline + :rtype: + ~azure.mgmt.monitor.models.SingleMetricBaselinePaged[~azure.mgmt.monitor.models.SingleMetricBaseline] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if metricnames is not None: + query_parameters['metricnames'] = self._serialize.query("metricnames", metricnames, 'str') + if metricnamespace is not None: + query_parameters['metricnamespace'] = self._serialize.query("metricnamespace", metricnamespace, 'str') + if timespan is not None: + query_parameters['timespan'] = self._serialize.query("timespan", timespan, 'str') + if interval is not None: + query_parameters['interval'] = self._serialize.query("interval", interval, 'duration') + if aggregation is not None: + query_parameters['aggregation'] = self._serialize.query("aggregation", aggregation, 'str') + if sensitivities is not None: + query_parameters['sensitivities'] = self._serialize.query("sensitivities", sensitivities, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if result_type is not None: + query_parameters['resultType'] = self._serialize.query("result_type", result_type, 'ResultType') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + 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) + 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 + deserialized = models.SingleMetricBaselinePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SingleMetricBaselinePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/metricBaselines'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/diagnostic_settings_category_operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/diagnostic_settings_category_operations.py new file mode 100644 index 000000000000..a6509c52d127 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/diagnostic_settings_category_operations.py @@ -0,0 +1,157 @@ +# 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 .. import models + + +class DiagnosticSettingsCategoryOperations(object): + """DiagnosticSettingsCategoryOperations operations. + + :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: Client Api Version. Constant value: "2017-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-05-01-preview" + + self.config = config + + def get( + self, resource_uri, name, custom_headers=None, raw=False, **operation_config): + """Gets the diagnostic settings category for the specified resource. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param name: The name of the diagnostic setting. + :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: DiagnosticSettingsCategoryResource or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.monitor.models.DiagnosticSettingsCategoryResource + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True), + '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') + + # 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('DiagnosticSettingsCategoryResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/diagnosticSettingsCategories/{name}'} + + def list( + self, resource_uri, custom_headers=None, raw=False, **operation_config): + """Lists the diagnostic settings categories for the specified resource. + + :param resource_uri: The identifier of the resource. + :type resource_uri: 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: DiagnosticSettingsCategoryResourceCollection or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.monitor.models.DiagnosticSettingsCategoryResourceCollection + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True) + } + 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') + + # 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('DiagnosticSettingsCategoryResourceCollection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/diagnosticSettingsCategories'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/diagnostic_settings_operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/diagnostic_settings_operations.py new file mode 100644 index 000000000000..e5b4c8d632cc --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/diagnostic_settings_operations.py @@ -0,0 +1,274 @@ +# 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 .. import models + + +class DiagnosticSettingsOperations(object): + """DiagnosticSettingsOperations operations. + + :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: Client Api Version. Constant value: "2017-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-05-01-preview" + + self.config = config + + def get( + self, resource_uri, name, custom_headers=None, raw=False, **operation_config): + """Gets the active diagnostic settings for the specified resource. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param name: The name of the diagnostic setting. + :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: DiagnosticSettingsResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.DiagnosticSettingsResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True), + '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') + + # 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('DiagnosticSettingsResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/diagnosticSettings/{name}'} + + def create_or_update( + self, resource_uri, parameters, name, custom_headers=None, raw=False, **operation_config): + """Creates or updates diagnostic settings for the specified resource. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param parameters: Parameters supplied to the operation. + :type parameters: + ~azure.mgmt.monitor.models.DiagnosticSettingsResource + :param name: The name of the diagnostic setting. + :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: DiagnosticSettingsResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.DiagnosticSettingsResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True), + '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') + + # 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, 'DiagnosticSettingsResource') + + # 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('DiagnosticSettingsResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/diagnosticSettings/{name}'} + + def delete( + self, resource_uri, name, custom_headers=None, raw=False, **operation_config): + """Deletes existing diagnostic settings for the specified resource. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param name: The name of the diagnostic setting. + :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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True), + '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') + + # 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, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/diagnosticSettings/{name}'} + + def list( + self, resource_uri, custom_headers=None, raw=False, **operation_config): + """Gets the active diagnostic settings list for the specified resource. + + :param resource_uri: The identifier of the resource. + :type resource_uri: 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: DiagnosticSettingsResourceCollection or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.monitor.models.DiagnosticSettingsResourceCollection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True) + } + 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') + + # 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('DiagnosticSettingsResourceCollection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/diagnosticSettings'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/event_categories_operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/event_categories_operations.py new file mode 100644 index 000000000000..69e9fc5bf3ff --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/event_categories_operations.py @@ -0,0 +1,98 @@ +# 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 .. import models + + +class EventCategoriesOperations(object): + """EventCategoriesOperations operations. + + :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: Client Api Version. Constant value: "2015-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-04-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Get the list of available event categories supported in the Activity + Logs Service.
The current list includes the following: + Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. + + :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 LocalizableString + :rtype: + ~azure.mgmt.monitor.models.LocalizableStringPaged[~azure.mgmt.monitor.models.LocalizableString] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + 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) + 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 + deserialized = models.LocalizableStringPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.LocalizableStringPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/microsoft.insights/eventcategories'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/log_profiles_operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/log_profiles_operations.py new file mode 100644 index 000000000000..31c7332b3cc6 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/log_profiles_operations.py @@ -0,0 +1,341 @@ +# 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 LogProfilesOperations(object): + """LogProfilesOperations operations. + + :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: Client Api Version. Constant value: "2016-03-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-03-01" + + self.config = config + + def delete( + self, log_profile_name, custom_headers=None, raw=False, **operation_config): + """Deletes the log profile. + + :param log_profile_name: The name of the log profile. + :type log_profile_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'logProfileName': self._serialize.url("log_profile_name", log_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # 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]: + 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}'} + + def get( + self, log_profile_name, custom_headers=None, raw=False, **operation_config): + """Gets the log profile. + + :param log_profile_name: The name of the log profile. + :type log_profile_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: LogProfileResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.LogProfileResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'logProfileName': self._serialize.url("log_profile_name", log_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # 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('LogProfileResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}'} + + def create_or_update( + self, log_profile_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or update a log profile in Azure Monitoring REST API. + + :param log_profile_name: The name of the log profile. + :type log_profile_name: str + :param parameters: Parameters supplied to the operation. + :type parameters: ~azure.mgmt.monitor.models.LogProfileResource + :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: LogProfileResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.LogProfileResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'logProfileName': self._serialize.url("log_profile_name", log_profile_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # 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, 'LogProfileResource') + + # 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]: + 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('LogProfileResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}'} + + def update( + self, log_profile_name, log_profiles_resource, custom_headers=None, raw=False, **operation_config): + """Updates an existing LogProfilesResource. To update other fields use the + CreateOrUpdate method. + + :param log_profile_name: The name of the log profile. + :type log_profile_name: str + :param log_profiles_resource: Parameters supplied to the operation. + :type log_profiles_resource: + ~azure.mgmt.monitor.models.LogProfileResourcePatch + :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: LogProfileResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.LogProfileResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'logProfileName': self._serialize.url("log_profile_name", log_profile_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') + + # 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(log_profiles_resource, 'LogProfileResourcePatch') + + # 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('LogProfileResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List the log profiles. + + :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 LogProfileResource + :rtype: + ~azure.mgmt.monitor.models.LogProfileResourcePaged[~azure.mgmt.monitor.models.LogProfileResource] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + 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') + } + 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') + + 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) + 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 + deserialized = models.LogProfileResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.LogProfileResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/metric_alerts_operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/metric_alerts_operations.py new file mode 100644 index 000000000000..ad0a818a3d20 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/metric_alerts_operations.py @@ -0,0 +1,415 @@ +# 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 MetricAlertsOperations(object): + """MetricAlertsOperations operations. + + :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: Client Api Version. Constant value: "2018-03-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-03-01" + + self.config = config + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Retrieve alert rule definitions in 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 MetricAlertResource + :rtype: + ~azure.mgmt.monitor.models.MetricAlertResourcePaged[~azure.mgmt.monitor.models.MetricAlertResource] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + 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) + 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 + deserialized = models.MetricAlertResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MetricAlertResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metricAlerts'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Retrieve alert rule definitions in a resource group. + + :param resource_group_name: The name of the resource group. + :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 MetricAlertResource + :rtype: + ~azure.mgmt.monitor.models.MetricAlertResourcePaged[~azure.mgmt.monitor.models.MetricAlertResource] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_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') + + 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) + 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 + deserialized = models.MetricAlertResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MetricAlertResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts'} + + def get( + self, resource_group_name, rule_name, custom_headers=None, raw=False, **operation_config): + """Retrieve an alert rule definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_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: MetricAlertResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.MetricAlertResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_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') + + # 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('MetricAlertResource', 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/metricAlerts/{ruleName}'} + + def create_or_update( + self, resource_group_name, rule_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or update an metric alert definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :param parameters: The parameters of the rule to create or update. + :type parameters: ~azure.mgmt.monitor.models.MetricAlertResource + :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: MetricAlertResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.MetricAlertResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_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') + + # 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, 'MetricAlertResource') + + # 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('MetricAlertResource', 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/metricAlerts/{ruleName}'} + + def update( + self, resource_group_name, rule_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update an metric alert definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :param parameters: The parameters of the rule to update. + :type parameters: ~azure.mgmt.monitor.models.MetricAlertResourcePatch + :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: MetricAlertResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.MetricAlertResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_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') + + # 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, 'MetricAlertResourcePatch') + + # 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('MetricAlertResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}'} + + def delete( + self, resource_group_name, rule_name, custom_headers=None, raw=False, **operation_config): + """Delete an alert rule definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_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') + + # 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, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/metric_alerts_status_operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/metric_alerts_status_operations.py new file mode 100644 index 000000000000..3cc2b07983a3 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/metric_alerts_status_operations.py @@ -0,0 +1,162 @@ +# 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 .. import models + + +class MetricAlertsStatusOperations(object): + """MetricAlertsStatusOperations operations. + + :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: Client Api Version. Constant value: "2018-03-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-03-01" + + self.config = config + + def list( + self, resource_group_name, rule_name, custom_headers=None, raw=False, **operation_config): + """Retrieve an alert rule status. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_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: MetricAlertStatusCollection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.MetricAlertStatusCollection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_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') + + # 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('MetricAlertStatusCollection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}/status'} + + def list_by_name( + self, resource_group_name, rule_name, status_name, custom_headers=None, raw=False, **operation_config): + """Retrieve an alert rule status. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :param status_name: The name of the status. + :type status_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: MetricAlertStatusCollection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.MetricAlertStatusCollection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_name.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'statusName': self._serialize.url("status_name", status_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') + + # 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('MetricAlertStatusCollection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}/status/{statusName}'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/metric_baseline_operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/metric_baseline_operations.py new file mode 100644 index 000000000000..29561c7199eb --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/metric_baseline_operations.py @@ -0,0 +1,196 @@ +# 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 .. import models + + +class MetricBaselineOperations(object): + """MetricBaselineOperations operations. + + :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: Client Api Version. Constant value: "2017-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-11-01-preview" + + self.config = config + + def get( + self, resource_uri, metric_name, timespan=None, interval=None, aggregation=None, sensitivities=None, result_type=None, custom_headers=None, raw=False, **operation_config): + """**Gets the baseline values for a specific metric**. + + :param resource_uri: The identifier of the resource. It has the + following structure: + subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. + For example: + subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 + :type resource_uri: str + :param metric_name: The name of the metric to retrieve the baseline + for. + :type metric_name: str + :param timespan: The timespan of the query. It is a string with the + following format 'startDateTime_ISO/endDateTime_ISO'. + :type timespan: str + :param interval: The interval (i.e. timegrain) of the query. + :type interval: timedelta + :param aggregation: The aggregation type of the metric to retrieve the + baseline for. + :type aggregation: str + :param sensitivities: The list of sensitivities (comma separated) to + retrieve. + :type sensitivities: str + :param result_type: Allows retrieving only metadata of the baseline. + On data request all information is retrieved. Possible values include: + 'Data', 'Metadata' + :type result_type: str or ~azure.mgmt.monitor.models.ResultType + :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: BaselineResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.BaselineResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True), + 'metricName': self._serialize.url("metric_name", metric_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timespan is not None: + query_parameters['timespan'] = self._serialize.query("timespan", timespan, 'str') + if interval is not None: + query_parameters['interval'] = self._serialize.query("interval", interval, 'duration') + if aggregation is not None: + query_parameters['aggregation'] = self._serialize.query("aggregation", aggregation, 'str') + if sensitivities is not None: + query_parameters['sensitivities'] = self._serialize.query("sensitivities", sensitivities, 'str') + if result_type is not None: + query_parameters['resultType'] = self._serialize.query("result_type", result_type, 'ResultType') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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('BaselineResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/baseline/{metricName}'} + + def calculate_baseline( + self, resource_uri, time_series_information, custom_headers=None, raw=False, **operation_config): + """**Lists the baseline values for a resource**. + + :param resource_uri: The identifier of the resource. It has the + following structure: + subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. + For example: + subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1 + :type resource_uri: str + :param time_series_information: Information that need to be specified + to calculate a baseline on a time series. + :type time_series_information: + ~azure.mgmt.monitor.models.TimeSeriesInformation + :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: CalculateBaselineResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.CalculateBaselineResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.calculate_baseline.metadata['url'] + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True) + } + 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') + + # 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(time_series_information, 'TimeSeriesInformation') + + # Construct and send request + request = self._client.post(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('CalculateBaselineResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + calculate_baseline.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/calculatebaseline'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/metric_definitions_operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/metric_definitions_operations.py new file mode 100644 index 000000000000..2a8314656421 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/metric_definitions_operations.py @@ -0,0 +1,107 @@ +# 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 .. import models + + +class MetricDefinitionsOperations(object): + """MetricDefinitionsOperations operations. + + :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: Client Api Version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, resource_uri, metricnamespace=None, custom_headers=None, raw=False, **operation_config): + """Lists the metric definitions for the resource. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param metricnamespace: Metric namespace to query metric definitions + for. + :type metricnamespace: 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 MetricDefinition + :rtype: + ~azure.mgmt.monitor.models.MetricDefinitionPaged[~azure.mgmt.monitor.models.MetricDefinition] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True) + } + 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') + if metricnamespace is not None: + query_parameters['metricnamespace'] = self._serialize.query("metricnamespace", metricnamespace, 'str') + + 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) + 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 + deserialized = models.MetricDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MetricDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/metricDefinitions'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/metric_namespaces_operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/metric_namespaces_operations.py new file mode 100644 index 000000000000..8dd5d6eab792 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/metric_namespaces_operations.py @@ -0,0 +1,107 @@ +# 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 .. import models + + +class MetricNamespacesOperations(object): + """MetricNamespacesOperations operations. + + :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: Client Api Version. Constant value: "2017-12-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-12-01-preview" + + self.config = config + + def list( + self, resource_uri, start_time=None, custom_headers=None, raw=False, **operation_config): + """Lists the metric namespaces for the resource. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param start_time: The ISO 8601 conform Date start time from which to + query for metric namespaces. + :type start_time: 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 MetricNamespace + :rtype: + ~azure.mgmt.monitor.models.MetricNamespacePaged[~azure.mgmt.monitor.models.MetricNamespace] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True) + } + 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') + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'str') + + 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) + 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 + deserialized = models.MetricNamespacePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MetricNamespacePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/metricNamespaces'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/metrics_operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/metrics_operations.py new file mode 100644 index 000000000000..5d5dd9e7f491 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/metrics_operations.py @@ -0,0 +1,150 @@ +# 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 .. import models + + +class MetricsOperations(object): + """MetricsOperations operations. + + :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: Client Api Version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, resource_uri, timespan=None, interval=None, metricnames=None, aggregation=None, top=None, orderby=None, filter=None, result_type=None, metricnamespace=None, custom_headers=None, raw=False, **operation_config): + """**Lists the metric values for a resource**. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param timespan: The timespan of the query. It is a string with the + following format 'startDateTime_ISO/endDateTime_ISO'. + :type timespan: str + :param interval: The interval (i.e. timegrain) of the query. + :type interval: timedelta + :param metricnames: The names of the metrics (comma separated) to + retrieve. + :type metricnames: str + :param aggregation: The list of aggregation types (comma separated) to + retrieve. + :type aggregation: str + :param top: The maximum number of records to retrieve. + Valid only if $filter is specified. + Defaults to 10. + :type top: int + :param orderby: The aggregation to use for sorting results and the + direction of the sort. + Only one order can be specified. + Examples: sum asc. + :type orderby: str + :param filter: The **$filter** is used to reduce the set of metric + data returned.
Example:
Metric contains metadata A, B and + C.
- Return all time series of C where A = a1 and B = b1 or + b2
**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq + ‘*’**
- Invalid variant:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C + 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 = + a1
**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + :type filter: str + :param result_type: Reduces the set of data collected. The syntax + allowed depends on the operation. See the operation's description for + details. Possible values include: 'Data', 'Metadata' + :type result_type: str or ~azure.mgmt.monitor.models.ResultType + :param metricnamespace: Metric namespace to query metric definitions + for. + :type metricnamespace: 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: Response or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.Response or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timespan is not None: + query_parameters['timespan'] = self._serialize.query("timespan", timespan, 'str') + if interval is not None: + query_parameters['interval'] = self._serialize.query("interval", interval, 'duration') + if metricnames is not None: + query_parameters['metricnames'] = self._serialize.query("metricnames", metricnames, 'str') + if aggregation is not None: + query_parameters['aggregation'] = self._serialize.query("aggregation", aggregation, 'str') + if top is not None: + query_parameters['top'] = self._serialize.query("top", top, 'int') + if orderby is not None: + query_parameters['orderby'] = self._serialize.query("orderby", orderby, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if result_type is not None: + query_parameters['resultType'] = self._serialize.query("result_type", result_type, 'ResultType') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if metricnamespace is not None: + query_parameters['metricnamespace'] = self._serialize.query("metricnamespace", metricnamespace, 'str') + + # 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('Response', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/metrics'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/operations.py new file mode 100644 index 000000000000..3d97da861138 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/operations.py @@ -0,0 +1,90 @@ +# 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 Operations(object): + """Operations operations. + + :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: Client Api Version. Constant value: "2015-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-04-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available operations from Microsoft.Insights provider. + + :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: OperationListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.OperationListResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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('OperationListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/microsoft.insights/operations'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/scheduled_query_rules_operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/scheduled_query_rules_operations.py new file mode 100644 index 000000000000..880112f3daef --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/scheduled_query_rules_operations.py @@ -0,0 +1,433 @@ +# 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 .. import models + + +class ScheduledQueryRulesOperations(object): + """ScheduledQueryRulesOperations operations. + + :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: Client Api Version. Constant value: "2018-04-16". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-04-16" + + self.config = config + + def create_or_update( + self, resource_group_name, rule_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates an log search rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :param parameters: The parameters of the rule to create or update. + :type parameters: ~azure.mgmt.monitor.models.LogSearchRuleResource + :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: LogSearchRuleResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.LogSearchRuleResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_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') + + # 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, 'LogSearchRuleResource') + + # 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, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LogSearchRuleResource', response) + if response.status_code == 201: + deserialized = self._deserialize('LogSearchRuleResource', 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/scheduledQueryRules/{ruleName}'} + + def get( + self, resource_group_name, rule_name, custom_headers=None, raw=False, **operation_config): + """Gets an Log Search rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_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: LogSearchRuleResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.LogSearchRuleResource 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'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # 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('LogSearchRuleResource', 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/scheduledQueryRules/{ruleName}'} + + def update( + self, resource_group_name, rule_name, tags=None, enabled=None, custom_headers=None, raw=False, **operation_config): + """Update log search Rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :param tags: Resource tags + :type tags: dict[str, str] + :param enabled: The flag which indicates whether the Log Search rule + is enabled. Value should be true or false. Possible values include: + 'true', 'false' + :type enabled: str or ~azure.mgmt.monitor.models.Enabled + :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: LogSearchRuleResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.LogSearchRuleResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.LogSearchRuleResourcePatch(tags=tags, enabled=enabled) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_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') + + # 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, 'LogSearchRuleResourcePatch') + + # 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('LogSearchRuleResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules/{ruleName}'} + + def delete( + self, resource_group_name, rule_name, custom_headers=None, raw=False, **operation_config): + """Deletes a Log Search rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + + # 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, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules/{ruleName}'} + + def list_by_subscription( + self, filter=None, custom_headers=None, raw=False, **operation_config): + """List the Log Search rules within a subscription group. + + :param filter: The filter to apply on the operation. For more + information please see + https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx + :type filter: 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 LogSearchRuleResource + :rtype: + ~azure.mgmt.monitor.models.LogSearchRuleResourcePaged[~azure.mgmt.monitor.models.LogSearchRuleResource] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + 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) + 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 + deserialized = models.LogSearchRuleResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.LogSearchRuleResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/scheduledQueryRules'} + + def list_by_resource_group( + self, resource_group_name, filter=None, custom_headers=None, raw=False, **operation_config): + """List the Log Search rules within a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param filter: The filter to apply on the operation. For more + information please see + https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx + :type filter: 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 LogSearchRuleResource + :rtype: + ~azure.mgmt.monitor.models.LogSearchRuleResourcePaged[~azure.mgmt.monitor.models.LogSearchRuleResource] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + 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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + 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) + 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 + deserialized = models.LogSearchRuleResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.LogSearchRuleResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/tenant_activity_logs_operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/tenant_activity_logs_operations.py new file mode 100644 index 000000000000..661a649e0085 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/tenant_activity_logs_operations.py @@ -0,0 +1,134 @@ +# 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 .. import models + + +class TenantActivityLogsOperations(object): + """TenantActivityLogsOperations operations. + + :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: Client Api Version. Constant value: "2015-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-04-01" + + self.config = config + + def list( + self, filter=None, select=None, custom_headers=None, raw=False, **operation_config): + """Gets the Activity Logs for the Tenant.
Everything that is applicable + to the API to get the Activity Logs for the subscription is applicable + to this API (the parameters, $filter, etc.).
One thing to point out + here is that this API does *not* retrieve the logs at the individual + subscription of the tenant but only surfaces the logs that were + generated at the tenant level. + + :param filter: Reduces the set of data collected.
The **$filter** + is very restricted and allows only the following patterns.
- List + events for a resource group: $filter=eventTimestamp ge '' + and eventTimestamp le '' and eventChannels eq 'Admin, + Operation' and resourceGroupName eq ''.
- List + events for resource: $filter=eventTimestamp ge '' and + eventTimestamp le '' and eventChannels eq 'Admin, Operation' + and resourceUri eq ''.
- List events for a + subscription: $filter=eventTimestamp ge '' and + eventTimestamp le '' and eventChannels eq 'Admin, + Operation'.
- List events for a resource provider: + $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, Operation' and resourceProvider eq + ''.
- List events for a correlation Id: + api-version=2014-04-01&$filter=eventTimestamp ge + '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' + and correlationId eq ''.
**NOTE**: No other syntax + is allowed. + :type filter: str + :param select: Used to fetch events with only the given + properties.
The **$select** argument is a comma separated list of + property names to be returned. Possible values are: *authorization*, + *claims*, *correlationId*, *description*, *eventDataId*, *eventName*, + *eventTimestamp*, *httpRequest*, *level*, *operationId*, + *operationName*, *properties*, *resourceGroupName*, + *resourceProviderName*, *resourceId*, *status*, *submissionTimestamp*, + *subStatus*, *subscriptionId* + :type select: 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 EventData + :rtype: + ~azure.mgmt.monitor.models.EventDataPaged[~azure.mgmt.monitor.models.EventData] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # 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') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + + 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) + 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 + deserialized = models.EventDataPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventDataPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/microsoft.insights/eventtypes/management/values'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/vm_insights_operations.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/vm_insights_operations.py new file mode 100644 index 000000000000..408e2bd83d3a --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/operations/vm_insights_operations.py @@ -0,0 +1,96 @@ +# 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 .. import models + + +class VMInsightsOperations(object): + """VMInsightsOperations operations. + + :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: API version. Constant value: "2018-11-27-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-27-preview" + + self.config = config + + def get_onboarding_status( + self, resource_uri, custom_headers=None, raw=False, **operation_config): + """Retrieves the VM Insights onboarding status for the specified resource + or resource scope. + + :param resource_uri: The fully qualified Azure Resource manager + identifier of the resource, or scope, whose status to retrieve. + :type resource_uri: 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: VMInsightsOnboardingStatus or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.VMInsightsOnboardingStatus or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ResponseWithErrorException` + """ + # Construct URL + url = self.get_onboarding_status.metadata['url'] + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True) + } + 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') + + # 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.ResponseWithErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VMInsightsOnboardingStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_onboarding_status.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default'} diff --git a/monitor/azure-mgmt-monitor/azure/mgmt/monitor/version.py b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/version.py new file mode 100644 index 000000000000..5a7feab42d26 --- /dev/null +++ b/monitor/azure-mgmt-monitor/azure/mgmt/monitor/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 = "0.6.0" +