azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

Listing Route Tables in Azure with Python SDK

Open lusbyr opened this issue 7 years ago • 5 comments

Hi,

I am trying to get a basic understanding of how to interact with Azure using the Python SDK. I am very new to this, although I understand how to interact with Azure using Powershell.

The syntax for the Python SDK is unfamiliar at this point. I managed to use the online documentation to figure out how to login to Azure.

I would like to pull out all the route table names in a subscription and print them out with Python

I have the following section of code:

network_client = NetworkManagementClient(credentials, subscription_id, base_url=AZURE_US_GOV_CLOUD.endpoints.resource_manager) route_table_list = network_client.route_tables.list_all(custom_headers=None, raw=False)

Can someone provide a snippet of Python code that will iterate over the RouteTablePaged class and print out the route table names?

Thanks.

lusbyr avatar Aug 07 '19 17:08 lusbyr

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @karenhammons

ghost avatar Aug 07 '19 22:08 ghost

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @karenhammons

ghost avatar Aug 07 '19 22:08 ghost

Thank you for the question. Looking into it and will respond soon.

KarenHammons avatar Aug 09 '19 22:08 KarenHammons

@lusbyr, thanks for your patience. @jispar, can you help with this?

allegradomel avatar Dec 05 '19 01:12 allegradomel

Hi,@lusbyr. you can print table name like this:

for route_table in route_table_list:
    print(route_table.name)

The reoute_table_list you got is an iterator.

00Kai0 avatar Jun 24 '20 07:06 00Kai0