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
A few examples of a selection of these endpoints follow
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.
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 example:
{
"payloadType": "BackupCapabilitiesPayload",
"payloadVersion": "1",
"payload": {
"storageAgents": [
"fs"
],
"backupAgents": [
"mariabackup-full",
"mariabackup-incremental",
"mysqldump",
"xtrabackup-incremental",
"xtrabackup-full",
"mariabackup",
"xtrabackup"
],
"defaultBackupAgent": "mysqldump",
"defaultStorageAgent": "fs"
}
}
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