Skip to content

Commit 841399c

Browse files
authored
[AutoPR network/resource-manager] Added NetworkConfigurationDiagnostic rest API + example (#3095)
* Generated from 6ad7c8a080cf905ffcbe9c42c0382059ce753188 Added NetworkConfigurationDiagnostic rest API + example * Generated from 6909b52c5e23056444d410930b8702e7540811e2 Removed 'read-only' from queries in NetworkConfigurationDiagnostic API * Generated from 6e6b30b52851dcd98880dc07125d2fc2faf97576 Added long-running-operation-options: final-state-via location to networkConfigurationDiagnostic API * Generated from f12e6b41326c05506097b75dce076c297074a3d2 Fixed example name * Generated from 9e5daf5f1cd3c59140eec06d6fb55e6456323c54 Fixed reference to ErrorDetails * Generated from 0858a238c818aa119584a9d61deddc2a26494de9 Fixed response for QueryConnectionMonitors API + fixed example * Generated from 377e5cc3f8f10f71d7816d78462fbb68685453bd Fixed types for latencies in networkwatcher.json
1 parent c7c9a9b commit 841399c

30 files changed

+1343
-124
lines changed

azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/__init__.py

+36
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
from .effective_network_security_group_list_result_py3 import EffectiveNetworkSecurityGroupListResult
116116
from .effective_route_py3 import EffectiveRoute
117117
from .effective_route_list_result_py3 import EffectiveRouteListResult
118+
from .error_response_py3 import ErrorResponse, ErrorResponseException
118119
from .network_watcher_py3 import NetworkWatcher
119120
from .topology_parameters_py3 import TopologyParameters
120121
from .topology_association_py3 import TopologyAssociation
@@ -172,6 +173,17 @@
172173
from .connection_monitor_result_py3 import ConnectionMonitorResult
173174
from .connection_state_snapshot_py3 import ConnectionStateSnapshot
174175
from .connection_monitor_query_result_py3 import ConnectionMonitorQueryResult
176+
from .traffic_query_py3 import TrafficQuery
177+
from .network_configuration_diagnostic_parameters_py3 import NetworkConfigurationDiagnosticParameters
178+
from .matched_rule_py3 import MatchedRule
179+
from .network_security_rules_evaluation_result_py3 import NetworkSecurityRulesEvaluationResult
180+
from .evaluated_network_security_group_py3 import EvaluatedNetworkSecurityGroup
181+
from .network_security_group_result_py3 import NetworkSecurityGroupResult
182+
from .network_configuration_diagnostic_result_py3 import NetworkConfigurationDiagnosticResult
183+
from .network_configuration_diagnostic_response_py3 import NetworkConfigurationDiagnosticResponse
184+
from .query_connection_monitors_parameters_py3 import QueryConnectionMonitorsParameters
185+
from .connection_monitors_query_result_item_py3 import ConnectionMonitorsQueryResultItem
186+
from .query_connection_monitors_response_py3 import QueryConnectionMonitorsResponse
175187
from .operation_display_py3 import OperationDisplay
176188
from .availability_py3 import Availability
177189
from .dimension_py3 import Dimension
@@ -330,6 +342,7 @@
330342
from .effective_network_security_group_list_result import EffectiveNetworkSecurityGroupListResult
331343
from .effective_route import EffectiveRoute
332344
from .effective_route_list_result import EffectiveRouteListResult
345+
from .error_response import ErrorResponse, ErrorResponseException
333346
from .network_watcher import NetworkWatcher
334347
from .topology_parameters import TopologyParameters
335348
from .topology_association import TopologyAssociation
@@ -387,6 +400,17 @@
387400
from .connection_monitor_result import ConnectionMonitorResult
388401
from .connection_state_snapshot import ConnectionStateSnapshot
389402
from .connection_monitor_query_result import ConnectionMonitorQueryResult
403+
from .traffic_query import TrafficQuery
404+
from .network_configuration_diagnostic_parameters import NetworkConfigurationDiagnosticParameters
405+
from .matched_rule import MatchedRule
406+
from .network_security_rules_evaluation_result import NetworkSecurityRulesEvaluationResult
407+
from .evaluated_network_security_group import EvaluatedNetworkSecurityGroup
408+
from .network_security_group_result import NetworkSecurityGroupResult
409+
from .network_configuration_diagnostic_result import NetworkConfigurationDiagnosticResult
410+
from .network_configuration_diagnostic_response import NetworkConfigurationDiagnosticResponse
411+
from .query_connection_monitors_parameters import QueryConnectionMonitorsParameters
412+
from .connection_monitors_query_result_item import ConnectionMonitorsQueryResultItem
413+
from .query_connection_monitors_response import QueryConnectionMonitorsResponse
390414
from .operation_display import OperationDisplay
391415
from .availability import Availability
392416
from .dimension import Dimension
@@ -673,6 +697,7 @@
673697
'EffectiveNetworkSecurityGroupListResult',
674698
'EffectiveRoute',
675699
'EffectiveRouteListResult',
700+
'ErrorResponse', 'ErrorResponseException',
676701
'NetworkWatcher',
677702
'TopologyParameters',
678703
'TopologyAssociation',
@@ -730,6 +755,17 @@
730755
'ConnectionMonitorResult',
731756
'ConnectionStateSnapshot',
732757
'ConnectionMonitorQueryResult',
758+
'TrafficQuery',
759+
'NetworkConfigurationDiagnosticParameters',
760+
'MatchedRule',
761+
'NetworkSecurityRulesEvaluationResult',
762+
'EvaluatedNetworkSecurityGroup',
763+
'NetworkSecurityGroupResult',
764+
'NetworkConfigurationDiagnosticResult',
765+
'NetworkConfigurationDiagnosticResponse',
766+
'QueryConnectionMonitorsParameters',
767+
'ConnectionMonitorsQueryResultItem',
768+
'QueryConnectionMonitorsResponse',
733769
'OperationDisplay',
734770
'Availability',
735771
'Dimension',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
14+
15+
class ConnectionMonitorsQueryResultItem(Model):
16+
"""Results of query particular connection monitor.
17+
18+
:param resource_id: Connection monitor resource ID.
19+
:type resource_id: str
20+
:param report:
21+
:type report:
22+
~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorQueryResult
23+
"""
24+
25+
_attribute_map = {
26+
'resource_id': {'key': 'resourceId', 'type': 'str'},
27+
'report': {'key': 'report', 'type': 'ConnectionMonitorQueryResult'},
28+
}
29+
30+
def __init__(self, **kwargs):
31+
super(ConnectionMonitorsQueryResultItem, self).__init__(**kwargs)
32+
self.resource_id = kwargs.get('resource_id', None)
33+
self.report = kwargs.get('report', None)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
14+
15+
class ConnectionMonitorsQueryResultItem(Model):
16+
"""Results of query particular connection monitor.
17+
18+
:param resource_id: Connection monitor resource ID.
19+
:type resource_id: str
20+
:param report:
21+
:type report:
22+
~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorQueryResult
23+
"""
24+
25+
_attribute_map = {
26+
'resource_id': {'key': 'resourceId', 'type': 'str'},
27+
'report': {'key': 'report', 'type': 'ConnectionMonitorQueryResult'},
28+
}
29+
30+
def __init__(self, *, resource_id: str=None, report=None, **kwargs) -> None:
31+
super(ConnectionMonitorsQueryResultItem, self).__init__(**kwargs)
32+
self.resource_id = resource_id
33+
self.report = report

azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/connection_state_snapshot.py

+20
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ class ConnectionStateSnapshot(Model):
3030
values include: 'NotStarted', 'InProgress', 'Completed'
3131
:type evaluation_state: str or
3232
~azure.mgmt.network.v2018_06_01.models.EvaluationState
33+
:param avg_latency_in_ms: Average latency in ms.
34+
:type avg_latency_in_ms: int
35+
:param min_latency_in_ms: Minimum latency in ms.
36+
:type min_latency_in_ms: int
37+
:param max_latency_in_ms: Maximum latency in ms.
38+
:type max_latency_in_ms: int
39+
:param probes_sent: The number of sent probes.
40+
:type probes_sent: int
41+
:param probes_failed: The number of failed probes.
42+
:type probes_failed: int
3343
:ivar hops: List of hops between the source and the destination.
3444
:vartype hops:
3545
list[~azure.mgmt.network.v2018_06_01.models.ConnectivityHop]
@@ -44,6 +54,11 @@ class ConnectionStateSnapshot(Model):
4454
'start_time': {'key': 'startTime', 'type': 'iso-8601'},
4555
'end_time': {'key': 'endTime', 'type': 'iso-8601'},
4656
'evaluation_state': {'key': 'evaluationState', 'type': 'str'},
57+
'avg_latency_in_ms': {'key': 'avgLatencyInMs', 'type': 'int'},
58+
'min_latency_in_ms': {'key': 'minLatencyInMs', 'type': 'int'},
59+
'max_latency_in_ms': {'key': 'maxLatencyInMs', 'type': 'int'},
60+
'probes_sent': {'key': 'probesSent', 'type': 'int'},
61+
'probes_failed': {'key': 'probesFailed', 'type': 'int'},
4762
'hops': {'key': 'hops', 'type': '[ConnectivityHop]'},
4863
}
4964

@@ -53,4 +68,9 @@ def __init__(self, **kwargs):
5368
self.start_time = kwargs.get('start_time', None)
5469
self.end_time = kwargs.get('end_time', None)
5570
self.evaluation_state = kwargs.get('evaluation_state', None)
71+
self.avg_latency_in_ms = kwargs.get('avg_latency_in_ms', None)
72+
self.min_latency_in_ms = kwargs.get('min_latency_in_ms', None)
73+
self.max_latency_in_ms = kwargs.get('max_latency_in_ms', None)
74+
self.probes_sent = kwargs.get('probes_sent', None)
75+
self.probes_failed = kwargs.get('probes_failed', None)
5676
self.hops = None

azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/connection_state_snapshot_py3.py

+21-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ class ConnectionStateSnapshot(Model):
3030
values include: 'NotStarted', 'InProgress', 'Completed'
3131
:type evaluation_state: str or
3232
~azure.mgmt.network.v2018_06_01.models.EvaluationState
33+
:param avg_latency_in_ms: Average latency in ms.
34+
:type avg_latency_in_ms: int
35+
:param min_latency_in_ms: Minimum latency in ms.
36+
:type min_latency_in_ms: int
37+
:param max_latency_in_ms: Maximum latency in ms.
38+
:type max_latency_in_ms: int
39+
:param probes_sent: The number of sent probes.
40+
:type probes_sent: int
41+
:param probes_failed: The number of failed probes.
42+
:type probes_failed: int
3343
:ivar hops: List of hops between the source and the destination.
3444
:vartype hops:
3545
list[~azure.mgmt.network.v2018_06_01.models.ConnectivityHop]
@@ -44,13 +54,23 @@ class ConnectionStateSnapshot(Model):
4454
'start_time': {'key': 'startTime', 'type': 'iso-8601'},
4555
'end_time': {'key': 'endTime', 'type': 'iso-8601'},
4656
'evaluation_state': {'key': 'evaluationState', 'type': 'str'},
57+
'avg_latency_in_ms': {'key': 'avgLatencyInMs', 'type': 'int'},
58+
'min_latency_in_ms': {'key': 'minLatencyInMs', 'type': 'int'},
59+
'max_latency_in_ms': {'key': 'maxLatencyInMs', 'type': 'int'},
60+
'probes_sent': {'key': 'probesSent', 'type': 'int'},
61+
'probes_failed': {'key': 'probesFailed', 'type': 'int'},
4762
'hops': {'key': 'hops', 'type': '[ConnectivityHop]'},
4863
}
4964

