CloudCasa APIs
Most of the CloudCasa functionality can be accessed using REST APIs. For some details in this regard, please see the API guide at https://docs.cloudcasa.io/apiguide/.
This section will cover some information that is specific to self hosted installations.
Swagger
Follow these steps if you want to use Swagger UI to explore CloudCasa APIs:
Create an API key by visiting the page Configuration => API Keys. Make sure you select the correct role.
Start Swagger UI. There are many different ways to do this but here is one of the easiest:
docker run -p 9000:8080 -e SWAGGER_JSON_URL=https://<CLOUDCASA-FQDN>/api-docs swaggerapi/swagger-ui
Then, visit “http://localhost:9000”.
Click on “Authorize” in Swagger UI and enter the api key created in the previous step.
You can now exercise APIs. Do note that PUT, PATCH, and DELETE methods need “If-Match” header to be set to “etag” value of the resource you are trying to access. This can be found by doing GET of the same resource and taking the value from “_etag” field.
Note that OpenAPI spec file can be obtained by doing GET on https://<CLOUDCASA-FQDN>/api-docs. For example:
# If using self signed certificate, pass "-k" option to curl.
curl -so cloudcasa-api-spec.json https://<CLOUDCASA-FQDN>/api-docs
This will be handy if you start Swagger UI using some other method and need to import api spec file.