Question

JJJerry on Wed, 19 Jul 2017 18:05:03


Azure Database for MySQL server is still in preview, though we can created database instance on it. I wonder do we have any API to retrieve the databases that we created on Azure Database for MySQL server? API for metrics of those databases? Same questions for Azure Database for PostgreSQL server. Thanks! Screenshot here: https://i.stack.imgur.com/opaFZ.png


Sponsored



Replies

Tao Wu_MSFT on Thu, 20 Jul 2017 06:49:10


API is already available. Documentation is lag behind. We have recorded your requirement, and will publish API documentation on https://docs.microsoft.com/en-us/azure/mysql/ soon. Thanks!

JJJerry on Thu, 20 Jul 2017 14:41:07


Hi Lin, thanks for replying. Actually I was able to query metrics for Azure DB for MySQL by replacing the resource-id:

https://management.azure.com/{resource-id}/providers/microsoft.insights/metrics?api-version={api-version}&$filter={filter-expression}

When I use java to connect to Azure, I will get an Azure object (com.microsoft.azure.management.Azure). 

We can get all the VM instances by azure.virtualMachines();

I wonder how can we get the Azure DB for MySQL server "instance" or the "database instances" on it?

JasonHowell on Tue, 25 Jul 2017 00:25:58


To get the list of servers in your subscription:

GET /subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/servers?api-version=2017-04-30-preview

To get the list of databases in your server:

GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/databases?api-version=2017-04-30-preview

We'll have the Rest API documentation done soon. Hopefully this week. 

Thanks, Jason

JasonHowell on Tue, 01 Aug 2017 17:01:55


We published the REST API docs here https://docs.microsoft.com/en-us/rest/api/mysql/