50-
def __init__(self, *, connection_state=None, start_time=None, end_time=None, evaluation_state=None, **kwargs) -> None:
65+
def __init__(self, *, connection_state=None, start_time=None, end_time=None, evaluation_state=None, avg_latency_in_ms: int=None, min_latency_in_ms: int=None, max_latency_in_ms: int=None, probes_sent: int=None, probes_failed: int=None, **kwargs) -> None:
5166
super(ConnectionStateSnapshot, self).__init__(**kwargs)
5267
self.connection_state = connection_state
5368
self.start_time = start_time
5469
self.end_time = end_time
5570
self.evaluation_state = evaluation_state
71+
self.avg_latency_in_ms = avg_latency_in_ms
72+
self.min_latency_in_ms = min_latency_in_ms
73+
self.max_latency_in_ms = max_latency_in_ms
74+
self.probes_sent = probes_sent
75+
self.probes_failed = probes_failed
5676
self.hops = None
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
from msrest.exceptions import HttpOperationError
14+
15+
16+
class ErrorResponse(Model):
17+
"""The error object.
18+
19+
:param error: Error.
20+
:type error: ~azure.mgmt.network.v2018_06_01.models.ErrorDetails
21+
"""
22+
23+
_attribute_map = {
24+
'error': {'key': 'error', 'type': 'ErrorDetails'},
25+
}
26+
27+
def __init__(self, **kwargs):
28+
super(ErrorResponse, self).__init__(**kwargs)
29+
self.error = kwargs.get('error', None)
30+
31+
32+
class ErrorResponseException(HttpOperationError):
33+
"""Server responsed with exception of type: 'ErrorResponse'.
34+
35+
:param deserialize: A deserializer
36+
:param response: Server response to be deserialized.
37+
"""
38+
39+
def __init__(self, deserialize, response, *args):
40+
41+
super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
from msrest.exceptions import HttpOperationError
14+
15+
16+
class ErrorResponse(Model):
17+
"""The error object.
18+
19+
:param error: Error.
20+
:type error: ~azure.mgmt.network.v2018_06_01.models.ErrorDetails
21+
"""
22+
23+
_attribute_map = {
24+
'error': {'key': 'error', 'type': 'ErrorDetails'},
25+
}
26+
27+
def __init__(self, *, error=None, **kwargs) -> None:
28+
super(ErrorResponse, self).__init__(**kwargs)
29+
self.error = error
30+
31+
32+
class ErrorResponseException(HttpOperationError):
33+
"""Server responsed with exception of type: 'ErrorResponse'.
34+
35+
:param deserialize: A deserializer
36+
:param response: Server response to be deserialized.
37+
"""
38+
39+
def __init__(self, deserialize, response, *args):
40+
41+
super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
14+
15+
class EvaluatedNetworkSecurityGroup(Model):
16+
"""Results of network security group evaluation.
17+
18+
Variables are only populated by the server, and will be ignored when
19+
sending a request.
20+
21+
:param network_security_group_id: Network security group ID.
22+
:type network_security_group_id: str
23+
:param matched_rule:
24+
:type matched_rule: ~azure.mgmt.network.v2018_06_01.models.MatchedRule
25+
:ivar rules_evaluation_result: List of network security rules evaluation
26+
results.
27+
:vartype rules_evaluation_result:
28+
list[~azure.mgmt.network.v2018_06_01.models.NetworkSecurityRulesEvaluationResult]
29+
"""
30+
31+
_validation = {
32+
'rules_evaluation_result': {'readonly': True},
33+
}
34+
35+
_attribute_map = {
36+
'network_security_group_id': {'key': 'networkSecurityGroupId', 'type': 'str'},
37+
'matched_rule': {'key': 'matchedRule', 'type': 'MatchedRule'},
38+
'rules_evaluation_result': {'key': 'rulesEvaluationResult', 'type': '[NetworkSecurityRulesEvaluationResult]'},
39+
}
40+
41+
def __init__(self, **kwargs):
42+
super(EvaluatedNetworkSecurityGroup, self).__init__(**kwargs)
43+
self.network_security_group_id = kwargs.get('network_security_group_id', None)
44+
self.matched_rule = kwargs.get('matched_rule', None)
45+
self.rules_evaluation_result = None

0 commit comments

Comments
 (0)