6.1.2.4. Examples
% curl https://mta1/api/protobuf -d '{ "version": { "major": 6, "minor": 5 }, "program": "smtpd", "command": "q" }' \
-H "Content-Type: application/json" \
-H "X-API-Key: badsecret"
{
"process": {
"pid": "145",
"runtime": "4235"
},
...
{
"version": { "major": 6, "minor": 5 },
"program": "smtpd",
"command": "F",
"payload": {
"conditions": {
"senders": [
{ "domain": { "value": "example.org" }},
{ "domain": { "value": "example.com" }}
]
}
}
}
The command line interface has two arguments called
--json-request
and --json
which dumps the request and response Protobuf
data as JSON. It can be very helpful when working with the HTTP/JSON API.
$ halonctl queue update --bounce --state DEFER --jobid foobar --json-request --json
{
"conditions": {
"queues": [
{
"queue": "DEFER"
...