Create a MariaDB Cluster

The request creates a new MariaDB cluster.

Note:

  • Only contract administrators, owners, and users with Access and manage DBaaS privilege are allowed to create and manage databases.

  • After creating a database, you can access it via the corresponding LAN using the same username and password specified during creation.

  • This is the only opportunity to set the username and password via the API. The API does not provide a way to change the credentials yet. However, you can change them later using raw SQL.

The data center must be provided as a UUID. The easiest way to retrieve the UUID is through the Cloud API.

Note: The sample UUID is 498ae72f-411f-11eb-9d07-046c59cc737e.

Request

curl -X 'POST' \
  'https://mariadb.de-txl.ionos.com/clusters' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "metadata": {
    "createdDate": "2020-12-10T13:37:50+01:00",
    "createdBy": "john.doe@example.com",
    "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "lastModifiedDate": "2020-12-11T13:37:50+01:00",
    "lastModifiedBy": "jane.doe@example.com",
    "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "state": "BUSY"
  },
  "properties": {
    "mariadbVersion": "10.6",
    "instances": 2,
    "cores": 4,
    "ram": 2,
    "storageSize": 10,
    "connections": [
      {
        "datacenterId": "5a029f4a-72e5-11ec-90d6-0242ac120003",
        "lanId": "2",
        "cidr": "192.168.1.100/24"
      }
    ],
    "displayName": "MariaDB cluster",
    "maintenanceWindow": {
      "time": "16:30:59",
      "dayOfTheWeek": "Monday"
    },
    "credentials": {
      "username": "db-admin",
      "password": "TopSecret!"
    }
  }
}'

Response

Your values will differ from those in the sample code. It may contain different IDs, timestamps etc.

You may have noticed that the metadata.state is BUSY and that the database is not yet reachable. This is because the cloud will create a completely new cluster and needs to provision new nodes for all the requested replicas. This process runs asynchronously in the background and might take up to 30 minutes.

202 Successful operation

{
  "type": "cluster",
  "id": "498ae72f-411f-11eb-9d07-046c59cc737e",
  "metadata": {
    "createdDate": "2020-12-10T13:37:50+01:00",
    "createdBy": "john.doe@example.com",
    "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "lastModifiedDate": "2020-12-11T13:37:50+01:00",
    "lastModifiedBy": "jane.doe@example.com",
    "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "state": "BUSY"
  },
  "properties": {
    "displayName": "MariaDB cluster",
    "mariadbVersion": "10.6",
    "dnsName": "ma-yourcluster.mariadb.region.ionos.com",
    "instances": 2,
    "ram": 2,
    "cores": 4,
    "storageSize": 10,
    "connections": [
      {
        "datacenterId": "5a029f4a-72e5-11ec-90d6-0242ac120003",
        "lanId": "2",
        "cidr": "192.168.1.100/24"
      }
    ],
    "maintenanceWindow": {
      "time": "16:30:59",
      "dayOfTheWeek": "Monday"
    }
  }
}

After creation, remember to validate the status of your MariaDB cluster. For more information, see Verify the Status of a MariaDB Cluster.

Last updated