|
18 | 18 | from azure.cli.command_modules.network._validators import ( |
19 | 19 | dns_zone_name_type, validate_inbound_nat_rule_id_list, |
20 | 20 | validate_address_pool_id_list, validate_inbound_nat_rule_name_or_id, |
21 | | - validate_address_pool_name_or_id, load_cert_file, validate_metadata, |
| 21 | + validate_address_pool_name_or_id, validate_metadata, |
22 | 22 | validate_dns_record_type, validate_private_ip_address, |
23 | 23 | get_servers_validator, get_public_ip_validator, get_nsg_validator, get_subnet_validator, |
24 | 24 | get_network_watcher_from_vm, get_network_watcher_for_pcap_creation, get_network_watcher_from_location, validate_capture_size_and_limit, |
|
31 | 31 | validate_waf_policy, |
32 | 32 | validate_user_assigned_identity, validate_virtul_network_gateway, |
33 | 33 | NWConnectionMonitorEndpointFilterItemAction, NWConnectionMonitorTestConfigurationHTTPRequestHeaderAction, |
34 | | - process_private_link_resource_id_argument, process_private_endpoint_connection_id_argument, |
35 | | - validate_vpn_connection_name_or_id) |
| 34 | + process_private_link_resource_id_argument, process_private_endpoint_connection_id_argument) |
36 | 35 | from azure.cli.command_modules.network._completers import ( |
37 | 36 | subnet_completion_list, get_lb_subresource_completion_list, get_ag_subresource_completion_list, |
38 | 37 | ag_url_map_rule_completion_list, tm_endpoint_completion_list) |
39 | 38 | from azure.cli.command_modules.network._actions import ( |
40 | 39 | TrustedClientCertificateCreate, |
41 | | - SslProfilesCreate, NatRuleCreate, AddMappingRequest, WAFRulesCreate) |
| 40 | + SslProfilesCreate, AddMappingRequest, WAFRulesCreate) |
42 | 41 | from azure.cli.core.util import get_json_object |
43 | 42 | from azure.cli.core.profiles import ResourceType |
44 | 43 |
|
|
47 | 46 | def load_arguments(self, _): |
48 | 47 |
|
49 | 48 | (ApplicationGatewayProtocol, |
50 | | - ApplicationGatewayRequestRoutingRuleType, ApplicationGatewaySkuName, ApplicationGatewaySslProtocol, AuthenticationMethod, |
51 | | - Direction, VpnAuthenticationType, |
| 49 | + ApplicationGatewayRequestRoutingRuleType, ApplicationGatewaySkuName, ApplicationGatewaySslProtocol, |
| 50 | + Direction, |
52 | 51 | FlowLogFormatType, HTTPMethod, IPAllocationMethod, |
53 | | - IPVersion, ProbeProtocol, ProcessorArchitecture, Protocol, PublicIPAddressSkuName, PublicIPAddressSkuTier, |
| 52 | + IPVersion, ProbeProtocol, Protocol, PublicIPAddressSkuName, PublicIPAddressSkuTier, |
54 | 53 | SecurityRuleAccess, SecurityRuleProtocol, SecurityRuleDirection, TransportProtocol, |
55 | | - VirtualNetworkGatewaySkuName, VirtualNetworkGatewayType, VpnClientProtocol, VpnType, |
56 | 54 | ConnectionMonitorEndpointFilterType, ConnectionMonitorTestConfigurationProtocol, |
57 | 55 | PreferredIPVersion, HTTPConfigurationMethod, OutputType, DestinationPortBehavior, CoverageLevel, EndpointType, |
58 | | - VpnNatRuleType, VpnNatRuleMode, PacketCaptureTargetType) = self.get_models( |
| 56 | + PacketCaptureTargetType) = self.get_models( |
59 | 57 | 'ApplicationGatewayProtocol', |
60 | | - 'ApplicationGatewayRequestRoutingRuleType', 'ApplicationGatewaySkuName', 'ApplicationGatewaySslProtocol', 'AuthenticationMethod', |
61 | | - 'Direction', 'VpnAuthenticationType', |
| 58 | + 'ApplicationGatewayRequestRoutingRuleType', 'ApplicationGatewaySkuName', 'ApplicationGatewaySslProtocol', |
| 59 | + 'Direction', |
62 | 60 | 'FlowLogFormatType', 'HTTPMethod', 'IPAllocationMethod', |
63 | | - 'IPVersion', 'ProbeProtocol', 'ProcessorArchitecture', 'Protocol', 'PublicIPAddressSkuName', 'PublicIPAddressSkuTier', |
| 61 | + 'IPVersion', 'ProbeProtocol', 'Protocol', 'PublicIPAddressSkuName', 'PublicIPAddressSkuTier', |
64 | 62 | 'SecurityRuleAccess', 'SecurityRuleProtocol', 'SecurityRuleDirection', 'TransportProtocol', |
65 | | - 'VirtualNetworkGatewaySkuName', 'VirtualNetworkGatewayType', 'VpnClientProtocol', 'VpnType', |
66 | 63 | 'ConnectionMonitorEndpointFilterType', 'ConnectionMonitorTestConfigurationProtocol', |
67 | 64 | 'PreferredIPVersion', 'HTTPConfigurationMethod', 'OutputType', 'DestinationPortBehavior', 'CoverageLevel', 'EndpointType', |
68 | | - 'VpnNatRuleType', 'VpnNatRuleMode', 'PacketCaptureTargetType') |
| 65 | + 'PacketCaptureTargetType') |
69 | 66 |
|
70 | 67 | ZoneType = self.get_models('ZoneType', resource_type=ResourceType.MGMT_NETWORK_DNS) |
71 | 68 |
|
@@ -675,13 +672,6 @@ def load_arguments(self, _): |
675 | 672 | c.argument('threshold', help='The number of consecutive probe failures before an instance is deemed unhealthy.') |
676 | 673 | # endregion |
677 | 674 |
|
678 | | - # region VnetGateway |
679 | | - for item in ['vnet-gateway']: |
680 | | - with self.argument_context('network {}'.format(item)) as c: |
681 | | - c.argument('asn', type=int, arg_group='BGP Peering', help='Autonomous System Number to use for the BGP settings.') |
682 | | - c.argument('peer_weight', arg_group='BGP Peering', help='Weight (0-100) added to routes learned through BGP peering.') |
683 | | - # endregion |
684 | | - |
685 | 675 | # region NetworkInterfaces (NIC) |
686 | 676 | with self.argument_context('network nic') as c: |
687 | 677 | c.argument('enable_accelerated_networking', min_api='2016-09-01', options_list=['--accelerated-networking'], help='Enable accelerated networking.', arg_type=get_three_state_flag()) |
@@ -1387,95 +1377,16 @@ def load_arguments(self, _): |
1387 | 1377 | # endregion |
1388 | 1378 |
|
1389 | 1379 | # region VirtualNetworkGateways |
1390 | | - vnet_gateway_type = CLIArgumentType(help='The gateway type.', arg_type=get_enum_type(VirtualNetworkGatewayType), default=VirtualNetworkGatewayType.vpn.value) |
1391 | | - vnet_gateway_sku_type = CLIArgumentType(help='VNet gateway SKU.', arg_type=get_enum_type(VirtualNetworkGatewaySkuName), default=VirtualNetworkGatewaySkuName.basic.value) |
1392 | | - vnet_gateway_routing_type = CLIArgumentType(help='VPN routing type.', arg_type=get_enum_type(VpnType), default=VpnType.route_based.value) |
1393 | | - edge_zone_vnet_id = CLIArgumentType(help='The Extended vnet resource id of the local gateway', min_api='2021-02-01') |
1394 | 1380 | with self.argument_context('network vnet-gateway') as c: |
1395 | 1381 | c.argument('virtual_network_gateway_name', options_list=['--name', '-n'], help='Name of the VNet gateway.', completer=get_resource_name_completion_list('Microsoft.Network/virtualNetworkGateways'), id_part='name') |
1396 | | - c.argument('cert_name', help='Root certificate name', options_list=['--name', '-n']) |
1397 | | - c.argument('gateway_name', help='Virtual network gateway name') |
1398 | | - c.argument('gateway_type', vnet_gateway_type) |
1399 | | - c.argument('gateway_default_site', help='Name or ID of a local network gateway representing a local network site with default routes.') |
1400 | | - c.argument('sku', vnet_gateway_sku_type) |
1401 | | - c.argument('vpn_type', vnet_gateway_routing_type) |
1402 | | - c.argument('bgp_peering_address', arg_group='BGP Peering', help='IP address to use for BGP peering.') |
1403 | | - c.argument('public_ip_address', options_list=['--public-ip-addresses'], nargs='+', help='Specify a single public IP (name or ID) for an active-standby gateway. Specify two space-separated public IPs for an active-active gateway.', completer=get_resource_name_completion_list('Microsoft.Network/publicIPAddresses')) |
1404 | | - c.argument('address_prefixes', help='Space-separated list of CIDR prefixes representing the address space for the P2S Vpnclient.', nargs='+', arg_group='VPN Client') |
1405 | | - c.argument('radius_server', min_api='2017-06-01', help='Radius server address to connect to.', arg_group='VPN Client') |
1406 | | - c.argument('radius_secret', min_api='2017-06-01', help='Radius secret to use for authentication.', arg_group='VPN Client') |
1407 | | - c.argument('client_protocol', min_api='2017-06-01', help='Protocols to use for connecting', nargs='+', arg_group='VPN Client', arg_type=get_enum_type(VpnClientProtocol)) |
1408 | | - c.argument('custom_routes', min_api='2019-02-01', help='Space-separated list of CIDR prefixes representing the custom routes address space specified by the customer for VpnClient.', nargs='+', arg_group='VPN Client') |
1409 | | - c.argument('vpn_auth_type', min_api='2020-11-01', nargs='+', help='VPN authentication types enabled for the virtual network gateway.', arg_type=get_enum_type(VpnAuthenticationType)) |
1410 | | - |
1411 | | - with self.argument_context('network vnet-gateway', arg_group='AAD Authentication', min_api='2020-11-01') as c: |
1412 | | - c.argument('aad_tenant', help='The AAD Tenant URI of the VirtualNetworkGateway.') |
1413 | | - c.argument('aad_audience', help='The AADAudience ID of the VirtualNetworkGateway.') |
1414 | | - c.argument('aad_issuer', help='The AAD Issuer URI of the VirtualNetworkGateway.') |
1415 | | - |
1416 | | - with self.argument_context('network vnet-gateway', arg_group='Root Cert Authentication', min_api='2020-11-01') as c: |
1417 | | - c.argument('root_cert_data', help='Base64 contents of the root certificate file or file path.', type=file_type, completer=FilesCompleter()) |
1418 | | - c.argument('root_cert_name', help='Root certificate name') |
1419 | | - |
1420 | | - with self.argument_context('network vnet-gateway', arg_group='Nat Rule', min_api='2021-02-01') as c: |
1421 | | - c.argument('nat_rule', nargs='+', action=NatRuleCreate) |
1422 | | - |
1423 | | - with self.argument_context('network vnet-gateway update') as c: |
1424 | | - c.argument('gateway_type', vnet_gateway_type, default=None) |
1425 | | - c.argument('sku', vnet_gateway_sku_type, default=None) |
1426 | | - c.argument('vpn_type', vnet_gateway_routing_type, default=None) |
1427 | | - |
1428 | | - with self.argument_context('network vnet-gateway create') as c: |
1429 | | - vnet_help = "Name or ID of an existing virtual network which has a subnet named 'GatewaySubnet'." |
1430 | | - c.argument('virtual_network', options_list='--vnet', help=vnet_help) |
1431 | | - c.argument('vpn_gateway_generation', arg_type=get_enum_type(['Generation1', 'Generation2']), min_api='2019-07-01', help='The generation for the virtual network gateway. vpn_gateway_generation should not be provided if gateway_type is not Vpn.') |
1432 | | - c.argument('edge_zone', edge_zone, min_api='2021-02-01') |
1433 | | - c.argument('edge_zone_vnet_id', edge_zone_vnet_id) |
1434 | | - |
1435 | | - with self.argument_context('network vnet-gateway update') as c: |
1436 | | - c.argument('enable_bgp', help='Enable BGP (Border Gateway Protocol)', arg_group='BGP Peering', arg_type=get_enum_type(['true', 'false'])) |
1437 | | - c.argument('virtual_network', virtual_network_name_type, options_list='--vnet', help="Name or ID of a virtual network that contains a subnet named 'GatewaySubnet'.") |
1438 | | - c.extra('address_prefixes', options_list='--address-prefixes', help='List of address prefixes for the VPN gateway. Prerequisite for uploading certificates.', nargs='+') |
1439 | | - |
1440 | | - with self.argument_context('network vnet-gateway aad assign', min_api='2019-04-01') as c: |
1441 | | - c.argument('aad_tenant', options_list='--tenant', help='The AADTenant URI of the VirtualNetworkGateway.') |
1442 | | - c.argument('aad_audience', options_list='--audience', help='The AADAudience ID of the VirtualNetworkGateway.') |
1443 | | - c.argument('aad_issuer', options_list='--issuer', help='The AADIssuer URI of the VirtualNetworkGateway.') |
1444 | | - |
1445 | | - with self.argument_context('network vnet-gateway root-cert create') as c: |
1446 | | - c.argument('public_cert_data', help='Base64 contents of the root certificate file or file path.', type=file_type, completer=FilesCompleter(), validator=load_cert_file('public_cert_data')) |
1447 | | - c.argument('cert_name', help='Root certificate name', options_list=['--name', '-n']) |
1448 | 1382 | c.argument('gateway_name', help='Virtual network gateway name') |
1449 | 1383 |
|
1450 | | - with self.argument_context('network vnet-gateway revoked-cert create') as c: |
1451 | | - c.argument('thumbprint', help='Certificate thumbprint.') |
1452 | | - |
1453 | | - with self.argument_context('network vnet-gateway packet-capture start') as c: |
1454 | | - c.argument('filter_data', options_list=['--filter'], help='Data filter.') |
1455 | | - |
1456 | | - with self.argument_context('network vnet-gateway packet-capture stop') as c: |
1457 | | - c.argument('sas_url', options_list=['--sas-url'], |
1458 | | - help='The SAS url to be used for packet capture.') |
1459 | | - |
1460 | 1384 | with self.argument_context('network vnet-gateway vpn-client') as c: |
1461 | | - c.argument('processor_architecture', help='Processor architecture of the target system.', arg_type=get_enum_type(ProcessorArchitecture)) |
1462 | | - c.argument('authentication_method', help='Method used to authenticate with the generated client.', arg_type=get_enum_type(AuthenticationMethod)) |
| 1385 | + c.argument('processor_architecture', help='Processor architecture of the target system.', arg_type=get_enum_type(['Amd64', 'X86'])) |
| 1386 | + c.argument('authentication_method', help='Method used to authenticate with the generated client.', arg_type=get_enum_type(['EAPMSCHAPv2', 'EAPTLS'])) |
1463 | 1387 | c.argument('radius_server_auth_certificate', help='Public certificate data for the Radius server auth certificate in Base-64 format. Required only if external Radius auth has been configured with EAPTLS auth.') |
1464 | 1388 | c.argument('client_root_certificates', nargs='+', help='Space-separated list of client root certificate public certificate data in Base-64 format. Optional for external Radius-based auth with EAPTLS') |
1465 | 1389 | c.argument('use_legacy', min_api='2017-06-01', help='Generate VPN client package using legacy implementation.', arg_type=get_three_state_flag()) |
1466 | | - |
1467 | | - with self.argument_context('network vnet-gateway disconnect-vpn-connections') as c: |
1468 | | - c.argument('vpn_connection_ids', options_list=['--vpn-connections'], nargs='+', |
1469 | | - help='List of Name or ID of VPN connections.', |
1470 | | - validator=validate_vpn_connection_name_or_id) |
1471 | | - |
1472 | | - with self.argument_context('network vnet-gateway nat-rule', min_api='2021-02-01') as c: |
1473 | | - c.argument('name', help='The name of the resource that is unique within a resource group. This name can be used to access the resource.') |
1474 | | - c.argument('rule_type', options_list='--type', help='The type of NAT rule for VPN NAT.', arg_type=get_enum_type(VpnNatRuleType)) |
1475 | | - c.argument('mode', help='The Source NAT direction of a VPN NAT.', arg_type=get_enum_type(VpnNatRuleMode)) |
1476 | | - c.argument('internal_mappings', nargs='+', help='The private IP address internal mapping for NAT.') |
1477 | | - c.argument('external_mappings', nargs='+', help='The private IP address external mapping for NAT.') |
1478 | | - c.argument('ip_config_id', help='The IP Configuration ID this NAT rule applies to.') |
1479 | 1390 | # endregion |
1480 | 1391 |
|
1481 | 1392 | # region VirtualNetworkGatewayConnections |
@@ -1547,7 +1458,7 @@ def load_arguments(self, _): |
1547 | 1458 | with self.argument_context('network routeserver create') as c: |
1548 | 1459 | c.argument('virtual_hub_name', id_part=None) |
1549 | 1460 |
|
1550 | | - for scope in ['vpn-connection', 'vnet-gateway', 'vnet-gateway vpn-client']: |
| 1461 | + for scope in ['vpn-connection']: |
1551 | 1462 | with self.argument_context('network {} ipsec-policy'.format(scope), arg_group='Security Association') as c: |
1552 | 1463 | c.argument('sa_data_size_kilobytes', options_list=['--sa-max-size'], type=int, help='The payload size in KB for P2S client.') |
1553 | 1464 | c.argument('sa_life_time_seconds', options_list=['--sa-lifetime'], type=int, help='The lifetime in seconds for P2S client.') |
|
0 commit comments