diff --git a/azure-mgmt-monitor/HISTORY.rst b/azure-mgmt-monitor/HISTORY.rst index 4006495dcf02..53018fbc70f4 100644 --- a/azure-mgmt-monitor/HISTORY.rst +++ b/azure-mgmt-monitor/HISTORY.rst @@ -3,8 +3,27 @@ Release History =============== -unreleased (2017-XX-XX) -+++++++++++++++++++++++ +0.4.0 (2017-10-25) +++++++++++++++++++ + +**Features** + +- Merge into this package the "azure-monitor" package including following operations groups + + - event categories + - activity log + - tenant activity log + - metrics definitions + - metrics + +- Adding new multi-dimensional metrics API + +**Breaking changes** + +- Some exceptions have moved from CloudError to ErrorResponseException +- "service_diagnostic_settings" renamed to "diagnostic_settings" + +- Update API version of "metrics". Migrating from "azure-monitor" to "metrics" here needs to be rewritten. **Bug fixes** diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py index 3fc6739b487a..b4da43b8c4ce 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py @@ -24,6 +24,9 @@ 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 @@ -42,10 +45,13 @@ 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 .service_diagnostic_settings_resource import ServiceDiagnosticSettingsResource -from .service_diagnostic_settings_resource_patch import ServiceDiagnosticSettingsResourcePatch +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 @@ -57,12 +63,26 @@ 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 .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 .monitor_management_client_enums import ( MetricStatisticType, TimeAggregationType, @@ -72,7 +92,12 @@ RecurrenceFrequency, ConditionOperator, TimeAggregationOperator, + CategoryType, ReceiverStatus, + EventLevel, + Unit, + AggregationType, + ResultType, ) __all__ = [ @@ -91,6 +116,9 @@ 'AutoscaleSettingResource', 'AutoscaleSettingResourcePatch', 'ErrorResponse', 'ErrorResponseException', + 'OperationDisplay', + 'Operation', + 'OperationListResult', 'Incident', 'RuleDataSource', 'RuleCondition', @@ -109,10 +137,13 @@ 'RetentionPolicy', 'LogProfileResource', 'LogProfileResourcePatch', + 'ProxyOnlyResource', 'MetricSettings', 'LogSettings', - 'ServiceDiagnosticSettingsResource', - 'ServiceDiagnosticSettingsResourcePatch', + 'DiagnosticSettingsResource', + 'DiagnosticSettingsResourceCollection', + 'DiagnosticSettingsCategoryResource', + 'DiagnosticSettingsCategoryResourceCollection', 'EmailReceiver', 'SmsReceiver', 'WebhookReceiver', @@ -124,12 +155,26 @@ 'ActivityLogAlertActionList', 'ActivityLogAlertResource', 'ActivityLogAlertPatchBody', + 'LocalizableString', + 'SenderAuthorization', + 'HttpRequestInfo', + 'EventData', + 'MetricAvailability', + 'MetricDefinition', + 'MetricValue', + 'MetadataValue', + 'TimeSeriesElement', + 'Metric', + 'Response', 'AutoscaleSettingResourcePaged', 'IncidentPaged', 'AlertRuleResourcePaged', 'LogProfileResourcePaged', 'ActionGroupResourcePaged', 'ActivityLogAlertResourcePaged', + 'EventDataPaged', + 'LocalizableStringPaged', + 'MetricDefinitionPaged', 'MetricStatisticType', 'TimeAggregationType', 'ComparisonOperationType', @@ -138,5 +183,10 @@ 'RecurrenceFrequency', 'ConditionOperator', 'TimeAggregationOperator', + 'CategoryType', 'ReceiverStatus', + 'EventLevel', + 'Unit', + 'AggregationType', + 'ResultType', ] diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/action_group_resource.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/action_group_resource.py index bca4fb7e8f20..cdec9c1ab992 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/action_group_resource.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/action_group_resource.py @@ -27,26 +27,23 @@ class ActionGroupResource(Resource): :param location: Resource location :type location: str :param tags: Resource tags - :type tags: dict + :type tags: dict[str, str] :param group_short_name: The short name of the action group. This will be used in SMS messages. :type group_short_name: str :param enabled: Indicates whether this action group is enabled. If an - action group is not enabled, then none of its receviers will receive + 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 of :class:`EmailReceiver - ` + :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 of :class:`SmsReceiver - ` + :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 of :class:`WebhookReceiver - ` + :type webhook_receivers: list[~azure.mgmt.monitor.models.WebhookReceiver] """ _validation = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_action_group.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_action_group.py index 6d122fc8775e..2e9cc3ebbf60 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_action_group.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_action_group.py @@ -20,7 +20,7 @@ class ActivityLogAlertActionGroup(Model): :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 + :type webhook_properties: dict[str, str] """ _validation = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_action_list.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_action_list.py index d9c99eb9f81c..b14666a31e69 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_action_list.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_action_list.py @@ -16,8 +16,8 @@ class ActivityLogAlertActionList(Model): """A list of activity log alert actions. :param action_groups: The list of activity log alerts. - :type action_groups: list of :class:`ActivityLogAlertActionGroup - ` + :type action_groups: + list[~azure.mgmt.monitor.models.ActivityLogAlertActionGroup] """ _attribute_map = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_all_of_condition.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_all_of_condition.py index 716763b8acc1..c994227b87ed 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_all_of_condition.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_all_of_condition.py @@ -17,8 +17,8 @@ class ActivityLogAlertAllOfCondition(Model): are met. :param all_of: The list of activity log alert conditions. - :type all_of: list of :class:`ActivityLogAlertLeafCondition - ` + :type all_of: + list[~azure.mgmt.monitor.models.ActivityLogAlertLeafCondition] """ _validation = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_patch_body.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_patch_body.py index 13e23b73c0d8..ef6f13e2558a 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_patch_body.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_patch_body.py @@ -16,7 +16,7 @@ class ActivityLogAlertPatchBody(Model): """An activity log alert object for the body of patch operations. :param tags: Resource tags - :type tags: dict + :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 . diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_resource.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_resource.py index b342c732402f..c27273a5df87 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_resource.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/activity_log_alert_resource.py @@ -27,21 +27,19 @@ class ActivityLogAlertResource(Resource): :param location: Resource location :type location: str :param tags: Resource tags - :type tags: dict + :type tags: dict[str, str] :param scopes: 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 of str + :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: The conditon that will cause this alert to activate. - :type condition: :class:`ActivityLogAlertAllOfCondition - ` + :param condition: The condition that will cause this alert to activate. + :type condition: ~azure.mgmt.monitor.models.ActivityLogAlertAllOfCondition :param actions: The actions that will activate when the condition is met. - :type actions: :class:`ActivityLogAlertActionList - ` + :type actions: ~azure.mgmt.monitor.models.ActivityLogAlertActionList :param description: A description of this activity log alert. :type description: str """ diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource.py index 56a5fd580e0a..a7a074fc5038 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource.py @@ -27,7 +27,7 @@ class AlertRuleResource(Resource): :param location: Resource location :type location: str :param tags: Resource tags - :type tags: dict + :type tags: dict[str, str] :param alert_rule_resource_name: the name of the alert rule. :type alert_rule_resource_name: str :param description: the description of the alert rule that will be @@ -38,12 +38,10 @@ class AlertRuleResource(Resource): :type is_enabled: bool :param condition: the condition that results in the alert rule being activated. - :type condition: :class:`RuleCondition - ` + :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 of :class:`RuleAction - ` + :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 """ diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource_patch.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource_patch.py index 010166b0c12d..8877ac7d2830 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource_patch.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource_patch.py @@ -19,7 +19,7 @@ class AlertRuleResourcePatch(Model): sending a request. :param tags: Resource tags - :type tags: dict + :type tags: dict[str, str] :param name: the name of the alert rule. :type name: str :param description: the description of the alert rule that will be @@ -30,12 +30,10 @@ class AlertRuleResourcePatch(Model): :type is_enabled: bool :param condition: the condition that results in the alert rule being activated. - :type condition: :class:`RuleCondition - ` + :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 of :class:`RuleAction - ` + :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 """ diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_notification.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_notification.py index b25af4778376..fbb63c0ceb3e 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_notification.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_notification.py @@ -22,11 +22,9 @@ class AutoscaleNotification(Model): value must be "scale". Default value: "Scale" . :vartype operation: str :param email: the email notification. - :type email: :class:`EmailNotification - ` + :type email: ~azure.mgmt.monitor.models.EmailNotification :param webhooks: the collection of webhook notifications. - :type webhooks: list of :class:`WebhookNotification - ` + :type webhooks: list[~azure.mgmt.monitor.models.WebhookNotification] """ _validation = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_profile.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_profile.py index 3b06cd544773..912b2a2c6dd5 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_profile.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_profile.py @@ -19,20 +19,16 @@ class AutoscaleProfile(Model): :type name: str :param capacity: the number of instances that can be used during this profile. - :type capacity: :class:`ScaleCapacity - ` + :type capacity: ~azure.mgmt.monitor.models.ScaleCapacity :param rules: 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 of :class:`ScaleRule - ` + :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: :class:`TimeWindow - ` + :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: :class:`Recurrence - ` + :type recurrence: ~azure.mgmt.monitor.models.Recurrence """ _validation = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource.py index 38e945c1f1c4..b58bb677e7b1 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource.py @@ -27,15 +27,14 @@ class AutoscaleSettingResource(Resource): :param location: Resource location :type location: str :param tags: Resource tags - :type tags: dict + :type tags: dict[str, str] :param profiles: 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 of :class:`AutoscaleProfile - ` + :type profiles: list[~azure.mgmt.monitor.models.AutoscaleProfile] :param notifications: the collection of notifications. - :type notifications: list of :class:`AutoscaleNotification - ` + :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 . diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource_patch.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource_patch.py index 50c8526aed10..e8e45c5b66d6 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource_patch.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_setting_resource_patch.py @@ -16,15 +16,14 @@ class AutoscaleSettingResourcePatch(Model): """The autoscale setting object for patch operations. :param tags: Resource tags - :type tags: dict + :type tags: dict[str, str] :param profiles: 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 of :class:`AutoscaleProfile - ` + :type profiles: list[~azure.mgmt.monitor.models.AutoscaleProfile] :param notifications: the collection of notifications. - :type notifications: list of :class:`AutoscaleNotification - ` + :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 . diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_category_resource.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_category_resource.py new file mode 100644 index 000000000000..4103b2e9bcbd --- /dev/null +++ b/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, category_type=None): + super(DiagnosticSettingsCategoryResource, self).__init__() + self.category_type = category_type diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_category_resource_collection.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_category_resource_collection.py new file mode 100644 index 000000000000..2a375065985b --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_category_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 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): + self.value = value diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/service_diagnostic_settings_resource.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_resource.py similarity index 65% rename from azure-mgmt-monitor/azure/mgmt/monitor/models/service_diagnostic_settings_resource.py rename to azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_resource.py index 975af3460335..a022ef0d9bad 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/service_diagnostic_settings_resource.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_resource.py @@ -9,11 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .proxy_only_resource import ProxyOnlyResource -class ServiceDiagnosticSettingsResource(Resource): - """Description of a service diagnostic setting. +class DiagnosticSettingsResource(ProxyOnlyResource): + """The diagnostic setting resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -24,27 +24,19 @@ class ServiceDiagnosticSettingsResource(Resource): :vartype name: str :ivar type: Azure resource type :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags - :type tags: dict :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 service bus - namespace in which you would like to have Event Hubs created for streaming - Diagnostic Logs. The rule ID is of the format: '{service bus resource - ID}/authorizationrules/{key name}'. - :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 of :class:`MetricSettings - ` + :type metrics: list[~azure.mgmt.monitor.models.MetricSettings] :param logs: the list of logs settings. - :type logs: list of :class:`LogSettings - ` + :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: @@ -56,28 +48,25 @@ class ServiceDiagnosticSettingsResource(Resource): '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}'}, '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, location, tags=None, storage_account_id=None, service_bus_rule_id=None, event_hub_authorization_rule_id=None, metrics=None, logs=None, workspace_id=None): - super(ServiceDiagnosticSettingsResource, self).__init__(location=location, tags=tags) + def __init__(self, storage_account_id=None, event_hub_authorization_rule_id=None, event_hub_name=None, metrics=None, logs=None, workspace_id=None): + super(DiagnosticSettingsResource, self).__init__() 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/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_resource_collection.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_resource_collection.py new file mode 100644 index 000000000000..7f9fcf968deb --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/diagnostic_settings_resource_collection.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.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): + self.value = value diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/email_notification.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/email_notification.py index 8b9eef93bc72..5195a5f2e045 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/email_notification.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/email_notification.py @@ -23,7 +23,7 @@ class EmailNotification(Model): :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 of str + :type custom_emails: list[str] """ _attribute_map = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/email_receiver.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/email_receiver.py index 7c0f630989e9..736c7e527e05 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/email_receiver.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/email_receiver.py @@ -25,8 +25,7 @@ class EmailReceiver(Model): :type email_address: str :ivar status: The receiver status of the e-mail. Possible values include: 'NotSpecified', 'Enabled', 'Disabled' - :vartype status: str or :class:`ReceiverStatus - ` + :vartype status: str or ~azure.mgmt.monitor.models.ReceiverStatus """ _validation = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/event_data.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/event_data.py new file mode 100644 index 000000000000..c4ea4df1b37e --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/event_data.py @@ -0,0 +1,155 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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. + + :param authorization: + :type authorization: ~azure.mgmt.monitor.models.SenderAuthorization + :param claims: key value pairs to identify ARM permissions. + :type claims: dict[str, str] + :param caller: the email address of the user who has performed the + operation, the UPN claim or SPN claim based on availability. + :type caller: str + :param description: the description of the event. + :type description: str + :param id: the Id of this event as required by ARM for RBAC. It contains + the EventDataID and a timestamp information. + :type id: str + :param event_data_id: the event data Id. This is a unique identifier for + an event. + :type event_data_id: str + :param 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. + :type correlation_id: str + :param event_name: the event name. This value should not be confused with + OperationName. For practical purposes, OperationName might be more + appealing to end users. + :type event_name: ~azure.mgmt.monitor.models.LocalizableString + :param category: the event category. + :type category: ~azure.mgmt.monitor.models.LocalizableString + :param 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). + :type http_request: ~azure.mgmt.monitor.models.HttpRequestInfo + :param level: the event level. Possible values include: 'Critical', + 'Error', 'Warning', 'Informational', 'Verbose' + :type level: str or ~azure.mgmt.monitor.models.EventLevel + :param resource_group_name: the resource group name of the impacted + resource. + :type resource_group_name: str + :param resource_provider_name: the resource provider name of the impacted + resource. + :type resource_provider_name: ~azure.mgmt.monitor.models.LocalizableString + :param resource_id: the resource uri that uniquely identifies the resource + that caused this event. + :type resource_id: str + :param resource_type: the resource type + :type resource_type: ~azure.mgmt.monitor.models.LocalizableString + :param operation_id: It is usually a GUID shared among the events + corresponding to single operation. This value should not be confused with + EventName. + :type operation_id: str + :param operation_name: the operation name. + :type operation_name: ~azure.mgmt.monitor.models.LocalizableString + :param properties: the set of pairs (usually a + Dictionary) that includes details about the event. + :type properties: dict[str, str] + :param status: a string describing the status of the operation. Some + typical values are: Started, In progress, Succeeded, Failed, Resolved. + :type status: ~azure.mgmt.monitor.models.LocalizableString + :param 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) + :type sub_status: ~azure.mgmt.monitor.models.LocalizableString + :param 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. + :type event_timestamp: datetime + :param 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. + :type submission_timestamp: datetime + :param subscription_id: the Azure subscription Id usually a GUID. + :type subscription_id: str + :param tenant_id: the Azure tenant Id + :type tenant_id: str + """ + + _validation = { + 'level': {'required': True}, + 'event_timestamp': {'required': True}, + 'submission_timestamp': {'required': 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, level, event_timestamp, submission_timestamp, authorization=None, claims=None, caller=None, description=None, id=None, event_data_id=None, correlation_id=None, event_name=None, category=None, http_request=None, resource_group_name=None, resource_provider_name=None, resource_id=None, resource_type=None, operation_id=None, operation_name=None, properties=None, status=None, sub_status=None, subscription_id=None, tenant_id=None): + self.authorization = authorization + self.claims = claims + self.caller = caller + self.description = description + self.id = id + self.event_data_id = event_data_id + self.correlation_id = correlation_id + self.event_name = event_name + self.category = category + self.http_request = http_request + self.level = level + self.resource_group_name = resource_group_name + self.resource_provider_name = resource_provider_name + self.resource_id = resource_id + self.resource_type = resource_type + self.operation_id = operation_id + self.operation_name = operation_name + self.properties = properties + self.status = status + self.sub_status = sub_status + self.event_timestamp = event_timestamp + self.submission_timestamp = submission_timestamp + self.subscription_id = subscription_id + self.tenant_id = tenant_id diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/event_data_paged.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/event_data_paged.py new file mode 100644 index 000000000000..dbe14dfbe747 --- /dev/null +++ b/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/azure-mgmt-monitor/azure/mgmt/monitor/models/http_request_info.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/http_request_info.py new file mode 100644 index 000000000000..9ba218c62c28 --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/http_request_info.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 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=None, client_ip_address=None, method=None, uri=None): + self.client_request_id = client_request_id + self.client_ip_address = client_ip_address + self.method = method + self.uri = uri diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/localizable_string.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/localizable_string.py new file mode 100644 index 000000000000..5de6dea750c0 --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/localizable_string.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 LocalizableString(Model): + """The localizable string class. + + :param value: 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, localized_value=None): + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/localizable_string_paged.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/localizable_string_paged.py new file mode 100644 index 000000000000..bde773362a14 --- /dev/null +++ b/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/azure-mgmt-monitor/azure/mgmt/monitor/models/location_threshold_rule_condition.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/location_threshold_rule_condition.py index 3e4e5e1b6b96..5c67c3027dd2 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/location_threshold_rule_condition.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/location_threshold_rule_condition.py @@ -17,9 +17,8 @@ class LocationThresholdRuleCondition(RuleCondition): :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: :class:`RuleDataSource - ` - :param odatatype: Polymorphic Discriminator + :type data_source: ~azure.mgmt.monitor.models.RuleDataSource + :param odatatype: 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 diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource.py index f9ecb885b923..0ab72410609a 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource.py @@ -27,7 +27,7 @@ class LogProfileResource(Resource): :param location: Resource location :type location: str :param tags: Resource tags - :type tags: dict + :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 @@ -39,14 +39,13 @@ class LogProfileResource(Resource): :param locations: 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 of str + :type locations: list[str] :param categories: 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 of str + :type categories: list[str] :param retention_policy: the retention policy for the events in the log. - :type retention_policy: :class:`RetentionPolicy - ` + :type retention_policy: ~azure.mgmt.monitor.models.RetentionPolicy """ _validation = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource_patch.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource_patch.py index 74ca22e30375..ec9ff28c65ad 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource_patch.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/log_profile_resource_patch.py @@ -16,7 +16,7 @@ class LogProfileResourcePatch(Model): """The log profile resource for patch operations. :param tags: Resource tags - :type tags: dict + :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 @@ -28,14 +28,13 @@ class LogProfileResourcePatch(Model): :param locations: 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 of str + :type locations: list[str] :param categories: 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 of str + :type categories: list[str] :param retention_policy: the retention policy for the events in the log. - :type retention_policy: :class:`RetentionPolicy - ` + :type retention_policy: ~azure.mgmt.monitor.models.RetentionPolicy """ _validation = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/log_settings.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/log_settings.py index 5a8f34317153..976c85def351 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/log_settings.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/log_settings.py @@ -24,8 +24,7 @@ class LogSettings(Model): :param enabled: a value indicating whether this log is enabled. :type enabled: bool :param retention_policy: the retention policy for this log. - :type retention_policy: :class:`RetentionPolicy - ` + :type retention_policy: ~azure.mgmt.monitor.models.RetentionPolicy """ _validation = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/management_event_aggregation_condition.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/management_event_aggregation_condition.py index 1273fcd1483a..ce3e48f92002 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/management_event_aggregation_condition.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/management_event_aggregation_condition.py @@ -17,8 +17,7 @@ class ManagementEventAggregationCondition(Model): :param operator: the condition operator. Possible values include: 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' - :type operator: str or :class:`ConditionOperator - ` + :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 diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/management_event_rule_condition.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/management_event_rule_condition.py index 6562136bafc3..5c6775bb0f67 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/management_event_rule_condition.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/management_event_rule_condition.py @@ -17,16 +17,15 @@ class ManagementEventRuleCondition(RuleCondition): :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: :class:`RuleDataSource - ` - :param odatatype: Polymorphic Discriminator + :type data_source: ~azure.mgmt.monitor.models.RuleDataSource + :param odatatype: 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: :class:`ManagementEventAggregationCondition - ` + :type aggregation: + ~azure.mgmt.monitor.models.ManagementEventAggregationCondition """ _validation = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/metadata_value.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/metadata_value.py new file mode 100644 index 000000000000..d8f5c8a849f3 --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/metadata_value.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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=None): + self.name = name + self.value = value diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/metric.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/metric.py new file mode 100644 index 000000000000..da3a2e224975 --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/metric.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 Metric(Model): + """The result data of a query. + + :param id: the metric Id. + :type id: str + :param type: the resource type of the metric resource. + :type type: str + :param name: the name and the display name of the metric, i.e. it is + 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 timeseries: 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, type, name, unit, timeseries): + self.id = id + self.type = type + self.name = name + self.unit = unit + self.timeseries = timeseries diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_availability.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_availability.py new file mode 100644 index 000000000000..cf9b4bf2ef16 --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_availability.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 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): + self.time_grain = time_grain + self.retention = retention diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_definition.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_definition.py new file mode 100644 index 000000000000..d2d9adf8a399 --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_definition.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 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 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 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'}, + 'name': {'key': 'name', 'type': 'LocalizableString'}, + 'unit': {'key': 'unit', 'type': 'Unit'}, + 'primary_aggregation_type': {'key': 'primaryAggregationType', 'type': 'AggregationType'}, + 'metric_availabilities': {'key': 'metricAvailabilities', 'type': '[MetricAvailability]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[LocalizableString]'}, + } + + def __init__(self, is_dimension_required=None, resource_id=None, name=None, unit=None, primary_aggregation_type=None, metric_availabilities=None, id=None, dimensions=None): + self.is_dimension_required = is_dimension_required + self.resource_id = resource_id + self.name = name + self.unit = unit + self.primary_aggregation_type = primary_aggregation_type + self.metric_availabilities = metric_availabilities + self.id = id + self.dimensions = dimensions diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_definition_paged.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_definition_paged.py new file mode 100644 index 000000000000..14f00a1ba9bd --- /dev/null +++ b/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/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_settings.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_settings.py index e78e80f1d582..e605018df4b2 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_settings.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_settings.py @@ -18,25 +18,30 @@ class MetricSettings(Model): :param time_grain: the timegrain of the metric in ISO8601 format. :type time_grain: timedelta - :param enabled: a value indicating whether this timegrain is enabled. + :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: a value indicating whether this category is enabled. :type enabled: bool - :param retention_policy: the retention policy for this timegrain. - :type retention_policy: :class:`RetentionPolicy - ` + :param retention_policy: the retention policy for this category. + :type retention_policy: ~azure.mgmt.monitor.models.RetentionPolicy """ _validation = { - 'time_grain': {'required': True}, '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, time_grain, enabled, retention_policy=None): + def __init__(self, enabled, time_grain=None, category=None, retention_policy=None): self.time_grain = time_grain + self.category = category self.enabled = enabled self.retention_policy = retention_policy diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_trigger.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_trigger.py index c3fb55a777b3..7fd84ff68965 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_trigger.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_trigger.py @@ -28,8 +28,7 @@ class MetricTrigger(Model): :param statistic: the metric statistic type. How the metrics from multiple instances are combined. Possible values include: 'Average', 'Min', 'Max', 'Sum' - :type statistic: str or :class:`MetricStatisticType - ` + :type statistic: str or ~azure.mgmt.monitor.models.MetricStatisticType :param time_window: 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. @@ -37,13 +36,12 @@ class MetricTrigger(Model): :param time_aggregation: 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' - :type time_aggregation: str or :class:`TimeAggregationType - ` + :type time_aggregation: str or + ~azure.mgmt.monitor.models.TimeAggregationType :param operator: 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 :class:`ComparisonOperationType - ` + :type operator: str or ~azure.mgmt.monitor.models.ComparisonOperationType :param threshold: the threshold of the metric that triggers the scale action. :type threshold: float diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_value.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_value.py new file mode 100644 index 000000000000..cb0886b50c40 --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/metric_value.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 MetricValue(Model): + """Represents a metric value. + + :param time_stamp: 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=None, minimum=None, maximum=None, total=None, count=None): + self.time_stamp = time_stamp + self.average = average + self.minimum = minimum + self.maximum = maximum + self.total = total + self.count = count diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/monitor_management_client_enums.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/monitor_management_client_enums.py index a2199f7aae10..bc378461b4ec 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/monitor_management_client_enums.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/monitor_management_client_enums.py @@ -82,8 +82,52 @@ class TimeAggregationOperator(Enum): last = "Last" +class CategoryType(Enum): + + metrics = "Metrics" + logs = "Logs" + + class ReceiverStatus(Enum): not_specified = "NotSpecified" enabled = "Enabled" disabled = "Disabled" + + +class EventLevel(Enum): + + critical = "Critical" + error = "Error" + warning = "Warning" + informational = "Informational" + verbose = "Verbose" + + +class Unit(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(Enum): + + none = "None" + average = "Average" + count = "Count" + minimum = "Minimum" + maximum = "Maximum" + total = "Total" + + +class ResultType(Enum): + + data = "Data" + metadata = "Metadata" diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/operation.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/operation.py new file mode 100644 index 000000000000..5d885493c824 --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/operation.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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=None, display=None): + self.name = name + self.display = display diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_display.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_display.py new file mode 100644 index 000000000000..561416693232 --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_display.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 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=None, resource=None, operation=None): + self.provider = provider + self.resource = resource + self.operation = operation diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_list_result.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_list_result.py new file mode 100644 index 000000000000..5bdb9217d290 --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/operation_list_result.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 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=None): + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/proxy_only_resource.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/proxy_only_resource.py new file mode 100644 index 000000000000..7926895e429e --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/proxy_only_resource.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 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): + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/recurrence.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/recurrence.py index 0a4a69ed3e24..1eb1267a7627 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/recurrence.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/recurrence.py @@ -20,11 +20,9 @@ class Recurrence(Model): should take effect. This value must be Week, meaning each week will have the same set of profiles. Possible values include: 'None', 'Second', 'Minute', 'Hour', 'Day', 'Week', 'Month', 'Year' - :type frequency: str or :class:`RecurrenceFrequency - ` + :type frequency: str or ~azure.mgmt.monitor.models.RecurrenceFrequency :param schedule: the scheduling constraints for when the profile begins. - :type schedule: :class:`RecurrentSchedule - ` + :type schedule: ~azure.mgmt.monitor.models.RecurrentSchedule """ _validation = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/recurrent_schedule.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/recurrent_schedule.py index 0f5af3860bed..36e510cf47c3 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/recurrent_schedule.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/recurrent_schedule.py @@ -56,14 +56,14 @@ class RecurrentSchedule(Model): :type time_zone: str :param days: the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. - :type days: list of str + :type days: list[str] :param hours: 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 of int + :type hours: list[int] :param minutes: A collection of minutes at which the profile takes effect at. - :type minutes: list of int + :type minutes: list[int] """ _validation = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/resource.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/resource.py index bf5fbf64da21..434476a1d049 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/resource.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/resource.py @@ -27,7 +27,7 @@ class Resource(Model): :param location: Resource location :type location: str :param tags: Resource tags - :type tags: dict + :type tags: dict[str, str] """ _validation = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/response.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/response.py new file mode 100644 index 000000000000..fad15051713b --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/response.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 Response(Model): + """The response to a metrics query. + + :param cost: The integer value representing the cost of the query, for + data case. + :type cost: float + :param timespan: The timespan for which the data was retrieved. Its value + consists of two datatimes 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 value: 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'}, + 'value': {'key': 'value', 'type': '[Metric]'}, + } + + def __init__(self, timespan, value, cost=None, interval=None): + self.cost = cost + self.timespan = timespan + self.interval = interval + self.value = value diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_action.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_action.py index ac57a67795da..0362c2ea93cd 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_action.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_action.py @@ -16,7 +16,10 @@ class RuleAction(Model): """The action that is performed when the alert rule becomes active, and when an alert condition is resolved. - :param odatatype: Polymorphic Discriminator + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: RuleEmailAction, RuleWebhookAction + + :param odatatype: Constant filled by server. :type odatatype: str """ diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_condition.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_condition.py index 41f170ec60f5..f1f58c723de3 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_condition.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_condition.py @@ -15,11 +15,14 @@ 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 + :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: :class:`RuleDataSource - ` - :param odatatype: Polymorphic Discriminator + :type data_source: ~azure.mgmt.monitor.models.RuleDataSource + :param odatatype: Constant filled by server. :type odatatype: str """ diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_data_source.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_data_source.py index 417787dc16f8..9dbcb1e1a5b7 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_data_source.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_data_source.py @@ -15,10 +15,13 @@ 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 + :param resource_uri: the resource identifier of the resource the rule - monitors. + monitors. **NOTE**: this property cannot be updated for an existing rule. :type resource_uri: str - :param odatatype: Polymorphic Discriminator + :param odatatype: Constant filled by server. :type odatatype: str """ diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_email_action.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_email_action.py index 5df7e547550b..f9e2cb4af4ce 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_email_action.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_email_action.py @@ -16,15 +16,15 @@ class RuleEmailAction(RuleAction): """Specifies the action to send email when the rule condition is evaluated. The discriminator is always RuleEmailAction in this case. - :param odatatype: Polymorphic Discriminator + :param odatatype: Constant filled by server. :type odatatype: str :param send_to_service_owners: Whether the administrators (service and - co-adiminstrators) of the service should be notified when the alert is + 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 - notifiy of the activation of the alert. - :type custom_emails: list of str + to notify of the activation of the alert. + :type custom_emails: list[str] """ _validation = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_management_event_data_source.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_management_event_data_source.py index 7905931b1d56..af6c99f92e25 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_management_event_data_source.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_management_event_data_source.py @@ -17,9 +17,9 @@ class RuleManagementEventDataSource(RuleDataSource): RuleManagementEventDataSource in this case. :param resource_uri: the resource identifier of the resource the rule - monitors. + monitors. **NOTE**: this property cannot be updated for an existing rule. :type resource_uri: str - :param odatatype: Polymorphic Discriminator + :param odatatype: Constant filled by server. :type odatatype: str :param event_name: the event name. :type event_name: str @@ -40,8 +40,8 @@ class RuleManagementEventDataSource(RuleDataSource): :param sub_status: the substatus. :type sub_status: str :param claims: the claims. - :type claims: :class:`RuleManagementEventClaimsDataSource - ` + :type claims: + ~azure.mgmt.monitor.models.RuleManagementEventClaimsDataSource """ _validation = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_metric_data_source.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_metric_data_source.py index 62281829d59c..d18479246de7 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_metric_data_source.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_metric_data_source.py @@ -17,9 +17,9 @@ class RuleMetricDataSource(RuleDataSource): RuleMetricDataSource in this case. :param resource_uri: the resource identifier of the resource the rule - monitors. + monitors. **NOTE**: this property cannot be updated for an existing rule. :type resource_uri: str - :param odatatype: Polymorphic Discriminator + :param odatatype: Constant filled by server. :type odatatype: str :param metric_name: the name of the metric that defines what the rule monitors. diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_webhook_action.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_webhook_action.py index d53ca16d9715..16a1055e7cf3 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_webhook_action.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/rule_webhook_action.py @@ -16,14 +16,14 @@ class RuleWebhookAction(RuleAction): """Specifies the action to post to service when the rule condition is evaluated. The discriminator is always RuleWebhookAction in this case. - :param odatatype: Polymorphic Discriminator + :param odatatype: Constant filled by server. :type odatatype: str - :param service_uri: the service uri to Post the notitication when the + :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 + :type properties: dict[str, str] """ _validation = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_action.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_action.py index 5cabae2db4a4..f3ff55ac2d0d 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_action.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_action.py @@ -18,13 +18,11 @@ class ScaleAction(Model): :param direction: the scale direction. Whether the scaling action increases or decreases the number of instances. Possible values include: 'None', 'Increase', 'Decrease' - :type direction: str or :class:`ScaleDirection - ` + :type direction: str or ~azure.mgmt.monitor.models.ScaleDirection :param type: the type of action that should occur when the scale rule fires. Possible values include: 'ChangeCount', 'PercentChangeCount', 'ExactCount' - :type type: str or :class:`ScaleType - ` + :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" . diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_rule.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_rule.py index 84f5ad49e8dc..c509b5b612d2 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_rule.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/scale_rule.py @@ -16,11 +16,9 @@ class ScaleRule(Model): """A rule that provide the triggers and parameters for the scaling action. :param metric_trigger: the trigger that results in a scaling action. - :type metric_trigger: :class:`MetricTrigger - ` + :type metric_trigger: ~azure.mgmt.monitor.models.MetricTrigger :param scale_action: the parameters for the scaling action. - :type scale_action: :class:`ScaleAction - ` + :type scale_action: ~azure.mgmt.monitor.models.ScaleAction """ _validation = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/sender_authorization.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/sender_authorization.py new file mode 100644 index 000000000000..c5f0319ba5eb --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/sender_authorization.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 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=None, role=None, scope=None): + self.action = action + self.role = role + self.scope = scope diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/service_diagnostic_settings_resource_patch.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/service_diagnostic_settings_resource_patch.py deleted file mode 100644 index 0e4f36330059..000000000000 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/service_diagnostic_settings_resource_patch.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license 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 ServiceDiagnosticSettingsResourcePatch(Model): - """Service diagnostic setting resource for patch operations. - - :param tags: Resource tags - :type tags: dict - :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 service bus - namespace in which you would like to have Event Hubs created for streaming - Diagnostic Logs. The rule ID is of the format: '{service bus resource - ID}/authorizationrules/{key name}'. - :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 metrics: the list of metric settings. - :type metrics: list of :class:`MetricSettings - ` - :param logs: the list of logs settings. - :type logs: list of :class:`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 - """ - - _attribute_map = { - 'tags': {'key': 'tags', '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'}, - 'metrics': {'key': 'properties.metrics', 'type': '[MetricSettings]'}, - 'logs': {'key': 'properties.logs', 'type': '[LogSettings]'}, - 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, - } - - def __init__(self, tags=None, storage_account_id=None, service_bus_rule_id=None, event_hub_authorization_rule_id=None, metrics=None, logs=None, workspace_id=None): - self.tags = tags - 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.metrics = metrics - self.logs = logs - self.workspace_id = workspace_id diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/sms_receiver.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/sms_receiver.py index c48764be6949..089dc7824c43 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/sms_receiver.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/sms_receiver.py @@ -27,8 +27,7 @@ class SmsReceiver(Model): :type phone_number: str :ivar status: The status of the receiver. Possible values include: 'NotSpecified', 'Enabled', 'Disabled' - :vartype status: str or :class:`ReceiverStatus - ` + :vartype status: str or ~azure.mgmt.monitor.models.ReceiverStatus """ _validation = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/threshold_rule_condition.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/threshold_rule_condition.py index 06b4f0914318..c330e8cc6601 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/threshold_rule_condition.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/threshold_rule_condition.py @@ -17,15 +17,13 @@ class ThresholdRuleCondition(RuleCondition): :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: :class:`RuleDataSource - ` - :param odatatype: Polymorphic Discriminator + :type data_source: ~azure.mgmt.monitor.models.RuleDataSource + :param odatatype: Constant filled by server. :type odatatype: str :param operator: the operator used to compare the data and the threshold. Possible values include: 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' - :type operator: str or :class:`ConditionOperator - ` + :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 @@ -36,8 +34,8 @@ class ThresholdRuleCondition(RuleCondition): 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 :class:`TimeAggregationOperator - ` + :type time_aggregation: str or + ~azure.mgmt.monitor.models.TimeAggregationOperator """ _validation = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_element.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_element.py new file mode 100644 index 000000000000..0abbfab18a71 --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/time_series_element.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 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): + self.metadatavalues = metadatavalues + self.data = data diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/models/webhook_notification.py b/azure-mgmt-monitor/azure/mgmt/monitor/models/webhook_notification.py index b4101ec3414a..3e1689a78e34 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/models/webhook_notification.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/models/webhook_notification.py @@ -18,7 +18,7 @@ class WebhookNotification(Model): :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 + :type properties: dict[str, str] """ _attribute_map = { diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/monitor_management_client.py b/azure-mgmt-monitor/azure/mgmt/monitor/monitor_management_client.py index 59b3934a6e7c..3811b14bb162 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/monitor_management_client.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/monitor_management_client.py @@ -14,12 +14,19 @@ 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.service_diagnostic_settings_operations import ServiceDiagnosticSettingsOperations +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 . import models @@ -43,8 +50,6 @@ def __init__( raise ValueError("Parameter 'credentials' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not isinstance(subscription_id, str): - raise TypeError("Parameter 'subscription_id' must be str.") if not base_url: base_url = 'https://management.azure.com' @@ -65,18 +70,32 @@ class MonitorManagementClient(object): :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 service_diagnostic_settings: ServiceDiagnosticSettings operations - :vartype service_diagnostic_settings: azure.mgmt.monitor.operations.ServiceDiagnosticSettingsOperations + :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 :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -98,15 +117,29 @@ def __init__( 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.service_diagnostic_settings = ServiceDiagnosticSettingsOperations( + 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) diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/operations/__init__.py b/azure-mgmt-monitor/azure/mgmt/monitor/operations/__init__.py index 415d5cfb641c..811736d2b984 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/operations/__init__.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/operations/__init__.py @@ -10,19 +10,33 @@ # -------------------------------------------------------------------------- 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 .service_diagnostic_settings_operations import ServiceDiagnosticSettingsOperations +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 __all__ = [ 'AutoscaleSettingsOperations', + 'Operations', 'AlertRuleIncidentsOperations', 'AlertRulesOperations', 'LogProfilesOperations', - 'ServiceDiagnosticSettingsOperations', + 'DiagnosticSettingsOperations', + 'DiagnosticSettingsCategoryOperations', 'ActionGroupsOperations', 'ActivityLogAlertsOperations', + 'ActivityLogsOperations', + 'EventCategoriesOperations', + 'TenantActivityLogsOperations', + 'MetricDefinitionsOperations', + 'MetricsOperations', ] diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/operations/action_groups_operations.py b/azure-mgmt-monitor/azure/mgmt/monitor/operations/action_groups_operations.py index 2d7f34ce9ab1..1fe6edf35bff 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/operations/action_groups_operations.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/operations/action_groups_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -44,21 +43,17 @@ def create_or_update( :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: :class:`ActionGroupResource - ` + :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: :class:`ActionGroupResource - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`ActionGroupResource - ` or - :class:`ClientRawResponse` - :raises: :class:`CloudError` + :return: ActionGroupResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.ActionGroupResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}' @@ -92,9 +87,7 @@ def create_or_update( request, header_parameters, body_content, **operation_config) if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -122,14 +115,11 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`ActionGroupResource - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`ActionGroupResource - ` or - :class:`ClientRawResponse` - :raises: :class:`CloudError` + :return: ActionGroupResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.ActionGroupResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}' @@ -159,9 +149,7 @@ def get( response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -187,12 +175,10 @@ def delete( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or - :class:`ClientRawResponse` if - raw=true - :rtype: None or - :class:`ClientRawResponse` - :raises: :class:`CloudError` + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}' @@ -222,9 +208,7 @@ def delete( response = self._client.send(request, header_parameters, **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 + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -239,11 +223,11 @@ def list_by_subscription_id( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of :class:`ActionGroupResource - ` - :rtype: :class:`ActionGroupResourcePaged - ` - :raises: :class:`CloudError` + :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): @@ -279,9 +263,7 @@ def internal_paging(next_link=None, raw=False): request, header_parameters, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response @@ -306,11 +288,11 @@ def list_by_resource_group( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of :class:`ActionGroupResource - ` - :rtype: :class:`ActionGroupResourcePaged - ` - :raises: :class:`CloudError` + :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): @@ -347,9 +329,7 @@ def internal_paging(next_link=None, raw=False): request, header_parameters, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response @@ -379,12 +359,10 @@ def enable_receiver( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or - :class:`ClientRawResponse` if - raw=true - :rtype: None or - :class:`ClientRawResponse` - :raises: :class:`CloudError` + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` """ enable_request = models.EnableRequest(receiver_name=receiver_name) @@ -419,10 +397,8 @@ def enable_receiver( response = self._client.send( request, header_parameters, body_content, **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 response.status_code not in [200, 409]: + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/operations/activity_log_alerts_operations.py b/azure-mgmt-monitor/azure/mgmt/monitor/operations/activity_log_alerts_operations.py index f215a19c2d0f..f6bbfa262ea7 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/operations/activity_log_alerts_operations.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/operations/activity_log_alerts_operations.py @@ -44,20 +44,16 @@ def create_or_update( :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: :class:`ActivityLogAlertResource - ` + :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: :class:`ActivityLogAlertResource - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`ActivityLogAlertResource - ` or - :class:`ClientRawResponse` + :return: ActivityLogAlertResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.ActivityLogAlertResource or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -121,13 +117,9 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`ActivityLogAlertResource - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`ActivityLogAlertResource - ` or - :class:`ClientRawResponse` + :return: ActivityLogAlertResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.ActivityLogAlertResource or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -185,11 +177,8 @@ def delete( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or - :class:`ClientRawResponse` if - raw=true - :rtype: None or - :class:`ClientRawResponse` + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -237,7 +226,7 @@ def update( :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 + :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. @@ -247,13 +236,9 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`ActivityLogAlertResource - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`ActivityLogAlertResource - ` or - :class:`ClientRawResponse` + :return: ActivityLogAlertResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.ActivityLogAlertResource or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -313,10 +298,9 @@ def list_by_subscription_id( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of :class:`ActivityLogAlertResource - ` - :rtype: :class:`ActivityLogAlertResourcePaged - ` + :return: An iterator like instance of ActivityLogAlertResource + :rtype: + ~azure.mgmt.monitor.models.ActivityLogAlertResourcePaged[~azure.mgmt.monitor.models.ActivityLogAlertResource] :raises: :class:`ErrorResponseException` """ @@ -379,10 +363,9 @@ def list_by_resource_group( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of :class:`ActivityLogAlertResource - ` - :rtype: :class:`ActivityLogAlertResourcePaged - ` + :return: An iterator like instance of ActivityLogAlertResource + :rtype: + ~azure.mgmt.monitor.models.ActivityLogAlertResourcePaged[~azure.mgmt.monitor.models.ActivityLogAlertResource] :raises: :class:`ErrorResponseException` """ diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/operations/activity_logs_operations.py b/azure-mgmt-monitor/azure/mgmt/monitor/operations/activity_logs_operations.py new file mode 100644 index 000000000000..c0c19381ea0a --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/operations/activity_logs_operations.py @@ -0,0 +1,130 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 objec model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-04-01". + """ + + 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 = '/subscriptions/{subscriptionId}/providers/microsoft.insights/eventtypes/management/values' + 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, **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 diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/operations/alert_rule_incidents_operations.py b/azure-mgmt-monitor/azure/mgmt/monitor/operations/alert_rule_incidents_operations.py index f44e66a47f6d..9ac7bfccbc35 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/operations/alert_rule_incidents_operations.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/operations/alert_rule_incidents_operations.py @@ -50,11 +50,9 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`Incident ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`Incident ` or - :class:`ClientRawResponse` + :return: Incident or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.Incident or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -113,10 +111,9 @@ def list_by_alert_rule( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of :class:`Incident - ` - :rtype: :class:`IncidentPaged - ` + :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): diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/operations/alert_rules_operations.py b/azure-mgmt-monitor/azure/mgmt/monitor/operations/alert_rules_operations.py index 521fc115c7a6..62d1cff27fb9 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/operations/alert_rules_operations.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/operations/alert_rules_operations.py @@ -44,20 +44,15 @@ def create_or_update( :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: :class:`AlertRuleResource - ` + :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: :class:`AlertRuleResource - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`AlertRuleResource - ` or - :class:`ClientRawResponse` + :return: AlertRuleResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.AlertRuleResource or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -121,11 +116,8 @@ def delete( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or - :class:`ClientRawResponse` if - raw=true - :rtype: None or - :class:`ClientRawResponse` + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL @@ -177,13 +169,9 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`AlertRuleResource - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`AlertRuleResource - ` or - :class:`ClientRawResponse` + :return: AlertRuleResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.AlertRuleResource or + ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL @@ -239,20 +227,16 @@ def update( :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: :class:`AlertRuleResourcePatch - ` + :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: :class:`AlertRuleResource - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`AlertRuleResource - ` or - :class:`ClientRawResponse` + :return: AlertRuleResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.AlertRuleResource or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -314,10 +298,9 @@ def list_by_resource_group( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of :class:`AlertRuleResource - ` - :rtype: :class:`AlertRuleResourcePaged - ` + :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): diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/operations/autoscale_settings_operations.py b/azure-mgmt-monitor/azure/mgmt/monitor/operations/autoscale_settings_operations.py index 54e9b1e7c51f..d83bb10360e9 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/operations/autoscale_settings_operations.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/operations/autoscale_settings_operations.py @@ -45,10 +45,9 @@ def list_by_resource_group( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of :class:`AutoscaleSettingResource - ` - :rtype: :class:`AutoscaleSettingResourcePaged - ` + :return: An iterator like instance of AutoscaleSettingResource + :rtype: + ~azure.mgmt.monitor.models.AutoscaleSettingResourcePaged[~azure.mgmt.monitor.models.AutoscaleSettingResource] :raises: :class:`ErrorResponseException` """ @@ -110,20 +109,15 @@ def create_or_update( :param autoscale_setting_name: The autoscale setting name. :type autoscale_setting_name: str :param parameters: Parameters supplied to the operation. - :type parameters: :class:`AutoscaleSettingResource - ` + :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: :class:`AutoscaleSettingResource - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`AutoscaleSettingResource - ` or - :class:`ClientRawResponse` + :return: AutoscaleSettingResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.AutoscaleSettingResource or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -187,11 +181,8 @@ def delete( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or - :class:`ClientRawResponse` if - raw=true - :rtype: None or - :class:`ClientRawResponse` + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -242,13 +233,9 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`AutoscaleSettingResource - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`AutoscaleSettingResource - ` or - :class:`ClientRawResponse` + :return: AutoscaleSettingResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.AutoscaleSettingResource or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -305,20 +292,15 @@ def update( :param autoscale_setting_resource: Parameters supplied to the operation. :type autoscale_setting_resource: - :class:`AutoscaleSettingResourcePatch - ` + ~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: :class:`AutoscaleSettingResource - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`AutoscaleSettingResource - ` or - :class:`ClientRawResponse` + :return: AutoscaleSettingResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.AutoscaleSettingResource or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/operations/diagnostic_settings_category_operations.py b/azure-mgmt-monitor/azure/mgmt/monitor/operations/diagnostic_settings_category_operations.py new file mode 100644 index 000000000000..11411772740d --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/operations/diagnostic_settings_category_operations.py @@ -0,0 +1,153 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 objec model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-05-01-preview". + """ + + 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 = '/{resourceUri}/providers/microsoft.insights/diagnosticSettingsCategories/{name}' + 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **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 + + 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 = '/{resourceUri}/providers/microsoft.insights/diagnosticSettingsCategories' + 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **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 diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/operations/service_diagnostic_settings_operations.py b/azure-mgmt-monitor/azure/mgmt/monitor/operations/diagnostic_settings_operations.py similarity index 59% rename from azure-mgmt-monitor/azure/mgmt/monitor/operations/service_diagnostic_settings_operations.py rename to azure-mgmt-monitor/azure/mgmt/monitor/operations/diagnostic_settings_operations.py index a0d6219f2a6a..7711f5c37319 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/operations/service_diagnostic_settings_operations.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/operations/diagnostic_settings_operations.py @@ -11,19 +11,18 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models -class ServiceDiagnosticSettingsOperations(object): - """ServiceDiagnosticSettingsOperations operations. +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 objec model deserializer. - :ivar api_version: Client Api Version. Constant value: "2016-09-01". + :ivar api_version: Client Api Version. Constant value: "2017-05-01-preview". """ def __init__(self, client, config, serializer, deserializer): @@ -31,36 +30,34 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2016-09-01" + self.api_version = "2017-05-01-preview" self.config = config def get( - self, resource_uri, custom_headers=None, raw=False, **operation_config): + self, resource_uri, name, custom_headers=None, raw=False, **operation_config): """Gets the active diagnostic settings for the specified resource. - **WARNING**: This method will be deprecated in future releases. :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: :class:`ServiceDiagnosticSettingsResource - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`ServiceDiagnosticSettingsResource - ` or - :class:`ClientRawResponse` + :return: DiagnosticSettingsResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.DiagnosticSettingsResource or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = '/{resourceUri}/providers/microsoft.insights/diagnosticSettings/service' + url = '/{resourceUri}/providers/microsoft.insights/diagnosticSettings/{name}' path_format_arguments = { - 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str') + '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) @@ -88,7 +85,7 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ServiceDiagnosticSettingsResource', response) + deserialized = self._deserialize('DiagnosticSettingsResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -97,33 +94,32 @@ def get( return deserialized def create_or_update( - self, resource_uri, parameters, custom_headers=None, raw=False, **operation_config): - """Create or update new diagnostic settings for the specified resource. - **WARNING**: This method will be deprecated in future releases. + 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: :class:`ServiceDiagnosticSettingsResource - ` + :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: :class:`ServiceDiagnosticSettingsResource - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`ServiceDiagnosticSettingsResource - ` or - :class:`ClientRawResponse` - :raises: :class:`CloudError` + :return: DiagnosticSettingsResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.DiagnosticSettingsResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` """ # Construct URL - url = '/{resourceUri}/providers/microsoft.insights/diagnosticSettings/service' + url = '/{resourceUri}/providers/microsoft.insights/diagnosticSettings/{name}' path_format_arguments = { - 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str') + '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) @@ -142,7 +138,7 @@ def create_or_update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'ServiceDiagnosticSettingsResource') + body_content = self._serialize.body(parameters, 'DiagnosticSettingsResource') # Construct and send request request = self._client.put(url, query_parameters) @@ -150,14 +146,12 @@ def create_or_update( request, header_parameters, body_content, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ServiceDiagnosticSettingsResource', response) + deserialized = self._deserialize('DiagnosticSettingsResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -165,38 +159,29 @@ def create_or_update( return deserialized - def update( - self, resource_uri, service_diagnostic_settings_resource, custom_headers=None, raw=False, **operation_config): - """Updates an existing ServiceDiagnosticSettingsResource. To update other - fields use the CreateOrUpdate method. **WARNING**: This method will be - deprecated in future releases. + 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 service_diagnostic_settings_resource: Parameters supplied to - the operation. - :type service_diagnostic_settings_resource: - :class:`ServiceDiagnosticSettingsResourcePatch - ` + :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: :class:`ServiceDiagnosticSettingsResource - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`ServiceDiagnosticSettingsResource - ` or - :class:`ClientRawResponse` + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = '/{resourceUri}/providers/microsoft.insights/diagnosticSettings/service' + url = '/{resourceUri}/providers/microsoft.insights/diagnosticSettings/{name}' path_format_arguments = { - 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str') + '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) @@ -214,13 +199,60 @@ def update( 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(service_diagnostic_settings_resource, 'ServiceDiagnosticSettingsResourcePatch') + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, **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 + + 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 = '/{resourceUri}/providers/microsoft.insights/diagnosticSettings' + 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['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 and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -228,7 +260,7 @@ def update( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ServiceDiagnosticSettingsResource', response) + deserialized = self._deserialize('DiagnosticSettingsResourceCollection', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/operations/event_categories_operations.py b/azure-mgmt-monitor/azure/mgmt/monitor/operations/event_categories_operations.py new file mode 100644 index 000000000000..639171fe93c9 --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/operations/event_categories_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 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 objec model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-04-01". + """ + + 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 = '/providers/microsoft.insights/eventcategories' + + # 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, **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 diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/operations/log_profiles_operations.py b/azure-mgmt-monitor/azure/mgmt/monitor/operations/log_profiles_operations.py index 7099e14bb4f0..4165c1c31298 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/operations/log_profiles_operations.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/operations/log_profiles_operations.py @@ -46,11 +46,8 @@ def delete( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or - :class:`ClientRawResponse` if - raw=true - :rtype: None or - :class:`ClientRawResponse` + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL @@ -99,13 +96,9 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: :class:`LogProfileResource - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`LogProfileResource - ` or - :class:`ClientRawResponse` + :return: LogProfileResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.LogProfileResource or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -156,20 +149,15 @@ def create_or_update( :param log_profile_name: The name of the log profile. :type log_profile_name: str :param parameters: Parameters supplied to the operation. - :type parameters: :class:`LogProfileResource - ` + :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: :class:`LogProfileResource - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`LogProfileResource - ` or - :class:`ClientRawResponse` + :return: LogProfileResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.LogProfileResource or + ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL @@ -226,20 +214,16 @@ def update( :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: :class:`LogProfileResourcePatch - ` + :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: :class:`LogProfileResource - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`LogProfileResource - ` or - :class:`ClientRawResponse` + :return: LogProfileResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.monitor.models.LogProfileResource or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -296,10 +280,9 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of :class:`LogProfileResource - ` - :rtype: :class:`LogProfileResourcePaged - ` + :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): diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/operations/metric_definitions_operations.py b/azure-mgmt-monitor/azure/mgmt/monitor/operations/metric_definitions_operations.py new file mode 100644 index 000000000000..5134f74a80b0 --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/operations/metric_definitions_operations.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 objec model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-05-01-preview". + """ + + 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 list( + self, resource_uri, 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 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 = '/{resourceUri}/providers/microsoft.insights/metricDefinitions' + 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') + + else: + url = next_link + query_parameters = {} + + # 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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, **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 diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/operations/metrics_operations.py b/azure-mgmt-monitor/azure/mgmt/monitor/operations/metrics_operations.py new file mode 100644 index 000000000000..aca37e3d6153 --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/operations/metrics_operations.py @@ -0,0 +1,141 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 objec model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-05-01-preview". + """ + + 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 list( + self, resource_uri, timespan=None, interval=None, metric=None, aggregation=None, top=None, orderby=None, filter=None, result_type=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 metric: The name of the metric to retrieve. + :type metric: 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: float + :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 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 = '/{resourceUri}/providers/microsoft.insights/metrics' + 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 metric is not None: + query_parameters['metric'] = self._serialize.query("metric", metric, '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, 'float') + 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') + + # 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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **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 diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/operations/operations.py b/azure-mgmt-monitor/azure/mgmt/monitor/operations/operations.py new file mode 100644 index 000000000000..815fa409cb7e --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/operations/operations.py @@ -0,0 +1,87 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 objec model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-04-01". + """ + + 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 = '/providers/microsoft.insights/operations' + + # 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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **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 diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/operations/tenant_activity_logs_operations.py b/azure-mgmt-monitor/azure/mgmt/monitor/operations/tenant_activity_logs_operations.py new file mode 100644 index 000000000000..3c46f893356a --- /dev/null +++ b/azure-mgmt-monitor/azure/mgmt/monitor/operations/tenant_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 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 objec model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-04-01". + """ + + 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 = '/providers/microsoft.insights/eventtypes/management/values' + + # 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, **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 diff --git a/azure-mgmt-monitor/azure/mgmt/monitor/version.py b/azure-mgmt-monitor/azure/mgmt/monitor/version.py index 3e682bbd5fb1..85da2c00c1a6 100644 --- a/azure-mgmt-monitor/azure/mgmt/monitor/version.py +++ b/azure-mgmt-monitor/azure/mgmt/monitor/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.3.0" +VERSION = "0.4.0" diff --git a/azure-mgmt-monitor/build.json b/azure-mgmt-monitor/build.json index 6ceceea19f09..c63116cab7c0 100644 --- a/azure-mgmt-monitor/build.json +++ b/azure-mgmt-monitor/build.json @@ -1 +1,339 @@ -{"autorest": "1.2.2", "date": "2017-08-08T22:19:02Z", "version": ""} \ No newline at end of file +{ + "autorest": [ + { + "resolvedInfo": null, + "packageMetadata": { + "name": "@microsoft.azure/autorest-core", + "version": "2.0.4168", + "engines": { + "node": ">=7.10.0" + }, + "dependencies": {}, + "optionalDependencies": {}, + "devDependencies": { + "@microsoft.azure/async-io": "~1.0.22", + "@microsoft.azure/extension": "~1.2.12", + "@types/commonmark": "^0.27.0", + "@types/jsonpath": "^0.1.29", + "@types/node": "^8.0.28", + "@types/pify": "0.0.28", + "@types/source-map": "^0.5.0", + "@types/yargs": "^8.0.2", + "commonmark": "^0.27.0", + "file-url": "^2.0.2", + "get-uri": "^2.0.0", + "jsonpath": "^0.2.11", + "linq-es2015": "^2.4.25", + "mocha": "3.4.2", + "mocha-typescript": "1.1.5", + "pify": "^3.0.0", + "safe-eval": "^0.3.0", + "shx": "^0.2.2", + "source-map": "^0.5.6", + "source-map-support": "^0.4.15", + "strip-bom": "^3.0.0", + "typescript": "2.5.3", + "untildify": "^3.0.2", + "urijs": "^1.18.10", + "vscode-jsonrpc": "^3.3.1", + "yaml-ast-parser": "https://github.com/olydis/yaml-ast-parser/releases/download/0.0.34/yaml-ast-parser-0.0.34.tgz", + "yargs": "^8.0.2" + }, + "bundleDependencies": false, + "peerDependencies": {}, + "deprecated": false, + "_resolved": "C:/Users/lmazuel/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", + "_shasum": "33813111fc9bfa488bd600fbba48bc53cc9182c7", + "_shrinkwrap": null, + "bin": null, + "_id": "@microsoft.azure/autorest-core@2.0.4168", + "_from": "file:C:/Users/lmazuel/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", + "_requested": { + "type": "directory", + "where": "D:\\VSProjects\\swagger-to-sdk", + "raw": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest-core@2.0.4168\\node_modules\\@microsoft.azure\\autorest-core", + "rawSpec": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest-core@2.0.4168\\node_modules\\@microsoft.azure\\autorest-core", + "saveSpec": "file:C:/Users/lmazuel/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", + "fetchSpec": "C:/Users/lmazuel/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core" + }, + "_spec": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest-core@2.0.4168\\node_modules\\@microsoft.azure\\autorest-core", + "_where": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest-core@2.0.4168\\node_modules\\@microsoft.azure\\autorest-core" + }, + "extensionManager": { + "installationPath": "C:\\Users\\lmazuel\\.autorest", + "dotnetPath": "C:\\Users\\lmazuel\\.dotnet" + }, + "installationPath": "C:\\Users\\lmazuel\\.autorest" + }, + { + "resolvedInfo": null, + "packageMetadata": { + "name": "@microsoft.azure/autorest.go", + "version": "2.0.24", + "dependencies": { + "dotnet-2.0.0": "^1.1.0" + }, + "optionalDependencies": {}, + "devDependencies": { + "@microsoft.azure/autorest.testserver": "^1.9.0", + "autorest": "^2.0.0", + "coffee-script": "^1.11.1", + "dotnet-sdk-2.0.0": "^1.1.1", + "gulp": "^3.9.1", + "gulp-filter": "^5.0.0", + "gulp-line-ending-corrector": "^1.0.1", + "iced-coffee-script": "^108.0.11", + "marked": "^0.3.6", + "marked-terminal": "^2.0.0", + "moment": "^2.17.1", + "run-sequence": "*", + "shx": "^0.2.2", + "through2-parallel": "^0.1.3", + "yargs": "^8.0.2", + "yarn": "^1.0.2" + }, + "bundleDependencies": false, + "peerDependencies": {}, + "deprecated": false, + "_resolved": "C:/Users/lmazuel/.autorest/@microsoft.azure_autorest.go@2.0.24/node_modules/@microsoft.azure/autorest.go", + "_shasum": "409a4a9a21708a7aea58fadb0b064ea487a90fea", + "_shrinkwrap": null, + "bin": null, + "_id": "@microsoft.azure/autorest.go@2.0.24", + "_from": "file:C:/Users/lmazuel/.autorest/@microsoft.azure_autorest.go@2.0.24/node_modules/@microsoft.azure/autorest.go", + "_requested": { + "type": "directory", + "where": "D:\\VSProjects\\swagger-to-sdk", + "raw": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest.go@2.0.24\\node_modules\\@microsoft.azure\\autorest.go", + "rawSpec": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest.go@2.0.24\\node_modules\\@microsoft.azure\\autorest.go", + "saveSpec": "file:C:/Users/lmazuel/.autorest/@microsoft.azure_autorest.go@2.0.24/node_modules/@microsoft.azure/autorest.go", + "fetchSpec": "C:/Users/lmazuel/.autorest/@microsoft.azure_autorest.go@2.0.24/node_modules/@microsoft.azure/autorest.go" + }, + "_spec": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest.go@2.0.24\\node_modules\\@microsoft.azure\\autorest.go", + "_where": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest.go@2.0.24\\node_modules\\@microsoft.azure\\autorest.go" + }, + "extensionManager": { + "installationPath": "C:\\Users\\lmazuel\\.autorest", + "dotnetPath": "C:\\Users\\lmazuel\\.dotnet" + }, + "installationPath": "C:\\Users\\lmazuel\\.autorest" + }, + { + "resolvedInfo": null, + "packageMetadata": { + "name": "@microsoft.azure/autorest.modeler", + "version": "2.0.18", + "dependencies": { + "dotnet-2.0.0": "^1.1.0" + }, + "optionalDependencies": {}, + "devDependencies": { + "coffee-script": "^1.11.1", + "dotnet-sdk-2.0.0": "^1.1.1", + "gulp": "^3.9.1", + "gulp-filter": "^5.0.0", + "gulp-line-ending-corrector": "^1.0.1", + "iced-coffee-script": "^108.0.11", + "marked": "^0.3.6", + "marked-terminal": "^2.0.0", + "moment": "^2.17.1", + "run-sequence": "*", + "shx": "^0.2.2", + "through2-parallel": "^0.1.3", + "yargs": "^8.0.2", + "yarn": "^1.0.2" + }, + "bundleDependencies": false, + "peerDependencies": {}, + "deprecated": false, + "_resolved": "C:/Users/lmazuel/.autorest/@microsoft.azure_autorest.modeler@2.0.18/node_modules/@microsoft.azure/autorest.modeler", + "_shasum": "b8e853f83b99b2a37ad534cb8463da5de4b11418", + "_shrinkwrap": null, + "bin": null, + "_id": "@microsoft.azure/autorest.modeler@2.0.18", + "_from": "file:C:/Users/lmazuel/.autorest/@microsoft.azure_autorest.modeler@2.0.18/node_modules/@microsoft.azure/autorest.modeler", + "_requested": { + "type": "directory", + "where": "D:\\VSProjects\\swagger-to-sdk", + "raw": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest.modeler@2.0.18\\node_modules\\@microsoft.azure\\autorest.modeler", + "rawSpec": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest.modeler@2.0.18\\node_modules\\@microsoft.azure\\autorest.modeler", + "saveSpec": "file:C:/Users/lmazuel/.autorest/@microsoft.azure_autorest.modeler@2.0.18/node_modules/@microsoft.azure/autorest.modeler", + "fetchSpec": "C:/Users/lmazuel/.autorest/@microsoft.azure_autorest.modeler@2.0.18/node_modules/@microsoft.azure/autorest.modeler" + }, + "_spec": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest.modeler@2.0.18\\node_modules\\@microsoft.azure\\autorest.modeler", + "_where": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest.modeler@2.0.18\\node_modules\\@microsoft.azure\\autorest.modeler" + }, + "extensionManager": { + "installationPath": "C:\\Users\\lmazuel\\.autorest", + "dotnetPath": "C:\\Users\\lmazuel\\.dotnet" + }, + "installationPath": "C:\\Users\\lmazuel\\.autorest" + }, + { + "resolvedInfo": null, + "packageMetadata": { + "name": "@microsoft.azure/autorest.modeler", + "version": "2.1.22", + "dependencies": { + "dotnet-2.0.0": "^1.4.4" + }, + "optionalDependencies": {}, + "devDependencies": { + "coffee-script": "^1.11.1", + "dotnet-sdk-2.0.0": "^1.4.4", + "gulp": "^3.9.1", + "gulp-filter": "^5.0.0", + "gulp-line-ending-corrector": "^1.0.1", + "iced-coffee-script": "^108.0.11", + "marked": "^0.3.6", + "marked-terminal": "^2.0.0", + "moment": "^2.17.1", + "run-sequence": "*", + "shx": "^0.2.2", + "through2-parallel": "^0.1.3", + "yargs": "^8.0.2", + "yarn": "^1.0.2" + }, + "bundleDependencies": false, + "peerDependencies": {}, + "deprecated": false, + "_resolved": "C:/Users/lmazuel/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", + "_shasum": "ca425289fa38a210d279729048a4a91673f09c67", + "_shrinkwrap": null, + "bin": null, + "_id": "@microsoft.azure/autorest.modeler@2.1.22", + "_from": "file:C:/Users/lmazuel/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", + "_requested": { + "type": "directory", + "where": "D:\\VSProjects\\swagger-to-sdk", + "raw": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest.modeler@2.1.22\\node_modules\\@microsoft.azure\\autorest.modeler", + "rawSpec": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest.modeler@2.1.22\\node_modules\\@microsoft.azure\\autorest.modeler", + "saveSpec": "file:C:/Users/lmazuel/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", + "fetchSpec": "C:/Users/lmazuel/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler" + }, + "_spec": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest.modeler@2.1.22\\node_modules\\@microsoft.azure\\autorest.modeler", + "_where": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest.modeler@2.1.22\\node_modules\\@microsoft.azure\\autorest.modeler" + }, + "extensionManager": { + "installationPath": "C:\\Users\\lmazuel\\.autorest", + "dotnetPath": "C:\\Users\\lmazuel\\.dotnet" + }, + "installationPath": "C:\\Users\\lmazuel\\.autorest" + }, + { + "resolvedInfo": null, + "packageMetadata": { + "name": "@microsoft.azure/autorest.python", + "version": "2.0.13", + "dependencies": { + "dotnet-2.0.0": "^1.1.0" + }, + "optionalDependencies": {}, + "devDependencies": { + "@microsoft.azure/autorest.testserver": "^1.9.0", + "autorest": "^2.0.0", + "coffee-script": "^1.11.1", + "dotnet-sdk-2.0.0": "^1.1.1", + "gulp": "^3.9.1", + "gulp-filter": "^5.0.0", + "gulp-line-ending-corrector": "^1.0.1", + "iced-coffee-script": "^108.0.11", + "marked": "^0.3.6", + "marked-terminal": "^2.0.0", + "moment": "^2.17.1", + "run-sequence": "*", + "shx": "^0.2.2", + "through2-parallel": "^0.1.3", + "yargs": "^8.0.2", + "yarn": "^1.0.2" + }, + "bundleDependencies": false, + "peerDependencies": {}, + "deprecated": false, + "_resolved": "C:/Users/lmazuel/.autorest/@microsoft.azure_autorest.python@2.0.13/node_modules/@microsoft.azure/autorest.python", + "_shasum": "ddbbf3e3f1f90ae4132b687cfa8450425ab4ffcd", + "_shrinkwrap": null, + "bin": null, + "_id": "@microsoft.azure/autorest.python@2.0.13", + "_from": "file:C:/Users/lmazuel/.autorest/@microsoft.azure_autorest.python@2.0.13/node_modules/@microsoft.azure/autorest.python", + "_requested": { + "type": "directory", + "where": "D:\\VSProjects\\swagger-to-sdk", + "raw": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest.python@2.0.13\\node_modules\\@microsoft.azure\\autorest.python", + "rawSpec": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest.python@2.0.13\\node_modules\\@microsoft.azure\\autorest.python", + "saveSpec": "file:C:/Users/lmazuel/.autorest/@microsoft.azure_autorest.python@2.0.13/node_modules/@microsoft.azure/autorest.python", + "fetchSpec": "C:/Users/lmazuel/.autorest/@microsoft.azure_autorest.python@2.0.13/node_modules/@microsoft.azure/autorest.python" + }, + "_spec": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest.python@2.0.13\\node_modules\\@microsoft.azure\\autorest.python", + "_where": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest.python@2.0.13\\node_modules\\@microsoft.azure\\autorest.python" + }, + "extensionManager": { + "installationPath": "C:\\Users\\lmazuel\\.autorest", + "dotnetPath": "C:\\Users\\lmazuel\\.dotnet" + }, + "installationPath": "C:\\Users\\lmazuel\\.autorest" + }, + { + "resolvedInfo": null, + "packageMetadata": { + "name": "@microsoft.azure/autorest.python", + "version": "2.0.19", + "dependencies": { + "dotnet-2.0.0": "^1.4.4" + }, + "optionalDependencies": {}, + "devDependencies": { + "@microsoft.azure/autorest.testserver": "^1.9.0", + "autorest": "^2.0.0", + "coffee-script": "^1.11.1", + "dotnet-sdk-2.0.0": "^1.4.4", + "gulp": "^3.9.1", + "gulp-filter": "^5.0.0", + "gulp-line-ending-corrector": "^1.0.1", + "iced-coffee-script": "^108.0.11", + "marked": "^0.3.6", + "marked-terminal": "^2.0.0", + "moment": "^2.17.1", + "run-sequence": "*", + "shx": "^0.2.2", + "through2-parallel": "^0.1.3", + "yargs": "^8.0.2", + "yarn": "^1.0.2" + }, + "bundleDependencies": false, + "peerDependencies": {}, + "deprecated": false, + "_resolved": "C:/Users/lmazuel/.autorest/@microsoft.azure_autorest.python@2.0.19/node_modules/@microsoft.azure/autorest.python", + "_shasum": "e069166c16fd903c8e1fdf9395b433f3043cb6e3", + "_shrinkwrap": null, + "bin": null, + "_id": "@microsoft.azure/autorest.python@2.0.19", + "_from": "file:C:/Users/lmazuel/.autorest/@microsoft.azure_autorest.python@2.0.19/node_modules/@microsoft.azure/autorest.python", + "_requested": { + "type": "directory", + "where": "D:\\VSProjects\\swagger-to-sdk", + "raw": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest.python@2.0.19\\node_modules\\@microsoft.azure\\autorest.python", + "rawSpec": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest.python@2.0.19\\node_modules\\@microsoft.azure\\autorest.python", + "saveSpec": "file:C:/Users/lmazuel/.autorest/@microsoft.azure_autorest.python@2.0.19/node_modules/@microsoft.azure/autorest.python", + "fetchSpec": "C:/Users/lmazuel/.autorest/@microsoft.azure_autorest.python@2.0.19/node_modules/@microsoft.azure/autorest.python" + }, + "_spec": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest.python@2.0.19\\node_modules\\@microsoft.azure\\autorest.python", + "_where": "C:\\Users\\lmazuel\\.autorest\\@microsoft.azure_autorest.python@2.0.19\\node_modules\\@microsoft.azure\\autorest.python" + }, + "extensionManager": { + "installationPath": "C:\\Users\\lmazuel\\.autorest", + "dotnetPath": "C:\\Users\\lmazuel\\.dotnet" + }, + "installationPath": "C:\\Users\\lmazuel\\.autorest" + } + ], + "autorest_bootstrap": { + "dependencies": { + "autorest": { + "version": "2.0.4166", + "from": "autorest@latest", + "resolved": "https://registry.npmjs.org/autorest/-/autorest-2.0.4166.tgz" + } + } + } +} \ No newline at end of file diff --git a/azure-mgmt-monitor/tests/recordings/test_mgmt_monitor.test_metrics.yaml b/azure-mgmt-monitor/tests/recordings/test_mgmt_monitor.test_metrics.yaml index ef5fe0b7da29..4fe9d27c8cb9 100644 --- a/azure-mgmt-monitor/tests/recordings/test_mgmt_monitor.test_metrics.yaml +++ b/azure-mgmt-monitor/tests/recordings/test_mgmt_monitor.test_metrics.yaml @@ -6,43 +6,42 @@ interactions: Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.1 (Windows-10-10.0.14393-SP0) requests/2.12.1 msrest/0.4.4 - msrest_azure/0.4.3 insightsclient/0.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.5.1 (Windows-10-10.0.16299-SP0) requests/2.17.3 msrest/0.4.11 + msrest_azure/0.4.11 monitormanagementclient/0.4.0 Azure-SDK-For-Python] accept-language: [en-US] - x-ms-client-request-id: [53ee6b76-ad02-11e6-8527-ecb1d756380e] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete/providers/microsoft.insights/metricDefinitions?api-version=2016-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632/providers/microsoft.insights/metricDefinitions?api-version=2017-05-01-preview response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete/providers/microsoft.insights/metricdefinitions","value":[{"resourceUri":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","name":{"value":"Percentage - CPU","localizedValue":"Percentage CPU"},"startTime":"0001-01-01T00:00:00Z","endTime":"0001-01-01T00:00:00Z","unit":"Percent","primaryAggregationType":"Average","ResourceUri":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","ResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","metricAvailabilities":[{"timeGrain":"PT1M","retention":"P30D"},{"timeGrain":"PT1H","retention":"P30D"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete/providers/microsoft.insights/metricdefinitions/Percentage - CPU"},{"resourceUri":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","name":{"value":"Network - In","localizedValue":"Network In"},"startTime":"0001-01-01T00:00:00Z","endTime":"0001-01-01T00:00:00Z","unit":"Bytes","primaryAggregationType":"Total","ResourceUri":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","ResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","metricAvailabilities":[{"timeGrain":"PT1M","retention":"P30D"},{"timeGrain":"PT1H","retention":"P30D"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete/providers/microsoft.insights/metricdefinitions/Network - In"},{"resourceUri":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","name":{"value":"Network - Out","localizedValue":"Network Out"},"startTime":"0001-01-01T00:00:00Z","endTime":"0001-01-01T00:00:00Z","unit":"Bytes","primaryAggregationType":"Total","ResourceUri":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","ResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","metricAvailabilities":[{"timeGrain":"PT1M","retention":"P30D"},{"timeGrain":"PT1H","retention":"P30D"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete/providers/microsoft.insights/metricdefinitions/Network - Out"},{"resourceUri":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","name":{"value":"Disk - Read Bytes","localizedValue":"Disk Read Bytes"},"startTime":"0001-01-01T00:00:00Z","endTime":"0001-01-01T00:00:00Z","unit":"Bytes","primaryAggregationType":"Total","ResourceUri":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","ResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","metricAvailabilities":[{"timeGrain":"PT1M","retention":"P30D"},{"timeGrain":"PT1H","retention":"P30D"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete/providers/microsoft.insights/metricdefinitions/Disk - Read Bytes"},{"resourceUri":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","name":{"value":"Disk - Write Bytes","localizedValue":"Disk Write Bytes"},"startTime":"0001-01-01T00:00:00Z","endTime":"0001-01-01T00:00:00Z","unit":"Bytes","primaryAggregationType":"Total","ResourceUri":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","ResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","metricAvailabilities":[{"timeGrain":"PT1M","retention":"P30D"},{"timeGrain":"PT1H","retention":"P30D"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete/providers/microsoft.insights/metricdefinitions/Disk - Write Bytes"},{"resourceUri":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","name":{"value":"Disk - Read Operations/Sec","localizedValue":"Disk Read Operations/Sec"},"startTime":"0001-01-01T00:00:00Z","endTime":"0001-01-01T00:00:00Z","unit":"CountPerSecond","primaryAggregationType":"Average","ResourceUri":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","ResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","metricAvailabilities":[{"timeGrain":"PT1M","retention":"P30D"},{"timeGrain":"PT1H","retention":"P30D"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete/providers/microsoft.insights/metricdefinitions/Disk - Read Operations/Sec"},{"resourceUri":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","name":{"value":"Disk - Write Operations/Sec","localizedValue":"Disk Write Operations/Sec"},"startTime":"0001-01-01T00:00:00Z","endTime":"0001-01-01T00:00:00Z","unit":"CountPerSecond","primaryAggregationType":"Average","ResourceUri":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","ResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete","metricAvailabilities":[{"timeGrain":"PT1M","retention":"P30D"},{"timeGrain":"PT1H","retention":"P30D"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete/providers/microsoft.insights/metricdefinitions/Disk - Write Operations/Sec"}]}'} + body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632/providers/microsoft.insights/metricdefinitions/Percentage + CPU","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632","name":{"value":"Percentage + CPU","localizedValue":"Percentage CPU"},"isDimensionRequired":false,"unit":"Percent","primaryAggregationType":"Average","metricAvailabilities":[{"timeGrain":"PT1M","retention":"P93D"},{"timeGrain":"PT1H","retention":"P93D"}]},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632/providers/microsoft.insights/metricdefinitions/Network + In","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632","name":{"value":"Network + In","localizedValue":"Network In"},"isDimensionRequired":false,"unit":"Bytes","primaryAggregationType":"Total","metricAvailabilities":[{"timeGrain":"PT1M","retention":"P93D"},{"timeGrain":"PT1H","retention":"P93D"}]},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632/providers/microsoft.insights/metricdefinitions/Network + Out","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632","name":{"value":"Network + Out","localizedValue":"Network Out"},"isDimensionRequired":false,"unit":"Bytes","primaryAggregationType":"Total","metricAvailabilities":[{"timeGrain":"PT1M","retention":"P93D"},{"timeGrain":"PT1H","retention":"P93D"}]},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632/providers/microsoft.insights/metricdefinitions/Disk + Read Bytes","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632","name":{"value":"Disk + Read Bytes","localizedValue":"Disk Read Bytes"},"isDimensionRequired":false,"unit":"Bytes","primaryAggregationType":"Total","metricAvailabilities":[{"timeGrain":"PT1M","retention":"P93D"},{"timeGrain":"PT1H","retention":"P93D"}]},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632/providers/microsoft.insights/metricdefinitions/Disk + Write Bytes","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632","name":{"value":"Disk + Write Bytes","localizedValue":"Disk Write Bytes"},"isDimensionRequired":false,"unit":"Bytes","primaryAggregationType":"Total","metricAvailabilities":[{"timeGrain":"PT1M","retention":"P93D"},{"timeGrain":"PT1H","retention":"P93D"}]},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632/providers/microsoft.insights/metricdefinitions/Disk + Read Operations/Sec","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632","name":{"value":"Disk + Read Operations/Sec","localizedValue":"Disk Read Operations/Sec"},"isDimensionRequired":false,"unit":"CountPerSecond","primaryAggregationType":"Average","metricAvailabilities":[{"timeGrain":"PT1M","retention":"P93D"},{"timeGrain":"PT1H","retention":"P93D"}]},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632/providers/microsoft.insights/metricdefinitions/Disk + Write Operations/Sec","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632","name":{"value":"Disk + Write Operations/Sec","localizedValue":"Disk Write Operations/Sec"},"isDimensionRequired":false,"unit":"CountPerSecond","primaryAggregationType":"Average","metricAvailabilities":[{"timeGrain":"PT1M","retention":"P93D"},{"timeGrain":"PT1H","retention":"P93D"}]},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632/providers/microsoft.insights/metricdefinitions/CPU + Credits Remaining","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632","name":{"value":"CPU + Credits Remaining","localizedValue":"CPU Credits Remaining"},"isDimensionRequired":false,"unit":"Count","primaryAggregationType":"Average","metricAvailabilities":[{"timeGrain":"PT1M","retention":"P93D"},{"timeGrain":"PT1H","retention":"P93D"}]},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632/providers/microsoft.insights/metricdefinitions/CPU + Credits Consumed","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632","name":{"value":"CPU + Credits Consumed","localizedValue":"CPU Credits Consumed"},"isDimensionRequired":false,"unit":"Count","primaryAggregationType":"Average","metricAvailabilities":[{"timeGrain":"PT1M","retention":"P93D"},{"timeGrain":"PT1H","retention":"P93D"}]}]}'} headers: - Cache-Control: [no-cache] - Content-Type: [application/json; charset=utf-8] - Date: ['Thu, 17 Nov 2016 20:13:39 GMT'] - Expires: ['-1'] - Pragma: [no-cache] - Server: [Microsoft-IIS/8.5] - Strict-Transport-Security: [max-age=31536000; includeSubDomains] - Transfer-Encoding: [chunked] - Vary: [Accept-Encoding] - content-length: ['8568'] - x-ms-correlation-request-id: [06008d44-7664-4140-9570-76bffae32064] - x-ms-ratelimit-remaining-subscription-reads: ['14994'] - x-ms-request-id: [c0500c03-1ca0-4728-8f15-321624802a6f] - x-ms-routing-request-id: ['WESTUS2:20161117T201339Z:06008d44-7664-4140-9570-76bffae32064'] + __handlingserverid__: [shoeboxproxyprod_shoeboxproxyprod-red_MetricsMP_IN_11] + cache-control: [no-cache] + content-length: ['5468'] + content-type: [application/json] + date: ['Mon, 23 Oct 2017 21:39:43 GMT'] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: ['Accept-Encoding,Accept-Encoding'] + x-powered-by: [ASP.NET] status: {code: 200, message: OK} - request: body: null @@ -51,31 +50,24 @@ interactions: Accept-Encoding: ['gzip, deflate'] Connection: [keep-alive] Content-Type: [application/json; charset=utf-8] - User-Agent: [python/3.5.1 (Windows-10-10.0.14393-SP0) requests/2.12.1 msrest/0.4.4 - msrest_azure/0.4.3 insightsclient/0.0.1 Azure-SDK-For-Python] + User-Agent: [python/3.5.1 (Windows-10-10.0.16299-SP0) requests/2.17.3 msrest/0.4.11 + msrest_azure/0.4.11 monitormanagementclient/0.4.0 Azure-SDK-For-Python] accept-language: [en-US] - x-ms-client-request-id: [542992b8-ad02-11e6-9e65-ecb1d756380e] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete/providers/microsoft.insights/metrics?api-version=2016-09-01&$filter=%28name.value%20eq%20%27Percentage%20CPU%27%29%20and%20%28aggregationType%20eq%20%27Total%27%29%20and%20startTime%20eq%202016-11-16%20and%20endTime%20eq%202016-11-17%20and%20timeGrain%20eq%20duration%27PT1H%27 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632/providers/microsoft.insights/metrics?timespan=2017-10-22%2F2017-10-23&metric=Percentage%20CPU&aggregation=Total&api-version=2017-05-01-preview&interval=PT1H response: - body: {string: '{"value":[{"data":[{"timeStamp":"2016-11-16T00:00:00Z","total":72.0},{"timeStamp":"2016-11-16T01:00:00Z","total":90.59},{"timeStamp":"2016-11-16T02:00:00Z","total":60.58},{"timeStamp":"2016-11-16T03:00:00Z","total":65.78},{"timeStamp":"2016-11-16T04:00:00Z","total":43.96},{"timeStamp":"2016-11-16T05:00:00Z","total":43.96},{"timeStamp":"2016-11-16T06:00:00Z","total":114.9},{"timeStamp":"2016-11-16T07:00:00Z","total":45.4},{"timeStamp":"2016-11-16T08:00:00Z","total":57.59},{"timeStamp":"2016-11-16T09:00:00Z","total":67.85},{"timeStamp":"2016-11-16T10:00:00Z","total":76.36},{"timeStamp":"2016-11-16T11:00:00Z","total":87.41},{"timeStamp":"2016-11-16T12:00:00Z","total":67.53},{"timeStamp":"2016-11-16T13:00:00Z","total":64.78},{"timeStamp":"2016-11-16T14:00:00Z","total":66.55},{"timeStamp":"2016-11-16T15:00:00Z","total":69.82},{"timeStamp":"2016-11-16T16:00:00Z","total":96.02},{"timeStamp":"2016-11-16T17:00:00Z","total":272.52},{"timeStamp":"2016-11-16T18:00:00Z","total":96.41},{"timeStamp":"2016-11-16T19:00:00Z","total":83.92},{"timeStamp":"2016-11-16T20:00:00Z","total":95.57},{"timeStamp":"2016-11-16T21:00:00Z","total":146.73},{"timeStamp":"2016-11-16T22:00:00Z","total":73.86},{"timeStamp":"2016-11-16T23:00:00Z","total":84.7}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/DoNotDeleteGroup/providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete/providers/Microsoft.Insights/metrics/Percentage - CPU","name":{"value":"Percentage CPU","localizedValue":"Percentage CPU"},"type":"Microsoft.Insights/metrics","unit":"Percent"}]}'} + body: {string: '{"cost":0,"timespan":"2017-10-22T00:00:00Z/2017-10-23T00:00:00Z","interval":"PT1H","value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azvmc632/providers/Microsoft.Compute/virtualMachines/azvmc632/providers/Microsoft.Insights/metrics/Percentage + CPU","type":"Microsoft.Insights/metrics","name":{"value":"Percentage CPU","localizedValue":"Percentage + CPU"},"unit":"Percent","timeseries":[{"metadatavalues":[],"data":[{"timeStamp":"2017-10-22T00:00:00Z","total":57.290000000000006},{"timeStamp":"2017-10-22T01:00:00Z","total":59.339999999999996},{"timeStamp":"2017-10-22T02:00:00Z","total":58.43},{"timeStamp":"2017-10-22T03:00:00Z","total":98.329999999999956},{"timeStamp":"2017-10-22T04:00:00Z","total":66.79},{"timeStamp":"2017-10-22T05:00:00Z","total":68.859999999999985},{"timeStamp":"2017-10-22T06:00:00Z","total":126.61999999999999},{"timeStamp":"2017-10-22T07:00:00Z","total":131.33000000000007},{"timeStamp":"2017-10-22T08:00:00Z","total":58.01},{"timeStamp":"2017-10-22T09:00:00Z","total":68.04},{"timeStamp":"2017-10-22T10:00:00Z","total":84.659999999999982},{"timeStamp":"2017-10-22T11:00:00Z","total":98.449999999999989},{"timeStamp":"2017-10-22T12:00:00Z","total":100.99999999999994},{"timeStamp":"2017-10-22T13:00:00Z","total":115.09000000000002},{"timeStamp":"2017-10-22T14:00:00Z","total":122.99999999999999},{"timeStamp":"2017-10-22T15:00:00Z","total":114.44999999999999},{"timeStamp":"2017-10-22T16:00:00Z","total":107.05},{"timeStamp":"2017-10-22T17:00:00Z","total":104.34},{"timeStamp":"2017-10-22T18:00:00Z","total":60.229999999999983},{"timeStamp":"2017-10-22T19:00:00Z","total":69.700000000000017},{"timeStamp":"2017-10-22T20:00:00Z","total":79.639999999999986},{"timeStamp":"2017-10-22T21:00:00Z","total":48.460000000000008},{"timeStamp":"2017-10-22T22:00:00Z","total":51.980000000000004},{"timeStamp":"2017-10-22T23:00:00Z","total":56.930000000000021}]}]}]}'} headers: - Cache-Control: [no-cache] - Content-Type: [application/json] - Date: ['Thu, 17 Nov 2016 20:13:39 GMT'] - Expires: ['-1'] - Pragma: [no-cache] - Server: [Microsoft-IIS/8.5] - Strict-Transport-Security: [max-age=31536000; includeSubDomains] - Transfer-Encoding: [chunked] - Vary: ['Accept-Encoding,Accept-Encoding'] - X-Powered-By: [ASP.NET] - __HandlingServerId__: [shoeboxproxyprod_shoeboxproxyprod-black_MetricsMP_IN_0] - content-length: ['1577'] - x-ms-correlation-request-id: [ef70224b-4230-43b9-9124-112b2a1d16f9] - x-ms-ratelimit-remaining-subscription-reads: ['14992'] - x-ms-request-id: ['{ef70224b-4230-43b9-9124-112b2a1d16f9}'] - x-ms-routing-request-id: ['WESTUS2:20161117T201340Z:ef70224b-4230-43b9-9124-112b2a1d16f9'] + __handlingserverid__: [shoeboxproxyprod_shoeboxproxyprod-red_MetricsMP_IN_9] + cache-control: [no-cache] + content-length: ['1910'] + content-type: [application/json] + date: ['Mon, 23 Oct 2017 21:39:55 GMT'] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + vary: [Accept-Encoding] + x-powered-by: [ASP.NET] status: {code: 200, message: OK} version: 1 diff --git a/azure-mgmt-monitor/tests/test_mgmt_monitor.py b/azure-mgmt-monitor/tests/test_mgmt_monitor.py index f842564b8437..95efc621d1fc 100644 --- a/azure-mgmt-monitor/tests/test_mgmt_monitor.py +++ b/azure-mgmt-monitor/tests/test_mgmt_monitor.py @@ -9,7 +9,6 @@ import datetime import azure.mgmt.monitor -import azure.monitor from azure.mgmt.monitor.models import ( ThresholdRuleCondition, @@ -26,12 +25,9 @@ class MgmtMonitorTest(AzureMgmtTestCase): def setUp(self): super(MgmtMonitorTest, self).setUp() - self.mgmt_client = self.create_mgmt_client( + self.client = self.create_mgmt_client( azure.mgmt.monitor.MonitorManagementClient ) - self.data_client = self.create_mgmt_client( - azure.monitor.MonitorClient - ) @ResourceGroupPreparer() def test_activity_log(self, resource_group): @@ -52,7 +48,7 @@ def test_activity_log(self, resource_group): ]) select = "eventName,operationName" filter = filter.format(resource_group.name) - activity_logs = list(self.data_client.activity_logs.list( + activity_logs = list(self.client.activity_logs.list( filter=filter, select=select )) @@ -69,11 +65,11 @@ def test_metrics(self): # Get the VM or your resource and use "id" attribute, or build the id yourself from RG and name resource_id = ( "subscriptions/{}/" - "resourceGroups/DoNotDeleteGroup/" - "providers/Microsoft.Compute/virtualMachines/UbuntuServerDoNotDelete" + "resourceGroups/azvmc632/" + "providers/Microsoft.Compute/virtualMachines/azvmc632" ).format(self.settings.SUBSCRIPTION_ID) - metrics = list(self.data_client.metric_definitions.list( + metrics = list(self.client.metric_definitions.list( resource_id, )) self.assertGreaterEqual(len(metrics), 1) @@ -86,33 +82,30 @@ def test_metrics(self): ) # Need to freeze the date for the recorded tests - today = datetime.date(2016, 11, 17) + today = datetime.date(2017, 10, 23) yesterday = today - datetime.timedelta(days=1) - filter = " and ".join([ - "(name.value eq 'Percentage CPU')", - "(aggregationType eq 'Total')", - "startTime eq {}".format(yesterday), - "endTime eq {}".format(today), - "timeGrain eq duration'PT1H'" - ]) - - metrics = list(self.data_client.metrics.list( + metrics = self.client.metrics.list( resource_id, - filter=filter - )) - self.assertGreaterEqual(len(metrics), 1) - for item in metrics: + timespan="{}/{}".format(yesterday, today), + interval='PT1H', + metric='Percentage CPU', + aggregation='Total' + ) + self.assertGreaterEqual(len(metrics.value), 1) + for item in metrics.value: self.assertIsNotNone(item.name) self.assertIsNotNone(item.unit) - for data in item.data: - self.assertIsNotNone(data.time_stamp) - self.assertIsNotNone(data.total) + for timeserie in item.timeseries: + for data in timeserie.data: + self.assertIsNotNone(data.time_stamp) + self.assertIsNotNone(data.total) - for item in metrics: + for item in metrics.value: print("{} ({})".format(item.name.localized_value, item.unit.name)) - for data in item.data: - print("{}: {}".format(data.time_stamp, data.total)) + for timeserie in item.timeseries: + for data in timeserie.data: + print("{}: {}".format(data.time_stamp, data.total)) @ResourceGroupPreparer() def test_alert_rules(self, resource_group, location): @@ -147,7 +140,7 @@ def test_alert_rules(self, resource_group, location): ) rule_name = 'MyPyTestAlertRule' - my_alert = self.mgmt_client.alert_rules.create_or_update( + my_alert = self.client.alert_rules.create_or_update( resource_group.name, rule_name, { @@ -162,16 +155,16 @@ def test_alert_rules(self, resource_group, location): } ) - my_alert = self.mgmt_client.alert_rules.get( + my_alert = self.client.alert_rules.get( resource_group.name, rule_name ) - my_alerts = list(self.mgmt_client.alert_rules.list_by_resource_group( + my_alerts = list(self.client.alert_rules.list_by_resource_group( resource_group.name )) - self.mgmt_client.alert_rules.delete( + self.client.alert_rules.delete( resource_group.name, rule_name ) @@ -179,10 +172,10 @@ def test_alert_rules(self, resource_group, location): @unittest.skip("Known bug") def test_tenants_event(self): - tenant_events = list(self.data_client.tenant_events.list()) + tenant_events = list(self.client.tenant_events.list()) def test_event_categories(self): - event_categories = list(self.data_client.event_categories.list()) + event_categories = list(self.client.event_categories.list()) for cat in event_categories: # azure.monitor.models.LocalizableString @@ -200,7 +193,7 @@ def test_usage_metrics(self): "providers/Microsoft.DocumentDb/databaseAccounts/pymonitortest" ).format(self.settings.SUBSCRIPTION_ID) - usage_metrics = list(self.data_client.usage_metrics.list( + usage_metrics = list(self.client.usage_metrics.list( resource_id, )) for item in usage_metrics: @@ -217,7 +210,7 @@ def test_usage_metrics(self): def test_log_profile(self): profile_name = self.get_resource_name('pyprofile') - profile = self.mgmt_client.log_profiles.create_or_update( + profile = self.client.log_profiles.create_or_update( profile_name, { "storage_account_id": "/subscriptions/f9d8179e-43f0-46cb-99cd-f72bfab0a63b/resourceGroups/test_mgmt_media_test_media8fdd0a81/providers/Microsoft.Storage/storageAccounts/msmediapttest", @@ -239,15 +232,15 @@ def test_log_profile(self): ) self.assertEqual(profile.name, profile_name) - profile = self.mgmt_client.log_profiles.get( + profile = self.client.log_profiles.get( profile_name, ) self.assertEqual(profile.name, profile_name) - profiles = list(self.mgmt_client.log_profiles.list()) + profiles = list(self.client.log_profiles.list()) self.assertEqual(len(profiles), 1) - self.mgmt_client.log_profiles.delete(profile_name) + self.client.log_profiles.delete(profile_name) @unittest.skip("Known bug") @ResourceGroupPreparer() @@ -255,7 +248,7 @@ def test_autoscale_settings(self, resource_group, location): as_name = "setting1" resource_id = "/subscriptions/f9d8179e-43f0-46cb-99cd-f72bfab0a63b/resourcegroups/MonitorTestsDoNotDelete/providers/Microsoft.Compute/virtualMachines/MonitorTest/" - as_obj = self.mgmt_client.autoscale_settings.create_or_update( + as_obj = self.client.autoscale_settings.create_or_update( resource_group.name, as_name, { @@ -292,19 +285,19 @@ def test_autoscale_settings(self, resource_group, location): ) self.assertEqual(as_obj.name, as_name) - as_obj = self.mgmt_client.autoscale_settings.get( + as_obj = self.client.autoscale_settings.get( resource_group.name, as_name ) self.assertEqual(as_obj.name, as_name) - ass = list(self.mgmt_client.autoscale_settings.list_by_resource_group( + ass = list(self.client.autoscale_settings.list_by_resource_group( resource_group.name )) self.assertEqual(len(ass), 1) self.assertEqual(ass[0].name, as_name) - self.mgmt_client.autoscale_settings.delete( + self.client.autoscale_settings.delete( resource_group.name, as_name ) diff --git a/azure-monitor/HISTORY.rst b/azure-monitor/HISTORY.rst index f9bc761ca67d..9582f55a2c35 100644 --- a/azure-monitor/HISTORY.rst +++ b/azure-monitor/HISTORY.rst @@ -3,6 +3,11 @@ Release History =============== +0.3.1 (2017-10-24) +++++++++++++++++++ + +* Adding a deprecation warning, this package is replaced by "azure-mgmt-monitor" + 0.3.0 (2017-04-19) ++++++++++++++++++ diff --git a/azure-monitor/azure/monitor/__init__.py b/azure-monitor/azure/monitor/__init__.py index 1b46a1443088..0dc9cd062b83 100755 --- a/azure-monitor/azure/monitor/__init__.py +++ b/azure-monitor/azure/monitor/__init__.py @@ -8,6 +8,7 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- +import warnings from .monitor_client import MonitorClient from .version import VERSION @@ -16,3 +17,7 @@ __version__ = VERSION +warnings.warn( + "This package is deprecated and replaced by azure-mgmt-monitor>=0.4.0", + DeprecationWarning +) diff --git a/azure-monitor/azure/monitor/version.py b/azure-monitor/azure/monitor/version.py index 3e682bbd5fb1..54fdd938c10a 100755 --- a/azure-monitor/azure/monitor/version.py +++ b/azure-monitor/azure/monitor/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.3.0" +VERSION = "0.3.1" diff --git a/swagger_to_sdk_config.json b/swagger_to_sdk_config.json index 97f9df4f54a2..d9f346975e61 100644 --- a/swagger_to_sdk_config.json +++ b/swagger_to_sdk_config.json @@ -306,24 +306,15 @@ "output_dir": "azure-mgmt-media/azure/mgmt/media", "build_dir": "azure-mgmt-media" }, - "monitor.mgmt": { + "monitor": { "markdown": "specification/monitor/resource-manager/readme.md", "autorest_options": { - "package-version": "0.3.0" + "package-version": "0.4.0" }, "output_dir": "azure-mgmt-monitor/azure/mgmt/monitor", "build_dir": "azure-mgmt-monitor", "generated_relative_base_directory": "python/azure/mgmt/monitor" }, - "monitor.data": { - "markdown": "specification/monitor/data-plane/readme.md", - "autorest_options": { - "package-version": "0.4.0" - }, - "output_dir": "azure-monitor/azure/monitor", - "build_dir": "azure-monitor", - "generated_relative_base_directory": "python/azure/monitor" - }, "network.2015-06-15": { "markdown": "specification/network/resource-manager/readme.md", "autorest_options": {