diff --git a/include/maxscale/config.h b/include/maxscale/config.h index f5165839d..26a12f79f 100644 --- a/include/maxscale/config.h +++ b/include/maxscale/config.h @@ -45,6 +45,7 @@ MXS_BEGIN_DECLS #define MXS_JSON_PTR_PARAMETERS "/data/attributes/parameters" /** Pointers to relation lists */ +#define MXS_JSON_PTR_RELATIONSHIPS "/data/relationships" #define MXS_JSON_PTR_RELATIONSHIPS_SERVERS "/data/relationships/servers/data" #define MXS_JSON_PTR_RELATIONSHIPS_SERVICES "/data/relationships/services/data" #define MXS_JSON_PTR_RELATIONSHIPS_MONITORS "/data/relationships/monitors/data" diff --git a/server/core/config_runtime.cc b/server/core/config_runtime.cc index 49fa3013e..9100ec974 100644 --- a/server/core/config_runtime.cc +++ b/server/core/config_runtime.cc @@ -1093,6 +1093,12 @@ SERVER* runtime_create_server_from_json(json_t* json) bool server_to_object_relations(SERVER* server, json_t* old_json, json_t* new_json) { + if (mxs_json_pointer(new_json, MXS_JSON_PTR_RELATIONSHIPS) == NULL) + { + /** No change to relationships */ + return true; + } + bool rval = false; set old_relations; set new_relations; @@ -1270,6 +1276,12 @@ MXS_MONITOR* runtime_create_monitor_from_json(json_t* json) bool object_to_server_relations(const char* target, json_t* old_json, json_t* new_json) { + if (mxs_json_pointer(new_json, MXS_JSON_PTR_RELATIONSHIPS) == NULL) + { + /** No change to relationships */ + return true; + } + bool rval = false; set old_relations; set new_relations;