Open alt-dima opened 2 months ago
Example usage in Jenkins groovy:
import groovy.json.JsonSlurper
def toasterDimValuesRequest(String dimkey){
def accessToken = "662cab7c5e116819738b01fe:wrongpass".bytes.encodeBase64().toString()
def req = new URL("https://toaster.altuhov.su/api/dimension/demo-org/${dimkey}").openConnection();
req.setRequestProperty("Authorization", "Basic " + accessToken)
def content = req.getInputStream().getText()
json = new JsonSlurper().parseText(content)
return json.Dimensions.DimValue
}
println(toasterDimValuesRequest("datacenter"))
println(toasterDimValuesRequest("account"))
Result:
[staging1, staging2]
[test-account]
Swagger API docs (full API documentation and examples): https://app.swaggerhub.com/apis-docs/altuhovsu/tofugu_toaster_api/
Please go to https://toaster.altuhov.su/ , fill form with Account Name, Email and press
Create User
You will receive a message with generated credentials and ready-to-use export command likeSwagger API docs (full API documentation and examples): https://app.swaggerhub.com/apis-docs/altuhovsu/tofugu_toaster_api/
To upload/update dimensions in Toaster from your Inventory Files repo you could use inventory-to-toaster.sh script example and execute it like
bash examples/inventory-to-toaster.sh examples/inventory/
It could be used in
tofugu
and directly from any other your application, for example: Jenkins, CircleCIFeel free to post your feedback in the comments! Thank you!