When you need an empty database for a new application, you can create it with a database resource template. The template is configured to allocate resources to the database.

Create an organization. See Create an Organization.

Create a database group. See Create a Database Group.

Enable a base DB template. See Enable a Base DB Template.

1

Retrieve information about database groups.

GET https://example.aurora.com/datadirector/api/dbgroups 
2

Retrieve information about the resource template for the organization in which you want to create the database.

GET https://example.aurora.com/datadirector/api/org/82/resourcetemplates 
3

Retrieve information about the base DB template.

GET https://example.aurora.com/datadirector/api/basedbtemplates
4

Retrieve data about the DB parameter groups for the organization that you want to use and the base DB template that you selected in the previous call.

DB parameter groups are associated with base DB templates and contain the database configuration settings that can be used to provision database instances. The database configurations can vary for different database engines.

GET https://example.aurora.com/datadirector/api/org/82/basedbtemplate/5/dbparametergroups

You can now use the information that you collected to create the database. The HTTP POST call includes payload data that might be included as application code in a Python or JavaScript application.

5

Create the database.

POST https://example.aurora.com/datadirector/api/databases

{
  "dbgroupId": 93,
  "parameterGroupSetting": {
    "parameterGroupId": 9
    },
  "name": "Aurora",
  "dbName": "Aurora",
  "administratorConfig": {
    "ownerName": "Aurora",
    "ownerPassword": "Aurora"
    }, 
  "resourceSetting": {
    "resourceTemplateId": 88
    },
  "baseDbTemplateId":5
}

The response that the system returns might look as follows.

202 Accepted location : https://example.aurora.com/datadirector/api/task/6

The following example shows all elements of the creation process discussed above together. The example assumes that you created a database group and a base DB template, and assigned the base DB template to a resource template. It also assumes that the template is enabled in the organization to which the database group belongs. The resource template and backup template used in this example are available by default, so you do not have to create them.

POST https://example.aurora.com/datadirector/api/databases
Content-type : application/json
Authorization : Basic YWRtaW5AYXVyb3JhLnZtd2FyZS5jb206Y2xvdWRibXM=
Accept : application/json

{
  "administratorConfig": {
     "ownerName": "Aurora",
     "ownerPassword": "Aurora"
  },
  "backupSetting": {
     "backupTemplateId": 15
  },
  "baseDbTemplateId": 1,
  "dbName": "Aurora_provision",
  "dbgroupId": 26,
  "description": "RestApiExample: provision database",
  "ipWhitelistConfig": {
     "enabled": true,
     "ipWhitelistDbIpRange": {
        "instance": [
           {
              "beginAddress": "10.37.1.1",
              "description": "ip range",
              "enabled": true,
              "endAddress": "10.37.1.100"
           },
           {
              "beginAddress": "10.37.1.105",
              "description": "single ip",
              "enabled": false,
              "endAddress": "10.37.1.105"
           }
        ]
     }
  },
  "name": "Aurora_provision",
  "parameterGroupSetting": {
     "parameterGroupId": 2
  },
  "resourceSetting": {
     "resourceConfig": {
        "cpuReservationMHz": 0,
        "highAvailabilityEnabled": true,
        "memoryMb": 2000,
        "memoryReservationMb": 0,
        "priority": "Automatic",
        "storageGb": 10,
        "swapstorageMb": 3000,
        "vCpuNumber": 1
     }
  },
  "takeSnapshotAfterCreation": true
}