Skip to content

Commit

Permalink
[AutoPR monitor/resource-manager] [DO NOT MERGE, until feb 20] Adding…
Browse files Browse the repository at this point in the history
… 2018-01-01 version for metrics API (#2007)

* Generated from 25392731dd0415e1e5700412428dd5a96a2d7813

Fix PR comments 1

* Generated from f6739fd0e07e3d040fc0b1f47f3297a7a4a69cba

Fixing top/orderby names, Please be reminded, there is no code change, it's just a typo
of the names.

* Generated from 8ddf699be2bc7bd7a429b97db29d4abb3f238cad

Fix meta data sample as well.
  • Loading branch information
AutorestCI authored Feb 20, 2018
1 parent 02e367e commit 2dd7bbb
Show file tree
Hide file tree
Showing 10 changed files with 119 additions and 166 deletions.
2 changes: 0 additions & 2 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
from .itsm_receiver import ItsmReceiver
from .azure_app_push_receiver import AzureAppPushReceiver
from .automation_runbook_receiver import AutomationRunbookReceiver
from .voice_receiver import VoiceReceiver
from .action_group_resource import ActionGroupResource
from .enable_request import EnableRequest
from .action_group_patch_body import ActionGroupPatchBody
Expand Down Expand Up @@ -161,7 +160,6 @@
'ItsmReceiver',
'AzureAppPushReceiver',
'AutomationRunbookReceiver',
'VoiceReceiver',
'ActionGroupResource',
'EnableRequest',
'ActionGroupPatchBody',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ class ActionGroupResource(Resource):
receivers that are part of this action group.
:type automation_runbook_receivers:
list[~azure.mgmt.monitor.models.AutomationRunbookReceiver]
:param voice_receivers: The list of voice receivers that are part of this
action group.
:type voice_receivers: list[~azure.mgmt.monitor.models.VoiceReceiver]
"""

_validation = {
Expand All @@ -83,10 +80,9 @@ class ActionGroupResource(Resource):
'itsm_receivers': {'key': 'properties.itsmReceivers', 'type': '[ItsmReceiver]'},
'azure_app_push_receivers': {'key': 'properties.azureAppPushReceivers', 'type': '[AzureAppPushReceiver]'},
'automation_runbook_receivers': {'key': 'properties.automationRunbookReceivers', 'type': '[AutomationRunbookReceiver]'},
'voice_receivers': {'key': 'properties.voiceReceivers', 'type': '[VoiceReceiver]'},
}

def __init__(self, location, group_short_name, tags=None, enabled=True, email_receivers=None, sms_receivers=None, webhook_receivers=None, itsm_receivers=None, azure_app_push_receivers=None, automation_runbook_receivers=None, voice_receivers=None):
def __init__(self, location, group_short_name, tags=None, enabled=True, email_receivers=None, sms_receivers=None, webhook_receivers=None, itsm_receivers=None, azure_app_push_receivers=None, automation_runbook_receivers=None):
super(ActionGroupResource, self).__init__(location=location, tags=tags)
self.group_short_name = group_short_name
self.enabled = enabled
Expand All @@ -96,4 +92,3 @@ def __init__(self, location, group_short_name, tags=None, enabled=True, email_re
self.itsm_receivers = itsm_receivers
self.azure_app_push_receivers = azure_app_push_receivers
self.automation_runbook_receivers = automation_runbook_receivers
self.voice_receivers = voice_receivers
179 changes: 77 additions & 102 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/event_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,115 +15,90 @@
class EventData(Model):
"""The Azure event log entries are of type EventData.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar authorization:
:vartype authorization: ~azure.mgmt.monitor.models.SenderAuthorization
:ivar claims: key value pairs to identify ARM permissions.
:vartype claims: dict[str, str]
:ivar caller: the email address of the user who has performed the
: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.
:vartype caller: str
:ivar description: the description of the event.
:vartype description: str
:ivar id: the Id of this event as required by ARM for RBAC. It contains
: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.
:vartype id: str
:ivar event_data_id: the event data Id. This is a unique identifier for an
event.
:vartype event_data_id: str
:ivar correlation_id: the correlation Id, usually a GUID in the string
: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.
:vartype correlation_id: str
:ivar event_name: the event name. This value should not be confused with
: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.
:vartype event_name: ~azure.mgmt.monitor.models.LocalizableString
:ivar category: the event category.
:vartype category: ~azure.mgmt.monitor.models.LocalizableString
:ivar http_request: the HTTP request info. Usually includes the
: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).
:vartype http_request: ~azure.mgmt.monitor.models.HttpRequestInfo
:ivar level: the event level. Possible values include: 'Critical',
:type http_request: ~azure.mgmt.monitor.models.HttpRequestInfo
:param level: the event level. Possible values include: 'Critical',
'Error', 'Warning', 'Informational', 'Verbose'
:vartype level: str or ~azure.mgmt.monitor.models.EventLevel
:ivar resource_group_name: the resource group name of the impacted
:type level: str or ~azure.mgmt.monitor.models.EventLevel
:param resource_group_name: the resource group name of the impacted
resource.
:vartype resource_group_name: str
:ivar resource_provider_name: the resource provider name of the impacted
:type resource_group_name: str
:param resource_provider_name: the resource provider name of the impacted
resource.
:vartype resource_provider_name:
~azure.mgmt.monitor.models.LocalizableString
:ivar resource_id: the resource uri that uniquely identifies the resource
:type resource_provider_name: ~azure.mgmt.monitor.models.LocalizableString
:param resource_id: the resource uri that uniquely identifies the resource
that caused this event.
:vartype resource_id: str
:ivar resource_type: the resource type
:vartype resource_type: ~azure.mgmt.monitor.models.LocalizableString
:ivar operation_id: It is usually a GUID shared among the events
: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.
:vartype operation_id: str
:ivar operation_name: the operation name.
:vartype operation_name: ~azure.mgmt.monitor.models.LocalizableString
:ivar properties: the set of <Key, Value> pairs (usually a
:type operation_id: str
:param operation_name: the operation name.
:type operation_name: ~azure.mgmt.monitor.models.LocalizableString
:param properties: the set of <Key, Value> pairs (usually a
Dictionary<String, String>) that includes details about the event.
:vartype properties: dict[str, str]
:ivar status: a string describing the status of the operation. Some
: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.
:vartype status: ~azure.mgmt.monitor.models.LocalizableString
:ivar sub_status: the event sub status. Most of the time, when included,
: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)
:vartype sub_status: ~azure.mgmt.monitor.models.LocalizableString
:ivar event_timestamp: the timestamp of when the event was generated by
: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.
:vartype event_timestamp: datetime
:ivar submission_timestamp: the timestamp of when the event became
: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.
:vartype submission_timestamp: datetime
:ivar subscription_id: the Azure subscription Id usually a GUID.
:vartype subscription_id: str
:ivar tenant_id: the Azure tenant Id
:vartype tenant_id: str
: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 = {
'authorization': {'readonly': True},
'claims': {'readonly': True},
'caller': {'readonly': True},
'description': {'readonly': True},
'id': {'readonly': True},
'event_data_id': {'readonly': True},
'correlation_id': {'readonly': True},
'event_name': {'readonly': True},
'category': {'readonly': True},
'http_request': {'readonly': True},
'level': {'readonly': True},
'resource_group_name': {'readonly': True},
'resource_provider_name': {'readonly': True},
'resource_id': {'readonly': True},
'resource_type': {'readonly': True},
'operation_id': {'readonly': True},
'operation_name': {'readonly': True},
'properties': {'readonly': True},
'status': {'readonly': True},
'sub_status': {'readonly': True},
'event_timestamp': {'readonly': True},
'submission_timestamp': {'readonly': True},
'subscription_id': {'readonly': True},
'tenant_id': {'readonly': True},
'level': {'required': True},
'event_timestamp': {'required': True},
'submission_timestamp': {'required': True},
}

