简体   繁体   中英

List of Azure SQL databases - usage by server using REST API

I can get a database usage report (including DB actual and maximum size) for a single database using REST API:

https://learn.microsoft.com/en-us/rest/api/sql/2021-05-01-preview/database-usages/list-by-database?tabs=HTTP

I want to get the same database usage report by server name for all the databases on that server. Is it possible using the Azure REST API?

You can list of all databases contained on that Azure SQL logical server using this REST API .

GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases?api-version=2021-05-01-preview

You can then iterate through the list returned and get the database usage for each database using the REST API you referenced in your question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM