Skip to content

Commit 3b0abfc

Browse files
AutorestCIlmazuel
authored andcommitted
[AutoPR monitor/resource-manager] [DO NOT MERGE, until feb 20] Adding 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.
1 parent 7d71b6a commit 3b0abfc

File tree

10 files changed

+119
-166
lines changed

10 files changed

+119
-166
lines changed

azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
from .itsm_receiver import ItsmReceiver
5959
from .azure_app_push_receiver import AzureAppPushReceiver
6060
from .automation_runbook_receiver import AutomationRunbookReceiver
61-
from .voice_receiver import VoiceReceiver
6261
from .action_group_resource import ActionGroupResource
6362
from .enable_request import EnableRequest
6463
from .action_group_patch_body import ActionGroupPatchBody
@@ -161,7 +160,6 @@
161160
'ItsmReceiver',
162161
'AzureAppPushReceiver',
163162
'AutomationRunbookReceiver',
164-
'VoiceReceiver',
165163
'ActionGroupResource',
166164
'EnableRequest',
167165
'ActionGroupPatchBody',

azure-mgmt-monitor/azure/mgmt/monitor/models/action_group_resource.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ class ActionGroupResource(Resource):
5555
receivers that are part of this action group.
5656
:type automation_runbook_receivers:
5757
list[~azure.mgmt.monitor.models.AutomationRunbookReceiver]
58-
:param voice_receivers: The list of voice receivers that are part of this
59-
action group.
60-
:type voice_receivers: list[~azure.mgmt.monitor.models.VoiceReceiver]
6158
"""
6259

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

89-
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):
85+
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):
9086
super(ActionGroupResource, self).__init__(location=location, tags=tags)
9187
self.group_short_name = group_short_name
9288
self.enabled = enabled
@@ -96,4 +92,3 @@ def __init__(self, location, group_short_name, tags=None, enabled=True, email_re
9692
self.itsm_receivers = itsm_receivers
9793
self.azure_app_push_receivers = azure_app_push_receivers
9894
self.automation_runbook_receivers = automation_runbook_receivers
99-
self.voice_receivers = voice_receivers

azure-mgmt-monitor/azure/mgmt/monitor/models/event_data.py

Lines changed: 77 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -15,115 +15,90 @@
1515
class EventData(Model):
1616
"""The Azure event log entries are of type EventData.
1717
18-
Variables are only populated by the server, and will be ignored when
19-
sending a request.
20-
21-
:ivar authorization:
22-
:vartype authorization: ~azure.mgmt.monitor.models.SenderAuthorization
23-
:ivar claims: key value pairs to identify ARM permissions.
24-
:vartype claims: dict[str, str]
25-
:ivar caller: the email address of the user who has performed the
18+
:param authorization:
19+
:type authorization: ~azure.mgmt.monitor.models.SenderAuthorization
20+
:param claims: key value pairs to identify ARM permissions.
21+
:type claims: dict[str, str]
22+
:param caller: the email address of the user who has performed the
2623
operation, the UPN claim or SPN claim based on availability.
27-
:vartype caller: str
28-
:ivar description: the description of the event.
29-
:vartype description: str
30-
:ivar id: the Id of this event as required by ARM for RBAC. It contains
24+
:type caller: str
25+
:param description: the description of the event.
26+
:type description: str
27+
:param id: the Id of this event as required by ARM for RBAC. It contains
3128
the EventDataID and a timestamp information.
32-
:vartype id: str
33-
:ivar event_data_id: the event data Id. This is a unique identifier for an
34-
event.
35-
:vartype event_data_id: str
36-
:ivar correlation_id: the correlation Id, usually a GUID in the string
29+
:type id: str
30+
:param event_data_id: the event data Id. This is a unique identifier for
31+
an event.
32+
:type event_data_id: str
33+
:param correlation_id: the correlation Id, usually a GUID in the string
3734
format. The correlation Id is shared among the events that belong to the
3835
same uber operation.
39-
:vartype correlation_id: str
40-
:ivar event_name: the event name. This value should not be confused with
36+
:type correlation_id: str
37+
:param event_name: the event name. This value should not be confused with
4138
OperationName. For practical purposes, OperationName might be more
4239
appealing to end users.
43-
:vartype event_name: ~azure.mgmt.monitor.models.LocalizableString
44-
:ivar category: the event category.
45-
:vartype category: ~azure.mgmt.monitor.models.LocalizableString
46-
:ivar http_request: the HTTP request info. Usually includes the
40+
:type event_name: ~azure.mgmt.monitor.models.LocalizableString
41+
:param category: the event category.
42+
:type category: ~azure.mgmt.monitor.models.LocalizableString
43+
:param http_request: the HTTP request info. Usually includes the
4744
'clientRequestId', 'clientIpAddress' (IP address of the user who initiated
4845
the event) and 'method' (HTTP method e.g. PUT).
49-
:vartype http_request: ~azure.mgmt.monitor.models.HttpRequestInfo
50-
:ivar level: the event level. Possible values include: 'Critical',
46+
:type http_request: ~azure.mgmt.monitor.models.HttpRequestInfo
47+
:param level: the event level. Possible values include: 'Critical',
5148
'Error', 'Warning', 'Informational', 'Verbose'
52-
:vartype level: str or ~azure.mgmt.monitor.models.EventLevel
53-
:ivar resource_group_name: the resource group name of the impacted
49+
:type level: str or ~azure.mgmt.monitor.models.EventLevel
50+
:param resource_group_name: the resource group name of the impacted
5451
resource.
55-
:vartype resource_group_name: str
56-
:ivar resource_provider_name: the resource provider name of the impacted
52+
:type resource_group_name: str
53+
:param resource_provider_name: the resource provider name of the impacted
5754
resource.
58-
:vartype resource_provider_name:
59-
~azure.mgmt.monitor.models.LocalizableString
60-
:ivar resource_id: the resource uri that uniquely identifies the resource
55+
:type resource_provider_name: ~azure.mgmt.monitor.models.LocalizableString
56+
:param resource_id: the resource uri that uniquely identifies the resource
6157
that caused this event.
62-
:vartype resource_id: str
63-
:ivar resource_type: the resource type
64-
:vartype resource_type: ~azure.mgmt.monitor.models.LocalizableString
65-
:ivar operation_id: It is usually a GUID shared among the events
58+
:type resource_id: str
59+
:param resource_type: the resource type
60+
:type resource_type: ~azure.mgmt.monitor.models.LocalizableString
61+
:param operation_id: It is usually a GUID shared among the events
6662
corresponding to single operation. This value should not be confused with
6763
EventName.
68-
:vartype operation_id: str
69-
:ivar operation_name: the operation name.
70-
:vartype operation_name: ~azure.mgmt.monitor.models.LocalizableString
71-
:ivar properties: the set of <Key, Value> pairs (usually a
64+
:type operation_id: str
65+
:param operation_name: the operation name.
66+
:type operation_name: ~azure.mgmt.monitor.models.LocalizableString
67+
:param properties: the set of <Key, Value> pairs (usually a
7268
Dictionary<String, String>) that includes details about the event.
73-
:vartype properties: dict[str, str]
74-
:ivar status: a string describing the status of the operation. Some
69+
:type properties: dict[str, str]
70+
:param status: a string describing the status of the operation. Some
7571
typical values are: Started, In progress, Succeeded, Failed, Resolved.
76-
:vartype status: ~azure.mgmt.monitor.models.LocalizableString
77-
:ivar sub_status: the event sub status. Most of the time, when included,
72+
:type status: ~azure.mgmt.monitor.models.LocalizableString
73+
:param sub_status: the event sub status. Most of the time, when included,
7874
this captures the HTTP status code of the REST call. Common values are: OK
7975
(HTTP Status Code: 200), Created (HTTP Status Code: 201), Accepted (HTTP
8076
Status Code: 202), No Content (HTTP Status Code: 204), Bad Request(HTTP
8177
Status Code: 400), Not Found (HTTP Status Code: 404), Conflict (HTTP
8278
Status Code: 409), Internal Server Error (HTTP Status Code: 500), Service
8379
Unavailable (HTTP Status Code:503), Gateway Timeout (HTTP Status Code:
8480
504)
85-
:vartype sub_status: ~azure.mgmt.monitor.models.LocalizableString
86-
:ivar event_timestamp: the timestamp of when the event was generated by
81+
:type sub_status: ~azure.mgmt.monitor.models.LocalizableString
82+
:param event_timestamp: the timestamp of when the event was generated by
8783
the Azure service processing the request corresponding the event. It in
8884
ISO 8601 format.
89-
:vartype event_timestamp: datetime
90-
:ivar submission_timestamp: the timestamp of when the event became
85+
:type event_timestamp: datetime
86+
:param submission_timestamp: the timestamp of when the event became
9187
available for querying via this API. It is in ISO 8601 format. This value
9288
should not be confused eventTimestamp. As there might be a delay between
9389
the occurrence time of the event, and the time that the event is submitted
9490
to the Azure logging infrastructure.
95-
:vartype submission_timestamp: datetime
96-
:ivar subscription_id: the Azure subscription Id usually a GUID.
97-
:vartype subscription_id: str
98-
:ivar tenant_id: the Azure tenant Id
99-
:vartype tenant_id: str
91+
:type submission_timestamp: datetime
92+
:param subscription_id: the Azure subscription Id usually a GUID.
93+
:type subscription_id: str
94+
:param tenant_id: the Azure tenant Id
95+
:type tenant_id: str
10096
"""
10197

10298
_validation = {
103-
'authorization': {'readonly': True},
104-
'claims': {'readonly': True},
105-
'caller': {'readonly': True},
106-
'description': {'readonly': True},
107-
'id': {'readonly': True},
108-
'event_data_id': {'readonly': True},
109-
'correlation_id': {'readonly': True},
110-
'event_name': {'readonly': True},
111-
'category': {'readonly': True},
112-
'http_request': {'readonly': True},
113-
'level': {'readonly': True},
114-
'resource_group_name': {'readonly': True},
115-
'resource_provider_name': {'readonly': True},
116-
'resource_id': {'readonly': True},
117-
'resource_type': {'readonly': True},
118-
'operation_id': {'readonly': True},
119-
'operation_name': {'readonly': True},
120-
'properties': {'readonly': True},
121-
'status': {'readonly': True},
122-
'sub_status': {'readonly': True},
123-
'event_timestamp': {'readonly': True},
124-
'submission_timestamp': {'readonly': True},
125-
'subscription_id': {'readonly': True},
126-
'tenant_id': {'readonly': True},
99+
'level': {'required': True},
100+
'event_timestamp': {'required': True},
101+
'submission_timestamp': {'required': True},
127102
}
128103

129104
_attribute_map = {
@@ -153,29 +128,29 @@ class EventData(Model):
153128
'tenant_id': {'key': 'tenantId', 'type': 'str'},
154129
}
155130

156-
def __init__(self):
131+
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):
157132
super(EventData, self).__init__()
158-
self.authorization = None
159-
self.claims = None
160-
self.caller = None
161-
self.description = None
162-
self.id = None
163-
self.event_data_id = None
164-
self.correlation_id = None
165-
self.event_name = None
166-
self.category = None
167-
self.http_request = None
168-
self.level = None
169-
self.resource_group_name = None
170-
self.resource_provider_name = None
171-
self.resource_id = None
172-
self.resource_type = None
173-
self.operation_id = None
174-
self.operation_name = None
175-
self.properties = None
176-
self.status = None
177-
self.sub_status = None
178-
self.event_timestamp = None
179-
self.submission_timestamp = None
180-
self.subscription_id = None
181-
self.tenant_id = None
133+
self.authorization = authorization
134+
self.claims = claims
135+
self.caller = caller
136+
self.description = description
137+
self.id = id
138+
self.event_data_id = event_data_id
139+
self.correlation_id = correlation_id
140+
self.event_name = event_name
141+
self.category = category
142+
self.http_request = http_request
143+
self.level = level
144+
self.resource_group_name = resource_group_name
145+
self.resource_provider_name = resource_provider_name
146+
self.resource_id = resource_id
147+
self.resource_type = resource_type
148+
self.operation_id = operation_id
149+
self.operation_name = operation_name
150+
self.properties = properties
151+
self.status = status
152+
self.sub_status = sub_status
153+
self.event_timestamp = event_timestamp
154+
self.submission_timestamp = submission_timestamp
155+
self.subscription_id = subscription_id
156+
self.tenant_id = tenant_id

azure-mgmt-monitor/azure/mgmt/monitor/models/metric_definition.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class MetricDefinition(Model):
2121
:param resource_id: the resource identifier of the resource that emitted
2222
the metric.
2323
:type resource_id: str
24+
:param namespace: the namespace the metric blongs to.
25+
:type namespace: str
2426
:param name: the name and the display name of the metric, i.e. it is a
2527
localizable string.
2628
:type name: ~azure.mgmt.monitor.models.LocalizableString
@@ -33,6 +35,10 @@ class MetricDefinition(Model):
3335
'None', 'Average', 'Count', 'Minimum', 'Maximum', 'Total'
3436
:type primary_aggregation_type: str or
3537
~azure.mgmt.monitor.models.AggregationType
38+
:param supported_aggregation_types: the collection of what aggregation
39+
types are supported.
40+
:type supported_aggregation_types: list[str or
41+
~azure.mgmt.monitor.models.AggregationType]
3642
:param metric_availabilities: the collection of what aggregation intervals
3743
are available to be queried.
3844
:type metric_availabilities:
@@ -47,21 +53,25 @@ class MetricDefinition(Model):
4753
_attribute_map = {
4854
'is_dimension_required': {'key': 'isDimensionRequired', 'type': 'bool'},
4955
'resource_id': {'key': 'resourceId', 'type': 'str'},
56+
'namespace': {'key': 'namespace', 'type': 'str'},
5057
'name': {'key': 'name', 'type': 'LocalizableString'},
5158
'unit': {'key': 'unit', 'type': 'Unit'},
5259
'primary_aggregation_type': {'key': 'primaryAggregationType', 'type': 'AggregationType'},
60+
'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[AggregationType]'},
5361
'metric_availabilities': {'key': 'metricAvailabilities', 'type': '[MetricAvailability]'},
5462
'id': {'key': 'id', 'type': 'str'},
5563
'dimensions': {'key': 'dimensions', 'type': '[LocalizableString]'},
5664
}
5765

58-
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):
66+
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):
5967
super(MetricDefinition, self).__init__()
6068
self.is_dimension_required = is_dimension_required
6169
self.resource_id = resource_id
70+
self.namespace = namespace
6271
self.name = name
6372
self.unit = unit
6473
self.primary_aggregation_type = primary_aggregation_type
74+
self.supported_aggregation_types = supported_aggregation_types
6575
self.metric_availabilities = metric_availabilities
6676
self.id = id
6777
self.dimensions = dimensions

azure-mgmt-monitor/azure/mgmt/monitor/models/response.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ class Response(Model):
2828
what was originally requested. This is not present if a metadata request
2929
was made.
3030
:type interval: timedelta
31+
:param namespace: The namespace of the metrics been queried
32+
:type namespace: str
33+
:param resourceregion: The region of the resource been queried for
34+
metrics.
35+
:type resourceregion: str
3136
:param value: the value of the collection.
3237
:type value: list[~azure.mgmt.monitor.models.Metric]
3338
"""
@@ -42,12 +47,16 @@ class Response(Model):
4247
'cost': {'key': 'cost', 'type': 'float'},
4348
'timespan': {'key': 'timespan', 'type': 'str'},
4449
'interval': {'key': 'interval', 'type': 'duration'},
50+
'namespace': {'key': 'namespace', 'type': 'str'},
51+
'resourceregion': {'key': 'resourceregion', 'type': 'str'},
4552
'value': {'key': 'value', 'type': '[Metric]'},
4653
}
4754

48-
def __init__(self, timespan, value, cost=None, interval=None):
55+
def __init__(self, timespan, value, cost=None, interval=None, namespace=None, resourceregion=None):
4956
super(Response, self).__init__()
5057
self.cost = cost
5158
self.timespan = timespan
5259
self.interval = interval
60+
self.namespace = namespace
61+
self.resourceregion = resourceregion
5362
self.value = value

azure-mgmt-monitor/azure/mgmt/monitor/models/voice_receiver.py

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)