From 7e40c93cc4ead1459a615bebf1cedd889dea7d13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 3 Jul 2017 15:08:05 +0300 Subject: [PATCH] MXS-1220: Add listener creation documentation The documentation for creating listeners was not added. --- Documentation/REST-API/Resources-Server.md | 7 ++-- Documentation/REST-API/Resources-Service.md | 43 +++++++++++++++++++++ 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/Documentation/REST-API/Resources-Server.md b/Documentation/REST-API/Resources-Server.md index 6d94a5583..bdbf05231 100644 --- a/Documentation/REST-API/Resources-Server.md +++ b/Documentation/REST-API/Resources-Server.md @@ -226,9 +226,10 @@ POST /v1/servers ``` Create a new server by defining the resource. The posted object must define the -_name_ field with the name of the server and the _parameters_ field with JSON -object containing values for the _address_ and _port_ parameters. The following -is the minimal required JSON object for defining a new server. +_data.id_ field with the name of the server and the +_data.atttributes.parameters_ field with JSON object containing values for the +_address_ and _port_ parameters. The following is the minimal required JSON +object for defining a new server. ```javascript { diff --git a/Documentation/REST-API/Resources-Service.md b/Documentation/REST-API/Resources-Service.md index a56bdd191..7d3a08b23 100644 --- a/Documentation/REST-API/Resources-Service.md +++ b/Documentation/REST-API/Resources-Service.md @@ -259,6 +259,49 @@ GET /v1/services/:name/listeners } ``` +### Create a new listener + + +``` +POST /v1/services/:name/listeners +``` + +Create a new listener for a service by defining the resource. The _:name_ in the +URI must map to a service name with all whitespace replaced with hyphens. The +posted object must define the _data.id_ field with the name of the server and +the _data.attributes.parameters.port_ field with the port where the listener +will listen on. The following is the minimal required JSON object for defining a +new listener. + +```javascript +{ + "data": { + "id": "my-listener", + "type": "listeners", + "attributes": { + "parameters": { + "port": 3306 + } + } + } +} +``` + +The following table contains all values that can be given in the _parameters_ +object. + +|Parameter | Description | +|-----------------------|---------------------------------------------------| +|port | Port to listen on | +|address | Interface to listen on | +|authenticator | Authenticator module | +|authenticator_options | Options for the authenticator | +|ssl_key | Path to SSL key | +|ssl_cert | Path to SSL certificate | +|ssl_ca_cert | Path to SSL CA certificate | +|ssl_version | The SSL version to use [TLSv1.2|TLSv1.1|TLSv1.0] | +|ssl_cert_verify_depth | Certificate verification depth | + ### Update a service The _:name_ in the URI must map to a service name and the request body must be a