From 99c989a8fa64cc340d64e64f249aa849728fdb7f Mon Sep 17 00:00:00 2001 From: ni-richard Date: Thu, 12 Sep 2019 16:02:49 +0200 Subject: [PATCH] Created process.restart (markdown) --- process.restart.md | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 process.restart.md diff --git a/process.restart.md b/process.restart.md new file mode 100644 index 0000000..03f5245 --- /dev/null +++ b/process.restart.md @@ -0,0 +1,55 @@ +### Request +* **Description**: Instructs the supervisor daemon to restart a registered process. +* **Subscribers**: [ProcessHandler](https://github.com/avatao-content/baseimage-tutorial-framework/wiki/ProcessHandler) + +```json +{ + "key": "process.restart", + "intent": "control", + "scope": "zmq" +} +``` + +| Parameter | Type | Required | Description | +| ------------ |:--------:|:------------------:| --------------------------- | +| *name* | `string` | :heavy_check_mark: | Name of the process. | + +*** + +**Example**: +```json +{ + "key": "process.restart", + "name": "webservice" +} +``` + +### Response +* **Description**: Raises an event that contains an `error` field if the process exited with an error code, otherwise it's just the same as the original request. +* **Subscribers**: *(none)* + +```json +{ + "key": "process.restart", + "intent": "event", + "scope": "broadcast" +} +``` + +| Parameter | Type | Required | Description | +| ------------ |:--------:|:------------------:| --------------------------- | +| *name* | `string` | :heavy_check_mark: | Name of the process. | +| *error* | `string` | | Error message from the supervisor daemon. | + +*** + +**Example**: +```json +{ + "key": "process.restart", + "intent": "event", + "scope": "broadcast", + "name": "webservice", + "error": "SPAWN_ERROR: webservice..." +} +``` \ No newline at end of file