Transactional Storage Size Selections with the SkySQL DBaaS API
This page is part of MariaDB's Documentation.
The parent of this page is: Launch-Time Selections for the SkySQL DBaaS API
Topics on this page:
Overview
This reference page details how to select transactional storage sizes with the SkySQL DBaaS API for SkySQL.
Available Transactional Storage Sizes
Transactional storage size choices are specific to each topology.
For Foundation tier:
Topology | Available Sizes |
---|---|
|
|
|
|
|
|
|
|
For Power tier:
Topology | Available Sizes |
---|---|
|
|
|
|
|
|
|
|
REST Client
A REST client can use the SkySQL DBaaS API to query storage size selections and choose a storage size for a new service.
Query Options with REST Client
A REST client can query the SkySQL DBaaS API for the hardware architecture selections for a specific topology.
To see the available storage sizes for a topology, use curl
to call the /provisioning/v1/topologies/${TOPOLOGY_NAME}/storage-sizes
API endpoint:
$ curl -sS --location \
--header "Authorization: Bearer ${SKYSQL_API_KEY}" \
'https://api.mariadb.com/provisioning/v1/topologies/es-single/storage-sizes' \
| jq .
[
{
"id": "5ce68752-8e14-49ae-a4e1-a55b926e7561",
"tier": "foundation",
"topology": "es-single",
"storage_sizes": [
100,
200,
300,
400,
500,
600,
700,
800,
900,
1000
]
}
]
The output can show different storage sizes, depending on whether your SkySQL account is Foundation tier or Power tier.
Select Option with REST Client
A storage size is selected during service launch. When using a REST client, select a transactional storage size by calling the /provisioning/v1/services
API endpoint with the storage
attribute set.
For example, prepare a request body containing the desired service options in a file called request-service.json
:
$ cat > request-service.json <<EOF
{
"service_type": "transactional",
"topology": "es-single",
"provider": "gcp",
"region": "us-central1",
"architecture": "amd64",
"size": "sky-2x8",
"storage": 100,
"nodes": 1,
"version": "10.6.11-6-1",
"name": "skysql-nr-quickstart",
"ssl_enabled": true
}
EOF
Then use curl
to call the /provisioning/v1/services
API endpoint to create (launch) a new database service and save the response to the response-service.json
file:
$ curl -sS --location --request POST \
--header "Authorization: Bearer ${SKYSQL_API_KEY}" \
--header "Accept: application/json" \
--header "Content-type: application/json" \
--data '@request-service.json' \
https://api.mariadb.com/provisioning/v1/services \
| tee response-service.json | jq .
Upon success, the command will return JSON with details about the new service.
Terraform
Terraform can use the SkySQL Terraform provider to choose a storage size for a new service. When using Terraform, select a transactional storage size using the storage
attribute for the skysql_service
resource:
# Create a service
resource "skysql_service" "default" {
service_type = "transactional"
topology = "es-single"
cloud_provider = "gcp"
region = "us-central1"
architecture = "amd64"
size = "sky-2x8"
storage = 100
nodes = 1
version = "10.6.11-6-1"
name = "skysql-nr-quickstart"
ssl_enabled = true
deletion_protection = true
wait_for_creation = true
wait_for_deletion = true
wait_for_update = true
is_active = true
}