return 204 for successful POST an use JSON for all response payloads
This commit is contained in:
parent
e9810328a9
commit
e1bb5f58c4
4 changed files with 9 additions and 9 deletions
|
@ -24,7 +24,7 @@ module.exports = function registerDelete(server) {
|
||||||
})
|
})
|
||||||
])
|
])
|
||||||
.then(function (pattern) {
|
.then(function (pattern) {
|
||||||
reply('success');
|
reply({success: true});
|
||||||
}, function (error) {
|
}, function (error) {
|
||||||
reply(handleESError(error));
|
reply(handleESError(error));
|
||||||
});
|
});
|
||||||
|
|
|
@ -91,7 +91,7 @@ module.exports = function registerPost(server) {
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
reply('success').code(201);
|
reply().code(204);
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
reply(handleESError(error));
|
reply(handleESError(error));
|
||||||
|
|
|
@ -14,7 +14,7 @@ define(function (require) {
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return request.post('/kibana/ingest')
|
return request.post('/kibana/ingest')
|
||||||
.send(createTestData())
|
.send(createTestData())
|
||||||
.expect(201);
|
.expect(204);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -38,16 +38,16 @@ define(function (require) {
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
bdd.it('should return 201 when an ingest config is successfully created', function createIngestConfig() {
|
bdd.it('should return 204 when an ingest config is successfully created', function createIngestConfig() {
|
||||||
return request.post('/kibana/ingest')
|
return request.post('/kibana/ingest')
|
||||||
.send(createTestData())
|
.send(createTestData())
|
||||||
.expect(201);
|
.expect(204);
|
||||||
});
|
});
|
||||||
|
|
||||||
bdd.it('should create an index template if a fields array is included', function createTemplate() {
|
bdd.it('should create an index template if a fields array is included', function createTemplate() {
|
||||||
return request.post('/kibana/ingest')
|
return request.post('/kibana/ingest')
|
||||||
.send(createTestData())
|
.send(createTestData())
|
||||||
.expect(201)
|
.expect(204)
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return scenarioManager.client.indices.getTemplate({name: 'kibana-logstash-*'});
|
return scenarioManager.client.indices.getTemplate({name: 'kibana-logstash-*'});
|
||||||
});
|
});
|
||||||
|
@ -56,7 +56,7 @@ define(function (require) {
|
||||||
bdd.it('should provide defaults for field properties', function createTemplate() {
|
bdd.it('should provide defaults for field properties', function createTemplate() {
|
||||||
return request.post('/kibana/ingest')
|
return request.post('/kibana/ingest')
|
||||||
.send(createTestData())
|
.send(createTestData())
|
||||||
.expect(201)
|
.expect(204)
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return scenarioManager.client.get({
|
return scenarioManager.client.get({
|
||||||
index: '.kibana',
|
index: '.kibana',
|
||||||
|
@ -82,7 +82,7 @@ define(function (require) {
|
||||||
function createTemplate() {
|
function createTemplate() {
|
||||||
return request.post('/kibana/ingest')
|
return request.post('/kibana/ingest')
|
||||||
.send(createTestData())
|
.send(createTestData())
|
||||||
.expect(201)
|
.expect(204)
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return scenarioManager.client.indices.getTemplate({name: 'kibana-logstash-*'})
|
return scenarioManager.client.indices.getTemplate({name: 'kibana-logstash-*'})
|
||||||
.then(function (template) {
|
.then(function (template) {
|
||||||
|
@ -112,7 +112,7 @@ define(function (require) {
|
||||||
bdd.it('should return 409 conflict when a pattern with the given ID already exists', function patternConflict() {
|
bdd.it('should return 409 conflict when a pattern with the given ID already exists', function patternConflict() {
|
||||||
return request.post('/kibana/ingest')
|
return request.post('/kibana/ingest')
|
||||||
.send(createTestData())
|
.send(createTestData())
|
||||||
.expect(201)
|
.expect(204)
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return request.post('/kibana/ingest')
|
return request.post('/kibana/ingest')
|
||||||
.send(createTestData())
|
.send(createTestData())
|
||||||
|
|
Loading…
Reference in a new issue