alt-dima / tofugu

Infrastructure layers configuration orchestrator for OpenTofu or Terraform
Apache License 2.0
0 stars 0 forks source link

Toaster-ToasterDB beta-testers wanted! #10

Open alt-dima opened 2 months ago

alt-dima commented 2 months ago

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 like

Please execute in shell to set toasterurl:
export toasterurl=https://6634b72292e9e996105de19e:generatedpassword@toaster.altuhov.su

Swagger 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, CircleCI

Feel free to post your feedback in the comments! Thank you!

alt-dima commented 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]
alt-dima commented 2 months ago

Swagger API docs (full API documentation and examples): https://app.swaggerhub.com/apis-docs/altuhovsu/tofugu_toaster_api/