grafana/azure-monitor-datasource

ResourceNames() should follow nextLink for pagination

Opened this issue · 0 comments

When Resource Group tons of resources that cannot returned from one single REST request.
It should follow the "nextLink" to get all resources.

{
    "value": [
        {
            "id": "/subscriptions/dddddddd-e7a1-44ba-beef-4c6a323b773e/resourceGroups/my-sql-servers/providers/Microsoft.Sql/servers/my-sql-server",
            "name": "share-sql-server-pro1-cu-1",
            "type": "Microsoft.Sql/servers",
            "kind": "v12.0",
            "location": "centralus"
        }
        ....... 100+ elements .......
    ],
    "nextLink": "https://management.azure.com/subscriptions/d499a666-e7a1-44ba-beef-5555323b773e/resourceGroups/smy-sql-servers/resources?api-version=2018-01-01&%24skiptoken=eyJuZXFydGl0aW9uS2V5IjoiMSE4IU1FWkRRek0tIiwibmV4dFJvd0tleSI6IjEhMjEyIVJEUTVPVUUyTmpaRk4wRXhORFJDUVVKRlJVWTBRelpCTXpJelFqYzNNMFZmUjFKTUxWTklRVkpGT2pKRVUxRk1PakpFVTBWU1ZrVlNVeTFOU1VOU1QxTlBSbFE2TWtWVFVVdzZNa1pUUlZKV1JWSlRPakpHVTBoh4T2pKRVExVTZNa1F4T2pKR1JFRlVRVUpCVTBWVE9qSkdTVlpRT2pWR016azROeTFEUlU1VVVrRk1WVk0tIn0%3d"
}

In addition, ResourceNames(rg-name, Microsoft.Sql/server) can leverage Azure REST API $filter syntax to filter out and it will not list all resources under that resource group

here is the discussion:
https://stackoverflow.com/questions/34270735/azure-rest-api-query-parameters-for-getting-all-the-virtual-machine