Database Mapper Using the API
EOL: An end of life announcement has been made for Database Mapper on February 28, 2023. See the Solarwinds End of Life Policy for more information.
Introduction
The Database MapperREST API exposes multiple endpoints:
|
|
|
Security
Authentication
The API is authenticated by using Windows Authentication.
API Documentation
Accessing the documentation
The REST documentation output for your environment is located at:
http://{DMRHostName}:44322/swagger/index.html
Using the documentation
This documentation includes information about the parameters and examples of the request body and schema.
Note: Expand the HTTP method header line in the API documentation page for details.
From here you can use the Try it out button to test the API endpoints using your installation.
Database Mapper API documentation example with Try it out button.
Once you select the Try it out button, you will see the option to Execute the request. Enter parameter values as needed, then select Execute.
Execute request example
Open API specification
Additional Information: The Database Mapper API has an Open API specification document. There are many client tools that allow you to work with the API. See the Swagger Specification Documentation for more details on getting started.
Examples
Snapshots
You can use the Snapshots endpoint with PowerShell to manage your snapshots. If you wanted to call the API endpoint to get all of your solution IDs and run the request for each ID, you can snapshot all solutions with a single script (instead of scheduling them one-by-one):
$apiUrl = "http://{DMRHostName}:44322/api/v1/solutions"
$r = Invoke-RestMethod -Method Get -Uri $apiUrl -ContentType "application/json" -UseDefaultCredentials
ForEach($solution in $r){
$solutionId = $solution.id
$apiUrl = "http://localhost:44322/api/v1/solutions/$solutionId/snapshots"
$data = @{
'loggingLevel' = '2'
'solutionItemIds' = ''
}
$requestBody = $data | ConvertTo-Json -Compress
Invoke-RestMethod -Method Post -Uri $apiUrl -Body $requestBody -ContentType "application/json" -UseDefaultCredentials
}
Note: Remember to update {S1DHostName}
in the script to your environment's host name.
If you wanted to make a request for a specific solution (instead of using the scheduling command line), you could run this:
$apiUrl = "http://localhost:44322/api/v1/solutions/{solutionId}/snapshots"
$data = @{
'loggingLevel' = '2'
'solutionItemIds' = ''
}
$requestBody = $data | ConvertTo-Json -Compress
Invoke-RestMethod -Method Post -Uri $apiUrl -Body $requestBody -ContentType "application/json" -UseDefaultCredentials