Merge pull request #2071 from simianhacker/snake_case_config

Changing camelCase to snake_case for configuration
This commit is contained in:
Rashid Khan 2014-12-03 13:17:09 -07:00
commit f764cddcb1
21 changed files with 43 additions and 43 deletions

View file

@ -33,7 +33,7 @@ define(function (require) {
var DocSource = Private(require('components/courier/data_source/doc_source'));
var doc = (new DocSource())
.index(configFile.kibanaIndex)
.index(configFile.kibana_index)
.type('config')
.id(kbnVersion);

View file

@ -57,7 +57,7 @@ define(function (require) {
// tell the docSource where to find the doc
docSource
.index(configFile.kibanaIndex)
.index(configFile.kibana_index)
.type(type)
.id(self.id);
@ -217,7 +217,7 @@ define(function (require) {
})
.then(function () {
return es.indices.refresh({
index: configFile.kibanaIndex
index: configFile.kibana_index
});
})
.then(function () {
@ -242,12 +242,12 @@ define(function (require) {
*/
self.delete = function () {
return es.delete({
index: configFile.kibanaIndex,
index: configFile.kibana_index,
type: type,
id: this.id
}).then(function () {
return es.indices.refresh({
index: configFile.kibanaIndex
index: configFile.kibana_index
});
});
};

View file

@ -15,7 +15,7 @@ define(function (require) {
}
cachedPromise = es.search({
index: configFile.kibanaIndex,
index: configFile.kibana_index,
type: 'index-pattern',
fields: [],
body: {
@ -39,4 +39,4 @@ define(function (require) {
return getIds;
};
});
});

View file

@ -39,7 +39,7 @@ define(function (require) {
self.init = function () {
// tell the docSource where to find the doc
docSource
.index(configFile.kibanaIndex)
.index(configFile.kibana_index)
.type(type)
.id(self.id);

View file

@ -32,7 +32,7 @@ define(function (require) {
if (!skipIndexPatternCache) {
return es.get({
index: configFile.kibanaIndex,
index: configFile.kibana_index,
type: 'index-pattern',
id: id,
_sourceInclude: ['fields']
@ -83,4 +83,4 @@ define(function (require) {
return new Mapper();
};
});
});

View file

@ -18,7 +18,7 @@ define(function (require) {
return function (response) {
var fields = {};
_.each(response, function (index, indexName) {
if (indexName === configFile.kibanaIndex) return;
if (indexName === configFile.kibana_index) return;
_.each(index.mappings, function (mappings, typeName) {
_.each(mappings, function (field, name) {
var keys = Object.keys(field.mapping);
@ -46,4 +46,4 @@ define(function (require) {
});
};
};
});
});

View file

@ -27,7 +27,7 @@ define(function (require) {
self.getIds.clearCache();
patternCache.delete(pattern.id);
return es.delete({
index: configFile.kibanaIndex,
index: configFile.kibana_index,
type: 'index-pattern',
id: pattern.id
});
@ -45,4 +45,4 @@ define(function (require) {
self.fieldFormats = Private(require('components/index_patterns/_field_formats'));
self.IndexPattern = IndexPattern;
});
});
});

View file

@ -6,12 +6,12 @@ define(function (require) {
return function checkForKibana() {
var complete = notify.lifecycle('kibana index check');
return es.indices.exists({
index: configFile.kibanaIndex
index: configFile.kibana_index
})
.catch(function (err) {
throw new SetupError('Unable to check for Kibana index "<%= configFile.kibanaIndex %>"', err);
throw new SetupError('Unable to check for Kibana index "<%= configFile.kibana_index %>"', err);
})
.then(complete, complete.failure);
};
};
});
});

View file

@ -6,7 +6,7 @@ define(function (require) {
var SetupError = Private(require('components/setup/_setup_error'));
return es.indices.create({
index: configFile.kibanaIndex,
index: configFile.kibana_index,
body: {
settings: {
number_of_shards : 1,
@ -15,18 +15,18 @@ define(function (require) {
}
})
.catch(function (err) {
throw new SetupError('Unable to create Kibana index "<%= configFile.kibanaIndex %>"', err);
throw new SetupError('Unable to create Kibana index "<%= configFile.kibana_index %>"', err);
})
.then(function () {
return es.cluster.health({
waitForStatus: 'yellow',
index: configFile.kibanaIndex
index: configFile.kibana_index
})
.catch(function (err) {
throw new SetupError('Waiting for Kibana index "<%= configFile.kibanaIndex %>" to come online failed', err);
throw new SetupError('Waiting for Kibana index "<%= configFile.kibana_index %>" to come online failed', err);
});
})
.then(complete, complete.failure);
};
};
});
});

View file

@ -55,7 +55,7 @@ define(function (require) {
}
function useDefaults() {
index = configFile.kibanaIndex;
index = configFile.kibana_index;
type = '__kibanaQueryValidator';
}
@ -122,4 +122,4 @@ define(function (require) {
}
};
});
});
});

View file

@ -45,7 +45,7 @@ define(function (require) {
// setup routes
routes
.otherwise({
redirectTo: '/' + configFile.defaultAppId
redirectTo: '/' + configFile.default_app_id
});
// tell the modules util to add it's modules as requirements for kibana

View file

@ -12,7 +12,7 @@ define(function (require) {
function SavedDashboard(id) {
// Gives our SavedDashboard the properties of a SavedObject
courier.SavedObject.call(this, {
// this object will be saved at {{configFile.kibanaIndex}}/dashboard/{{id}}
// this object will be saved at {{configFile.kibana_index}}/dashboard/{{id}}
type: SavedDashboard.type,
// if this is null/undefined then the SavedObject will be assigned the defaults

View file

@ -47,7 +47,7 @@ define(function (require) {
}
}: { query: {match_all: {}}};
return es.search({
index: config.file.kibanaIndex,
index: config.file.kibana_index,
type: 'dashboard',
body: body,
size: 100

View file

@ -51,7 +51,7 @@ define(function (require) {
}
}: { query: {match_all: {}}};
return es.search({
index: configFile.kibanaIndex,
index: configFile.kibana_index,
type: 'search',
body: body,
size: 100

View file

@ -2,8 +2,8 @@ define(function (require) {
return function RefreshKibanaIndexFn(es, configFile) {
return function () {
return es.indices.refresh({
index: configFile.kibanaIndex
index: configFile.kibana_index
});
};
};
});
});

View file

@ -74,7 +74,7 @@ define(function (require) {
$scope.title = inflection.singularize(serviceObj.title);
es.get({
index: config.file.kibanaIndex,
index: config.file.kibana_index,
type: service.type,
id: $routeParams.id
})
@ -127,7 +127,7 @@ define(function (require) {
*/
$scope.delete = function () {
es.delete({
index: config.file.kibanaIndex,
index: config.file.kibana_index,
type: service.type,
id: $routeParams.id
})
@ -156,7 +156,7 @@ define(function (require) {
});
es.index({
index: config.file.kibanaIndex,
index: config.file.kibana_index,
type: service.type,
id: $routeParams.id,
body: source
@ -169,7 +169,7 @@ define(function (require) {
function redirectHandler(action) {
return es.indices.refresh({
index: config.file.kibanaIndex
index: config.file.kibana_index
})
.then(function (resp) {
var msg = 'You successfully ' + action + ' the "' + $scope.obj._source.title + '" ' + $scope.title.toLowerCase() + ' object';

View file

@ -46,7 +46,7 @@ define(function (require) {
}
}: { query: {match_all: {}}};
return es.search({
index: config.file.kibanaIndex,
index: config.file.kibana_index,
type: 'visualization',
body: body,
size: 100,

View file

@ -23,7 +23,7 @@ define(function () {
* @return {[type]} [description]
*/
var getKnownKibanaTypes = _.once(function () {
var indexName = configFile.kibanaIndex;
var indexName = configFile.kibana_index;
return es.indices.getFieldMapping({
// only concerned with types in this kibana index
index: indexName,
@ -82,7 +82,7 @@ define(function () {
};
return es.indices.putMapping({
index: configFile.kibanaIndex,
index: configFile.kibana_index,
type: type,
body: body
}).then(function (resp) {
@ -105,4 +105,4 @@ define(function () {
};
};
});
});

View file

@ -9,10 +9,10 @@ elasticsearch: "http://localhost:9200"
# Kibana uses an index in Elasticsearch to store saved searches, visualizations
# and dashboards. It will create a new index if it doesn't already exist.
kibanaIndex: ".kibana"
kibana_index: ".kibana"
# The default application to load.
defaultAppId: "discover"
default_app_id: "discover"
# Time in seconds to wait for responses from the back end or elasticsearch.
# Note this should always be higher than "shard_timeout".
@ -26,4 +26,4 @@ shard_timeout: 30000
# Set to false to have a complete disregard for the validity of the SSL
# certificate.
verifySSL: true
verify_ssl: true

View file

@ -8,7 +8,7 @@ module Kibana
config = settings.config
use Rack::ReverseProxy do
reverse_proxy_options timeout: config["request_timeout"]
@global_options[:verify_ssl] = config["verifySSL"].nil? ? true : config["verifySSL"]
@global_options[:verify_ssl] = config["verify_ssl"].nil? ? true : config["verify_ssl"]
reverse_proxy(/^\/elasticsearch(.*)$/, "#{config["elasticsearch"]}$1")
end
end

View file

@ -42,7 +42,7 @@ define(function (require) {
});
$provide.constant('configFile', {
kibanaIndex: 'test-index'
kibana_index: 'test-index'
});
});