1 define(['app/yangui/yangui.module', 'common/yangutils/yangutils.services'], function(yangui, yangutils) {
3 yangui.register.factory('checkFlow', function($http, reqBuilder, apiConnector, yangUtils) {
5 var fnc = function($scope) {
6 var requestPath = $scope.selApi.basePath+'/'+$scope.selSubApi.buildApiRequestString().replace('config','operational'),
9 getPathIdentifierData = function(pathArray){
11 pathArray.forEach(function(item){
12 if( item.hasIdentifier() ) {
13 data += item.name + ': ' + item.identifierValue + '\n ';
19 $http({method: "GET", url: requestPath}).success(function(data) {
21 identifiers = getPathIdentifierData($scope.selSubApi.pathArray);
22 alert('Flow: \n\n' + identifiers + '\n\n is in controller.');
24 }).error(function(data, status) {
25 console.info('error sending request to',requestPath,'got',status,'data',data);
26 identifiers = getPathIdentifierData($scope.selSubApi.pathArray);
27 alert('Flow: \n\n' + identifiers + '\n\n isn\'t in controller.');
32 module: 'opendaylight-inventory',
34 pathString: '/config/opendaylight-inventory:nodes/node/{id}/table/{id}/flow/{id}/',
35 label: 'Verify operational flow',