Skip to content

Update Server Configuration

Updates server configuration.

Request

HTTP Request

PATCH /node/api/configuration

Permissions

manage-configuration

Path parameters

No parameters required.

Request body

{
    "server": {
        "retain_expired_stat": false,
        "history_update_period": 15000,
        "stat_scan_period": 1000,
        "event_log_max_bytes": "1 G",
        "default_result_timeout": 2000,
        "incident_timeout": 60000,
        "email": {
            "disabled": false,
            "transport": {
                "service": "...",
                "auth": {
                    "user": "saymon@saymon.info",
                    "pass": "..."
                }
            },
            "fields": {
                "from": "saymon@saymon.info"
            },
            "max_json_length": 100000
        },
        "user": {
            "new_user_access": "not"
        }
    }
}

Response

Work in Progress

This topic is a work in progress and may be incomplete.

Examples

Request examples

login=<...>
password=<...>
saymon_hostname=<...>
url=https://$saymon_hostname/node/api/configuration

curl -X PATCH $url -u $login:$password \
    -H "Content-Type: application/json" \
    -d @- <<EOF
{
    "server": {
        "retain_expired_stat": false,
        "history_update_period": 15000,
        "stat_scan_period": 1000,
        "event_log_max_bytes": "1 G",
        "default_result_timeout": 2000,
        "incident_timeout": 60000,
        "email": {
            "disabled": false,
            "transport": {
                "service": "...",
                "auth": {
                    "user": "saymon@saymon.info",
                    "pass": "..."
                }
            },
            "fields": {
                "from": "saymon@saymon.info"
            },
            "max_json_length": 100000
        },
        "user": {
            "new_user_access": "not"
        }
    }
}
EOF
let login = <...>
let password = <...>
let saymonHostname = <...>
let path = "/node/api/configuration";
let auth = "Basic " + btoa(login + ":" + password);

let headers = new Headers();
headers.append("Content-Type", "application/json");
headers.append("Authorization", auth);

let data = JSON.stringify({
    "server": {
        "retain_expired_stat": false,
        "history_update_period": 15000,
        "stat_scan_period": 1000,
        "event_log_max_bytes": "1 G",
        "default_result_timeout": 2000,
        "incident_timeout": 60000,
        "email": {
            "disabled": false,
            "transport": {
                "service": "...",
                "auth": {
                    "user": "saymon@saymon.info",
                    "pass": "..."
                }
            },
            "fields": {
                "from": "saymon@saymon.info"
            },
            "max_json_length": 100000
        },
        "user": {
            "new_user_access": "not"
        }
    }
});

let requestOptions = {
    method: "PATCH",
    headers: headers,
    body: data
};

fetch(saymonHostname + path, requestOptions)
    .then(response => response.text())
    .then(result => console.log(result))
    .catch(error => console.log("error", error));
const http = require("http");

let login = <...>
let password = <...>
let saymonHostname = <...>
let path = "/node/api/configuration";
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");

let options = {
    "method": "PATCH",
    "hostname": saymonHostname,
    "headers": {
        "Authorization": auth,
        "Content-Type": "application/json"
    },
    "path": path
};

let req = http.request(options, function (res) {
    let chunks = [];

    res.on("data", function (chunk) {
        chunks.push(chunk);
    });

    res.on("end", function (chunk) {
        let body = Buffer.concat(chunks);
        console.log(body.toString());
    });

    res.on("error", function (error) {
        console.error(error);
    });
});

let data = JSON.stringify({
    "server": {
        "retain_expired_stat": false,
        "history_update_period": 15000,
        "stat_scan_period": 1000,
        "event_log_max_bytes": "1 G",
        "default_result_timeout": 2000,
        "incident_timeout": 60000,
        "email": {
            "disabled": false,
            "transport": {
                "service": "...",
                "auth": {
                    "user": "saymon@saymon.info",
                    "pass": "..."
                }
            },
            "fields": {
                "from": "saymon@saymon.info"
            },
            "max_json_length": 100000
        },
        "user": {
            "new_user_access": "not"
        }
    }
});

req.write(data);
req.end();
import requests

login = <...>
password = <...>
saymon_hostname = <...>
url = "https://" + saymon_hostname + "/node/api/configuration"

body = {
    "server": {
        "retain_expired_stat": False,
        "history_update_period": 15000,
        "stat_scan_period": 1000,
        "event_log_max_bytes": "1 G",
        "default_result_timeout": 2000,
        "incident_timeout": 60000,
        "email": {
            "disabled": False,
            "transport": {
                "service": "...",
                "auth": {
                    "user": "saymon@saymon.info",
                    "pass": "..."
                }
            },
            "fields": {
                "from": "saymon@saymon.info"
            },
            "max_json_length": 100000
        },
        "user": {
            "new_user_access": "not"
        }
    }
}

response = requests.request("PATCH", url, json=body, auth=(login, password))
print(response.text)

Response example

{
    "server": {
        "retain_expired_stat": false,
        "history_update_period": 15000,
        "stat_scan_period": 1000,
        "event_log_max_bytes": "1 G",
        "default_result_timeout": 2000,
        "incident_timeout": 60000,
        "email": {
            "disabled": false,
            "transport": {
                "service": "...",
                "auth": {
                    "user": "saymon@saymon.info",
                    "pass": "..."
                }
            },
            "fields": {
                "from": "saymon@saymon.info"
            },
            "max_json_length": 100000
        },
        "user": {
            "new_user_access": "not"
        }
    }
}