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/v8/replicator/services/west/backup'
or
POST 'https://127.0.0.1:8097/api/v8/replicator/services/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.
backup-capabilities
Returns the defined backup capabilities for the service.
This is a GET request to
GET 'https://127.0.0.1:8097/api/v8/replicator/services/west/backup-capabilities'
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"
}
}
role
Changes the role of the replicator service.
This is a POST request
PUT 'https://127.0.0.1:8097/api/v8/replicator/services/west/role'
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