Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR network/resource-manager] Added NetworkConfigurationDiagnostic rest API + example #3095

Merged
merged 7 commits into from
Aug 15, 2018
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -673,6 +697,7 @@
'EffectiveNetworkSecurityGroupListResult',
'EffectiveRoute',
'EffectiveRouteListResult',
'ErrorResponse', 'ErrorResponseException',
'NetworkWatcher',
'TopologyParameters',
'TopologyAssociation',
Expand Down Expand Up @@ -730,6 +755,17 @@
'ConnectionMonitorResult',
'ConnectionStateSnapshot',
'ConnectionMonitorQueryResult',
'TrafficQuery',
'NetworkConfigurationDiagnosticParameters',
'MatchedRule',
'NetworkSecurityRulesEvaluationResult',
'EvaluatedNetworkSecurityGroup',
'NetworkSecurityGroupResult',
'NetworkConfigurationDiagnosticResult',
'NetworkConfigurationDiagnosticResponse',
'QueryConnectionMonitorsParameters',
'ConnectionMonitorsQueryResultItem',
'QueryConnectionMonitorsResponse',
'OperationDisplay',
'Availability',
'Dimension',
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]'},
}

Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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
Loading