I noticed that there is no sub-command to list the existing policy for a system, so
tried writing one [1]. My primary objective is to of course having it as a sub-command,
unless there was another reason other than time that it wasn't added earlier.
The second objective is to use it as the second example in our developer guide
to show how you expose controller methods and write a client to access it.
Example usage:
# bkr policy-list --system beaker-test-vm1 --hub
http://localhost/bkr --username admin
--password foobar
{
"rules": [
{
"everybody": true,
"permission": "control_system",
"group": null,
"id": 1,
"user": null
},
{
"everybody": true,
"permission": "reserve",
"group": null,
"id": 4,
"user": null
}
],
"possible_permissions": [
{
"value": "edit_policy",
. ..
. ..
The authentication bit is not required I suspect.
[1]
http://paste.fedoraproject.org/41757/13800067/
Thoughts and suggestions welcome.
Best,
Amit.
--
Amit Saha <
http://echorand.me>
Infrastructure Engineering and Development
Red Hat, Inc.