Skip to content

Commit

Permalink
Logstash central management typeless API (#30546)
Browse files Browse the repository at this point in the history
This commit adopts Elasticsearch's typeless API for Logstash
central management.

Relates: elastic/elasticsearch#3863
  • Loading branch information
jakelandis authored and alexwizp committed Mar 1, 2019
1 parent 369bef3 commit c2f89f4
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 23 deletions.
1 change: 0 additions & 1 deletion x-pack/plugins/logstash/common/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

export { INDEX_NAMES } from './index_names';
export { TYPE_NAMES } from './type_names';
export { ROUTES } from './routes';
export { PAGINATION } from './pagination';
export { PLUGIN } from './plugin';
Expand Down
11 changes: 0 additions & 11 deletions x-pack/plugins/logstash/common/constants/type_names.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@

import { callWithRequestFactory } from '../../../lib/call_with_request_factory';
import { wrapEsError } from '../../../lib/error_wrappers';
import { INDEX_NAMES, TYPE_NAMES } from '../../../../common/constants';
import { INDEX_NAMES } from '../../../../common/constants';
import { licensePreRoutingFactory } from'../../../lib/license_pre_routing_factory';

function deletePipeline(callWithRequest, pipelineId) {
return callWithRequest('delete', {
index: INDEX_NAMES.PIPELINES,
type: TYPE_NAMES.PIPELINES,
id: pipelineId,
refresh: 'wait_for'
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
*/

import Boom from 'boom';
import { INDEX_NAMES, TYPE_NAMES } from '../../../../common/constants';
import { INDEX_NAMES } from '../../../../common/constants';
import { callWithRequestFactory } from '../../../lib/call_with_request_factory';
import { Pipeline } from '../../../models/pipeline';
import { licensePreRoutingFactory } from'../../../lib/license_pre_routing_factory';

function fetchPipeline(callWithRequest, pipelineId) {
return callWithRequest('get', {
index: INDEX_NAMES.PIPELINES,
type: TYPE_NAMES.PIPELINES,
id: pipelineId,
_source: [
'description',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@

import { get } from 'lodash';
import { wrapEsError } from '../../../lib/error_wrappers';
import { INDEX_NAMES, TYPE_NAMES } from '../../../../common/constants';
import { INDEX_NAMES } from '../../../../common/constants';
import { callWithRequestFactory } from '../../../lib/call_with_request_factory';
import { Pipeline } from '../../../models/pipeline';
import { licensePreRoutingFactory } from'../../../lib/license_pre_routing_factory';

function savePipeline(callWithRequest, pipelineId, pipelineBody) {
return callWithRequest('index', {
index: INDEX_NAMES.PIPELINES,
type: TYPE_NAMES.PIPELINES,
id: pipelineId,
body: pipelineBody,
refresh: 'wait_for'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@

import { callWithRequestFactory } from '../../../lib/call_with_request_factory';
import { wrapUnknownError } from '../../../lib/error_wrappers';
import { INDEX_NAMES, TYPE_NAMES } from '../../../../common/constants';
import { INDEX_NAMES } from '../../../../common/constants';
import { licensePreRoutingFactory } from'../../../lib/license_pre_routing_factory';

function deletePipelines(callWithRequest, pipelineIds) {
const deletePromises = pipelineIds.map(pipelineId => {
return callWithRequest('delete', {
index: INDEX_NAMES.PIPELINES,
type: TYPE_NAMES.PIPELINES,
id: pipelineId,
refresh: 'wait_for'
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { callWithRequestFactory } from '../../../lib/call_with_request_factory';
import { wrapUnknownError } from '../../../lib/error_wrappers';
import { INDEX_NAMES, TYPE_NAMES } from '../../../../common/constants';
import { INDEX_NAMES } from '../../../../common/constants';
import { licensePreRoutingFactory } from'../../../lib/license_pre_routing_factory';

function doesIndexExist(callWithRequest) {
Expand All @@ -24,8 +24,6 @@ async function executeUpgrade(callWithRequest) {

return callWithRequest('indices.putMapping', {
index: INDEX_NAMES.PIPELINES,
include_type_name: true,
type: TYPE_NAMES.PIPELINES,
body: {
properties: {
pipeline_settings: {
Expand Down

0 comments on commit c2f89f4

Please sign in to comment.