MXS-1220: Add /users/ resource

The /users/ resource shows all user accounts that can be used with
MaxScale. This resource is further split into two resource collections,
/users/inet and /users/unix, which contain the network users and Linux
accounts respectively.
This commit is contained in:
Markus Mäkelä
2017-05-19 14:29:02 +03:00
parent 7fc2d25cf2
commit ead9059eeb
9 changed files with 181 additions and 38 deletions

View File

@ -137,9 +137,19 @@ json_t* mxs_json_self_link(const char* host, const char* path, const char* id)
json_t* links = json_object();
string self = host;
self += "/";
if (path[0] != '/')
{
self += "/";
}
self += path;
self += "/";
if (self[self.length() - 1] != '/')
{
self += "/";
}
self += id;
json_object_set_new(links, CN_SELF, json_string(self.c_str()));