.. versionadded:: 2019.2.0

    List all routes within a route table.

    :param route_table: The route table to query.

    :param resource_group: The resource group name assigned to the
        route table.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_network.routes_list test-rt-table testgroup

def routes_list(route_table, resource_group, **kwargs):
    '''
    .. versionadded:: 2019.2.0

    List all routes within a route table.

    :param route_table: The route table to query.

    :param resource_group: The resource group name assigned to the
        route table.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_network.routes_list test-rt-table testgroup

    '''
    result = {}
    netconn = __utils__['azurearm.get_client']('network', **kwargs)
    try:
        routes = __utils__['azurearm.paged_object_to_list'](
            netconn.routes.list(
                resource_group_name=resource_group,
                route_table_name=route_table
            )
        )

        for route in routes:
            result[route['name']] = route
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('network', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result