_attribute_map = {
Expand Down Expand Up @@ -153,29 +128,29 @@ class EventData(Model):
'tenant_id': {'key': 'tenantId', 'type': 'str'},
}

def __init__(self):
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):
super(EventData, self).__init__()
self.authorization = None
self.claims = None
self.caller = None
self.description = None
self.id = None
self.event_data_id = None
self.correlation_id = None
self.event_name = None
self.category = None
self.http_request = None
self.level = None
self.resource_group_name = None
self.resource_provider_name = None
self.resource_id = None
self.resource_type = None
self.operation_id = None
self.operation_name = None
self.properties = None
self.status = None
self.sub_status = None
self.event_timestamp = None
self.submission_timestamp = None
self.subscription_id = None
self.tenant_id = None
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class MetricDefinition(Model):
:param resource_id: the resource identifier of the resource that emitted
the metric.
:type resource_id: str
:param namespace: the namespace the metric blongs to.
:type namespace: str
:param name: the name and the display name of the metric, i.e. it is a
localizable string.
:type name: ~azure.mgmt.monitor.models.LocalizableString
Expand All @@ -33,6 +35,10 @@ class MetricDefinition(Model):
'None', 'Average', 'Count', 'Minimum', 'Maximum', 'Total'
:type primary_aggregation_type: str or
~azure.mgmt.monitor.models.AggregationType
:param supported_aggregation_types: the collection of what aggregation
types are supported.
:type supported_aggregation_types: list[str or
~azure.mgmt.monitor.models.AggregationType]
:param metric_availabilities: the collection of what aggregation intervals
are available to be queried.
:type metric_availabilities:
Expand All @@ -47,21 +53,25 @@ class MetricDefinition(Model):
_attribute_map = {
'is_dimension_required': {'key': 'isDimensionRequired', 'type': 'bool'},
'resource_id': {'key': 'resourceId', 'type': 'str'},
'namespace': {'key': 'namespace', 'type': 'str'},
'name': {'key': 'name', 'type': 'LocalizableString'},
'unit': {'key': 'unit', 'type': 'Unit'},
'primary_aggregation_type': {'key': 'primaryAggregationType', 'type': 'AggregationType'},
'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[AggregationType]'},
'metric_availabilities': {'key': 'metricAvailabilities', 'type': '[MetricAvailability]'},
'id': {'key': 'id', 'type': 'str'},
'dimensions': {'key': 'dimensions', 'type': '[LocalizableString]'},
}

