Database Orchestration
Different database environments have a variety of tools to provide ways to promote and manage the databases, such as the MySQL Orchestrator. In order to integrate with these tools better, Heimdall has a simplified API call that allows the server state for a data source to be downloaded, adjusted, and uploaded. Examples:
To download the server configuration for a given data source:
wget --http-user=admin --http-password=<password> http://demoa.heimdalldata.com:8087/api/config/source/<source name>/servers
This will provide a file named "servers" with a format as follows (in json):
[
{
"name": "Primary",
"url": "jdbc:postgresql://pg.cfjxl5jnvj49.us-east-1.rds.amazonaws.com:5433/${catalog}",
"enabled": true,
"writeable": true,
"weight": 1,
"readWeight": 0,
"writeWeight": 0,
"active": true,
"failed": false,
"maxLag": 2147483647
},
{
"name": "Secondary test",
"url": "jdbc:postgresql://pg.cfjxl5jnvj49.us-east-1.rds.amazonaws.com:5433/${catalog}?readOnly\u003dtrue",
"enabled": true,
"writeable": false,
"weight": 8,
"readWeight": 0,
"writeWeight": 0,
"active": true,
"failed": false,
"maxLag": 2147483647
}
]
This can then be edited as needed in the context of the events that have happened, and uploaded back to Heimdall with the following:
wget --http-user=admin --http-password=<password> --post-file=servers http://demoa.heimdalldata.com:8087/api/config/source/<source name>/servers/1 --header=Content-Type:application/json
Note: The "1" at the end of the URL represents a configuration version number, not a server ID, and should remain 1 in general.