The requests that send a body should define at least a `data` member.
Added a simple test that checks that bad requests are rejected. This test
should be expanded to check that the returned error body contains the
correct members.
The creation and modification of moitor now supports the JSON API
conforming format generated by the GET endpoints.
Also added tests for creating and altering monitors via the REST API.
When a monitor is created, any parameters given to it are immediately
processed. This is done by processing the initial request as if it were an
update to the monitor that was just created.
Changed the order in which servers are linked to objects. The old
relations are removed first and only after that are the new relations
added. This fixed a problem when the monitor which monitors a server was
being changed.
Also fixed a few minor bugs.
Destroyed servers were still shown as a part of the servers resource
collection.
If a parameter defined in persisted configurations was replaced, the value
would be appended to itself after it was replaced.
Return correct error codes for internal errors.
The server check was checking for old parameter locations.
Service parameters can now be altered with a PUT request to the REST
API. This allows general level parameters to be altered.
Module specific parameters need to be altered with a different mechanism,
namely the module command system. This requires that a generic way to call
a function needs to be devised.
When a persisted configuration file is read, the values in it are
considered to be more up-to-date than the ones in the main configuration
file. This allows all objects to be persisted in a more complete form
making it easier to change configuration values at runtime.
This change is intended to help make runtime alterations to services
possible.
Monitor resources can now be altered with a PUT request. The method allows
alterations on all parameters that the maxadmin `alter monitor` command
allows.
The alteration function is only called when the value of a parameter
changes. This removes some of the redundant logging that was caused by
calling the alteration function with the same values.
The server can now be modified with a PUT request of a modified server
resource. The server resource was reorganized to have the parameters as a
separate entity from the other more general entities of the resource.
The PUT/POST functions return a more appropriate error message when no
request body is provided.
Moved some of the constant names used in server.cc into the config.h
header.
Now all relevant and working core configuration parameters have constants
for their names. This removes some of the risk that comes with the
repetition of the same parameter name in more than place.
The parameter names for monitors and servers now use a set of constant
names. This removes some of the errors caused by spelling mistakes when
the same parameter name is repeated in multiple places.
The service, filter and listener parameters should also be converted to
constants. This allows for a consistent user experience.
This number (defaults to 1) sets how many times mon_connect_to_db
will try to connect to a backend before returning an error. Every
connection attempt may take backend_connect_timeout seconds to
complete.
Also refactored code a bit. Renamed mon_connect_to_db to
mon_ping_or_connect_to_db, since it does not connect if the connection
is already alive.