Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/azure-cli/azure/cli/command_modules/network/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -2728,6 +2728,15 @@
--path primary --peering-name AzurePrivatePeering
"""

helps['network express-route list-route-tables-summary'] = """
type: command
short-summary: Show the current routing table summary of an ExpressRoute circuit peering.
examples:
- name: List Route Table Summary
text: |
az network express-route list-route-tables-summary -g MyResourceGroup -n MyCircuit --path primary --peering-name AzurePrivatePeering
"""

helps['network express-route list-service-providers'] = """
type: command
short-summary: List available ExpressRoute service providers.
Expand Down Expand Up @@ -2772,6 +2781,15 @@
short-summary: Get the details of an ExpressRoute circuit connection.
"""

helps['network express-route peering connection list'] = """
type: command
short-summary: List all global reach connections associated with a private peering in an express route circuit.
examples:
- name: List ExpressRouteCircuit Connection
text: |
az network express-route peering connection list --circuit-name MyCircuit --peering-name MyPeering --resource-group MyResourceGroup
"""

helps['network express-route peering create'] = """
type: command
short-summary: Create peering settings for an ExpressRoute circuit.
Expand Down Expand Up @@ -2841,6 +2859,15 @@
crafted: true
"""

helps['network express-route peering get-stats'] = """
type: command
short-summary: Get all traffic stats of an ExpressRoute peering.
examples:
- name: Get ExpressRoute Circuit Peering Traffic Stats
text: |
az network express-route peering get-stats --circuit-name MyCircuit --name MyPeering --resource-group MyResourceGroup
"""

helps['network express-route port'] = """
type: group
short-summary: Manage ExpressRoute ports.
Expand Down
4 changes: 4 additions & 0 deletions src/azure-cli/azure/cli/command_modules/network/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,10 @@ def load_arguments(self, _):
c.argument('connection_name', options_list=['--name', '-n'], help='Name of the peering connection.', id_part='child_name_2')
c.argument('peer_circuit', help='Name or ID of the peer ExpressRoute circuit.', validator=validate_er_peer_circuit)

with self.argument_context('network express-route peering connection list') as c:
c.argument('circuit_name', id_part=None)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is 'id_part=None' needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we are not suppose to add --ids argument for list and create commands.

c.argument('peering_name', id_part=None)

with self.argument_context('network express-route peering peer-connection') as c:
c.argument('circuit_name', circuit_name_type, id_part=None)
c.argument('peering_name', options_list=['--peering-name'], help='Name of BGP peering (i.e. AzurePrivatePeering).', id_part=None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,8 @@ def _make_singular(value):
g.show_command('show', 'get')
g.command('get-stats', 'get_stats')
g.command('list-arp-tables', 'begin_list_arp_table')
g.custom_command('list-route-tables', 'list_express_route_route_tables')
g.command('list-route-tables', 'begin_list_routes_table', is_preview=True)
g.command('list-route-tables-summary', 'begin_list_routes_table_summary', is_preview=True)
g.custom_command('create', 'create_express_route', supports_no_wait=True)
g.custom_command('list', 'list_express_route_circuits')
g.command('list-service-providers', 'list', command_type=network_ersp_sdk)
Expand Down Expand Up @@ -782,12 +783,14 @@ def _make_singular(value):
g.command('delete', 'begin_delete')
g.show_command('show', 'get')
g.command('list', 'list')
g.command('get-stats', 'get_peering_stats', command_type=network_er_sdk, is_preview=True)
g.generic_update_command('update', setter_name='begin_create_or_update', setter_arg_name='peering_parameters', custom_func_name='update_express_route_peering')

with self.command_group('network express-route peering connection', network_erconn_sdk) as g:
g.custom_command('create', 'create_express_route_peering_connection')
g.command('delete', 'begin_delete')
g.show_command('show')
g.command('list', 'list')

with self.command_group('network express-route peering peer-connection', network_perconn_sdk, is_preview=True) as g:
g.show_command('show', is_preview=True)
Expand Down
9 changes: 0 additions & 9 deletions src/azure-cli/azure/cli/command_modules/network/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2576,15 +2576,6 @@ def update_express_route(instance, cmd, bandwidth_in_mbps=None, peering_location
return instance


def list_express_route_route_tables(cmd, resource_group_name, circuit_name, peering_name, device_path):
from azure.cli.core.commands import LongRunningOperation

client = network_client_factory(cmd.cli_ctx).express_route_circuits

return LongRunningOperation(cmd.cli_ctx)(
client.begin_list_routes_table(resource_group_name, circuit_name, peering_name, device_path)).value


def create_express_route_peering_connection(cmd, resource_group_name, circuit_name, peering_name, connection_name,
peer_circuit, address_prefix, authorization_key=None):
client = network_client_factory(cmd.cli_ctx).express_route_circuit_connections
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from azure.cli.core.profiles import supported_api_version, ResourceType

from azure.cli.testsdk import (
ScenarioTest, LiveScenarioTest, ResourceGroupPreparer, StorageAccountPreparer, live_only)
ScenarioTest, LiveScenarioTest, ResourceGroupPreparer, StorageAccountPreparer, live_only, record_only)

from knack.util import CLIError

Expand Down Expand Up @@ -746,6 +746,7 @@ def _test_express_route_auth(self):

self.cmd('network express-route auth list --resource-group {rg} --circuit-name {er}', checks=self.is_empty())

@record_only() # record_only as the express route is extremely expensive, contact service team for an available ER
@ResourceGroupPreparer(name_prefix='cli_test_express_route')
def test_network_express_route(self, resource_group):

Expand Down Expand Up @@ -803,6 +804,7 @@ def test_network_express_route(self, resource_group):

class NetworkExpressRouteIPv6PeeringScenarioTest(ScenarioTest):

@record_only() # record_only as the express route is extremely expensive, contact service team for an available ER
@ResourceGroupPreparer(name_prefix='cli_test_express_route_ipv6_peering')
def test_network_express_route_ipv6_peering(self, resource_group):

Expand Down
Loading