Titanium JIRA Archive
Appcelerator Daemon (DAEMON)

[DAEMON-5] appcd: JSON response filtering

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusResolved
ResolutionFixed
Resolution Date2016-03-19T22:23:31.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsappcd-core
Labelsn/a
ReporterChris Barber
AssigneeChris Barber
Created2016-02-03T23:42:56.000+0000
Updated2016-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
  }
}

Comments

  1. Chris Barber 2016-03-19

    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 like appcd exec /appcd/status/system. You can even monitor individual values: appcd exec /appcd/status/appcd/uptime.

JSON Source