[DAEMON-5] appcd: JSON response filtering
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2016-03-19T22:23:31.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | appcd-core |
Labels | n/a |
Reporter | Chris Barber |
Assignee | Chris Barber |
Created | 2016-02-03T23:42:56.000+0000 |
Updated | 2016-10-21T22:23:05.000+0000 |
Description
All the ability to filter JSON responses based on criteria from a dispatcher path.
For example, requests to
/appcd/status/system
would return only the system information:
{
"platform": "darwin",
"arch": "x64",
"cpus": 8,
"hostname": "yojimbo.local",
"loadavg": [
1.609375,
1.78076171875,
1.80810546875
],
"memory": {
"usage": {
"rss": 41881600,
"heapTotal": 22978592,
"heapUsed": 17236152
},
"free": 97452032,
"total": 17179869184
}
}
Most of the filtering is thanks to carefully crafted dispatcher paths (regexes) and the observable model, gawk. So you can now run
appcd exec /appcd/status
to get a JSON object of the entire server status or add additional segments to the path to filter the response likeappcd exec /appcd/status/system
. You can even monitor individual values:appcd exec /appcd/status/appcd/uptime
.