Skip to content

Commit cde74c5

Browse files
author
Jianhui Harold
authored
[Network] Support --tcp-port-behavior while configuring a TCP configuration of a Connection Monitor V2 (Azure#14937)
1 parent fb4635d commit cde74c5

File tree

4 files changed

+1208
-654
lines changed

4 files changed

+1208
-654
lines changed

src/azure-cli/azure/cli/command_modules/network/_params.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def load_arguments(self, _):
6161
VirtualNetworkGatewaySkuName, VirtualNetworkGatewayType, VpnClientProtocol, VpnType,
6262
ExpressRouteLinkMacSecCipher, ExpressRouteLinkAdminState,
6363
ConnectionMonitorEndpointFilterType, ConnectionMonitorTestConfigurationProtocol,
64-
PreferredIPVersion, HTTPConfigurationMethod, OutputType) = self.get_models(
64+
PreferredIPVersion, HTTPConfigurationMethod, OutputType, DestinationPortBehavior) = self.get_models(
6565
'Access', 'ApplicationGatewayFirewallMode', 'ApplicationGatewayProtocol', 'ApplicationGatewayRedirectType',
6666
'ApplicationGatewayRequestRoutingRuleType', 'ApplicationGatewaySkuName', 'ApplicationGatewaySslProtocol', 'AuthenticationMethod',
6767
'Direction',
@@ -72,7 +72,7 @@ def load_arguments(self, _):
7272
'VirtualNetworkGatewaySkuName', 'VirtualNetworkGatewayType', 'VpnClientProtocol', 'VpnType',
7373
'ExpressRouteLinkMacSecCipher', 'ExpressRouteLinkAdminState',
7474
'ConnectionMonitorEndpointFilterType', 'ConnectionMonitorTestConfigurationProtocol',
75-
'PreferredIPVersion', 'HTTPConfigurationMethod', 'OutputType')
75+
'PreferredIPVersion', 'HTTPConfigurationMethod', 'OutputType', 'DestinationPortBehavior')
7676

7777
ZoneType = self.get_models('ZoneType', resource_type=ResourceType.MGMT_NETWORK_DNS)
7878

@@ -1198,6 +1198,10 @@ def load_arguments(self, _):
11981198
options_list='--tcp-port',
11991199
help='The port to connect to',
12001200
type=int)
1201+
c.argument('test_config_tcp_port_behavior',
1202+
options_list='--tcp-port-behavior',
1203+
help='Destination port behavior',
1204+
arg_type=get_enum_type(DestinationPortBehavior))
12011205
c.argument('test_config_tcp_disable_trace_route',
12021206
options_list='--tcp-disable-trace-route',
12031207
help='Value indicating whether path evaluation with trace route should be disabled. '
@@ -1331,6 +1335,9 @@ def load_arguments(self, _):
13311335
help='Value indicating whether path evaluation with trace route should be disabled. '
13321336
'false is default.',
13331337
arg_type=get_three_state_flag())
1338+
c.argument('tcp_port_behavior',
1339+
help='Destination port behavior',
1340+
arg_type=get_enum_type(DestinationPortBehavior))
13341341
# ICMP protocol configuration
13351342
with self.argument_context('network watcher connection-monitor test-configuration',
13361343
min_api='2019-11-01',

src/azure-cli/azure/cli/command_modules/network/custom.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -4066,6 +4066,7 @@ def create_nw_connection_monitor(cmd,
40664066
test_config_threshold_round_trip_time=None,
40674067
test_config_tcp_disable_trace_route=None,
40684068
test_config_tcp_port=None,
4069+
test_config_tcp_port_behavior=None,
40694070
test_config_icmp_disable_trace_route=None,
40704071
test_config_http_port=None,
40714072
test_config_http_method=None,
@@ -4124,6 +4125,7 @@ def create_nw_connection_monitor(cmd,
41244125
test_config_threshold_failed_percent,
41254126
test_config_threshold_round_trip_time,
41264127
test_config_tcp_port,
4128+
test_config_tcp_port_behavior,
41274129
test_config_tcp_disable_trace_route,
41284130
test_config_icmp_disable_trace_route,
41294131
test_config_http_port,
@@ -4199,6 +4201,7 @@ def _create_nw_connection_monitor_v2(cmd,
41994201
test_config_threshold_failed_percent=None,
42004202
test_config_threshold_round_trip_time=None,
42014203
test_config_tcp_port=None,
4204+
test_config_tcp_port_behavior=None,
42024205
test_config_tcp_disable_trace_route=False,
42034206
test_config_icmp_disable_trace_route=False,
42044207
test_config_http_port=None,
@@ -4227,6 +4230,7 @@ def _create_nw_connection_monitor_v2(cmd,
42274230
test_config_threshold_round_trip_time,
42284231
test_config_preferred_ip_version,
42294232
test_config_tcp_port,
4233+
test_config_tcp_port_behavior,
42304234
test_config_tcp_disable_trace_route,
42314235
test_config_icmp_disable_trace_route,
42324236
test_config_http_port,
@@ -4292,6 +4296,7 @@ def _create_nw_connection_monitor_v2_test_configuration(cmd,
42924296
threshold_round_trip_time,
42934297
preferred_ip_version,
42944298
tcp_port=None,
4299+
tcp_port_behavior=None,
42954300
tcp_disable_trace_route=None,
42964301
icmp_disable_trace_route=None,
42974302
http_port=None,
@@ -4319,7 +4324,8 @@ def _create_nw_connection_monitor_v2_test_configuration(cmd,
43194324
ConnectionMonitorTcpConfiguration = cmd.get_models('ConnectionMonitorTcpConfiguration')
43204325
tcp_config = ConnectionMonitorTcpConfiguration(
43214326
port=tcp_port,
4322-
tcp_disable_trace_route=tcp_disable_trace_route
4327+
destination_port_behavior=tcp_port_behavior,
4328+
disable_trace_route=tcp_disable_trace_route
43234329
)
43244330
test_config.tcp_configuration = tcp_config
43254331
elif protocol == ConnectionMonitorTestConfigurationProtocol.icmp:
@@ -4475,6 +4481,7 @@ def add_nw_connection_monitor_v2_test_configuration(cmd,
44754481
threshold_round_trip_time=None,
44764482
preferred_ip_version=None,
44774483
tcp_port=None,
4484+
tcp_port_behavior=None,
44784485
tcp_disable_trace_route=None,
44794486
icmp_disable_trace_route=None,
44804487
http_port=None,
@@ -4491,6 +4498,7 @@ def add_nw_connection_monitor_v2_test_configuration(cmd,
44914498
threshold_round_trip_time,
44924499
preferred_ip_version,
44934500
tcp_port,
4501+
tcp_port_behavior,
44944502
tcp_disable_trace_route,
44954503
icmp_disable_trace_route,
44964504
http_port,

0 commit comments

Comments
 (0)