});
}
- function getByEpg(epg, successCallback) {
+ function getByEpg(epg, tenant, successCallback) {
/* jshint validthis:true */
var self = this;
var restObj = Restangular.one('restconf').one('operational').one('base-endpoint:endpoints');
return restObj.get().then(function (data) {
- //var endpoints = $filter('filter')(data.endpoints['address-endpoints']['address-endpoint'], {'endpoint-group': epg.id});
- var endpoints = $filter('filter')(data.endpoints['address-endpoints']['address-endpoint'].map(function(endpoint) {
- return endpoint;
- }),
- function(ep) {
- if(ep['endpoint-group'].indexOf(epg.id) != -1)
+ var endpoints = $filter('filter')(
+ data.endpoints['address-endpoints']['address-endpoint'].map(function(endpoint) {
+ return endpoint;
+ }),
+ function (ep) {
+ if (ep.tenant === tenant && ep['endpoint-group'].indexOf(epg.id) !== -1) {
return true;
+ }
}
);
self.setData(endpoints);