2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 define(['app/vpp/vpp.module'], function(vpp) {
9 vpp.register.factory('bdmVppService', function(VPPRestangular) {
12 var Vpp = function(nodeId, vppId) {
13 this['node-id'] = nodeId || null;
14 this['supporting-node'] = [
16 'topology-ref': 'topology-netconf',
20 this['netconf-node-topology:pass-through'] = {};
23 s.createObj = function(nodeId, vppId) {
24 return new Vpp(nodeId, vppId);
27 s.add = function(vpp, bridgeDomainId, successCallback, errorCallback) {
28 var restObj = VPPRestangular.one('restconf').one('config').one('network-topology:network-topology').one('topology').one(bridgeDomainId).one('node').one(vpp['node-id']);
29 var dataObj = {'node': [vpp]};
31 restObj.customPUT(dataObj).then(function(data) {
32 successCallback(data);
34 errorCallback(res.data, res.status);
38 s.get = function(bridgeDomainId, successCallback, errorCallback) {
39 var restObj = VPPRestangular.one('restconf').one('config').one('network-topology:network-topology').one('topology').one(bridgeDomainId);
41 restObj.get().then(function(data) {
42 successCallback(data);
44 errorCallback(res.data, res.status);