MXS-1220: Add creation of listeners via REST API

Listeners can now be created via the REST API by doing a POST request to
the service listener resource.
This commit is contained in:
Markus Mäkelä
2017-05-07 10:31:32 +03:00
parent 3e1ff70d7d
commit 461cd6afd9
5 changed files with 133 additions and 19 deletions

View File

@ -62,5 +62,28 @@ describe("Service", function() {
})
});
it("create a listener", function() {
var listener = {
"links": {
"self": "http://localhost:8989/v1/services/RW-Split-Router/listeners"
},
"data": {
"attributes": {
"parameters": {
"port": 4012,
"protocol": "MySQLClient",
"authenticator": "MySQLAuth",
"address": "127.0.0.1"
}
},
"id": "RW-Split-Listener-2",
"type": "listeners"
}
}
return request.post(base_url + "/services/RW-Split-Router/listeners", {json: listener})
.should.be.fulfilled
});
after(stopMaxScale)
});