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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user