Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
curl -s \
-H 'Authorization: Bearer <token>' \
-d '<data>' \
'http://<unimus-address>:8085/api/v1v2/<API-path>' | json_pp

Explanation:
-s  : makes curl run silent - not show request processing, etc.
-H : adds HTTP headers needed to communicate with Unimus API
-d  : data needed for various requests - not always needed

...

Code Block
curl -H "Authorization: Bearer <token>" "http://<unimus-address>:8085/api/v1v2/<API-path>"

You will need to substitute the values inside <...> for your actual values:

...

Code Block
curl -s \
-H 'Authorization: Bearer <token>' \
'http://<unimus-address>:8085/api/v1v2/health' | json_pp


Output:

...

Code Block
curl -s \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer <token>' \
-d '{"address":"<address>"}' \
'http://<unimus-address>:8085/api/v1v2/devices' | json_pp


Output:

...

Code Block
curl -s \
-H 'Authorization: Bearer <token>' \
'http://<unimus-address>:8085/api/v1v2/devices/findByAddress/1.1.1.1' | json_pp

...

Code Block
curl -s \
-H 'Authorization: Bearer <token>' \
-X PATCH \
'http://<unimus-address>:8085/api/v1v2/jobs/backup?id=57' | json_pp


Output:

...

Code Block
curl -s \
-H 'Authorization: Bearer <token>' \
'http://<unimus-address>:8085/api/v1v2/devices/57/backups/latest' | json_pp

...