I'm trying to use the restangular api to capture specific data from an elasticsearch rest call. I've tried it several different ways (including an attempt to use the addResponseInterceptor). Either I'm just not doing it correctly or I don't understand how/if the data is formatted in a way that can be processed by the API.
The elasticsearch call i'm making is '_stats/index,store'. The data returned by it is:
{
"_shards": {
"total": 12,
"successful": 6,
"failed": 0
},
"_all": {
"primaries": {
"store": {
"size_in_bytes": 34177,
"throttle_time_in_millis": 0
}
},
"total": {
"store": {
"size_in_bytes": 34177,
"throttle_time_in_millis": 0
}
}
},
"indices": {
"logstash-2015.05.09": {
"primaries": {
"store": {
"size_in_bytes": 575,
"throttle_time_in_millis": 0
}
},
"total": {
"store": {
"size_in_bytes": 575,
"throttle_time_in_millis": 0
}
}
},
".kibana": {
"primaries": {
"store": {
"size_in_bytes": 33602,
"throttle_time_in_millis": 0
}
},
"total": {
"store": {
"size_in_bytes": 33602,
"throttle_time_in_millis": 0
}
}
}
}
}
The data I'm interested in is every one of the indices. Any help on how to capture this using the restangular api would be greatly appreciated.
I've tried using the following to get the data using the restangular api:
app.controller('MainController', ['$scope', 'Restangular',
function($scope, Restangular) {
var restCall = Restangular.all('_stats/index,store');
var allData = restCall.get();
var allData2 = restCall.getList();
}]);
The get and getList fail with different errors.
The get returns: TypeError: Cannot read property 'toString' of undefined
The getList returns: Error: Response for getList SHOULD be an array and not an object or something else
Thank you, Gregg