This directory includes few small scripts that you can use to interact with the Agama REST API from shell.
Run the login.sh script to log into an Agama system.
By default it uses the Agama instance running at https://agama.local URL but
you can change the server URL with the -u option.
The password can be provided on the command line via the -p option, but be
careful, this reveals the password in the process list! If the password is not
specified on the command line the script asks for it interactively. This
is recommended to avoid leaking the password in the process list.
The login script creates the curl.conf file which contains the login token,
the used Agama URL and some more curl options which are used later when sending
requests.
For sending the API requests use the requests.sh script. The
first parameter is the API endpoint name (without the /api/v2 prefix). The
remaining parameters are just passed to the curl call unmodified so you can pass
whatever curl option you need.
Here are few request examples:
# reset the configuration
./request.sh config -X PUT -d '{}'
# partially update the configuration (select SLES with the GNOME pattern)
./request.sh config -X PATCH -d '{"update": {"product": {"id": "SLES"}, "software": {"patterns": ["gnome"] }}}'
# show current configuration (only the user configured options)
./request.sh config | jq
# show current configuration (including the default or pre-configured values)
./request.sh extended_config | jq
# show system details (available software patterns, hardware details )
./request.sh system | jq
# show the proposal
./request.sh proposal | jq
# show the current issues
./request.sh issues | jq