Skip to content

Commit 676b80e

Browse files
author
Rakshith Bhyravabhotla
authored
Regenerate monitor code (#19375)
* Regenrate code * statistics * Update sdk/monitor/azure-monitor-query/tests/test_logs_client.py * ci fix * Apply suggestions from code review * lint * Update sdk/monitor/azure-monitor-query/azure/monitor/query/_models.py * ci
1 parent b8f7a18 commit 676b80e

File tree

11 files changed

+290
-304
lines changed

11 files changed

+290
-304
lines changed

sdk/monitor/azure-monitor-query/azure/monitor/query/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
LogsBatchResultError,
1616
LogsQueryRequest,
1717
LogsBatchResults,
18-
LogsErrorDetails,
1918
MetricNamespace,
2019
MetricDefinition,
2120
MetricsMetadataValue,
@@ -35,7 +34,6 @@
3534
"LogsQueryResultColumn",
3635
"LogsQueryResultTable",
3736
"LogsQueryRequest",
38-
"LogsErrorDetails",
3937
"MetricsQueryClient",
4038
"MetricNamespace",
4139
"MetricDefinition",

sdk/monitor/azure-monitor-query/azure/monitor/query/_generated/models/__init__.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@
99
try:
1010
from ._models_py3 import BatchRequest
1111
from ._models_py3 import BatchResponse
12-
from ._models_py3 import BatchResponseError
13-
from ._models_py3 import BatchResponseErrorInnerError
1412
from ._models_py3 import Column
1513
from ._models_py3 import ErrorDetail
16-
from ._models_py3 import ErrorDetails
1714
from ._models_py3 import ErrorInfo
1815
from ._models_py3 import ErrorResponse
1916
from ._models_py3 import ErrorResponseAutoGenerated
2017
from ._models_py3 import LocalizableString
2118
from ._models_py3 import LogQueryRequest
2219
from ._models_py3 import LogQueryResponse
20+
from ._models_py3 import LogQueryResult
2321
from ._models_py3 import MetadataApplication
2422
from ._models_py3 import MetadataApplicationRelated
2523
from ._models_py3 import MetadataCategory
@@ -59,17 +57,15 @@
5957
except (SyntaxError, ImportError):
6058
from ._models import BatchRequest # type: ignore
6159
from ._models import BatchResponse # type: ignore
62-
from ._models import BatchResponseError # type: ignore
63-
from ._models import BatchResponseErrorInnerError # type: ignore
6460
from ._models import Column # type: ignore
6561
from ._models import ErrorDetail # type: ignore
66-
from ._models import ErrorDetails # type: ignore
6762
from ._models import ErrorInfo # type: ignore
6863
from ._models import ErrorResponse # type: ignore
6964
from ._models import ErrorResponseAutoGenerated # type: ignore
7065
from ._models import LocalizableString # type: ignore
7166
from ._models import LogQueryRequest # type: ignore
7267
from ._models import LogQueryResponse # type: ignore
68+
from ._models import LogQueryResult # type: ignore
7369
from ._models import MetadataApplication # type: ignore
7470
from ._models import MetadataApplicationRelated # type: ignore
7571
from ._models import MetadataCategory # type: ignore
@@ -109,6 +105,7 @@
109105

110106
from ._monitor_query_client_enums import (
111107
AggregationType,
108+
ColumnDataType,
112109
MetadataColumnDataType,
113110
ResultType,
114111
Unit,
@@ -117,17 +114,15 @@
117114
__all__ = [
118115
'BatchRequest',
119116
'BatchResponse',
120-
'BatchResponseError',
121-
'BatchResponseErrorInnerError',
122117
'Column',
123118
'ErrorDetail',
124-
'ErrorDetails',
125119
'ErrorInfo',
126120
'ErrorResponse',
127121
'ErrorResponseAutoGenerated',
128122
'LocalizableString',
129123
'LogQueryRequest',
130124
'LogQueryResponse',
125+
'LogQueryResult',
131126
'MetadataApplication',
132127
'MetadataApplicationRelated',
133128
'MetadataCategory',
@@ -165,6 +160,7 @@
165160
'Table',
166161
'TimeSeriesElement',
167162
'AggregationType',
163+
'ColumnDataType',
168164
'MetadataColumnDataType',
169165
'ResultType',
170166
'Unit',

sdk/monitor/azure-monitor-query/azure/monitor/query/_generated/models/_models.py

Lines changed: 68 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,10 @@ class BatchResponse(msrest.serialization.Model):
3434
3535
:param responses: An array of responses corresponding to each individual request in a batch.
3636
:type responses: list[~monitor_query_client.models.LogQueryResponse]
37-
:param error: Error response for a batch request.
38-
:type error: ~monitor_query_client.models.BatchResponseError
3937
"""
4038

4139
_attribute_map = {
4240
'responses': {'key': 'responses', 'type': '[LogQueryResponse]'},
43-
'error': {'key': 'error', 'type': 'BatchResponseError'},
4441
}
4542

4643
def __init__(
@@ -49,72 +46,25 @@ def __init__(
4946
):
5047
super(BatchResponse, self).__init__(**kwargs)
5148
self.responses = kwargs.get('responses', None)
52-
self.error = kwargs.get('error', None)
53-
54-
55-
class BatchResponseError(msrest.serialization.Model):
56-
"""Error response for a batch request.
57-
58-
:param message: The error message describing the cause of the error.
59-
:type message: str
60-
:param code: The error code.
61-
:type code: str
62-
:param inner_error:
63-
:type inner_error: ~monitor_query_client.models.BatchResponseErrorInnerError
64-
"""
65-
66-
_attribute_map = {
67-
'message': {'key': 'message', 'type': 'str'},
68-
'code': {'key': 'code', 'type': 'str'},
69-
'inner_error': {'key': 'innerError', 'type': 'BatchResponseErrorInnerError'},
70-
}
71-
72-
def __init__(
73-
self,
74-
**kwargs
75-
):
76-
super(BatchResponseError, self).__init__(**kwargs)
77-
self.message = kwargs.get('message', None)
78-
self.code = kwargs.get('code', None)
79-
self.inner_error = kwargs.get('inner_error', None)
80-
81-
82-
class BatchResponseErrorInnerError(msrest.serialization.Model):
83-
"""BatchResponseErrorInnerError.
84-
85-
:param code:
86-
:type code: str
87-
:param message:
88-
:type message: str
89-
:param details:
90-
:type details: list[~monitor_query_client.models.ErrorDetails]
91-
"""
92-
93-
_attribute_map = {
94-
'code': {'key': 'code', 'type': 'str'},
95-
'message': {'key': 'message', 'type': 'str'},
96-
'details': {'key': 'details', 'type': '[ErrorDetails]'},
97-
}
98-
99-
def __init__(
100-
self,
101-
**kwargs
102-
):
103-
super(BatchResponseErrorInnerError, self).__init__(**kwargs)
104-
self.code = kwargs.get('code', None)
105-
self.message = kwargs.get('message', None)
106-
self.details = kwargs.get('details', None)
10749

10850

10951
class Column(msrest.serialization.Model):
11052
"""A column in a table.
11153
112-
:param name: The name of this column.
54+
All required parameters must be populated in order to send to Azure.
55+
56+
:param name: Required. The name of this column.
11357
:type name: str
114-
:param type: The data type of this column.
115-
:type type: str
58+
:param type: Required. The data type of this column. Possible values include: "bool",
59+
"datetime", "dynamic", "int", "long", "real", "string".
60+
:type type: str or ~monitor_query_client.models.ColumnDataType
11661
"""
11762

63+
_validation = {
64+
'name': {'required': True},
65+
'type': {'required': True},
66+
}
67+
11868
_attribute_map = {
11969
'name': {'key': 'name', 'type': 'str'},
12070
'type': {'key': 'type', 'type': 'str'},
@@ -125,8 +75,8 @@ def __init__(
12575
**kwargs
12676
):
12777
super(Column, self).__init__(**kwargs)
128-
self.name = kwargs.get('name', None)
129-
self.type = kwargs.get('type', None)
78+
self.name = kwargs['name']
79+
self.type = kwargs['type']
13080

13181

13282
class ErrorDetail(msrest.serialization.Model):
@@ -176,33 +126,6 @@ def __init__(
176126
self.additional_properties = kwargs.get('additional_properties', None)
177127

178128

179-
class ErrorDetails(msrest.serialization.Model):
180-
"""ErrorDetails.
181-
182-
:param code:
183-
:type code: str
184-
:param message:
185-
:type message: str
186-
:param target:
187-
:type target: str
188-
"""
189-
190-
_attribute_map = {
191-
'code': {'key': 'code', 'type': 'str'},
192-
'message': {'key': 'message', 'type': 'str'},
193-
'target': {'key': 'target', 'type': 'str'},
194-
}
195-
196-
def __init__(
197-
self,
198-
**kwargs
199-
):
200-
super(ErrorDetails, self).__init__(**kwargs)
201-
self.code = kwargs.get('code', None)
202-
self.message = kwargs.get('message', None)
203-
self.target = kwargs.get('target', None)
204-
205-
206129
class ErrorInfo(msrest.serialization.Model):
207130
"""The code and message for an error.
208131
@@ -378,14 +301,18 @@ class LogQueryResponse(msrest.serialization.Model):
378301
:type id: str
379302
:param status:
380303
:type status: int
381-
:param body: Contains the tables, columns & rows resulting from a query.
382-
:type body: ~monitor_query_client.models.QueryResults
304+
:param body: Contains the tables, columns & rows resulting from the query or the error details
305+
if the query failed.
306+
:type body: ~monitor_query_client.models.LogQueryResult
307+
:param headers: Dictionary of :code:`<string>`.
308+
:type headers: dict[str, str]
383309
"""
384310

385311
_attribute_map = {
386312
'id': {'key': 'id', 'type': 'str'},
387313
'status': {'key': 'status', 'type': 'int'},
388-
'body': {'key': 'body', 'type': 'QueryResults'},
314+
'body': {'key': 'body', 'type': 'LogQueryResult'},
315+
'headers': {'key': 'headers', 'type': '{str}'},
389316
}
390317

391318
def __init__(
@@ -396,6 +323,38 @@ def __init__(
396323
self.id = kwargs.get('id', None)
397324
self.status = kwargs.get('status', None)
398325
self.body = kwargs.get('body', None)
326+
self.headers = kwargs.get('headers', None)
327+
328+
329+
class LogQueryResult(msrest.serialization.Model):
330+
"""Contains the tables, columns & rows resulting from the query or the error details if the query failed.
331+
332+
:param tables: The list of tables, columns and rows.
333+
:type tables: list[~monitor_query_client.models.Table]
334+
:param error: The code and message for an error.
335+
:type error: ~monitor_query_client.models.ErrorInfo
336+
:param statistics: Any object.
337+
:type statistics: object
338+
:param render: Any object.
339+
:type render: object
340+
"""
341+
342+
_attribute_map = {
343+
'tables': {'key': 'tables', 'type': '[Table]'},
344+
'error': {'key': 'error', 'type': 'ErrorInfo'},
345+
'statistics': {'key': 'statistics', 'type': 'object'},
346+
'render': {'key': 'render', 'type': 'object'},
347+
}
348+
349+
def __init__(
350+
self,
351+
**kwargs
352+
):
353+
super(LogQueryResult, self).__init__(**kwargs)
354+
self.tables = kwargs.get('tables', None)
355+
self.error = kwargs.get('error', None)
356+
self.statistics = kwargs.get('statistics', None)
357+
self.render = kwargs.get('render', None)
399358

400359

401360
class MetadataApplication(msrest.serialization.Model):
@@ -1630,12 +1589,6 @@ class QueryBody(msrest.serialization.Model):
16301589
:type timespan: str
16311590
:param workspaces: A list of workspaces that are included in the query.
16321591
:type workspaces: list[str]
1633-
:param qualified_names: A list of qualified workspace names that are included in the query.
1634-
:type qualified_names: list[str]
1635-
:param workspace_ids: A list of workspace IDs that are included in the query.
1636-
:type workspace_ids: list[str]
1637-
:param azure_resource_ids: A list of Azure resource IDs that are included in the query.
1638-
:type azure_resource_ids: list[str]
16391592
"""
16401593

16411594
_validation = {
@@ -1646,9 +1599,6 @@ class QueryBody(msrest.serialization.Model):
16461599
'query': {'key': 'query', 'type': 'str'},
16471600
'timespan': {'key': 'timespan', 'type': 'str'},
16481601
'workspaces': {'key': 'workspaces', 'type': '[str]'},
1649-
'qualified_names': {'key': 'qualifiedNames', 'type': '[str]'},
1650-
'workspace_ids': {'key': 'workspaceIds', 'type': '[str]'},
1651-
'azure_resource_ids': {'key': 'azureResourceIds', 'type': '[str]'},
16521602
}
16531603

16541604
def __init__(
@@ -1659,32 +1609,39 @@ def __init__(
16591609
self.query = kwargs['query']
16601610
self.timespan = kwargs.get('timespan', None)
16611611
self.workspaces = kwargs.get('workspaces', None)
1662-
self.qualified_names = kwargs.get('qualified_names', None)
1663-
self.workspace_ids = kwargs.get('workspace_ids', None)
1664-
self.azure_resource_ids = kwargs.get('azure_resource_ids', None)
16651612

16661613

16671614
class QueryResults(msrest.serialization.Model):
16681615
"""Contains the tables, columns & rows resulting from a query.
16691616
1670-
:param tables: The list of tables, columns and rows.
1617+
All required parameters must be populated in order to send to Azure.
1618+
1619+
:param tables: Required. The list of tables, columns and rows.
16711620
:type tables: list[~monitor_query_client.models.Table]
1672-
:param errors:
1673-
:type errors: ~monitor_query_client.models.ErrorDetails
1621+
:param statistics: Any object.
1622+
:type statistics: object
1623+
:param render: Any object.
1624+
:type render: object
16741625
"""
16751626

1627+
_validation = {
1628+
'tables': {'required': True},
1629+
}
1630+
16761631
_attribute_map = {
16771632
'tables': {'key': 'tables', 'type': '[Table]'},
1678-
'errors': {'key': 'errors', 'type': 'ErrorDetails'},
1633+
'statistics': {'key': 'statistics', 'type': 'object'},
1634+
'render': {'key': 'render', 'type': 'object'},
16791635
}
16801636

16811637
def __init__(
16821638
self,
16831639
**kwargs
16841640
):
16851641
super(QueryResults, self).__init__(**kwargs)
1686-
self.tables = kwargs.get('tables', None)
1687-
self.errors = kwargs.get('errors', None)
1642+
self.tables = kwargs['tables']
1643+
self.statistics = kwargs.get('statistics', None)
1644+
self.render = kwargs.get('render', None)
16881645

16891646

16901647
class Response(msrest.serialization.Model):

0 commit comments

Comments
 (0)