This page describes the APIs that can be used to retrieve and update StandbyMP 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:
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:
{ "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:
{ "Status": 200, "Result": {} }
Configuration(s) API Usage Examples
For getting comprehensive JSON output results, while using API, we parse all outputs with “jq” which can be easily installed by for example as root:
yum install jq
In all below examples we use authentication method via “-u” for authentication method via cookie, check the /wiki/spaces/DSMP/pages/3432415233 page
Configuration Details
To list all configurations keys and values information run:
curl -sku admin:admin https://localhost:4433/api/configurations | jq
List specific value for any key for all configurations:
curl -sku admin:admin https://localhost:4433/api/configurations | jq \ '.Result[].PrimaryAgentManagerId, .Result[].ConfigurationName'
To see specific value for specific key for specific configuration (In this example called MEGA):
curl -sku admin:admin https://localhost:4433/api/configurations | jq \ '.Result[] | select(.ConfigurationName=="MEGA") | .Settings.AutomatedStandbyUpdate.Enabled'
Another example of listing all configurations and names with automated standby update disabled:
curl -sku admin:admin https://localhost:4433/api/configurations | jq \ '.Result[] | select(.Settings.AutomatedStandbyUpdate.Enabled==false) | .ConfigurationName'