From verison 2.x on, iDNA Applications provides an external API for the following scenarios:
- With the API you can extract database and replica set information collected by iDNA Applications to use it in other applications
- With the API you can assign or update custom properties to databases or replica sets so that you can use them within iDNA Applications.
Postman
Use the Postman collection to test the API calls.
Note that you have to set the host variable in the in postman (under settings → manage environments).
The external API is located under https:/<IFA_host_name>/api/external/xxx
Authorization
In order to use the API an authorization header needs to be sent. We are using Basic Authentication, so the header should look like this:
if your credentials are for example user:password
- Authorization: Basic dXNlcjpwYXNzd29yZA==
the API returns 401 if
- No Authorization header is provided
- User credentials are wrong
- User Authority is insufficient
Database Instances
Description | URL | Payload | Response | Response Json |
---|---|---|---|---|
Get a list of all databases | GET {{host}}/api/external/databases Parameters: focus - boolean: filter focus databases e.g.: {{host}}/api/external/databases?focus=true | - | Returns an array of database objects with basic information. | |
Get a list of all databases with custom properties | GET {{host}}/api/external/databases/all/customProperties Parameters: resIds - string: comma separated list of res_id values that can be used to select specific databases e.g.: {{host}}/api/external/databases/all/customProperties?resIds=402,403,404 | - | Returns an array of database objects with custom properties | |
Get a list of all databases with detailed information | GET {{host}}/api/external/databases/all/details Parameters: resIds - string: comma separated list of res_id values that can be used to select specific databases e.g.: {{host}}/api/external/databases/all/details?resIds=402,403,404 | - | Returns an array of database objects with detailed information (including custom properties) |
ReplicaSets
Description | URL | Payload | Response | Response Json |
---|---|---|---|---|
Get a list of all replica sets | GET {{host}}/api/external/replicaSets Parameters: focus - boolean: filter focus databases e.g.: {{host}}/api/external/replicaSets?focus=true | - | Returns an array of replica set objects with basic information | |
Get a list of all replica sets with custom properties | GET {{host}}/api/external/replicaSets/all/customProperties Parameters: replicaIds- string: comma separated list of replicaid values that can be used to select specific replica sets e.g.: {{host}}/api/external/databases/all/customProperties?replicaIds=C1257E4B007EDE78,C12579AE0035A4B3,C1257714004555A9 | - | Returns an array of replica set objects with custom properties | |
Get a list of all replica sets with detailed information | GET {{host}}/api/external/replicaSets/all/details Parameters: replicaIds- string: comma separated list of replicaid values that can be used to select specific replica sets e.g.: {{host}}/api/external/databases/all/details?replicaIds=C1257E4B007EDE78,C12579AE0035A4B3,C1257714004555A9 | - | Returns an array of replica set objects with detailed information (including custom properties) |
Custom Properties
Description | URL | Payload | Response | Response Json |
---|---|---|---|---|
Get all custom properties | GET {{host}}/api/external/customProperties Parameters: type - string: can be used to filter for database or replica set custom properties e.g.: {{host}}/api/external/customProperties?type=rs {{host}}/api/external/customProperties?type=db | - | Returns an array of custom property objects |
Custom Property Assignments
Description | URL | Payload | Response | Response Json |
---|---|---|---|---|
Assign x custom properties to y databases | POST {{host}}/api/external/customPropertyAssignment/database Headers: Content-Type: application/json | { "targetIds": [402, 403, 404], "customProperties": { "1001009": "floushee", "1001005": "Very High" } } targetIds - comma separated list of database res_id values customProperties - an object with key / value pairs of custom property id and custom property value | updated - An array of created / updated custom properties error - Contains error information. e.g. if certain targetIds does not exist | |
Assign x custom properties to y replica sets | POST {{host}}/api/external/customPropertyAssignment/replicaSet Headers: Content-Type: application/json | { "targetIds": ["C1257E4B007EDE78", "C12579AE0035A4B3", "C1257714004555A9"], "customProperties": { "1001009": "floushee", "1001005": "Very High" } } targetIds - comma separated list of replicaset replicaid values customProperties - an object with key / value pairs of custom property id and custom property value | updated - An array of created / updated custom properties error - Contains error information. e.g. if certain targetIds does not exist |