From 574bc83df84e5cff982fedc06138f49dc6688e48 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 13 Sep 2018 21:10:36 +0000 Subject: [PATCH] Generated from ea178ff68090a4517f4ebaa73fae2fee7962c504 Updated NetworkConfigurationDiagnostic API + example --- .../network/v2018_08_01/models/__init__.py | 8 +++++--- .../evaluated_network_security_group.py | 5 +++++ .../evaluated_network_security_group_py3.py | 7 ++++++- ...ork_configuration_diagnostic_parameters.py | 18 ++++++++++++----- ...configuration_diagnostic_parameters_py3.py | 20 +++++++++++++------ ...twork_configuration_diagnostic_profile.py} | 4 ++-- ...k_configuration_diagnostic_profile_py3.py} | 4 ++-- ...network_configuration_diagnostic_result.py | 9 +++++---- ...ork_configuration_diagnostic_result_py3.py | 11 +++++----- .../models/network_management_client_enums.py | 7 +++++++ .../operations/network_watchers_operations.py | 19 ++++++------------ 11 files changed, 71 insertions(+), 41 deletions(-) rename azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/{traffic_query.py => network_configuration_diagnostic_profile.py} (94%) rename azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/{traffic_query_py3.py => network_configuration_diagnostic_profile_py3.py} (94%) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/__init__.py index 4c5a7e5cb869..286e7e196028 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/__init__.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/__init__.py @@ -201,7 +201,7 @@ 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_profile_py3 import NetworkConfigurationDiagnosticProfile from .network_configuration_diagnostic_parameters_py3 import NetworkConfigurationDiagnosticParameters from .matched_rule_py3 import MatchedRule from .network_security_rules_evaluation_result_py3 import NetworkSecurityRulesEvaluationResult @@ -468,7 +468,7 @@ 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_profile import NetworkConfigurationDiagnosticProfile from .network_configuration_diagnostic_parameters import NetworkConfigurationDiagnosticParameters from .matched_rule import MatchedRule from .network_security_rules_evaluation_result import NetworkSecurityRulesEvaluationResult @@ -661,6 +661,7 @@ ConnectionMonitorSourceStatus, ConnectionState, EvaluationState, + VerbosityLevel, PublicIPPrefixSkuName, VirtualNetworkPeeringState, VirtualNetworkGatewayType, @@ -880,7 +881,7 @@ 'ConnectionMonitorResult', 'ConnectionStateSnapshot', 'ConnectionMonitorQueryResult', - 'TrafficQuery', + 'NetworkConfigurationDiagnosticProfile', 'NetworkConfigurationDiagnosticParameters', 'MatchedRule', 'NetworkSecurityRulesEvaluationResult', @@ -1072,6 +1073,7 @@ 'ConnectionMonitorSourceStatus', 'ConnectionState', 'EvaluationState', + 'VerbosityLevel', 'PublicIPPrefixSkuName', 'VirtualNetworkPeeringState', 'VirtualNetworkGatewayType', diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/evaluated_network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/evaluated_network_security_group.py index 22d13bc85570..2cd91bf6a876 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/evaluated_network_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/evaluated_network_security_group.py @@ -20,6 +20,9 @@ class EvaluatedNetworkSecurityGroup(Model): :param network_security_group_id: Network security group ID. :type network_security_group_id: str + :param applied_to: Resource ID of nic or subnet to which network security + group is applied. + :type applied_to: str :param matched_rule: :type matched_rule: ~azure.mgmt.network.v2018_08_01.models.MatchedRule :ivar rules_evaluation_result: List of network security rules evaluation @@ -34,6 +37,7 @@ class EvaluatedNetworkSecurityGroup(Model): _attribute_map = { 'network_security_group_id': {'key': 'networkSecurityGroupId', 'type': 'str'}, + 'applied_to': {'key': 'appliedTo', 'type': 'str'}, 'matched_rule': {'key': 'matchedRule', 'type': 'MatchedRule'}, 'rules_evaluation_result': {'key': 'rulesEvaluationResult', 'type': '[NetworkSecurityRulesEvaluationResult]'}, } @@ -41,5 +45,6 @@ class EvaluatedNetworkSecurityGroup(Model): def __init__(self, **kwargs): super(EvaluatedNetworkSecurityGroup, self).__init__(**kwargs) self.network_security_group_id = kwargs.get('network_security_group_id', None) + self.applied_to = kwargs.get('applied_to', None) self.matched_rule = kwargs.get('matched_rule', None) self.rules_evaluation_result = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/evaluated_network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/evaluated_network_security_group_py3.py index b29d2c935adb..d2cdb31df3b6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/evaluated_network_security_group_py3.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/evaluated_network_security_group_py3.py @@ -20,6 +20,9 @@ class EvaluatedNetworkSecurityGroup(Model): :param network_security_group_id: Network security group ID. :type network_security_group_id: str + :param applied_to: Resource ID of nic or subnet to which network security + group is applied. + :type applied_to: str :param matched_rule: :type matched_rule: ~azure.mgmt.network.v2018_08_01.models.MatchedRule :ivar rules_evaluation_result: List of network security rules evaluation @@ -34,12 +37,14 @@ class EvaluatedNetworkSecurityGroup(Model): _attribute_map = { 'network_security_group_id': {'key': 'networkSecurityGroupId', 'type': 'str'}, + 'applied_to': {'key': 'appliedTo', '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: + def __init__(self, *, network_security_group_id: str=None, applied_to: str=None, matched_rule=None, **kwargs) -> None: super(EvaluatedNetworkSecurityGroup, self).__init__(**kwargs) self.network_security_group_id = network_security_group_id + self.applied_to = applied_to self.matched_rule = matched_rule self.rules_evaluation_result = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_parameters.py index 6e10c5624a31..6412f93cc83f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_parameters.py @@ -21,21 +21,29 @@ class NetworkConfigurationDiagnosticParameters(Model): 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_08_01.models.TrafficQuery] + :param verbosity_level: Verbosity level. Accepted values are 'Normal', + 'Minimum', 'Full'. Possible values include: 'Normal', 'Minimum', 'Full' + :type verbosity_level: str or + ~azure.mgmt.network.v2018_08_01.models.VerbosityLevel + :param profiles: Required. List of network configuration diagnostic + profiles. + :type profiles: + list[~azure.mgmt.network.v2018_08_01.models.NetworkConfigurationDiagnosticProfile] """ _validation = { 'target_resource_id': {'required': True}, - 'queries': {'required': True}, + 'profiles': {'required': True}, } _attribute_map = { 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, - 'queries': {'key': 'queries', 'type': '[TrafficQuery]'}, + 'verbosity_level': {'key': 'verbosityLevel', 'type': 'str'}, + 'profiles': {'key': 'profiles', 'type': '[NetworkConfigurationDiagnosticProfile]'}, } 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) + self.verbosity_level = kwargs.get('verbosity_level', None) + self.profiles = kwargs.get('profiles', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_parameters_py3.py index 222296e26b94..cbaeb2f460ed 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_parameters_py3.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_parameters_py3.py @@ -21,21 +21,29 @@ class NetworkConfigurationDiagnosticParameters(Model): 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_08_01.models.TrafficQuery] + :param verbosity_level: Verbosity level. Accepted values are 'Normal', + 'Minimum', 'Full'. Possible values include: 'Normal', 'Minimum', 'Full' + :type verbosity_level: str or + ~azure.mgmt.network.v2018_08_01.models.VerbosityLevel + :param profiles: Required. List of network configuration diagnostic + profiles. + :type profiles: + list[~azure.mgmt.network.v2018_08_01.models.NetworkConfigurationDiagnosticProfile] """ _validation = { 'target_resource_id': {'required': True}, - 'queries': {'required': True}, + 'profiles': {'required': True}, } _attribute_map = { 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, - 'queries': {'key': 'queries', 'type': '[TrafficQuery]'}, + 'verbosity_level': {'key': 'verbosityLevel', 'type': 'str'}, + 'profiles': {'key': 'profiles', 'type': '[NetworkConfigurationDiagnosticProfile]'}, } - def __init__(self, *, target_resource_id: str, queries, **kwargs) -> None: + def __init__(self, *, target_resource_id: str, profiles, verbosity_level=None, **kwargs) -> None: super(NetworkConfigurationDiagnosticParameters, self).__init__(**kwargs) self.target_resource_id = target_resource_id - self.queries = queries + self.verbosity_level = verbosity_level + self.profiles = profiles diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/traffic_query.py b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_profile.py similarity index 94% rename from azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/traffic_query.py rename to azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_profile.py index 1ba916ade144..55497a3781ab 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/traffic_query.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_profile.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class TrafficQuery(Model): +class NetworkConfigurationDiagnosticProfile(Model): """Parameters to compare with network configuration. All required parameters must be populated in order to send to Azure. @@ -53,7 +53,7 @@ class TrafficQuery(Model): } def __init__(self, **kwargs): - super(TrafficQuery, self).__init__(**kwargs) + super(NetworkConfigurationDiagnosticProfile, self).__init__(**kwargs) self.direction = kwargs.get('direction', None) self.protocol = kwargs.get('protocol', None) self.source = kwargs.get('source', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/traffic_query_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_profile_py3.py similarity index 94% rename from azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/traffic_query_py3.py rename to azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_profile_py3.py index 1251b1d00794..9e208e0f73d1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/traffic_query_py3.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_profile_py3.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class TrafficQuery(Model): +class NetworkConfigurationDiagnosticProfile(Model): """Parameters to compare with network configuration. All required parameters must be populated in order to send to Azure. @@ -53,7 +53,7 @@ class TrafficQuery(Model): } def __init__(self, *, direction, protocol: str, source: str, destination: str, destination_port: str, **kwargs) -> None: - super(TrafficQuery, self).__init__(**kwargs) + super(NetworkConfigurationDiagnosticProfile, self).__init__(**kwargs) self.direction = direction self.protocol = protocol self.source = source diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_result.py index 7b8bc0ac12db..e606c618a08e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_result.py @@ -16,19 +16,20 @@ class NetworkConfigurationDiagnosticResult(Model): """Network configuration diagnostic result corresponded to provided traffic query. - :param traffic_query: - :type traffic_query: ~azure.mgmt.network.v2018_08_01.models.TrafficQuery + :param profile: + :type profile: + ~azure.mgmt.network.v2018_08_01.models.NetworkConfigurationDiagnosticProfile :param network_security_group_result: :type network_security_group_result: ~azure.mgmt.network.v2018_08_01.models.NetworkSecurityGroupResult """ _attribute_map = { - 'traffic_query': {'key': 'trafficQuery', 'type': 'TrafficQuery'}, + 'profile': {'key': 'profile', 'type': 'NetworkConfigurationDiagnosticProfile'}, '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.profile = kwargs.get('profile', None) self.network_security_group_result = kwargs.get('network_security_group_result', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_result_py3.py index e88307a490e3..1b3365d9067e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_result_py3.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_configuration_diagnostic_result_py3.py @@ -16,19 +16,20 @@ class NetworkConfigurationDiagnosticResult(Model): """Network configuration diagnostic result corresponded to provided traffic query. - :param traffic_query: - :type traffic_query: ~azure.mgmt.network.v2018_08_01.models.TrafficQuery + :param profile: + :type profile: + ~azure.mgmt.network.v2018_08_01.models.NetworkConfigurationDiagnosticProfile :param network_security_group_result: :type network_security_group_result: ~azure.mgmt.network.v2018_08_01.models.NetworkSecurityGroupResult """ _attribute_map = { - 'traffic_query': {'key': 'trafficQuery', 'type': 'TrafficQuery'}, + 'profile': {'key': 'profile', 'type': 'NetworkConfigurationDiagnosticProfile'}, 'network_security_group_result': {'key': 'networkSecurityGroupResult', 'type': 'NetworkSecurityGroupResult'}, } - def __init__(self, *, traffic_query=None, network_security_group_result=None, **kwargs) -> None: + def __init__(self, *, profile=None, network_security_group_result=None, **kwargs) -> None: super(NetworkConfigurationDiagnosticResult, self).__init__(**kwargs) - self.traffic_query = traffic_query + self.profile = profile self.network_security_group_result = network_security_group_result diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_management_client_enums.py b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_management_client_enums.py index e443490e1126..8bc0b8aaec16 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_management_client_enums.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/models/network_management_client_enums.py @@ -450,6 +450,13 @@ class EvaluationState(str, Enum): completed = "Completed" +class VerbosityLevel(str, Enum): + + normal = "Normal" + minimum = "Minimum" + full = "Full" + + class PublicIPPrefixSkuName(str, Enum): standard = "Standard" diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/network_watchers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/network_watchers_operations.py index 8e36dcf8d031..6443e4c1412f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/network_watchers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_08_01/operations/network_watchers_operations.py @@ -1562,9 +1562,7 @@ def get_long_running_output(response): 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) - + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.get_network_configuration_diagnostic.metadata['url'] path_format_arguments = { @@ -1613,20 +1611,16 @@ def _get_network_configuration_diagnostic_initial( 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): + self, resource_group_name, network_watcher_name, parameters, 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_08_01.models.TrafficQuery] + :param parameters: Parameters to get network configuration diagnostic. + :type parameters: + ~azure.mgmt.network.v2018_08_01.models.NetworkConfigurationDiagnosticParameters :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 @@ -1645,8 +1639,7 @@ def get_network_configuration_diagnostic( 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, + parameters=parameters, custom_headers=custom_headers, raw=True, **operation_config