Skip to content

JsonStructureConf v1

Rostislav Spinar edited this page May 26, 2017 · 3 revisions

JSON STRUCTURE for Configuration

This document is draft under construction

This message category is used to configure deamon components.

The messages of this category are generally called JsonConfigMessage and can be referred as:

  • JsonConfigRequest if sent from a sender to the daemon.
  • JsonConfigResponse if sent from the daemon to the sender as the direct reply to the JsonConfigRequest.

Common parameters

The parameters described in this chapter are common and used in more message types. The parameters special for a particular message type are described in following chapters.

  • "ctype": "<STRING>" defines the category. It has to be conf.

  • "type": "<STRING>" is a type of the JsonConfigMessage and it is the key identification of an expected structure of the rest of the message. If received as a JsonConfigRequest the daemon passes the message to a parser component configured for the receiving channel to get the JsonConfigRequest to be processed by the daemon. If sent from the daemon as a JsonConfigResponse it plays the same role for the addressee of the message.

We have only one type referring as cfg_admin at present.

  • "msgid": "<STRING>" is the message identification unique for a sender. If used in JsonSchedulerMessage, it is repated in the counterpart. Then it can be used by the sender to match outgoing and incoming messages.

  • "cfgid": "<STRING>" is the identification of the component to be configured.

  • "properties": "<JSON>" each daemon component in the configuration has properties to be configured.

  • "status": "<STRING>" is a string with textual form of response code returned by a JsonSchedulerResponse. Possible values are described in dedicated chapter.

Status codes

The response code is passed by "rcode": <WORD> as a number or by "status": <STRING> in the textual representation. The textual form comes from DPA.h declarations with some additions:

NUMBER STRING Comment
0 STATUS_NO_ERROR
TODO

Components

We have not yet designed which component`s properties are to be configuerd in runtime. There are also security measures to be considered.

Input from real world deployment very much appreciated!

TracerFile

Runtime configuration of the main TracerFile.json as for illustration just now.

JsonConfigRequest:

{
  "ctype": "conf",
  "type": "cfg-admin",
  "msgid": "<STRING>",
  "cfgid": "config_tracer_file",
  "properties":{
    "[trace_file_name]": "<STRING>",
    "[trace_file_size]": "<INT>",
    "[verbosity_level]": "<STRING>"
  } 
}

JsonConfigResponse:

{
  "ctype": "conf",
  "type": "cfg-admin",
  "msgid": "<STRING>",
  "cfgid": "config_tracer_file",
  "properties":{
    "[trace_file_name]": "<STRING>",
    "[trace_file_size]": "<INT>",
    "[verbosity_level]": "<STRING>"
  },
  "status": "<STRING>"
}

Gateway runtime parameters

There is a mode in which gateway operates.

Mode

JsonConfigRequest:

{
  "ctype": "conf",
  "type": "mode",
  "msgid": "<STRING>",
  "cmd": "<STRING>"
}

JsonConfigResponse:

{
  "ctype": "conf",
  "type": "mode",
  "msgid": "<STRING>",
  "cmd": "<STRING>",
  "status": "<STRING>"
}