MXS-1300: Add link/unlink command to MaxCtrl

The link/unlink commands are similar to the add/remove commands in
MaxAdmin but they link services and monitors to a list of servers instead
of linking servers to a list of either services or monitors. This can
reduce the number of required calls to alter the configuration while
making the process easier for MaxCtrl to do via the REST API.

Also fixed a false negative where a service alteration which results in a
no-op would be counted as an error.
This commit is contained in:
Markus Mäkelä
2017-07-05 13:14:32 +03:00
parent 7db1f4c768
commit b0f2d02787
4 changed files with 97 additions and 2 deletions

View File

@ -1377,7 +1377,7 @@ bool runtime_alter_service_from_json(SERVICE* service, json_t* new_json)
if (is_valid_resource_body(new_json) &&
object_to_server_relations(service->name, old_json.get(), new_json))
{
bool changed = false;
rval = true;
json_t* parameters = mxs_json_pointer(new_json, MXS_JSON_PTR_PARAMETERS);
json_t* old_parameters = mxs_json_pointer(old_json.get(), MXS_JSON_PTR_PARAMETERS);
@ -1395,7 +1395,6 @@ bool runtime_alter_service_from_json(SERVICE* service, json_t* new_json)
}
}
rval = true;
const char* key;
json_t* value;