Software Version Selections with the SkySQL DBaaS API

Overview

This reference page details how to select software versions with the SkySQL DBaaS API for SkySQL.

Available features vary based on software version.

Available Software Versions

Software version choices are specific to the product used by each topology.

MariaDB Enterprise ColumnStore

Software Version

Topology

23.02.3

csdw

MariaDB Enterprise Server

Software Version

Topology

10.4.30-20

es-replica

10.4.30-20

es-single

10.5.21-15

es-replica

10.5.21-15

es-single

10.6.14-9

es-replica

10.6.14-9

es-single

MariaDB Xpand

Software Version

Topology

6.1.1

xpand

REST Client

A REST client can use the SkySQL DBaaS API to query software version selections and choose a software version for a new service.

Query Options with REST Client

A REST client can query the SkySQL DBaaS API for the software version selections for a specific topology.

To see the available software versions for a topology, use curl to call the /provisioning/v1/versions API endpoint:

$ curl -sS --location \
   --header "Authorization: Bearer ${SKYSQL_API_KEY}" \
   'https://api.mariadb.com/provisioning/v1/versions?topology=es-single' \
   | jq .
[
  {
    "id": "c9ec06ab-aefb-48f5-a7e7-77b4cd23c17c",
    "name": "10.6.11-6-1",
    "version": "10.6.11-6",
    "topology": "es-single",
    "product": "server",
    "display_name": "Enterprise Server 10.6.11-6",
    "is_major": true,
    "release_date": "0001-01-01T00:00:00Z",
    "release_notes_url": "https://mariadb.com/docs/server/release-notes/mariadb-enterprise-server-10-6/10-6-11-6/"
  },
  {
    "id": "cdfa1230-bd14-4224-99b0-066808e138a0",
    "name": "10.5.18-13-1",
    "version": "10.5.18-13",
    "topology": "es-single",
    "product": "server",
    "display_name": "Enterprise Server 10.5.18-13",
    "is_major": true,
    "release_date": "0001-01-01T00:00:00Z",
    "release_notes_url": "https://mariadb.com/docs/server/release-notes/mariadb-enterprise-server-10-5/10-5-18-13/"
  },
  {
    "id": "48c9c49e-c031-49cb-a0dc-5e2e639a9ed3",
    "name": "10.4.27-18-1",
    "version": "10.4.27-18",
    "topology": "es-single",
    "product": "server",
    "display_name": "Enterprise Server 10.4.27-18",
    "is_major": true,
    "release_date": "0001-01-01T00:00:00Z",
    "release_notes_url": "https://mariadb.com/docs/server/release-notes/mariadb-enterprise-server-10-4/10-4-27-18/"
  }
]

For the version that you would like to select, extract the name attribute from the output and provide that value to the /provisioning/v1/services API endpoint as the version attribute.

Select Option with REST Client

A software version is selected during service launch. When using a REST client, select a software version by calling the /provisioning/v1/services API endpoint with the version 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 query software version selections and choose a software version for a new service.

Query Options with Terraform

Terraform can query the SkySQL Terraform provider for the software version selections for a specific topology using the skysql_versions data source:

data "skysql_versions" "default" {
  topology            = var.topology
}

Select Options with Terraform

When using Terraform, select a software version using the version 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             = coalesce(var.sw_version, data.skysql_versions.default.versions[0].name)
  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
}

In the above example, the coalesce() function is used to take the first non-null value from the sw_version variable or the skysql_versions data source.