MXS-1390: Add missing self-link to module command output

The module commands now produce functional self-links. The links most
often require parameters so they are not of great use.
This commit is contained in:
Markus Mäkelä
2017-09-07 21:16:38 +03:00
parent 6cf90ceb15
commit 5abb30c357
3 changed files with 33 additions and 10 deletions

View File

@ -39,6 +39,14 @@ json_t* mxs_json_resource(const char* host, const char* self, json_t* data)
return rval;
}
json_t* mxs_json_metadata(const char* host, const char* self, json_t* data)
{
json_t* rval = json_object();
json_object_set_new(rval, CN_LINKS, self_link(host, self));
json_object_set_new(rval, CN_META, data);
return rval;
}
json_t* mxs_json_relationship(const char* host, const char* endpoint)
{
json_t* rel = json_object();