MXS-1220: Add endpoint for set/clear of server status

The server status can now be manipulated via the REST API. Added tests for
the state manipulation. Fixed minor issues in related code.
This commit is contained in:
Markus Mäkelä
2017-06-30 12:57:16 +03:00
parent c189378389
commit 63d2eee0e3
7 changed files with 172 additions and 25 deletions

View File

@ -155,3 +155,17 @@ json_t* mxs_json_self_link(const char* host, const char* path, const char* id)
return links;
}
json_t* mxs_json_error(const char* message)
{
json_t* err = json_object();
json_object_set_new(err, "detail", json_string(message));
json_t* arr = json_array();
json_array_append_new(arr, err);
json_t* obj = json_object();
json_object_set_new(obj, "errors", arr);
return obj;
}