Use cases
A Cloverleaf software developer is asked to develop an application where users can add or modify Cloverleaf objects through a custom-built front-end. The developer users the RESTful API to develop the front-end applications that use Cloverleaf objects.
Command line API example:
A user has a script for running on the server using an API. The user places the script in a specific directory on the site. The API is configured to only run user-defined scripts from this site. The user develops a Client-side utility that runs the script using the API and processes the output.
Command line API using Curl example:
A user has a script for running on the Server using an API. The user places the script in a specific directory on the site. The API is configured to only run user-defined scripts from this site. The user runs the Client-side utility that runs the script using the API through Curl and processes the output.
Adding Cloverleaf objects
When adding Cloverleaf objects, a software developer can create an application for users to add or modify Cloverleaf objects through a custom-built user interface.
For a command line API through Curl, if you have a script that is required to run on the server through an API, then you can:
- Place the script in a specific directory on the site.
- Configure the API to run only user-defined scripts from this site.
- Run the client-side utility that runs the script through the API using Curl to process the output.
Examples:
-
curl -G https://127.0.0.1:15057/clapi/api/sites/helloworld/alerts -k --header "Authorization:Basic dXNlckE6MTExMTEx" -v (dXNlckE6MTExMTEx is base64 encoded user:password authentication string "userA:111111")
-
curl https://127.0.0.1:15057/clapi/api/root/preferences -k --header "Authorization:Basic dXNlckE6MTExMTEx" -H "Content-Type:application/json" --data-binary @data.json -v