From a1c2eee006ddc7016a83515b2637677c93ae7aae Mon Sep 17 00:00:00 2001 From: Nikolay Stanchev <ns17@it-innovation.soton.ac.uk> Date: Fri, 22 Feb 2019 09:09:19 +0000 Subject: [PATCH] Updates documentation on the Graph API --- docs/clmc-service.md | 80 ++++++++++++++++++++++++++++++++------------ 1 file changed, 58 insertions(+), 22 deletions(-) diff --git a/docs/clmc-service.md b/docs/clmc-service.md index a78de7b..eacb13a 100644 --- a/docs/clmc-service.md +++ b/docs/clmc-service.md @@ -187,6 +187,58 @@ with **/clmc-service** so that the nginx reverse proxy server (listening on port * For each service function, there is a field/fields from which an average estimation of the size of a **response** from this service function can be derived. * All the aforementioned fields reside in a single measurement. +* **POST** ***/graph/monitor*** + + This API method instructs the CLMC service to run a pipeline script executing the workflow of building a temporal graph, querying for round-trip time (and other measurements) and + deleting the temporal graph. The pipeline script will run continuously as a background process on CLMC. + + * Request: + + Expects a JSON-formatted request body that declares the service function chain and service function chain instance for which the pipeline script will execute. + The request body must define the service functions that will be included in the graph along with the measurement name, response time field, request size field and + response size field for each service function. The declared fields could be influx functions across multiple fields. The query period (how often the pipeline is executed) + and the results measurement name (where results will be inserted) must also be included. + + * Request Body Example: + ```json + { + "query_period": "30", + "results_measurement_name": "round_trip_time_measurement", + "service_function_chain": "MSDemo", + "service_function_chain_instance": "MSDemo_1", + "service_functions": { + "nginx": { + "response_time_field": "mean(response_time)", + "request_size_field": "mean(request_size)", + "response_size_field": "mean(response_size)", + "measurement_name": "nginx" + }, + "minio": { + "response_time_field": "mean(sum)/mean(count)", + "request_size_field": "mean(request_size)/mean(count)", + "response_size_field": "mean(response_size)/mean(count)", + "measurement_name": "minio_http_requests_duration_seconds" + } + } + } + ``` + + * Response: + + The response of this request is a JSON content, which contains a generated UUID and the database name. + This request UUID can then be used to manage the pipeline script (e.g. stopping it). + + Returns a 400 Bad Request error if the request body is invalid. + + * Response Body Example: + + ```json + { + "uuid": "75df6f8d-3829-4fd8-a3e6-b3e917010141", + "database": "MSDemo" + } + ``` + * **POST** ***/graph/temporal*** This API method sends a request to the CLMC service to build a graph snapshot in the time range between the *from* and *to* timestamps. @@ -240,7 +292,8 @@ with **/clmc-service** so that the nginx reverse proxy server (listening on port * Response: - The response of this request is a JSON content, which contains all request parameters used to build the graph, along with a request UUID. + The response of this request is a JSON content, which contains the temporal graph's UUID, the database name, the timestamps converted to nanoseconds and a list + of the names of all Endpoint nodes that were created for this temporal graph. This request ID can then be used to manage the temporal subgraph that was created in response to this request. Returns a 400 Bad Request error if the request body is invalid. @@ -250,28 +303,12 @@ with **/clmc-service** so that the nginx reverse proxy server (listening on port ```json { "database": "MSDemo", - "retention_policy": "autogen", - "service_function_chain": "MSDemo", - "service_function_chain_instance": "MSDemo_1", - "service_functions": { - "nginx": { - "response_time_field": "mean(response_time)", - "request_size_field": "mean(request_size)", - "response_size_field": "mean(response_size)", - "measurement_name": "nginx" - }, - "minio": { - "response_time_field": "mean(sum)/mean(count)", - "request_size_field": "mean(request_size)/mean(count)", - "response_size_field": "mean(response_size)/mean(count)", - "measurement_name": "minio_http_requests_duration_seconds" - } - }, "graph": { "uuid": "75df6f8d-3829-4fd8-a3e6-b3e917010141", + "endpoints": ["minio_ep1", "minio_ep2", "nginx_ep1", "nginx_ep2"], "time_range": { - "from": 1528385420, - "to": 1528385860 + "from": 1528385420000000000, + "to": 1528385860000000000 } } } @@ -284,7 +321,7 @@ with **/clmc-service** so that the nginx reverse proxy server (listening on port * Response: - The response of this request is a JSON content, which contains the request UUID and the number of deleted nodes. + The response of this request is a JSON content, which contains the number of deleted nodes. Returns a 404 Not Found error if the request UUID is not associated with any nodes in the graph. @@ -292,7 +329,6 @@ with **/clmc-service** so that the nginx reverse proxy server (listening on port ```json { - "uuid": "75df6f8d-3829-4fd8-a3e6-b3e917010141", "deleted": 5 } ``` -- GitLab