Prev: Next: Up: Top[Contents][Index]


Appendix C Old Control Output Format

Prior to version 4.18, JSON output from pound control interface differred from the current format (see Input object) in several important aspects:

  1. Objects didn’t carry the kind attribute.
  2. The full listing object incorporated attributes from the core listing directly, instead of storing them under the core attribute.
  3. The core listing object lacked uptime attribute.

In the absense of explicit indication of the object type being passed (see pt. 1 above), templates were using an heuristics based on the presence or absence of certain attribute to deduce the object type in question. This heuristic is described in the following pseudo-code fragment:

{{if exists . "listeners" }}
  {{/* This is a full listing, as requested by poundctl list. */}}
  ...
{{else if exists . "services"}}
  {{/* Single listener, as requested by poundctl list /L.
       Notice that this attribute is present in the full listing as
       well, so presence of "listeners" should be checked first. */}}
  ...
{{else if exists . "backends"}}
  {{/* Single service, as requested by poundctl list /L/S. */}}
  ...
{{else if exists . "pid"}}
  {{/* Core statistics (poundctl core) */}}
  ...
{{else}}
  {{/* Backend listing (poundctl list /L/I/B) */}}
  ...
{{end}}

For backward compatibility, template file shipped with pound version 4.23 checks whether kind attribute is present, and if it is not, falls back to using the heuristics above.