This page describes the APIs that can be used to retrieve and update StandbyMP Configurations information as well as to perform StandbyMP Tasks and Actions.
Table of Contents |
---|
Security
All requests are made over HTTPS.
Authentication API
Purpose:
Returns existing authentication cookie in a header.
API:
POST /api/login
Request body:
Code Block |
---|
{
"UserName": "USERNAME",
"Password": "PASSWORD"
} |
Successful response body:
Code Block |
---|
{
"Status": 200,
"Result": {}
} |
Successful response header example:
Code Block |
---|
Set-Cookie: dbvisit-standby=MTY0Njg2NTYwOHxEdi1CQkFFQ180SUFBUkFCRUFBQUxmLUNBQUVHYzNSeWFXNW5EQVVBQTNOcFpBWnpkSEpwYm1jTUVnQVFaVEV5TnpnMVkyTTJOREV4TlRJeE53PT18W39Sxb15sXZWvlEQ-mEFcwfusDjPXuFY-CXsaDu6CAU=; Path=/; Expires=Fri, 08 Apr 2022 22:40:08 GMT; Max-Age=2592000 |
A successful response header contains a cookie that must be supplied along with future API calls.
Alternatively, each request can contain an Authorization header using HTTP BASIC authentication specifying the user name and password.
Curl example of calling Configuration(s) API with HTTP BASIC authentication :
curl -k -u admin:admin https://localhost:4433/api/configurations/1
where username is “admin“ and password is “admin“
Configurations
Configuration(s) Listing API
Purpose:
Returns existing Configuration(s) and related settings, such as Automated Standby Update, Standby Update Delay, Email and Slack settings, Observer, etc.
API:
GET /api/configurations
to get information about all the Configurations
GET /api/configurations/{configurationId}
to get information about the specific one
Request body:
None.
Curl example:
curl -k -u admin:admin https://localhost:4433/api/configurations/1
Successful response body:
Expand | |||||
---|---|---|---|---|---|
|
Edit Configuration API
Purpose:
Allows updating Configuration parameters and settings, such as Automated Standby Update, Standby Update Delay, Email and Slack settings, Observer, etc.
Warning: This API allows to change all the Configuration parameters. Please be careful while using.
Parameters in the request body override only the corresponding parameters in Configuration.
API:
PUT /api/configurations/{configurationId}
to bulk update parameters,
PUT /api/configurations/{configurationId}/Settings/AutomatedStandbyUpdate/Enabled
to update 1 parameter
Request body:
Code Block | ||
---|---|---|
| ||
{
"Settings": {
"AutomatedStandbyUpdate": {
"Enabled": false
}
}
} |
Curl example:
curl -k -u admin:admin -X PUT -d '{"Settings": {"AutomatedStandbyUpdate": {"Enabled": false}}}' https://localhost:4433/api/configurations/1
OR
curl -k -u admin:admin -X PUT -d 'false' https://localhost:4433/api/configurations/1/Settings/AutomatedStandbyUpdate/Enabled
Successful response body:
Code Block | ||
---|---|---|
| ||
{
"Status": 200,
"Result": {}
} |
Dashboard
Configuration(s) full information with current states API
Purpose:
Allows getting up-to-date information about Configuration(s), including the Configurations states (Busy, in Failover State, etc.) and Databases states (ONLINE, RECOVERING, etc), log gap, and others.
API:
POST /api/dashboard
to get information about all Configurations
POST /api/dashboard/{configurationId}
to get information about the specific one
Request body:
None.
Curl example:
curl -k -u admin:admin -d '{}' https://localhost:4433/api/dashboard
Successful response body:
Expand | |||||
---|---|---|---|---|---|
|
Create a Task API
Purpose:
Allows creating a task (performing an Action) for a Configuration.
Recommended list of tasks:
backupAndSend - Create Backup Log & Send to Standby
applyBackup - Apply Backup Log onto Standby Database
failOver - Activate Standby
Other Tasks can be launched using this API as well.
API:
POST /api/tasks
Request body:
Code Block | ||
---|---|---|
| ||
{
"Task": {
"ConfigurationId": 1,
"Script": "backupAndSend",
"Params": {}
}
} |
Curl example:
curl -k -u admin:admin -d '{"Task":{"ConfigurationId":1,"Script":"backupAndSend","Params":{}}}' https://localhost:4433/api/tasks
Successful response body:
Expand | |||||
---|---|---|---|---|---|
|
Get Task progress API
Purpose:
Allows getting actual task progress (Started, In Progress, Success, Error) together with description message.
API:
GET /api/tasks/{taskId}
Request body:
None
Curl example:
curl -k -u admin:admin https://localhost:4433/api/tasks/1
Successful response body:
Code Block | ||
---|---|---|
| ||
{
"Status": 200,
"Result": {
"TaskId": 1,
"State": "In Progress",
"Progress": [
{
"Timestamp": "2022-02-28T15:36:12Z",
"Message": ""
},
{
"Timestamp": "2022-02-28T15:36:12Z",
"Message": "Starting to do the thing"
}
]
}
} |