diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/__init__.py index 5dbefcc0eb66..b15cccfd19ec 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/__init__.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/__init__.py @@ -115,6 +115,7 @@ from .effective_network_security_group_list_result_py3 import EffectiveNetworkSecurityGroupListResult from .effective_route_py3 import EffectiveRoute from .effective_route_list_result_py3 import EffectiveRouteListResult + from .error_response_py3 import ErrorResponse, ErrorResponseException from .network_watcher_py3 import NetworkWatcher from .topology_parameters_py3 import TopologyParameters from .topology_association_py3 import TopologyAssociation @@ -172,6 +173,17 @@ from .connection_monitor_result_py3 import ConnectionMonitorResult from .connection_state_snapshot_py3 import ConnectionStateSnapshot from .connection_monitor_query_result_py3 import ConnectionMonitorQueryResult + from .traffic_query_py3 import TrafficQuery + from .network_configuration_diagnostic_parameters_py3 import NetworkConfigurationDiagnosticParameters + from .matched_rule_py3 import MatchedRule + from .network_security_rules_evaluation_result_py3 import NetworkSecurityRulesEvaluationResult + from .evaluated_network_security_group_py3 import EvaluatedNetworkSecurityGroup + from .network_security_group_result_py3 import NetworkSecurityGroupResult + from .network_configuration_diagnostic_result_py3 import NetworkConfigurationDiagnosticResult + from .network_configuration_diagnostic_response_py3 import NetworkConfigurationDiagnosticResponse + from .query_connection_monitors_parameters_py3 import QueryConnectionMonitorsParameters + from .connection_monitors_query_result_item_py3 import ConnectionMonitorsQueryResultItem + from .query_connection_monitors_response_py3 import QueryConnectionMonitorsResponse from .operation_display_py3 import OperationDisplay from .availability_py3 import Availability from .dimension_py3 import Dimension @@ -330,6 +342,7 @@ from .effective_network_security_group_list_result import EffectiveNetworkSecurityGroupListResult from .effective_route import EffectiveRoute from .effective_route_list_result import EffectiveRouteListResult + from .error_response import ErrorResponse, ErrorResponseException from .network_watcher import NetworkWatcher from .topology_parameters import TopologyParameters from .topology_association import TopologyAssociation @@ -387,6 +400,17 @@ from .connection_monitor_result import ConnectionMonitorResult from .connection_state_snapshot import ConnectionStateSnapshot from .connection_monitor_query_result import ConnectionMonitorQueryResult + from .traffic_query import TrafficQuery + from .network_configuration_diagnostic_parameters import NetworkConfigurationDiagnosticParameters + from .matched_rule import MatchedRule + from .network_security_rules_evaluation_result import NetworkSecurityRulesEvaluationResult + from .evaluated_network_security_group import EvaluatedNetworkSecurityGroup + from .network_security_group_result import NetworkSecurityGroupResult + from .network_configuration_diagnostic_result import NetworkConfigurationDiagnosticResult + from .network_configuration_diagnostic_response import NetworkConfigurationDiagnosticResponse + from .query_connection_monitors_parameters import QueryConnectionMonitorsParameters + from .connection_monitors_query_result_item import ConnectionMonitorsQueryResultItem + from .query_connection_monitors_response import QueryConnectionMonitorsResponse from .operation_display import OperationDisplay from .availability import Availability from .dimension import Dimension @@ -673,6 +697,7 @@ 'EffectiveNetworkSecurityGroupListResult', 'EffectiveRoute', 'EffectiveRouteListResult', + 'ErrorResponse', 'ErrorResponseException', 'NetworkWatcher', 'TopologyParameters', 'TopologyAssociation', @@ -730,6 +755,17 @@ 'ConnectionMonitorResult', 'ConnectionStateSnapshot', 'ConnectionMonitorQueryResult', + 'TrafficQuery', + 'NetworkConfigurationDiagnosticParameters', + 'MatchedRule', + 'NetworkSecurityRulesEvaluationResult', + 'EvaluatedNetworkSecurityGroup', + 'NetworkSecurityGroupResult', + 'NetworkConfigurationDiagnosticResult', + 'NetworkConfigurationDiagnosticResponse', + 'QueryConnectionMonitorsParameters', + 'ConnectionMonitorsQueryResultItem', + 'QueryConnectionMonitorsResponse', 'OperationDisplay', 'Availability', 'Dimension', diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/connection_monitors_query_result_item.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/connection_monitors_query_result_item.py new file mode 100644 index 000000000000..e8e345b48961 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/connection_monitors_query_result_item.py @@ -0,0 +1,33 @@ +# 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 ConnectionMonitorsQueryResultItem(Model): + """Results of query particular connection monitor. + + :param resource_id: Connection monitor resource ID. + :type resource_id: str + :param report: + :type report: + ~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorQueryResult + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'report': {'key': 'report', 'type': 'ConnectionMonitorQueryResult'}, + } + + def __init__(self, **kwargs): + super(ConnectionMonitorsQueryResultItem, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.report = kwargs.get('report', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/connection_monitors_query_result_item_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/connection_monitors_query_result_item_py3.py new file mode 100644 index 000000000000..dcd6a28e8fdf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/connection_monitors_query_result_item_py3.py @@ -0,0 +1,33 @@ +# 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 ConnectionMonitorsQueryResultItem(Model): + """Results of query particular connection monitor. + + :param resource_id: Connection monitor resource ID. + :type resource_id: str + :param report: + :type report: + ~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorQueryResult + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'report': {'key': 'report', 'type': 'ConnectionMonitorQueryResult'}, + } + + def __init__(self, *, resource_id: str=None, report=None, **kwargs) -> None: + super(ConnectionMonitorsQueryResultItem, self).__init__(**kwargs) + self.resource_id = resource_id + self.report = report diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/connection_state_snapshot.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/connection_state_snapshot.py index 1c17f0ab012e..adbc9e1251ab 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/connection_state_snapshot.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/connection_state_snapshot.py @@ -30,6 +30,16 @@ class ConnectionStateSnapshot(Model): values include: 'NotStarted', 'InProgress', 'Completed' :type evaluation_state: str or ~azure.mgmt.network.v2018_06_01.models.EvaluationState + :param avg_latency_in_ms: Average latency in ms. + :type avg_latency_in_ms: int + :param min_latency_in_ms: Minimum latency in ms. + :type min_latency_in_ms: int + :param max_latency_in_ms: Maximum latency in ms. + :type max_latency_in_ms: int + :param probes_sent: The number of sent probes. + :type probes_sent: int + :param probes_failed: The number of failed probes. + :type probes_failed: int :ivar hops: List of hops between the source and the destination. :vartype hops: list[~azure.mgmt.network.v2018_06_01.models.ConnectivityHop] @@ -44,6 +54,11 @@ class ConnectionStateSnapshot(Model): 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, 'evaluation_state': {'key': 'evaluationState', 'type': 'str'}, + 'avg_latency_in_ms': {'key': 'avgLatencyInMs', 'type': 'int'}, + 'min_latency_in_ms': {'key': 'minLatencyInMs', 'type': 'int'}, + 'max_latency_in_ms': {'key': 'maxLatencyInMs', 'type': 'int'}, + 'probes_sent': {'key': 'probesSent', 'type': 'int'}, + 'probes_failed': {'key': 'probesFailed', 'type': 'int'}, 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, } @@ -53,4 +68,9 @@ def __init__(self, **kwargs): self.start_time = kwargs.get('start_time', None) self.end_time = kwargs.get('end_time', None) self.evaluation_state = kwargs.get('evaluation_state', None) + self.avg_latency_in_ms = kwargs.get('avg_latency_in_ms', None) + self.min_latency_in_ms = kwargs.get('min_latency_in_ms', None) + self.max_latency_in_ms = kwargs.get('max_latency_in_ms', None) + self.probes_sent = kwargs.get('probes_sent', None) + self.probes_failed = kwargs.get('probes_failed', None) self.hops = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/connection_state_snapshot_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/connection_state_snapshot_py3.py index d4580aaa36d1..73ccc65a31de 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/connection_state_snapshot_py3.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/connection_state_snapshot_py3.py @@ -30,6 +30,16 @@ class ConnectionStateSnapshot(Model): values include: 'NotStarted', 'InProgress', 'Completed' :type evaluation_state: str or ~azure.mgmt.network.v2018_06_01.models.EvaluationState + :param avg_latency_in_ms: Average latency in ms. + :type avg_latency_in_ms: int + :param min_latency_in_ms: Minimum latency in ms. + :type min_latency_in_ms: int + :param max_latency_in_ms: Maximum latency in ms. + :type max_latency_in_ms: int + :param probes_sent: The number of sent probes. + :type probes_sent: int + :param probes_failed: The number of failed probes. + :type probes_failed: int :ivar hops: List of hops between the source and the destination. :vartype hops: list[~azure.mgmt.network.v2018_06_01.models.ConnectivityHop] @@ -44,13 +54,23 @@ class ConnectionStateSnapshot(Model): 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, 'evaluation_state': {'key': 'evaluationState', 'type': 'str'}, + 'avg_latency_in_ms': {'key': 'avgLatencyInMs', 'type': 'int'}, + 'min_latency_in_ms': {'key': 'minLatencyInMs', 'type': 'int'}, + 'max_latency_in_ms': {'key': 'maxLatencyInMs', 'type': 'int'}, + 'probes_sent': {'key': 'probesSent', 'type': 'int'}, + 'probes_failed': {'key': 'probesFailed', 'type': 'int'}, 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, } - def __init__(self, *, connection_state=None, start_time=None, end_time=None, evaluation_state=None, **kwargs) -> None: + 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: super(ConnectionStateSnapshot, self).__init__(**kwargs) self.connection_state = connection_state self.start_time = start_time self.end_time = end_time self.evaluation_state = evaluation_state + self.avg_latency_in_ms = avg_latency_in_ms + self.min_latency_in_ms = min_latency_in_ms + self.max_latency_in_ms = max_latency_in_ms + self.probes_sent = probes_sent + self.probes_failed = probes_failed self.hops = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/error_response.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/error_response.py new file mode 100644 index 000000000000..8695cf6db9cc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/error_response.py @@ -0,0 +1,41 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """The error object. + + :param error: Error. + :type error: ~azure.mgmt.network.v2018_06_01.models.ErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/error_response_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/error_response_py3.py new file mode 100644 index 000000000000..a2bf4e9aa21c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/error_response_py3.py @@ -0,0 +1,41 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """The error object. + + :param error: Error. + :type error: ~azure.mgmt.network.v2018_06_01.models.ErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/evaluated_network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/evaluated_network_security_group.py new file mode 100644 index 000000000000..8f545dfdc3bd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/evaluated_network_security_group.py @@ -0,0 +1,45 @@ +# 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 EvaluatedNetworkSecurityGroup(Model): + """Results of network security group evaluation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param network_security_group_id: Network security group ID. + :type network_security_group_id: str + :param matched_rule: + :type matched_rule: ~azure.mgmt.network.v2018_06_01.models.MatchedRule + :ivar rules_evaluation_result: List of network security rules evaluation + results. + :vartype rules_evaluation_result: + list[~azure.mgmt.network.v2018_06_01.models.NetworkSecurityRulesEvaluationResult] + """ + + _validation = { + 'rules_evaluation_result': {'readonly': True}, + } + + _attribute_map = { + 'network_security_group_id': {'key': 'networkSecurityGroupId', 'type': 'str'}, + 'matched_rule': {'key': 'matchedRule', 'type': 'MatchedRule'}, + 'rules_evaluation_result': {'key': 'rulesEvaluationResult', 'type': '[NetworkSecurityRulesEvaluationResult]'}, + } + + def __init__(self, **kwargs): + super(EvaluatedNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group_id = kwargs.get('network_security_group_id', None) + self.matched_rule = kwargs.get('matched_rule', None) + self.rules_evaluation_result = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/evaluated_network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/evaluated_network_security_group_py3.py new file mode 100644 index 000000000000..2afe0aab6d23 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/evaluated_network_security_group_py3.py @@ -0,0 +1,45 @@ +# 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 EvaluatedNetworkSecurityGroup(Model): + """Results of network security group evaluation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param network_security_group_id: Network security group ID. + :type network_security_group_id: str + :param matched_rule: + :type matched_rule: ~azure.mgmt.network.v2018_06_01.models.MatchedRule + :ivar rules_evaluation_result: List of network security rules evaluation + results. + :vartype rules_evaluation_result: + list[~azure.mgmt.network.v2018_06_01.models.NetworkSecurityRulesEvaluationResult] + """ + + _validation = { + 'rules_evaluation_result': {'readonly': True}, + } + + _attribute_map = { + 'network_security_group_id': {'key': 'networkSecurityGroupId', 'type': 'str'}, + 'matched_rule': {'key': 'matchedRule', 'type': 'MatchedRule'}, + 'rules_evaluation_result': {'key': 'rulesEvaluationResult', 'type': '[NetworkSecurityRulesEvaluationResult]'}, + } + + def __init__(self, *, network_security_group_id: str=None, matched_rule=None, **kwargs) -> None: + super(EvaluatedNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group_id = network_security_group_id + self.matched_rule = matched_rule + self.rules_evaluation_result = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/matched_rule.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/matched_rule.py new file mode 100644 index 000000000000..ffa2f54f52fd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/matched_rule.py @@ -0,0 +1,33 @@ +# 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 MatchedRule(Model): + """Matched rule. + + :param rule_name: Name of the matched network security rule. + :type rule_name: str + :param action: The network traffic is allowed or denied. Possible values + are 'Allow' and 'Deny'. + :type action: str + """ + + _attribute_map = { + 'rule_name': {'key': 'ruleName', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MatchedRule, self).__init__(**kwargs) + self.rule_name = kwargs.get('rule_name', None) + self.action = kwargs.get('action', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/matched_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/matched_rule_py3.py new file mode 100644 index 000000000000..67868d929d0c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/matched_rule_py3.py @@ -0,0 +1,33 @@ +# 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 MatchedRule(Model): + """Matched rule. + + :param rule_name: Name of the matched network security rule. + :type rule_name: str + :param action: The network traffic is allowed or denied. Possible values + are 'Allow' and 'Deny'. + :type action: str + """ + + _attribute_map = { + 'rule_name': {'key': 'ruleName', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__(self, *, rule_name: str=None, action: str=None, **kwargs) -> None: + super(MatchedRule, self).__init__(**kwargs) + self.rule_name = rule_name + self.action = action diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_configuration_diagnostic_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_configuration_diagnostic_parameters.py new file mode 100644 index 000000000000..60493d6726f8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_configuration_diagnostic_parameters.py @@ -0,0 +1,41 @@ +# 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 NetworkConfigurationDiagnosticParameters(Model): + """Parameters to get network configuration diagnostic. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to + perform network configuration diagnostic. Valid options are VM, + NetworkInterface, VMSS/NetworkInterface and Application Gateway. + :type target_resource_id: str + :param queries: Required. List of traffic queries. + :type queries: list[~azure.mgmt.network.v2018_06_01.models.TrafficQuery] + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'queries': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'queries': {'key': 'queries', 'type': '[TrafficQuery]'}, + } + + def __init__(self, **kwargs): + super(NetworkConfigurationDiagnosticParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.queries = kwargs.get('queries', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_configuration_diagnostic_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_configuration_diagnostic_parameters_py3.py new file mode 100644 index 000000000000..6c6e44dd2afb --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_configuration_diagnostic_parameters_py3.py @@ -0,0 +1,41 @@ +# 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 NetworkConfigurationDiagnosticParameters(Model): + """Parameters to get network configuration diagnostic. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to + perform network configuration diagnostic. Valid options are VM, + NetworkInterface, VMSS/NetworkInterface and Application Gateway. + :type target_resource_id: str + :param queries: Required. List of traffic queries. + :type queries: list[~azure.mgmt.network.v2018_06_01.models.TrafficQuery] + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'queries': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'queries': {'key': 'queries', 'type': '[TrafficQuery]'}, + } + + def __init__(self, *, target_resource_id: str, queries, **kwargs) -> None: + super(NetworkConfigurationDiagnosticParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.queries = queries diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_configuration_diagnostic_response.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_configuration_diagnostic_response.py new file mode 100644 index 000000000000..479c797577fb --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_configuration_diagnostic_response.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 NetworkConfigurationDiagnosticResponse(Model): + """Results of network configuration diagnostic on the target resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar results: List of network configuration diagnostic results. + :vartype results: + list[~azure.mgmt.network.v2018_06_01.models.NetworkConfigurationDiagnosticResult] + """ + + _validation = { + 'results': {'readonly': True}, + } + + _attribute_map = { + 'results': {'key': 'results', 'type': '[NetworkConfigurationDiagnosticResult]'}, + } + + def __init__(self, **kwargs): + super(NetworkConfigurationDiagnosticResponse, self).__init__(**kwargs) + self.results = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_configuration_diagnostic_response_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_configuration_diagnostic_response_py3.py new file mode 100644 index 000000000000..18d7aad6e566 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_configuration_diagnostic_response_py3.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 NetworkConfigurationDiagnosticResponse(Model): + """Results of network configuration diagnostic on the target resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar results: List of network configuration diagnostic results. + :vartype results: + list[~azure.mgmt.network.v2018_06_01.models.NetworkConfigurationDiagnosticResult] + """ + + _validation = { + 'results': {'readonly': True}, + } + + _attribute_map = { + 'results': {'key': 'results', 'type': '[NetworkConfigurationDiagnosticResult]'}, + } + + def __init__(self, **kwargs) -> None: + super(NetworkConfigurationDiagnosticResponse, self).__init__(**kwargs) + self.results = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_configuration_diagnostic_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_configuration_diagnostic_result.py new file mode 100644 index 000000000000..15ff152ed766 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_configuration_diagnostic_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 NetworkConfigurationDiagnosticResult(Model): + """Network configuration diagnostic result corresponded to provided traffic + query. + + :param traffic_query: + :type traffic_query: ~azure.mgmt.network.v2018_06_01.models.TrafficQuery + :param network_security_group_result: + :type network_security_group_result: + ~azure.mgmt.network.v2018_06_01.models.NetworkSecurityGroupResult + """ + + _attribute_map = { + 'traffic_query': {'key': 'trafficQuery', 'type': 'TrafficQuery'}, + 'network_security_group_result': {'key': 'networkSecurityGroupResult', 'type': 'NetworkSecurityGroupResult'}, + } + + def __init__(self, **kwargs): + super(NetworkConfigurationDiagnosticResult, self).__init__(**kwargs) + self.traffic_query = kwargs.get('traffic_query', None) + self.network_security_group_result = kwargs.get('network_security_group_result', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_configuration_diagnostic_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_configuration_diagnostic_result_py3.py new file mode 100644 index 000000000000..8050ce584804 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_configuration_diagnostic_result_py3.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 NetworkConfigurationDiagnosticResult(Model): + """Network configuration diagnostic result corresponded to provided traffic + query. + + :param traffic_query: + :type traffic_query: ~azure.mgmt.network.v2018_06_01.models.TrafficQuery + :param network_security_group_result: + :type network_security_group_result: + ~azure.mgmt.network.v2018_06_01.models.NetworkSecurityGroupResult + """ + + _attribute_map = { + 'traffic_query': {'key': 'trafficQuery', 'type': 'TrafficQuery'}, + 'network_security_group_result': {'key': 'networkSecurityGroupResult', 'type': 'NetworkSecurityGroupResult'}, + } + + def __init__(self, *, traffic_query=None, network_security_group_result=None, **kwargs) -> None: + super(NetworkConfigurationDiagnosticResult, self).__init__(**kwargs) + self.traffic_query = traffic_query + self.network_security_group_result = network_security_group_result diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_security_group_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_security_group_result.py new file mode 100644 index 000000000000..bf1800b1e8fd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_security_group_result.py @@ -0,0 +1,45 @@ +# 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 NetworkSecurityGroupResult(Model): + """Network configuration diagnostic result corresponded provided traffic + query. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param security_rule_access_result: The network traffic is allowed or + denied. Possible values are 'Allow' and 'Deny'. Possible values include: + 'Allow', 'Deny' + :type security_rule_access_result: str or + ~azure.mgmt.network.v2018_06_01.models.SecurityRuleAccess + :ivar evaluated_network_security_groups: List of results network security + groups diagnostic. + :vartype evaluated_network_security_groups: + list[~azure.mgmt.network.v2018_06_01.models.EvaluatedNetworkSecurityGroup] + """ + + _validation = { + 'evaluated_network_security_groups': {'readonly': True}, + } + + _attribute_map = { + 'security_rule_access_result': {'key': 'securityRuleAccessResult', 'type': 'str'}, + 'evaluated_network_security_groups': {'key': 'evaluatedNetworkSecurityGroups', 'type': '[EvaluatedNetworkSecurityGroup]'}, + } + + def __init__(self, **kwargs): + super(NetworkSecurityGroupResult, self).__init__(**kwargs) + self.security_rule_access_result = kwargs.get('security_rule_access_result', None) + self.evaluated_network_security_groups = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_security_group_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_security_group_result_py3.py new file mode 100644 index 000000000000..5ce4e0d71fca --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_security_group_result_py3.py @@ -0,0 +1,45 @@ +# 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 NetworkSecurityGroupResult(Model): + """Network configuration diagnostic result corresponded provided traffic + query. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param security_rule_access_result: The network traffic is allowed or + denied. Possible values are 'Allow' and 'Deny'. Possible values include: + 'Allow', 'Deny' + :type security_rule_access_result: str or + ~azure.mgmt.network.v2018_06_01.models.SecurityRuleAccess + :ivar evaluated_network_security_groups: List of results network security + groups diagnostic. + :vartype evaluated_network_security_groups: + list[~azure.mgmt.network.v2018_06_01.models.EvaluatedNetworkSecurityGroup] + """ + + _validation = { + 'evaluated_network_security_groups': {'readonly': True}, + } + + _attribute_map = { + 'security_rule_access_result': {'key': 'securityRuleAccessResult', 'type': 'str'}, + 'evaluated_network_security_groups': {'key': 'evaluatedNetworkSecurityGroups', 'type': '[EvaluatedNetworkSecurityGroup]'}, + } + + def __init__(self, *, security_rule_access_result=None, **kwargs) -> None: + super(NetworkSecurityGroupResult, self).__init__(**kwargs) + self.security_rule_access_result = security_rule_access_result + self.evaluated_network_security_groups = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_security_rules_evaluation_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_security_rules_evaluation_result.py new file mode 100644 index 000000000000..63c680f2093f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_security_rules_evaluation_result.py @@ -0,0 +1,51 @@ +# 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 NetworkSecurityRulesEvaluationResult(Model): + """Network security rules evaluation result. + + :param name: Name of the network security rule. + :type name: str + :param protocol_matched: Value indicating whether protocol is matched. + :type protocol_matched: bool + :param source_matched: Value indicating whether source is matched. + :type source_matched: bool + :param source_port_matched: Value indicating whether source port is + matched. + :type source_port_matched: bool + :param destination_matched: Value indicating whether destination is + matched. + :type destination_matched: bool + :param destination_port_matched: Value indicating whether destination port + is matched. + :type destination_port_matched: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'protocol_matched': {'key': 'protocolMatched', 'type': 'bool'}, + 'source_matched': {'key': 'sourceMatched', 'type': 'bool'}, + 'source_port_matched': {'key': 'sourcePortMatched', 'type': 'bool'}, + 'destination_matched': {'key': 'destinationMatched', 'type': 'bool'}, + 'destination_port_matched': {'key': 'destinationPortMatched', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(NetworkSecurityRulesEvaluationResult, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.protocol_matched = kwargs.get('protocol_matched', None) + self.source_matched = kwargs.get('source_matched', None) + self.source_port_matched = kwargs.get('source_port_matched', None) + self.destination_matched = kwargs.get('destination_matched', None) + self.destination_port_matched = kwargs.get('destination_port_matched', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_security_rules_evaluation_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_security_rules_evaluation_result_py3.py new file mode 100644 index 000000000000..3958fc34a17b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/network_security_rules_evaluation_result_py3.py @@ -0,0 +1,51 @@ +# 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 NetworkSecurityRulesEvaluationResult(Model): + """Network security rules evaluation result. + + :param name: Name of the network security rule. + :type name: str + :param protocol_matched: Value indicating whether protocol is matched. + :type protocol_matched: bool + :param source_matched: Value indicating whether source is matched. + :type source_matched: bool + :param source_port_matched: Value indicating whether source port is + matched. + :type source_port_matched: bool + :param destination_matched: Value indicating whether destination is + matched. + :type destination_matched: bool + :param destination_port_matched: Value indicating whether destination port + is matched. + :type destination_port_matched: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'protocol_matched': {'key': 'protocolMatched', 'type': 'bool'}, + 'source_matched': {'key': 'sourceMatched', 'type': 'bool'}, + 'source_port_matched': {'key': 'sourcePortMatched', 'type': 'bool'}, + 'destination_matched': {'key': 'destinationMatched', 'type': 'bool'}, + 'destination_port_matched': {'key': 'destinationPortMatched', 'type': 'bool'}, + } + + def __init__(self, *, name: str=None, protocol_matched: bool=None, source_matched: bool=None, source_port_matched: bool=None, destination_matched: bool=None, destination_port_matched: bool=None, **kwargs) -> None: + super(NetworkSecurityRulesEvaluationResult, self).__init__(**kwargs) + self.name = name + self.protocol_matched = protocol_matched + self.source_matched = source_matched + self.source_port_matched = source_port_matched + self.destination_matched = destination_matched + self.destination_port_matched = destination_port_matched diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/query_connection_monitors_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/query_connection_monitors_parameters.py new file mode 100644 index 000000000000..94f264d0c7bc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/query_connection_monitors_parameters.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 QueryConnectionMonitorsParameters(Model): + """Parameters to query connection monitors. + + :param connection_monitor_ids: List of connection monitors ID. + :type connection_monitor_ids: list[str] + """ + + _attribute_map = { + 'connection_monitor_ids': {'key': 'connectionMonitorIds', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(QueryConnectionMonitorsParameters, self).__init__(**kwargs) + self.connection_monitor_ids = kwargs.get('connection_monitor_ids', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/query_connection_monitors_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/query_connection_monitors_parameters_py3.py new file mode 100644 index 000000000000..3b6e288d647d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/query_connection_monitors_parameters_py3.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 QueryConnectionMonitorsParameters(Model): + """Parameters to query connection monitors. + + :param connection_monitor_ids: List of connection monitors ID. + :type connection_monitor_ids: list[str] + """ + + _attribute_map = { + 'connection_monitor_ids': {'key': 'connectionMonitorIds', 'type': '[str]'}, + } + + def __init__(self, *, connection_monitor_ids=None, **kwargs) -> None: + super(QueryConnectionMonitorsParameters, self).__init__(**kwargs) + self.connection_monitor_ids = connection_monitor_ids diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/query_connection_monitors_response.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/query_connection_monitors_response.py new file mode 100644 index 000000000000..80b99a0ca296 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/query_connection_monitors_response.py @@ -0,0 +1,33 @@ +# 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 QueryConnectionMonitorsResponse(Model): + """Results of query connection monitors. + + :param value: The list query connection monitor results. + :type value: + list[~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorsQueryResultItem] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ConnectionMonitorsQueryResultItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QueryConnectionMonitorsResponse, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/query_connection_monitors_response_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/query_connection_monitors_response_py3.py new file mode 100644 index 000000000000..00c3eba8cb31 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/query_connection_monitors_response_py3.py @@ -0,0 +1,33 @@ +# 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 QueryConnectionMonitorsResponse(Model): + """Results of query connection monitors. + + :param value: The list query connection monitor results. + :type value: + list[~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorsQueryResultItem] + :param next_link: URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ConnectionMonitorsQueryResultItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(QueryConnectionMonitorsResponse, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/traffic_query.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/traffic_query.py new file mode 100644 index 000000000000..b753c1eb01d8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/traffic_query.py @@ -0,0 +1,61 @@ +# 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 TrafficQuery(Model): + """Parameters to compare with network configuration. + + All required parameters must be populated in order to send to Azure. + + :param direction: Required. The direction of the traffic. Accepted values + are 'Inbound' and 'Outbound'. Possible values include: 'Inbound', + 'Outbound' + :type direction: str or ~azure.mgmt.network.v2018_06_01.models.Direction + :param protocol: Required. Protocol to be verified on. Accepted values are + '*', TCP, UDP. + :type protocol: str + :param source: Required. Traffic source. Accepted values are '*', IP + Address/CIDR, Service Tag. + :type source: str + :param destination: Required. Traffic destination. Accepted values are: + '*', IP Address/CIDR, Service Tag. + :type destination: str + :param destination_port: Required. Traffice destination port. Accepted + values are '*', port (for example, 3389) and port range (for example, + 80-100). + :type destination_port: str + """ + + _validation = { + 'direction': {'required': True}, + 'protocol': {'required': True}, + 'source': {'required': True}, + 'destination': {'required': True}, + 'destination_port': {'required': True}, + } + + _attribute_map = { + 'direction': {'key': 'direction', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'destination': {'key': 'destination', 'type': 'str'}, + 'destination_port': {'key': 'destinationPort', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrafficQuery, self).__init__(**kwargs) + self.direction = kwargs.get('direction', None) + self.protocol = kwargs.get('protocol', None) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) + self.destination_port = kwargs.get('destination_port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/traffic_query_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/traffic_query_py3.py new file mode 100644 index 000000000000..346799b3a992 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/models/traffic_query_py3.py @@ -0,0 +1,61 @@ +# 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 TrafficQuery(Model): + """Parameters to compare with network configuration. + + All required parameters must be populated in order to send to Azure. + + :param direction: Required. The direction of the traffic. Accepted values + are 'Inbound' and 'Outbound'. Possible values include: 'Inbound', + 'Outbound' + :type direction: str or ~azure.mgmt.network.v2018_06_01.models.Direction + :param protocol: Required. Protocol to be verified on. Accepted values are + '*', TCP, UDP. + :type protocol: str + :param source: Required. Traffic source. Accepted values are '*', IP + Address/CIDR, Service Tag. + :type source: str + :param destination: Required. Traffic destination. Accepted values are: + '*', IP Address/CIDR, Service Tag. + :type destination: str + :param destination_port: Required. Traffice destination port. Accepted + values are '*', port (for example, 3389) and port range (for example, + 80-100). + :type destination_port: str + """ + + _validation = { + 'direction': {'required': True}, + 'protocol': {'required': True}, + 'source': {'required': True}, + 'destination': {'required': True}, + 'destination_port': {'required': True}, + } + + _attribute_map = { + 'direction': {'key': 'direction', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'destination': {'key': 'destination', 'type': 'str'}, + 'destination_port': {'key': 'destinationPort', 'type': 'str'}, + } + + def __init__(self, *, direction, protocol: str, source: str, destination: str, destination_port: str, **kwargs) -> None: + super(TrafficQuery, self).__init__(**kwargs) + self.direction = direction + self.protocol = protocol + self.source = source + self.destination = destination + self.destination_port = destination_port diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/connection_monitors_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/connection_monitors_operations.py index f712d8aae613..8d02855b0574 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/connection_monitors_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/connection_monitors_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling @@ -75,9 +74,7 @@ def _create_or_update_initial( response = self._client.send(request, stream=False, **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 @@ -118,7 +115,8 @@ def create_or_update( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorResult] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorResult]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -167,7 +165,8 @@ def get( :return: ConnectionMonitorResult or ClientRawResponse if raw=true :rtype: ~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorResult or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -198,9 +197,7 @@ def get( response = self._client.send(request, stream=False, **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 @@ -245,9 +242,7 @@ def _delete_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 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) @@ -273,7 +268,8 @@ def delete( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -329,9 +325,7 @@ def _stop_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: - 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) @@ -357,7 +351,8 @@ def stop( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._stop_initial( resource_group_name=resource_group_name, @@ -413,9 +408,7 @@ def _start_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: - 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) @@ -441,7 +434,8 @@ def start( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._start_initial( resource_group_name=resource_group_name, @@ -498,9 +492,7 @@ def _query_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -539,7 +531,8 @@ def query( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorQueryResult] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorQueryResult]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._query_initial( resource_group_name=resource_group_name, @@ -585,7 +578,8 @@ def list( :return: An iterator like instance of ConnectionMonitorResult :rtype: ~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorResultPaged[~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorResult] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def internal_paging(next_link=None, raw=False): @@ -622,9 +616,7 @@ def internal_paging(next_link=None, raw=False): response = self._client.send(request, stream=False, **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 diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/network_watchers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/network_watchers_operations.py index 02a638a93499..783c4401676c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/network_watchers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/network_watchers_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling @@ -59,7 +58,8 @@ def create_or_update( :return: NetworkWatcher or ClientRawResponse if raw=true :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkWatcher or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.create_or_update.metadata['url'] @@ -93,9 +93,7 @@ def create_or_update( response = self._client.send(request, stream=False, **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 @@ -127,7 +125,8 @@ def get( :return: NetworkWatcher or ClientRawResponse if raw=true :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkWatcher or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -157,9 +156,7 @@ def get( response = self._client.send(request, stream=False, **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 @@ -203,9 +200,7 @@ def _delete_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 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) @@ -228,7 +223,8 @@ def delete( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -270,7 +266,8 @@ def update_tags( :return: NetworkWatcher or ClientRawResponse if raw=true :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkWatcher or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ parameters = models.TagsObject(tags=tags) @@ -306,9 +303,7 @@ def update_tags( response = self._client.send(request, stream=False, **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 @@ -336,7 +331,8 @@ def list( :return: An iterator like instance of NetworkWatcher :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkWatcherPaged[~azure.mgmt.network.v2018_06_01.models.NetworkWatcher] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def internal_paging(next_link=None, raw=False): @@ -372,9 +368,7 @@ def internal_paging(next_link=None, raw=False): response = self._client.send(request, stream=False, **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 @@ -401,7 +395,8 @@ def list_all( :return: An iterator like instance of NetworkWatcher :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkWatcherPaged[~azure.mgmt.network.v2018_06_01.models.NetworkWatcher] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def internal_paging(next_link=None, raw=False): @@ -436,9 +431,7 @@ def internal_paging(next_link=None, raw=False): response = self._client.send(request, stream=False, **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 @@ -473,7 +466,8 @@ def get_topology( :return: Topology or ClientRawResponse if raw=true :rtype: ~azure.mgmt.network.v2018_06_01.models.Topology or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get_topology.metadata['url'] @@ -507,9 +501,7 @@ def get_topology( response = self._client.send(request, stream=False, **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 @@ -558,9 +550,7 @@ def _verify_ip_flow_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -599,7 +589,8 @@ def verify_ip_flow( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_06_01.models.VerificationIPFlowResult] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_06_01.models.VerificationIPFlowResult]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._verify_ip_flow_initial( resource_group_name=resource_group_name, @@ -663,9 +654,7 @@ def _get_next_hop_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -703,7 +692,8 @@ def get_next_hop( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_06_01.models.NextHopResult] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_06_01.models.NextHopResult]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._get_next_hop_initial( resource_group_name=resource_group_name, @@ -769,9 +759,7 @@ def _get_vm_security_rules_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -808,7 +796,8 @@ def get_vm_security_rules( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_06_01.models.SecurityGroupViewResult] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_06_01.models.SecurityGroupViewResult]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._get_vm_security_rules_initial( resource_group_name=resource_group_name, @@ -872,9 +861,7 @@ def _get_troubleshooting_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -912,7 +899,8 @@ def get_troubleshooting( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_06_01.models.TroubleshootingResult] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_06_01.models.TroubleshootingResult]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._get_troubleshooting_initial( resource_group_name=resource_group_name, @@ -978,9 +966,7 @@ def _get_troubleshooting_result_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -1017,7 +1003,8 @@ def get_troubleshooting_result( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_06_01.models.TroubleshootingResult] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_06_01.models.TroubleshootingResult]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._get_troubleshooting_result_initial( resource_group_name=resource_group_name, @@ -1081,9 +1068,7 @@ def _set_flow_log_configuration_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -1123,7 +1108,8 @@ def set_flow_log_configuration( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_06_01.models.FlowLogInformation] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_06_01.models.FlowLogInformation]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._set_flow_log_configuration_initial( resource_group_name=resource_group_name, @@ -1189,9 +1175,7 @@ def _get_flow_log_status_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -1230,7 +1214,8 @@ def get_flow_log_status( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_06_01.models.FlowLogInformation] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_06_01.models.FlowLogInformation]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._get_flow_log_status_initial( resource_group_name=resource_group_name, @@ -1294,9 +1279,7 @@ def _check_connectivity_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -1337,7 +1320,8 @@ def check_connectivity( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_06_01.models.ConnectivityInformation] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_06_01.models.ConnectivityInformation]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._check_connectivity_initial( resource_group_name=resource_group_name, @@ -1401,9 +1385,7 @@ def _get_azure_reachability_report_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -1443,7 +1425,8 @@ def get_azure_reachability_report( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_06_01.models.AzureReachabilityReport] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_06_01.models.AzureReachabilityReport]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._get_azure_reachability_report_initial( resource_group_name=resource_group_name, @@ -1507,9 +1490,7 @@ def _list_available_providers_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -1549,7 +1530,8 @@ def list_available_providers( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_06_01.models.AvailableProvidersList] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_06_01.models.AvailableProvidersList]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._list_available_providers_initial( resource_group_name=resource_group_name, @@ -1577,3 +1559,217 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) list_available_providers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList'} + + + def _get_network_configuration_diagnostic_initial( + self, resource_group_name, network_watcher_name, target_resource_id, queries, custom_headers=None, raw=False, **operation_config): + parameters = models.NetworkConfigurationDiagnosticParameters(target_resource_id=target_resource_id, queries=queries) + + # Construct URL + url = self.get_network_configuration_diagnostic.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', response) + if response.status_code == 202: + deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_network_configuration_diagnostic( + self, resource_group_name, network_watcher_name, target_resource_id, queries, custom_headers=None, raw=False, polling=True, **operation_config): + """Get network configuration diagnostic. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param target_resource_id: The ID of the target resource to perform + network configuration diagnostic. Valid options are VM, + NetworkInterface, VMSS/NetworkInterface and Application Gateway. + :type target_resource_id: str + :param queries: List of traffic queries. + :type queries: + list[~azure.mgmt.network.v2018_06_01.models.TrafficQuery] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + NetworkConfigurationDiagnosticResponse or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_06_01.models.NetworkConfigurationDiagnosticResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_06_01.models.NetworkConfigurationDiagnosticResponse]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._get_network_configuration_diagnostic_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + target_resource_id=target_resource_id, + queries=queries, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_network_configuration_diagnostic.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic'} + + + def _query_connection_monitors_initial( + self, resource_group_name, network_watcher_name, connection_monitor_ids=None, custom_headers=None, raw=False, **operation_config): + parameters = models.QueryConnectionMonitorsParameters(connection_monitor_ids=connection_monitor_ids) + + # Construct URL + url = self.query_connection_monitors.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(parameters, 'QueryConnectionMonitorsParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('QueryConnectionMonitorsResponse', response) + if response.status_code == 202: + deserialized = self._deserialize('QueryConnectionMonitorsResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def query_connection_monitors( + self, resource_group_name, network_watcher_name, connection_monitor_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Query connection monitors. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param connection_monitor_ids: List of connection monitors ID. + :type connection_monitor_ids: list[str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + QueryConnectionMonitorsResponse or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_06_01.models.QueryConnectionMonitorsResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_06_01.models.QueryConnectionMonitorsResponse]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._query_connection_monitors_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_ids=connection_monitor_ids, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('QueryConnectionMonitorsResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + query_connection_monitors.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryConnectionMonitors'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/packet_captures_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/packet_captures_operations.py index edea41b61484..a309a5b87267 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/packet_captures_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/packet_captures_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling @@ -75,9 +74,7 @@ def _create_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -114,7 +111,8 @@ def create( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_06_01.models.PacketCaptureResult] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_06_01.models.PacketCaptureResult]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._create_initial( resource_group_name=resource_group_name, @@ -162,7 +160,8 @@ def get( :return: PacketCaptureResult or ClientRawResponse if raw=true :rtype: ~azure.mgmt.network.v2018_06_01.models.PacketCaptureResult or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -193,9 +192,7 @@ def get( response = self._client.send(request, stream=False, **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 @@ -240,9 +237,7 @@ def _delete_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202, 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) @@ -267,7 +262,8 @@ def delete( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -323,9 +319,7 @@ def _stop_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: - 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) @@ -350,7 +344,8 @@ def stop( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._stop_initial( resource_group_name=resource_group_name, @@ -407,9 +402,7 @@ def _get_status_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -447,7 +440,8 @@ def get_status( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_06_01.models.PacketCaptureQueryStatusResult] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_06_01.models.PacketCaptureQueryStatusResult]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._get_status_initial( resource_group_name=resource_group_name, @@ -492,7 +486,8 @@ def list( :return: An iterator like instance of PacketCaptureResult :rtype: ~azure.mgmt.network.v2018_06_01.models.PacketCaptureResultPaged[~azure.mgmt.network.v2018_06_01.models.PacketCaptureResult] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def internal_paging(next_link=None, raw=False): @@ -529,9 +524,7 @@ def internal_paging(next_link=None, raw=False): response = self._client.send(request, stream=False, **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