10.2.2. Service Endpoints

Services can also be controlled individually through a number of endpoints. Some are the same as the main replicator service endpoints (service, status, online, offline, purge, reset), but other are specific to services, for a full list, review the Replicator API Developer Docs

A few examples of a selection of these endpoints follow

10.2.2.1. backupCapabilities

Returns the defined backup capabilities for the service.

This is a GET request to

GET 'https://127.0.0.1:8097/api/v2/replicator/service/west/backupCapabilities'

and returns a BackupCapabilitiesPayload, for exmaple:

{
  "payloadType": "BackupCapabilitiesPayload",
  "payloadVersion": "1",
  "payload": {
    "storageAgents": [
      "fs"
    ],
    "backupAgents": [
      "mariabackup-full",
      "mariabackup-incremental",
      "mysqldump",
      "xtrabackup-incremental",
      "xtrabackup-full",
      "mariabackup",
      "xtrabackup"
    ],
    "defaultBackupAgent": "mysqldump",
   "defaultStorageAgent": "fs"
  }
}

10.2.2.2. backup / restore

Backups or restores the service.

This is a POST request :

POST 'https://127.0.0.1:8097/api/v2/replicator/service/west/backup'
or
POST 'https://127.0.0.1:8097/api/v2/replicator/service/west/restore'

and a BackupPayLoad can be specified to provide different settings :

{
  "payloadType": "BackupPayload",
  "payloadVersion": "1",
  "payload": {
    "agentName": "mysqldump",
    "storageName": "fs"
  }
}

If no payload is provided, backup will use the default backup and storage agents, as shown by backupCapabilities, while restore will use the last available backup of the service.

10.2.2.3. setrole

Changes the role of the replicator service.

This is a POST request

POST 'https://127.0.0.1:8097/api/v2/replicator/service/west/setrole'

A payload is mandatory to specify which should be the new role, for example:

{
  "payloadType": "SetRolePayload",
  "payloadVersion": "1",
  "payload": {
    "role": "primary"
  }
}

Valid roles are : primary, replica, relay, archive, thl_server, thl_client, direct

For other calls, refer to the Replicator API Developer documentation.