Skip to main content

Config

Config

This call allows changing the core server configuration, including enabled outputs and the API port. Requests take the following form:

{
"config": {

//All of the below members are optional, and will only override their currently set values when given.
//To unset a value, set it to null, which will activate the default setting.

"controller": { //controller settings. Any of these may be left out or null to set the default.
"interface": "0.0.0.0", //interface to listen on. Defaults to 0.0.0.0 = all interfaces.
"port": 4242, //port to listen on. Defaults to 4242.
"username": "root", //username to drop privileges to. Defaults to root.
"debug": 3 // Debug level to run entire server under. Defaults to 3 (production level).
},
"protocols": [ //enabled outputs (named protocols here for historical reasons)
{
"connector": "HTTP" //Name of the output to enable
//any required and/or optional settings may be given here as "name": "value" pairs inside this object.
},
//above structure repeated for all enabled connectors / protocols
],
"triggers": { //Pro-only: list of enabled triggers
"SOME_TRIGGER": [
{
"handler": "/some/handler", //handler of trigger
"sync": true, //true if blocking, false otherwise
"streams": ["optional", "stream", "list"], //List of streams to trigger for
"params": "optional parameters"
},
//Or... (deprecated syntax)
["handler", nonblocking, ["optional", "stream", "list"]],
//Multiple handlers may be defined, a mixture of the above syntaxes is supported
],
//Multiple triggers may be defined. For details, see manual chapter on triggers!
},
"serverid": "", //human-readable server identifier
"prometheus": "", //Passphrase for prometheus access. When empty, prometheus access is disabled (default).
"accesslog": "LOG", //Where to write the access log. When set to LOG, prints to regular log (default).
"defaultStream": "" //Global default stream setting, when a requested stream cannot be opened by an output
}
}

Similarly to the call, all enabled outputs must be given at once. To add or remove outputs incrementally, see the "", "" and "" calls. Any/all changed settings will take immediate effect.

MistServer will respond as follows:

{
"config": {
"controller": {}, //controller settings, same as in request.
"protocols": [ //enabled outputs
{
"connector": "HTTP" //Name of the output
//any required and/or optional settings will be included here as well
"online": 1 //0 = offline, 1 = online, 2 = enabled (on demand)
},
//above structure repeated for all enabled outputs
],
"triggers": {},//Configured trigger list. Same format as in request.
"serverid": "", //human-readable server identifier, as configured.
"iid": "12345678", //Instance ID. Unique ID for this currently running instance, changes every restart.
"time": 1398982430, //Current server unix time.
"version": "2.7/Generic_64", //Currently running server version string.
"prometheus": "", //Passphrase for prometheus access.
"accesslog": "LOG" //Current accesslog storage location.
}
}