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 #3092

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@
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 .operation_display_py3 import OperationDisplay
from .availability_py3 import Availability
from .dimension_py3 import Dimension
Expand Down Expand Up @@ -387,6 +395,14 @@
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 .operation_display import OperationDisplay
from .availability import Availability
from .dimension import Dimension
Expand Down Expand Up @@ -730,6 +746,14 @@
'ConnectionMonitorResult',
'ConnectionStateSnapshot',
'ConnectionMonitorQueryResult',
'TrafficQuery',
'NetworkConfigurationDiagnosticParameters',
'MatchedRule',
'NetworkSecurityRulesEvaluationResult',
'EvaluatedNetworkSecurityGroup',
'NetworkSecurityGroupResult',
'NetworkConfigurationDiagnosticResult',
'NetworkConfigurationDiagnosticResponse',
'OperationDisplay',
'Availability',
'Dimension',
Expand Down
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
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, *, 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
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 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)
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 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
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 NetworkConfigurationDiagnosticParameters(Model):
"""Parameters to get network configuration diagnostic.

Variables are only populated by the server, and will be ignored when
sending a request.

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
:ivar queries: Required. List of traffic queries.
:vartype queries:
list[~azure.mgmt.network.v2018_06_01.models.TrafficQuery]
"""

_validation = {
'target_resource_id': {'required': True},
'queries': {'required': True, 'readonly': 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 = None
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 NetworkConfigurationDiagnosticParameters(Model):
"""Parameters to get network configuration diagnostic.

Variables are only populated by the server, and will be ignored when
sending a request.

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
:ivar queries: Required. List of traffic queries.
:vartype queries:
list[~azure.mgmt.network.v2018_06_01.models.TrafficQuery]
"""

_validation = {
'target_resource_id': {'required': True},
'queries': {'required': True, 'readonly': True},
}

_attribute_map = {
'target_resource_id': {'key': 'targetResourceId', 'type': 'str'},
'queries': {'key': 'queries', 'type': '[TrafficQuery]'},
}

def __init__(self, *, target_resource_id: str, **kwargs) -> None:
super(NetworkConfigurationDiagnosticParameters, self).__init__(**kwargs)
self.target_resource_id = target_resource_id
self.queries = None
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Loading