MXS-1220: Treat service listeners as service sub-resources

The listeners under the /services/:service/listeners collection are now
fully JSON API compliant resources.

The listeners could also be exposed as a /listeners collection to easily
group all listener type resources in one place. This approach does has
some semantical and practical problems, namely the fact that each listener
has a many-to-one relationship with its service and listeners by
themselves can't exist alone.
This commit is contained in:
Markus Mäkelä
2017-05-05 06:38:45 +03:00
parent 1d98b4b67b
commit 08dca8c273
6 changed files with 66 additions and 41 deletions

View File

@ -304,6 +304,16 @@ json_t* service_to_json(const SERVICE* service, const char* host);
*/
json_t* service_list_to_json(const char* host);
/**
* @brief Convert service listeners to JSON
*
* @param service Service whose listeners are converted
* @param host Hostname of this server
*
* @return Array of JSON format listeners
*/
json_t* service_listeners_to_json(const SERVICE* service, const char* host);
/**
* @brief Get links to services that relate to a server
*