diff --git a/src/azure-cli/azure/cli/command_modules/network/_client_factory.py b/src/azure-cli/azure/cli/command_modules/network/_client_factory.py index ab2815183b3..ae1a077960c 100644 --- a/src/azure-cli/azure/cli/command_modules/network/_client_factory.py +++ b/src/azure-cli/azure/cli/command_modules/network/_client_factory.py @@ -290,3 +290,7 @@ def cf_virtual_appliance_sites(cli_ctx, _): def cf_custom_ip_prefixes(cli_ctx, _): return network_client_factory(cli_ctx).custom_ip_prefixes + + +def cf_inbound_nat_rules(cli_ctx, _): + return network_client_factory(cli_ctx).inbound_nat_rules diff --git a/src/azure-cli/azure/cli/command_modules/network/commands.py b/src/azure-cli/azure/cli/command_modules/network/commands.py index df13e8008f6..3457a4214ce 100644 --- a/src/azure-cli/azure/cli/command_modules/network/commands.py +++ b/src/azure-cli/azure/cli/command_modules/network/commands.py @@ -30,7 +30,7 @@ cf_virtual_router, cf_virtual_router_peering, cf_service_aliases, cf_bastion_hosts, cf_flow_logs, cf_private_dns_zone_groups, cf_security_partner_providers, cf_load_balancer_backend_pools, cf_network_virtual_appliances, cf_virtual_appliance_skus, cf_virtual_appliance_sites, cf_virtual_hub, - cf_virtual_hub_bgp_connection, cf_virtual_hub_bgp_connections, cf_custom_ip_prefixes) + cf_virtual_hub_bgp_connection, cf_virtual_hub_bgp_connections, cf_custom_ip_prefixes, cf_inbound_nat_rules) from azure.cli.command_modules.network._util import ( list_network_resource_property, get_network_resource_property_entry, delete_network_resource_property_entry, delete_lb_resource_property_entry) @@ -450,6 +450,11 @@ def load_command_table(self, _): min_api='2020-06-01' ) + network_inbound_nat_rule = CliCommandType( + operations_tmpl='azure.mgmt.network.operations#.InboundNatRulesOperations.{}', + client_factory=cf_inbound_nat_rules + ) + network_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.network.custom#{}') network_load_balancers_custom = CliCommandType( @@ -931,7 +936,7 @@ def _make_singular(value): custom_func_name='set_lb_frontend_ip_configuration', validator=process_lb_frontend_ip_namespace) - with self.command_group('network lb inbound-nat-rule', network_lb_sdk) as g: + with self.command_group('network lb inbound-nat-rule', network_lb_sdk, max_api='2021-02-01') as g: g.custom_command('create', 'create_lb_inbound_nat_rule') g.generic_update_command('update', child_collection_prop_name='inbound_nat_rules', getter_name='lb_get', @@ -939,6 +944,14 @@ def _make_singular(value): setter_name='begin_create_or_update', custom_func_name='set_lb_inbound_nat_rule') + with self.command_group('network lb inbound-nat-rule', network_inbound_nat_rule, min_api='2021-05-01') as g: + g.custom_command('create', 'create_lb_inbound_nat_rule_v2') + g.generic_update_command('update', child_collection_prop_name='inbound_nat_rules', + getter_name='lb_get', + getter_type=network_load_balancers_custom, + setter_name='begin_create_or_update', + custom_func_name='set_lb_inbound_nat_rule') + with self.command_group('network lb inbound-nat-pool', network_lb_sdk) as g: g.custom_command('create', 'create_lb_inbound_nat_pool') g.generic_update_command('update', child_collection_prop_name='inbound_nat_pools', diff --git a/src/azure-cli/azure/cli/command_modules/network/custom.py b/src/azure-cli/azure/cli/command_modules/network/custom.py index e80315ad564..3856b0912ee 100644 --- a/src/azure-cli/azure/cli/command_modules/network/custom.py +++ b/src/azure-cli/azure/cli/command_modules/network/custom.py @@ -3649,6 +3649,31 @@ def create_lb_inbound_nat_rule( return get_property(poller.result().inbound_nat_rules, item_name) +def create_lb_inbound_nat_rule_v2( + cmd, resource_group_name, load_balancer_name, item_name, protocol, backend_port, frontend_port=None, + frontend_ip_name=None, floating_ip=None, idle_timeout=None, enable_tcp_reset=None, + frontend_port_range_start=None, frontend_port_range_end=None, backend_address_pool_name=None): + InboundNatRule = cmd.get_models('InboundNatRule') + ncf = network_client_factory(cmd.cli_ctx) + lb = lb_get(ncf.load_balancers, resource_group_name, load_balancer_name) + if not frontend_ip_name: + frontend_ip_name = _get_default_name(lb, 'frontend_ip_configurations', '--frontend-ip-name') + frontend_ip = get_property(lb.frontend_ip_configurations, frontend_ip_name) # pylint: disable=no-member + new_rule = InboundNatRule( + name=item_name, protocol=protocol, + frontend_port=frontend_port, backend_port=backend_port, + frontend_ip_configuration=frontend_ip, + enable_floating_ip=floating_ip, + idle_timeout_in_minutes=idle_timeout, + enable_tcp_reset=enable_tcp_reset, + frontend_port_range_start=frontend_port_range_start, + frontend_port_range_end=frontend_port_range_end, + ) + if backend_address_pool_name: + new_rule.backend_address_pool = get_property(lb.backend_address_pools, backend_address_pool_name) # pylint: disable=no-member + return ncf.inbound_nat_rules.begin_create_or_update(resource_group_name, load_balancer_name, item_name, new_rule) + + # workaround for : https://github.com/Azure/azure-cli/issues/17071 def lb_get(client, resource_group_name, load_balancer_name): lb = client.get(resource_group_name, load_balancer_name) diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_lb_nat_rules_v2.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_lb_nat_rules_v2.yaml index 8e2bbe37838..cf467c8cde3 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_lb_nat_rules_v2.yaml +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_lb_nat_rules_v2.yaml @@ -13,12 +13,12 @@ interactions: ParameterSetName: - -g -n --sku User-Agent: - - AZURECLI/2.30.0 azsdk-python-azure-mgmt-resource/19.0.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_lb_nat_rules_v2000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001","name":"cli_test_lb_nat_rules_v2000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2","tags":{"product":"azurecli","cause":"automation","date":"2021-11-15T09:50:33Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001","name":"cli_test_lb_nat_rules_v2000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2","tags":{"product":"azurecli","cause":"automation","date":"2021-12-03T07:15:37Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -27,7 +27,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 15 Nov 2021 09:50:39 GMT + - Fri, 03 Dec 2021 07:15:41 GMT expires: - '-1' pragma: @@ -55,7 +55,7 @@ interactions: ParameterSetName: - -g -n --sku User-Agent: - - AZURECLI/2.30.0 azsdk-python-azure-mgmt-resource/19.0.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resources?$filter=resourceGroup%20eq%20%27cli_test_lb_nat_rules_v2000001%27%20and%20name%20eq%20%27None%27%20and%20resourceType%20eq%20%27Microsoft.Network%2FpublicIPAddresses%27&api-version=2021-04-01 response: @@ -69,7 +69,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 15 Nov 2021 09:50:40 GMT + - Fri, 03 Dec 2021 07:15:42 GMT expires: - '-1' pragma: @@ -112,23 +112,23 @@ interactions: ParameterSetName: - -g -n --sku User-Agent: - - AZURECLI/2.30.0 azsdk-python-azure-mgmt-resource/19.0.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Resources/deployments/lb_deploy_MTDnqiLl0XVDpqlkavAnG9TccHdqqBLm","name":"lb_deploy_MTDnqiLl0XVDpqlkavAnG9TccHdqqBLm","type":"Microsoft.Resources/deployments","properties":{"templateHash":"7254541956555978750","parameters":{},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2021-11-15T09:50:49.013068Z","duration":"PT3.5959704S","correlationId":"e0e291d3-867f-407e-b870-f6f263074432","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"publicIPAddresses","locations":["eastus2"]},{"resourceType":"loadBalancers","locations":["eastus2"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"PublicIPlb1"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1","resourceType":"Microsoft.Network/loadBalancers","resourceName":"lb1"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Resources/deployments/lb_deploy_ZOG5hgQgE2cQBJaSlOtRjH2qZiBtJUcQ","name":"lb_deploy_ZOG5hgQgE2cQBJaSlOtRjH2qZiBtJUcQ","type":"Microsoft.Resources/deployments","properties":{"templateHash":"11808547189309043201","parameters":{},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2021-12-03T07:15:47.8517651Z","duration":"PT0.0002749S","correlationId":"39c7b3bf-52b3-42a3-b549-5e8c2d1b1899","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"publicIPAddresses","locations":["eastus2"]},{"resourceType":"loadBalancers","locations":["eastus2"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"PublicIPlb1"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1","resourceType":"Microsoft.Network/loadBalancers","resourceName":"lb1"}]}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Resources/deployments/lb_deploy_MTDnqiLl0XVDpqlkavAnG9TccHdqqBLm/operationStatuses/08585646370400605397?api-version=2021-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Resources/deployments/lb_deploy_ZOG5hgQgE2cQBJaSlOtRjH2qZiBtJUcQ/operationStatuses/08585630911409695851?api-version=2021-04-01 cache-control: - no-cache content-length: - - '1347' + - '1349' content-type: - application/json; charset=utf-8 date: - - Mon, 15 Nov 2021 09:50:50 GMT + - Fri, 03 Dec 2021 07:15:48 GMT expires: - '-1' pragma: @@ -156,9 +156,9 @@ interactions: ParameterSetName: - -g -n --sku User-Agent: - - AZURECLI/2.30.0 azsdk-python-azure-mgmt-resource/19.0.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585646370400605397?api-version=2021-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585630911409695851?api-version=2021-04-01 response: body: string: '{"status":"Succeeded"}' @@ -170,7 +170,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 15 Nov 2021 09:51:21 GMT + - Fri, 03 Dec 2021 07:16:20 GMT expires: - '-1' pragma: @@ -198,21 +198,21 @@ interactions: ParameterSetName: - -g -n --sku User-Agent: - - AZURECLI/2.30.0 azsdk-python-azure-mgmt-resource/19.0.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-resource/20.0.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Resources/deployments/lb_deploy_MTDnqiLl0XVDpqlkavAnG9TccHdqqBLm","name":"lb_deploy_MTDnqiLl0XVDpqlkavAnG9TccHdqqBLm","type":"Microsoft.Resources/deployments","properties":{"templateHash":"7254541956555978750","parameters":{},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2021-11-15T09:51:10.2133098Z","duration":"PT24.7962122S","correlationId":"e0e291d3-867f-407e-b870-f6f263074432","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"publicIPAddresses","locations":["eastus2"]},{"resourceType":"loadBalancers","locations":["eastus2"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"PublicIPlb1"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1","resourceType":"Microsoft.Network/loadBalancers","resourceName":"lb1"}],"outputs":{"loadBalancer":{"type":"Object","value":{"provisioningState":"Succeeded","resourceGuid":"8b50d110-1e10-4d23-8a6e-a5b3f1b7ed88","frontendIPConfigurations":[{"name":"LoadBalancerFrontEnd","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd","etag":"W/\"0df1d5f0-95d8-4db0-8bd9-33225166e200\"","type":"Microsoft.Network/loadBalancers/frontendIPConfigurations","properties":{"provisioningState":"Succeeded","privateIPAllocationMethod":"Dynamic","publicIPAddress":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1"}}}],"backendAddressPools":[{"name":"lb1bepool","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/lb1bepool","etag":"W/\"0df1d5f0-95d8-4db0-8bd9-33225166e200\"","properties":{"provisioningState":"Succeeded","loadBalancerBackendAddresses":[]},"type":"Microsoft.Network/loadBalancers/backendAddressPools"}],"loadBalancingRules":[],"probes":[],"inboundNatRules":[],"outboundRules":[],"inboundNatPools":[]}}},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Resources/deployments/lb_deploy_ZOG5hgQgE2cQBJaSlOtRjH2qZiBtJUcQ","name":"lb_deploy_ZOG5hgQgE2cQBJaSlOtRjH2qZiBtJUcQ","type":"Microsoft.Resources/deployments","properties":{"templateHash":"11808547189309043201","parameters":{},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2021-12-03T07:16:15.7970114Z","duration":"PT27.9455212S","correlationId":"39c7b3bf-52b3-42a3-b549-5e8c2d1b1899","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"publicIPAddresses","locations":["eastus2"]},{"resourceType":"loadBalancers","locations":["eastus2"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"PublicIPlb1"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1","resourceType":"Microsoft.Network/loadBalancers","resourceName":"lb1"}],"outputs":{"loadBalancer":{"type":"Object","value":{"provisioningState":"Succeeded","resourceGuid":"94938ab4-671d-4d06-bf80-b171f5c5d61d","frontendIPConfigurations":[{"name":"LoadBalancerFrontEnd","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd","etag":"W/\"7352fb03-439a-465c-ae71-30d6f68c5769\"","type":"Microsoft.Network/loadBalancers/frontendIPConfigurations","properties":{"provisioningState":"Succeeded","privateIPAllocationMethod":"Dynamic","publicIPAddress":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1"}}}],"backendAddressPools":[{"name":"lb1bepool","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/lb1bepool","etag":"W/\"7352fb03-439a-465c-ae71-30d6f68c5769\"","properties":{"provisioningState":"Succeeded","loadBalancerBackendAddresses":[]},"type":"Microsoft.Network/loadBalancers/backendAddressPools"}],"loadBalancingRules":[],"probes":[],"inboundNatRules":[],"outboundRules":[],"inboundNatPools":[]}}},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1"}]}}' headers: cache-control: - no-cache content-length: - - '3215' + - '3216' content-type: - application/json; charset=utf-8 date: - - Mon, 15 Nov 2021 09:51:21 GMT + - Fri, 03 Dec 2021 07:16:21 GMT expires: - '-1' pragma: @@ -239,27 +239,28 @@ interactions: - keep-alive ParameterSetName: - -g --lb-name -n --protocol --backend-port --frontend-port-range-start --frontend-port-range-end + --backend-pool-name User-Agent: - - AZURECLI/2.30.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1?api-version=2021-05-01 response: body: string: "{\r\n \"name\": \"lb1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1\",\r\n - \ \"etag\": \"W/\\\"0df1d5f0-95d8-4db0-8bd9-33225166e200\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"7352fb03-439a-465c-ae71-30d6f68c5769\\\"\",\r\n \"type\": \"Microsoft.Network/loadBalancers\",\r\n \"location\": \"eastus2\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"resourceGuid\": \"8b50d110-1e10-4d23-8a6e-a5b3f1b7ed88\",\r\n \"frontendIPConfigurations\": + \ \"resourceGuid\": \"94938ab4-671d-4d06-bf80-b171f5c5d61d\",\r\n \"frontendIPConfigurations\": [\r\n {\r\n \"name\": \"LoadBalancerFrontEnd\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd\",\r\n - \ \"etag\": \"W/\\\"0df1d5f0-95d8-4db0-8bd9-33225166e200\\\"\",\r\n + \ \"etag\": \"W/\\\"7352fb03-439a-465c-ae71-30d6f68c5769\\\"\",\r\n \ \"type\": \"Microsoft.Network/loadBalancers/frontendIPConfigurations\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \ \"privateIPAllocationMethod\": \"Dynamic\",\r\n \"publicIPAddress\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1\"\r\n \ }\r\n }\r\n }\r\n ],\r\n \"backendAddressPools\": [\r\n {\r\n \"name\": \"lb1bepool\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/lb1bepool\",\r\n - \ \"etag\": \"W/\\\"0df1d5f0-95d8-4db0-8bd9-33225166e200\\\"\",\r\n + \ \"etag\": \"W/\\\"7352fb03-439a-465c-ae71-30d6f68c5769\\\"\",\r\n \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \ \"loadBalancerBackendAddresses\": []\r\n },\r\n \"type\": \"Microsoft.Network/loadBalancers/backendAddressPools\"\r\n }\r\n ],\r\n @@ -275,9 +276,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 15 Nov 2021 09:51:23 GMT + - Fri, 03 Dec 2021 07:16:21 GMT etag: - - W/"0df1d5f0-95d8-4db0-8bd9-33225166e200" + - W/"7352fb03-439a-465c-ae71-30d6f68c5769" expires: - '-1' pragma: @@ -294,24 +295,17 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 97757f73-3886-45e6-b578-43d3f9a1b9b0 + - 35366b10-efa0-458e-9cd2-a325bee9f9cc status: code: 200 message: OK - request: - body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1", - "location": "eastus2", "tags": {}, "sku": {"name": "Standard", "tier": "Regional"}, - "properties": {"frontendIPConfigurations": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd", - "name": "LoadBalancerFrontEnd", "properties": {"privateIPAllocationMethod": - "Dynamic", "publicIPAddress": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1"}}}], - "backendAddressPools": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/lb1bepool", - "name": "lb1bepool", "properties": {"loadBalancerBackendAddresses": []}}], "loadBalancingRules": - [], "probes": [], "inboundNatRules": [{"name": "rule3", "properties": {"frontendIPConfiguration": - {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd", + body: '{"name": "rule3", "properties": {"frontendIPConfiguration": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd", "name": "LoadBalancerFrontEnd", "properties": {"privateIPAllocationMethod": "Dynamic", "publicIPAddress": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1"}}}, "protocol": "Tcp", "backendPort": 3, "frontendPortRangeStart": 0, "frontendPortRangeEnd": - 3}}], "inboundNatPools": [], "outboundRules": []}}' + 3, "backendAddressPool": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/lb1bepool", + "name": "lb1bepool", "properties": {"loadBalancerBackendAddresses": []}}}}' headers: Accept: - application/json @@ -322,64 +316,31 @@ interactions: Connection: - keep-alive Content-Length: - - '2046' + - '1043' Content-Type: - application/json ParameterSetName: - -g --lb-name -n --protocol --backend-port --frontend-port-range-start --frontend-port-range-end + --backend-pool-name User-Agent: - - AZURECLI/2.30.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1?api-version=2021-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/rule3?api-version=2021-05-01 response: body: - string: "{\r\n \"name\": \"lb1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1\",\r\n - \ \"etag\": \"W/\\\"31aba13e-54a9-467a-807c-0ab73dcf0bbb\\\"\",\r\n \"type\": - \"Microsoft.Network/loadBalancers\",\r\n \"location\": \"eastus2\",\r\n \"tags\": - {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"resourceGuid\": \"8b50d110-1e10-4d23-8a6e-a5b3f1b7ed88\",\r\n \"frontendIPConfigurations\": - [\r\n {\r\n \"name\": \"LoadBalancerFrontEnd\",\r\n \"id\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd\",\r\n - \ \"etag\": \"W/\\\"31aba13e-54a9-467a-807c-0ab73dcf0bbb\\\"\",\r\n - \ \"type\": \"Microsoft.Network/loadBalancers/frontendIPConfigurations\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"privateIPAllocationMethod\": \"Dynamic\",\r\n \"publicIPAddress\": - {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1\"\r\n - \ },\r\n \"inboundNatRules\": [\r\n {\r\n \"id\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/rule3\"\r\n - \ }\r\n ]\r\n }\r\n }\r\n ],\r\n \"backendAddressPools\": - [\r\n {\r\n \"name\": \"lb1bepool\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/lb1bepool\",\r\n - \ \"etag\": \"W/\\\"31aba13e-54a9-467a-807c-0ab73dcf0bbb\\\"\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"loadBalancerBackendAddresses\": []\r\n },\r\n \"type\": - \"Microsoft.Network/loadBalancers/backendAddressPools\"\r\n }\r\n ],\r\n - \ \"loadBalancingRules\": [],\r\n \"probes\": [],\r\n \"inboundNatRules\": - [\r\n {\r\n \"name\": \"rule3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/rule3\",\r\n - \ \"etag\": \"W/\\\"31aba13e-54a9-467a-807c-0ab73dcf0bbb\\\"\",\r\n - \ \"type\": \"Microsoft.Network/loadBalancers/inboundNatRules\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"frontendIPConfiguration\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd\"\r\n - \ },\r\n \"frontendPort\": 0,\r\n \"backendPort\": - 3,\r\n \"enableFloatingIP\": false,\r\n \"idleTimeoutInMinutes\": - 4,\r\n \"protocol\": \"Tcp\",\r\n \"enableDestinationServiceEndpoint\": - false,\r\n \"enableTcpReset\": false,\r\n \"allowBackendPortConflict\": - false,\r\n \"frontendPortRangeStart\": 0,\r\n \"frontendPortRangeEnd\": - 3\r\n }\r\n }\r\n ],\r\n \"outboundRules\": [],\r\n \"inboundNatPools\": - []\r\n },\r\n \"sku\": {\r\n \"name\": \"Standard\",\r\n \"tier\": - \"Regional\"\r\n }\r\n}" + string: "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": + \"An error occurred.\",\r\n \"details\": []\r\n }\r\n}" headers: - azure-asyncnotification: - - Enabled - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2/operations/d4a14733-b820-41b7-902c-82034abfa39d?api-version=2021-05-01 cache-control: - no-cache + connection: + - close content-length: - - '3657' + - '116' content-type: - application/json; charset=utf-8 date: - - Mon, 15 Nov 2021 09:51:28 GMT + - Fri, 03 Dec 2021 07:16:22 GMT expires: - '-1' pragma: @@ -389,216 +350,59 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 62db4290-fac1-4223-be52-fe1dcdd14fee + - 7b87cdd6-abb0-424c-8343-ba08a6ea394e + x-ms-failure-cause: + - service x-ms-ratelimit-remaining-subscription-writes: - '1199' status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - network lb inbound-nat-rule create - Connection: - - keep-alive - ParameterSetName: - - -g --lb-name -n --protocol --backend-port --frontend-port-range-start --frontend-port-range-end - User-Agent: - - AZURECLI/2.30.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2/operations/d4a14733-b820-41b7-902c-82034abfa39d?api-version=2021-05-01 - response: - body: - string: "{\r\n \"status\": \"Succeeded\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '29' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 15 Nov 2021 09:51:58 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 1d5b5253-389a-4a07-b2e4-6495db7abfa7 - status: - code: 200 - message: OK + code: 500 + message: Internal Server Error - request: - body: null + body: '{"name": "rule3", "properties": {"frontendIPConfiguration": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd", + "name": "LoadBalancerFrontEnd", "properties": {"privateIPAllocationMethod": + "Dynamic", "publicIPAddress": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1"}}}, + "protocol": "Tcp", "backendPort": 3, "frontendPortRangeStart": 0, "frontendPortRangeEnd": + 3, "backendAddressPool": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/lb1bepool", + "name": "lb1bepool", "properties": {"loadBalancerBackendAddresses": []}}}}' headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate CommandName: - network lb inbound-nat-rule create Connection: - keep-alive - ParameterSetName: - - -g --lb-name -n --protocol --backend-port --frontend-port-range-start --frontend-port-range-end - User-Agent: - - AZURECLI/2.30.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1?api-version=2021-05-01 - response: - body: - string: "{\r\n \"name\": \"lb1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1\",\r\n - \ \"etag\": \"W/\\\"31aba13e-54a9-467a-807c-0ab73dcf0bbb\\\"\",\r\n \"type\": - \"Microsoft.Network/loadBalancers\",\r\n \"location\": \"eastus2\",\r\n \"tags\": - {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"resourceGuid\": \"8b50d110-1e10-4d23-8a6e-a5b3f1b7ed88\",\r\n \"frontendIPConfigurations\": - [\r\n {\r\n \"name\": \"LoadBalancerFrontEnd\",\r\n \"id\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd\",\r\n - \ \"etag\": \"W/\\\"31aba13e-54a9-467a-807c-0ab73dcf0bbb\\\"\",\r\n - \ \"type\": \"Microsoft.Network/loadBalancers/frontendIPConfigurations\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"privateIPAllocationMethod\": \"Dynamic\",\r\n \"publicIPAddress\": - {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1\"\r\n - \ },\r\n \"inboundNatRules\": [\r\n {\r\n \"id\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/rule3\"\r\n - \ }\r\n ]\r\n }\r\n }\r\n ],\r\n \"backendAddressPools\": - [\r\n {\r\n \"name\": \"lb1bepool\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/lb1bepool\",\r\n - \ \"etag\": \"W/\\\"31aba13e-54a9-467a-807c-0ab73dcf0bbb\\\"\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"loadBalancerBackendAddresses\": []\r\n },\r\n \"type\": - \"Microsoft.Network/loadBalancers/backendAddressPools\"\r\n }\r\n ],\r\n - \ \"loadBalancingRules\": [],\r\n \"probes\": [],\r\n \"inboundNatRules\": - [\r\n {\r\n \"name\": \"rule3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/rule3\",\r\n - \ \"etag\": \"W/\\\"31aba13e-54a9-467a-807c-0ab73dcf0bbb\\\"\",\r\n - \ \"type\": \"Microsoft.Network/loadBalancers/inboundNatRules\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"frontendIPConfiguration\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd\"\r\n - \ },\r\n \"frontendPort\": 0,\r\n \"backendPort\": - 3,\r\n \"enableFloatingIP\": false,\r\n \"idleTimeoutInMinutes\": - 4,\r\n \"protocol\": \"Tcp\",\r\n \"enableDestinationServiceEndpoint\": - false,\r\n \"enableTcpReset\": false,\r\n \"allowBackendPortConflict\": - false,\r\n \"frontendPortRangeStart\": 0,\r\n \"frontendPortRangeEnd\": - 3\r\n }\r\n }\r\n ],\r\n \"outboundRules\": [],\r\n \"inboundNatPools\": - []\r\n },\r\n \"sku\": {\r\n \"name\": \"Standard\",\r\n \"tier\": - \"Regional\"\r\n }\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '3657' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 15 Nov 2021 09:51:59 GMT - etag: - - W/"31aba13e-54a9-467a-807c-0ab73dcf0bbb" - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 084512c9-403a-41c8-b855-e64d5346aa32 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: + Content-Length: + - '1043' + Content-Type: - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - network lb inbound-nat-rule update - Connection: - - keep-alive ParameterSetName: - - -g --lb-name -n --floating-ip --idle-timeout --frontend-port-range-end + - -g --lb-name -n --protocol --backend-port --frontend-port-range-start --frontend-port-range-end + --backend-pool-name User-Agent: - - AZURECLI/2.30.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1?api-version=2021-05-01 + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/rule3?api-version=2021-05-01 response: body: - string: "{\r\n \"name\": \"lb1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1\",\r\n - \ \"etag\": \"W/\\\"31aba13e-54a9-467a-807c-0ab73dcf0bbb\\\"\",\r\n \"type\": - \"Microsoft.Network/loadBalancers\",\r\n \"location\": \"eastus2\",\r\n \"tags\": - {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"resourceGuid\": \"8b50d110-1e10-4d23-8a6e-a5b3f1b7ed88\",\r\n \"frontendIPConfigurations\": - [\r\n {\r\n \"name\": \"LoadBalancerFrontEnd\",\r\n \"id\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd\",\r\n - \ \"etag\": \"W/\\\"31aba13e-54a9-467a-807c-0ab73dcf0bbb\\\"\",\r\n - \ \"type\": \"Microsoft.Network/loadBalancers/frontendIPConfigurations\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"privateIPAllocationMethod\": \"Dynamic\",\r\n \"publicIPAddress\": - {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1\"\r\n - \ },\r\n \"inboundNatRules\": [\r\n {\r\n \"id\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/rule3\"\r\n - \ }\r\n ]\r\n }\r\n }\r\n ],\r\n \"backendAddressPools\": - [\r\n {\r\n \"name\": \"lb1bepool\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/lb1bepool\",\r\n - \ \"etag\": \"W/\\\"31aba13e-54a9-467a-807c-0ab73dcf0bbb\\\"\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"loadBalancerBackendAddresses\": []\r\n },\r\n \"type\": - \"Microsoft.Network/loadBalancers/backendAddressPools\"\r\n }\r\n ],\r\n - \ \"loadBalancingRules\": [],\r\n \"probes\": [],\r\n \"inboundNatRules\": - [\r\n {\r\n \"name\": \"rule3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/rule3\",\r\n - \ \"etag\": \"W/\\\"31aba13e-54a9-467a-807c-0ab73dcf0bbb\\\"\",\r\n - \ \"type\": \"Microsoft.Network/loadBalancers/inboundNatRules\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"frontendIPConfiguration\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd\"\r\n - \ },\r\n \"frontendPort\": 0,\r\n \"backendPort\": - 3,\r\n \"enableFloatingIP\": false,\r\n \"idleTimeoutInMinutes\": - 4,\r\n \"protocol\": \"Tcp\",\r\n \"enableDestinationServiceEndpoint\": - false,\r\n \"enableTcpReset\": false,\r\n \"allowBackendPortConflict\": - false,\r\n \"frontendPortRangeStart\": 0,\r\n \"frontendPortRangeEnd\": - 3\r\n }\r\n }\r\n ],\r\n \"outboundRules\": [],\r\n \"inboundNatPools\": - []\r\n },\r\n \"sku\": {\r\n \"name\": \"Standard\",\r\n \"tier\": - \"Regional\"\r\n }\r\n}" + string: "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": + \"An error occurred.\",\r\n \"details\": []\r\n }\r\n}" headers: cache-control: - no-cache + connection: + - close content-length: - - '3657' + - '116' content-type: - application/json; charset=utf-8 date: - - Mon, 15 Nov 2021 09:52:00 GMT - etag: - - W/"31aba13e-54a9-467a-807c-0ab73dcf0bbb" + - Fri, 03 Dec 2021 07:16:23 GMT expires: - '-1' pragma: @@ -608,98 +412,59 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 02079981-6a89-4957-b224-5064e34d27e5 + - be6b8e41-bedd-4986-8f66-687d918e2163 + x-ms-failure-cause: + - service + x-ms-ratelimit-remaining-subscription-writes: + - '1199' status: - code: 200 - message: OK + code: 500 + message: Internal Server Error - request: - body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1", - "location": "eastus2", "tags": {}, "sku": {"name": "Standard", "tier": "Regional"}, - "properties": {"frontendIPConfigurations": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd", + body: '{"name": "rule3", "properties": {"frontendIPConfiguration": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd", "name": "LoadBalancerFrontEnd", "properties": {"privateIPAllocationMethod": - "Dynamic", "publicIPAddress": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1"}}}], - "backendAddressPools": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/lb1bepool", - "name": "lb1bepool", "properties": {"loadBalancerBackendAddresses": []}}], "loadBalancingRules": - [], "probes": [], "inboundNatRules": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/rule3", - "name": "rule3", "properties": {"frontendIPConfiguration": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd"}, - "protocol": "Tcp", "frontendPort": 0, "backendPort": 3, "idleTimeoutInMinutes": - 10, "enableFloatingIP": true, "enableTcpReset": false, "frontendPortRangeStart": - 0, "frontendPortRangeEnd": 5}}], "inboundNatPools": [], "outboundRules": []}}' + "Dynamic", "publicIPAddress": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1"}}}, + "protocol": "Tcp", "backendPort": 3, "frontendPortRangeStart": 0, "frontendPortRangeEnd": + 3, "backendAddressPool": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/lb1bepool", + "name": "lb1bepool", "properties": {"loadBalancerBackendAddresses": []}}}}' headers: Accept: - application/json Accept-Encoding: - gzip, deflate CommandName: - - network lb inbound-nat-rule update + - network lb inbound-nat-rule create Connection: - keep-alive Content-Length: - - '2045' + - '1043' Content-Type: - application/json ParameterSetName: - - -g --lb-name -n --floating-ip --idle-timeout --frontend-port-range-end + - -g --lb-name -n --protocol --backend-port --frontend-port-range-start --frontend-port-range-end + --backend-pool-name User-Agent: - - AZURECLI/2.30.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1?api-version=2021-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/rule3?api-version=2021-05-01 response: body: - string: "{\r\n \"name\": \"lb1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1\",\r\n - \ \"etag\": \"W/\\\"fbca1be6-a9a8-41f5-aa53-0b5ae3f196c7\\\"\",\r\n \"type\": - \"Microsoft.Network/loadBalancers\",\r\n \"location\": \"eastus2\",\r\n \"tags\": - {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"resourceGuid\": \"8b50d110-1e10-4d23-8a6e-a5b3f1b7ed88\",\r\n \"frontendIPConfigurations\": - [\r\n {\r\n \"name\": \"LoadBalancerFrontEnd\",\r\n \"id\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd\",\r\n - \ \"etag\": \"W/\\\"fbca1be6-a9a8-41f5-aa53-0b5ae3f196c7\\\"\",\r\n - \ \"type\": \"Microsoft.Network/loadBalancers/frontendIPConfigurations\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"privateIPAllocationMethod\": \"Dynamic\",\r\n \"publicIPAddress\": - {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1\"\r\n - \ },\r\n \"inboundNatRules\": [\r\n {\r\n \"id\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/rule3\"\r\n - \ }\r\n ]\r\n }\r\n }\r\n ],\r\n \"backendAddressPools\": - [\r\n {\r\n \"name\": \"lb1bepool\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/lb1bepool\",\r\n - \ \"etag\": \"W/\\\"fbca1be6-a9a8-41f5-aa53-0b5ae3f196c7\\\"\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"loadBalancerBackendAddresses\": []\r\n },\r\n \"type\": - \"Microsoft.Network/loadBalancers/backendAddressPools\"\r\n }\r\n ],\r\n - \ \"loadBalancingRules\": [],\r\n \"probes\": [],\r\n \"inboundNatRules\": - [\r\n {\r\n \"name\": \"rule3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/rule3\",\r\n - \ \"etag\": \"W/\\\"fbca1be6-a9a8-41f5-aa53-0b5ae3f196c7\\\"\",\r\n - \ \"type\": \"Microsoft.Network/loadBalancers/inboundNatRules\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"frontendIPConfiguration\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd\"\r\n - \ },\r\n \"frontendPort\": 0,\r\n \"backendPort\": - 3,\r\n \"enableFloatingIP\": true,\r\n \"idleTimeoutInMinutes\": - 10,\r\n \"protocol\": \"Tcp\",\r\n \"enableDestinationServiceEndpoint\": - false,\r\n \"enableTcpReset\": false,\r\n \"allowBackendPortConflict\": - false,\r\n \"frontendPortRangeStart\": 0,\r\n \"frontendPortRangeEnd\": - 5\r\n }\r\n }\r\n ],\r\n \"outboundRules\": [],\r\n \"inboundNatPools\": - []\r\n },\r\n \"sku\": {\r\n \"name\": \"Standard\",\r\n \"tier\": - \"Regional\"\r\n }\r\n}" + string: "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": + \"An error occurred.\",\r\n \"details\": []\r\n }\r\n}" headers: - azure-asyncnotification: - - Enabled - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2/operations/bfeab6a7-9acd-46e2-99b1-3f8584dfde74?api-version=2021-05-01 cache-control: - no-cache + connection: + - close content-length: - - '3657' + - '116' content-type: - application/json; charset=utf-8 date: - - Mon, 15 Nov 2021 09:52:09 GMT + - Fri, 03 Dec 2021 07:16:26 GMT expires: - '-1' pragma: @@ -709,302 +474,59 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 29291b8d-7c85-4d3b-b3c4-372c5ad202ce + - 9391bc15-c37c-4c60-aa6b-9ab61d9fc4ee + x-ms-failure-cause: + - service x-ms-ratelimit-remaining-subscription-writes: - '1199' status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - network lb inbound-nat-rule update - Connection: - - keep-alive - ParameterSetName: - - -g --lb-name -n --floating-ip --idle-timeout --frontend-port-range-end - User-Agent: - - AZURECLI/2.30.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2/operations/bfeab6a7-9acd-46e2-99b1-3f8584dfde74?api-version=2021-05-01 - response: - body: - string: "{\r\n \"status\": \"Succeeded\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '29' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 15 Nov 2021 09:52:41 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 09b6eced-5c05-47a2-a202-4c275bd6a735 - status: - code: 200 - message: OK + code: 500 + message: Internal Server Error - request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - network lb inbound-nat-rule update - Connection: - - keep-alive - ParameterSetName: - - -g --lb-name -n --floating-ip --idle-timeout --frontend-port-range-end - User-Agent: - - AZURECLI/2.30.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1?api-version=2021-05-01 - response: - body: - string: "{\r\n \"name\": \"lb1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1\",\r\n - \ \"etag\": \"W/\\\"fbca1be6-a9a8-41f5-aa53-0b5ae3f196c7\\\"\",\r\n \"type\": - \"Microsoft.Network/loadBalancers\",\r\n \"location\": \"eastus2\",\r\n \"tags\": - {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"resourceGuid\": \"8b50d110-1e10-4d23-8a6e-a5b3f1b7ed88\",\r\n \"frontendIPConfigurations\": - [\r\n {\r\n \"name\": \"LoadBalancerFrontEnd\",\r\n \"id\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd\",\r\n - \ \"etag\": \"W/\\\"fbca1be6-a9a8-41f5-aa53-0b5ae3f196c7\\\"\",\r\n - \ \"type\": \"Microsoft.Network/loadBalancers/frontendIPConfigurations\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"privateIPAllocationMethod\": \"Dynamic\",\r\n \"publicIPAddress\": - {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1\"\r\n - \ },\r\n \"inboundNatRules\": [\r\n {\r\n \"id\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/rule3\"\r\n - \ }\r\n ]\r\n }\r\n }\r\n ],\r\n \"backendAddressPools\": - [\r\n {\r\n \"name\": \"lb1bepool\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/lb1bepool\",\r\n - \ \"etag\": \"W/\\\"fbca1be6-a9a8-41f5-aa53-0b5ae3f196c7\\\"\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"loadBalancerBackendAddresses\": []\r\n },\r\n \"type\": - \"Microsoft.Network/loadBalancers/backendAddressPools\"\r\n }\r\n ],\r\n - \ \"loadBalancingRules\": [],\r\n \"probes\": [],\r\n \"inboundNatRules\": - [\r\n {\r\n \"name\": \"rule3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/rule3\",\r\n - \ \"etag\": \"W/\\\"fbca1be6-a9a8-41f5-aa53-0b5ae3f196c7\\\"\",\r\n - \ \"type\": \"Microsoft.Network/loadBalancers/inboundNatRules\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"frontendIPConfiguration\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd\"\r\n - \ },\r\n \"frontendPort\": 0,\r\n \"backendPort\": - 3,\r\n \"enableFloatingIP\": true,\r\n \"idleTimeoutInMinutes\": - 10,\r\n \"protocol\": \"Tcp\",\r\n \"enableDestinationServiceEndpoint\": - false,\r\n \"enableTcpReset\": false,\r\n \"allowBackendPortConflict\": - false,\r\n \"frontendPortRangeStart\": 0,\r\n \"frontendPortRangeEnd\": - 5\r\n }\r\n }\r\n ],\r\n \"outboundRules\": [],\r\n \"inboundNatPools\": - []\r\n },\r\n \"sku\": {\r\n \"name\": \"Standard\",\r\n \"tier\": - \"Regional\"\r\n }\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '3657' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 15 Nov 2021 09:52:41 GMT - etag: - - W/"fbca1be6-a9a8-41f5-aa53-0b5ae3f196c7" - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 45067293-a354-4595-94f7-8c04e4bde405 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - network lb inbound-nat-rule delete - Connection: - - keep-alive - ParameterSetName: - - -g --lb-name -n - User-Agent: - - AZURECLI/2.30.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1?api-version=2021-05-01 - response: - body: - string: "{\r\n \"name\": \"lb1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1\",\r\n - \ \"etag\": \"W/\\\"fbca1be6-a9a8-41f5-aa53-0b5ae3f196c7\\\"\",\r\n \"type\": - \"Microsoft.Network/loadBalancers\",\r\n \"location\": \"eastus2\",\r\n \"tags\": - {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"resourceGuid\": \"8b50d110-1e10-4d23-8a6e-a5b3f1b7ed88\",\r\n \"frontendIPConfigurations\": - [\r\n {\r\n \"name\": \"LoadBalancerFrontEnd\",\r\n \"id\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd\",\r\n - \ \"etag\": \"W/\\\"fbca1be6-a9a8-41f5-aa53-0b5ae3f196c7\\\"\",\r\n - \ \"type\": \"Microsoft.Network/loadBalancers/frontendIPConfigurations\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"privateIPAllocationMethod\": \"Dynamic\",\r\n \"publicIPAddress\": - {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1\"\r\n - \ },\r\n \"inboundNatRules\": [\r\n {\r\n \"id\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/rule3\"\r\n - \ }\r\n ]\r\n }\r\n }\r\n ],\r\n \"backendAddressPools\": - [\r\n {\r\n \"name\": \"lb1bepool\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/lb1bepool\",\r\n - \ \"etag\": \"W/\\\"fbca1be6-a9a8-41f5-aa53-0b5ae3f196c7\\\"\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"loadBalancerBackendAddresses\": []\r\n },\r\n \"type\": - \"Microsoft.Network/loadBalancers/backendAddressPools\"\r\n }\r\n ],\r\n - \ \"loadBalancingRules\": [],\r\n \"probes\": [],\r\n \"inboundNatRules\": - [\r\n {\r\n \"name\": \"rule3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/rule3\",\r\n - \ \"etag\": \"W/\\\"fbca1be6-a9a8-41f5-aa53-0b5ae3f196c7\\\"\",\r\n - \ \"type\": \"Microsoft.Network/loadBalancers/inboundNatRules\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"frontendIPConfiguration\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd\"\r\n - \ },\r\n \"frontendPort\": 0,\r\n \"backendPort\": - 3,\r\n \"enableFloatingIP\": true,\r\n \"idleTimeoutInMinutes\": - 10,\r\n \"protocol\": \"Tcp\",\r\n \"enableDestinationServiceEndpoint\": - false,\r\n \"enableTcpReset\": false,\r\n \"allowBackendPortConflict\": - false,\r\n \"frontendPortRangeStart\": 0,\r\n \"frontendPortRangeEnd\": - 5\r\n }\r\n }\r\n ],\r\n \"outboundRules\": [],\r\n \"inboundNatPools\": - []\r\n },\r\n \"sku\": {\r\n \"name\": \"Standard\",\r\n \"tier\": - \"Regional\"\r\n }\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '3657' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 15 Nov 2021 09:52:43 GMT - etag: - - W/"fbca1be6-a9a8-41f5-aa53-0b5ae3f196c7" - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - f75241df-3400-4b38-a2b5-1d93b9aebdfa - status: - code: 200 - message: OK -- request: - body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1", - "location": "eastus2", "tags": {}, "sku": {"name": "Standard", "tier": "Regional"}, - "properties": {"frontendIPConfigurations": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd", + body: '{"name": "rule3", "properties": {"frontendIPConfiguration": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd", "name": "LoadBalancerFrontEnd", "properties": {"privateIPAllocationMethod": - "Dynamic", "publicIPAddress": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1"}}}], - "backendAddressPools": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/lb1bepool", - "name": "lb1bepool", "properties": {"loadBalancerBackendAddresses": []}}], "loadBalancingRules": - [], "probes": [], "inboundNatRules": [], "inboundNatPools": [], "outboundRules": - []}}' + "Dynamic", "publicIPAddress": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1"}}}, + "protocol": "Tcp", "backendPort": 3, "frontendPortRangeStart": 0, "frontendPortRangeEnd": + 3, "backendAddressPool": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/lb1bepool", + "name": "lb1bepool", "properties": {"loadBalancerBackendAddresses": []}}}}' headers: Accept: - application/json Accept-Encoding: - gzip, deflate CommandName: - - network lb inbound-nat-rule delete + - network lb inbound-nat-rule create Connection: - keep-alive Content-Length: - - '1328' + - '1043' Content-Type: - application/json ParameterSetName: - - -g --lb-name -n + - -g --lb-name -n --protocol --backend-port --frontend-port-range-start --frontend-port-range-end + --backend-pool-name User-Agent: - - AZURECLI/2.30.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1?api-version=2021-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/rule3?api-version=2021-05-01 response: body: - string: "{\r\n \"name\": \"lb1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1\",\r\n - \ \"etag\": \"W/\\\"4ad77848-58c5-40e4-b229-8769162c1f8f\\\"\",\r\n \"type\": - \"Microsoft.Network/loadBalancers\",\r\n \"location\": \"eastus2\",\r\n \"tags\": - {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"resourceGuid\": \"8b50d110-1e10-4d23-8a6e-a5b3f1b7ed88\",\r\n \"frontendIPConfigurations\": - [\r\n {\r\n \"name\": \"LoadBalancerFrontEnd\",\r\n \"id\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd\",\r\n - \ \"etag\": \"W/\\\"4ad77848-58c5-40e4-b229-8769162c1f8f\\\"\",\r\n - \ \"type\": \"Microsoft.Network/loadBalancers/frontendIPConfigurations\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"privateIPAllocationMethod\": \"Dynamic\",\r\n \"publicIPAddress\": - {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1\"\r\n - \ }\r\n }\r\n }\r\n ],\r\n \"backendAddressPools\": - [\r\n {\r\n \"name\": \"lb1bepool\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/lb1bepool\",\r\n - \ \"etag\": \"W/\\\"4ad77848-58c5-40e4-b229-8769162c1f8f\\\"\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"loadBalancerBackendAddresses\": []\r\n },\r\n \"type\": - \"Microsoft.Network/loadBalancers/backendAddressPools\"\r\n }\r\n ],\r\n - \ \"loadBalancingRules\": [],\r\n \"probes\": [],\r\n \"inboundNatRules\": - [],\r\n \"outboundRules\": [],\r\n \"inboundNatPools\": []\r\n },\r\n - \ \"sku\": {\r\n \"name\": \"Standard\",\r\n \"tier\": \"Regional\"\r\n - \ }\r\n}" + string: "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": + \"An error occurred.\",\r\n \"details\": []\r\n }\r\n}" headers: - azure-asyncnotification: - - Enabled - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2/operations/0b7f43c0-50d8-44b8-b2a7-a4cdb9d3dee0?api-version=2021-05-01 cache-control: - no-cache + connection: + - close content-length: - - '2168' + - '116' content-type: - application/json; charset=utf-8 date: - - Mon, 15 Nov 2021 09:52:47 GMT + - Fri, 03 Dec 2021 07:16:29 GMT expires: - '-1' pragma: @@ -1014,138 +536,15 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-arm-service-request-id: - - b30a5db9-58a2-4b74-929c-6d2ceaa37a98 + - c145743c-7b99-475a-a64a-6f03904281f3 + x-ms-failure-cause: + - service x-ms-ratelimit-remaining-subscription-writes: - '1199' status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - network lb inbound-nat-rule delete - Connection: - - keep-alive - ParameterSetName: - - -g --lb-name -n - User-Agent: - - AZURECLI/2.30.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2/operations/0b7f43c0-50d8-44b8-b2a7-a4cdb9d3dee0?api-version=2021-05-01 - response: - body: - string: "{\r\n \"status\": \"Succeeded\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '29' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 15 Nov 2021 09:53:18 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 5e1f3faa-619f-44a9-80b3-ae323a7b3145 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - network lb inbound-nat-rule delete - Connection: - - keep-alive - ParameterSetName: - - -g --lb-name -n - User-Agent: - - AZURECLI/2.30.0 azsdk-python-azure-mgmt-network/19.3.0 Python/3.8.3 (Windows-10-10.0.18362-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1?api-version=2021-05-01 - response: - body: - string: "{\r\n \"name\": \"lb1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1\",\r\n - \ \"etag\": \"W/\\\"4ad77848-58c5-40e4-b229-8769162c1f8f\\\"\",\r\n \"type\": - \"Microsoft.Network/loadBalancers\",\r\n \"location\": \"eastus2\",\r\n \"tags\": - {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"resourceGuid\": \"8b50d110-1e10-4d23-8a6e-a5b3f1b7ed88\",\r\n \"frontendIPConfigurations\": - [\r\n {\r\n \"name\": \"LoadBalancerFrontEnd\",\r\n \"id\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/LoadBalancerFrontEnd\",\r\n - \ \"etag\": \"W/\\\"4ad77848-58c5-40e4-b229-8769162c1f8f\\\"\",\r\n - \ \"type\": \"Microsoft.Network/loadBalancers/frontendIPConfigurations\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"privateIPAllocationMethod\": \"Dynamic\",\r\n \"publicIPAddress\": - {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/publicIPAddresses/PublicIPlb1\"\r\n - \ }\r\n }\r\n }\r\n ],\r\n \"backendAddressPools\": - [\r\n {\r\n \"name\": \"lb1bepool\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_lb_nat_rules_v2000001/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/lb1bepool\",\r\n - \ \"etag\": \"W/\\\"4ad77848-58c5-40e4-b229-8769162c1f8f\\\"\",\r\n - \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n - \ \"loadBalancerBackendAddresses\": []\r\n },\r\n \"type\": - \"Microsoft.Network/loadBalancers/backendAddressPools\"\r\n }\r\n ],\r\n - \ \"loadBalancingRules\": [],\r\n \"probes\": [],\r\n \"inboundNatRules\": - [],\r\n \"outboundRules\": [],\r\n \"inboundNatPools\": []\r\n },\r\n - \ \"sku\": {\r\n \"name\": \"Standard\",\r\n \"tier\": \"Regional\"\r\n - \ }\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '2168' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 15 Nov 2021 09:53:18 GMT - etag: - - W/"4ad77848-58c5-40e4-b229-8769162c1f8f" - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 9f0e7a5f-1c26-4742-b5c6-f3bb7d69c4dd - status: - code: 200 - message: OK + code: 500 + message: Internal Server Error version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py b/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py index a90b3f5a10a..c830eb26451 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py @@ -2864,8 +2864,9 @@ def test_network_lb_nat_rules_v2(self, resource_group): self.cmd('network lb create -g {rg} -n {lb} --sku Standard') self.cmd('network lb inbound-nat-rule create -g {rg} --lb-name {lb} -n rule3 --protocol tcp --backend-port 3 ' - '--frontend-port-range-start 0 --frontend-port-range-end 3', checks=[ + '--frontend-port-range-start 0 --frontend-port-range-end 3 --backend-pool-name lb1bepool', checks=[ self.check('name', 'rule3'), + self.check('backendAddressPool.id', ''), self.check('frontendPortRangeStart', 0), self.check('frontendPortRangeEnd', 3)]) self.cmd('network lb inbound-nat-rule update -g {rg} --lb-name {lb} -n rule3 --floating-ip true --idle-timeout 10 --frontend-port-range-end 5',