This is the question about the Azure Management Libraries for Java.
First, some background:
The Azure Management REST API mentions at the createorupdate definition the ability to create the database and set different database properties like this (example from the page):
{
"location": "southeastasia",
"sku": {
"name": "S0",
"tier": "Standard"
},
"properties": {
"createMode": "Default",
"collation": "SQL_Latin1_General_CP1_CI_AS",
"maxSizeBytes": 1073741824
}
}
I'm looking how to do the similar request from the Azure Management Libraries for Java.
So far I have found how to set the "sku" part. This is done by using the appropriate ServiceObjectiveName object:
final SqlServer sqlServer = ...get SQL server object ...;
final Creatable<SqlDatabase> myDb = sqlServer.databases()
.define(targetDBName)
.withServiceObjective(ServiceObjectiveName.fromString("S0"));
...
myDb.createAsync(...); // create the db with sku S0
But I can't figure out how to set the properties. For my purpose I need to set a bit different properties than in the sample. Namely, the specific properties.maxSizeBytes
and properties.autoPauseDelay
.
I even found the .withMaxSizeBytes()
method here but it's marked deprecated without any explanation.
I haven't found any way to set the autoPauseDelay
.