def __init__(self, is_dimension_required=None, resource_id=None, name=None, unit=None, primary_aggregation_type=None, metric_availabilities=None, id=None, dimensions=None):
def __init__(self, is_dimension_required=None, resource_id=None, namespace=None, name=None, unit=None, primary_aggregation_type=None, supported_aggregation_types=None, metric_availabilities=None, id=None, dimensions=None):
super(MetricDefinition, self).__init__()
self.is_dimension_required = is_dimension_required
self.resource_id = resource_id
self.namespace = namespace
self.name = name
self.unit = unit
self.primary_aggregation_type = primary_aggregation_type
self.supported_aggregation_types = supported_aggregation_types
self.metric_availabilities = metric_availabilities
self.id = id
self.dimensions = dimensions
11 changes: 10 additions & 1 deletion azure-mgmt-monitor/azure/mgmt/monitor/models/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ class Response(Model):
what was originally requested. This is not present if a metadata request
was made.
:type interval: timedelta
:param namespace: The namespace of the metrics been queried
:type namespace: str
:param resourceregion: The region of the resource been queried for
metrics.
:type resourceregion: str
:param value: the value of the collection.
:type value: list[~azure.mgmt.monitor.models.Metric]
"""
Expand All @@ -42,12 +47,16 @@ class Response(Model):
'cost': {'key': 'cost', 'type': 'float'},
'timespan': {'key': 'timespan', 'type': 'str'},
'interval': {'key': 'interval', 'type': 'duration'},
'namespace': {'key': 'namespace', 'type': 'str'},
'resourceregion': {'key': 'resourceregion', 'type': 'str'},
'value': {'key': 'value', 'type': '[Metric]'},
}

def __init__(self, timespan, value, cost=None, interval=None):
def __init__(self, timespan, value, cost=None, interval=None, namespace=None, resourceregion=None):
super(Response, self).__init__()
self.cost = cost
self.timespan = timespan
self.interval = interval
self.namespace = namespace
self.resourceregion = resourceregion
self.value = value
43 changes: 0 additions & 43 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/voice_receiver.py

This file was deleted.

Loading

0 comments on commit 2dd7bbb

Please sign in to comment.