From: shlomi Date: Sun, 15 Jan 2017 16:52:25 +0000 (+0200) Subject: add auto generated id for mef elements X-Git-Tag: release/carbon~36 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=3dfa830e16a04f631b1ac8df04536bd8ba2e2b49;p=unimgr.git add auto generated id for mef elements Change-Id: Icc8ba37a8c08e5c41b112f73a5c3a6cbe97b35b2 Signed-off-by: shlomi --- diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddEvc.tpl.html b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddEvc.tpl.html index 8507775d..5620cd09 100644 --- a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddEvc.tpl.html +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddEvc.tpl.html @@ -14,20 +14,20 @@
- - -
-
Number is required!
-
+ + +
+
Name is required!
+
- {{ typ }} + {{ typ }}
-
This is required!
-
+
This is required!
+
@@ -43,58 +43,58 @@
-
IP/Mask is required! (ex. 127.0.0.1/32)
-
+
IP/Mask is required! (ex. 127.0.0.1/32)
+
-
- - - Preserve VLAN - - - - -
-
Number is required!
-
-
-
- - - -
-
Number must be positive
-
-
- - - -
-
Number must be in range [1522..16384]
-
Number must be in range [1522..16384]
-
-
- - - - - Discard - Unconditional - Conditional - - - - - - - Discard - Unconditional - Conditional - - - +
+ + + Preserve VLAN + + + + +
+
Number is required!
+
+
+
+ + + +
+
Number must be positive
+
+
+ + + +
+
Number must be in range [1522..16384]
+
Number must be in range [1522..16384]
+
+
+ + + + + Discard + Unconditional + Conditional + + + + + + + Discard + Unconditional + Conditional + + + @@ -105,4 +105,4 @@ Create - \ No newline at end of file + diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddIpUni.tpl.html b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddIpUni.tpl.html index a2ef9838..8ee42c94 100644 --- a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddIpUni.tpl.html +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddIpUni.tpl.html @@ -14,8 +14,8 @@
- - + +
Number is required!
diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddIpvc.tpl.html b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddIpvc.tpl.html index de444bda..40fbe4ca 100644 --- a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddIpvc.tpl.html +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/dialogs/AddIpvc.tpl.html @@ -14,53 +14,53 @@
- - -
-
Number is required!
-
-
- - +
@@ -70,4 +70,4 @@ Create - \ No newline at end of file + diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/services/cpeui.services.js b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/services/cpeui.services.js index 6d41f7bb..5a169b8f 100644 --- a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/services/cpeui.services.js +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/services/cpeui.services.js @@ -1,6 +1,6 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { - cpeui.factory('CpeuiSvc', function($http) { + cpeui.factory('CpeuiSvc', function($http, Utils) { var baseUrl = "/restconf/config/mef-global:mef-global/"; var svc = {}; @@ -95,7 +95,7 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { } }); }; - + svc.deleteProfile = function(name, callback) { $http({ method:'DELETE', @@ -270,7 +270,7 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { // copy config fields like tenant-id if (confMap[u['uni-id']]){ for (var attrname in confMap[u['uni-id']]) { - u[attrname] = confMap[u['uni-id']][attrname]; + u[attrname] = confMap[u['uni-id']][attrname]; } } }); @@ -311,13 +311,15 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { // IPVCs svc.addIpvc = function(ipvc, tenant, callback) { + var ipvcId = Utils.randomId(); var data = { "mef-service" : { - "svc-id" : ipvc.id, + "svc-id" : ipvcId, + "name" : ipvc.svc_name, "svc-type" : 'eplan', "tenant-id" : tenant, "ipvc" : { - "ipvc-id" : ipvc.id, + "ipvc-id" : ipvcId, "ipvc-type" : 'multipoint', } } @@ -333,9 +335,10 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { }); }; - svc.addIpUni = function(uniid, ipuni_id, ip_address, vlan, segmentation_id, callback) { + svc.addIpUni = function(uniid, ip_address, vlan, segmentation_id, callback) { + var ipUniId = Utils.randomId(); var data = {"ip-uni":{ - "ip-uni-id": ipuni_id, + "ip-uni-id": ipUniId, "ip-address": ip_address }}; if (vlan){ @@ -354,7 +357,7 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { } }); }; - + svc.getAllIpUniSubnets = function(callback) { $http({ method:'GET', @@ -381,7 +384,7 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { svc.addIpUniSubnet = function(uniid, ipuniid, subnet, gateway, callback) { var data = { - "subnet": + "subnet": { "subnet": subnet, "uni-id":uniid, @@ -392,7 +395,7 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { $http( { method : 'POST', - url : "/restconf/config/mef-interfaces:mef-interfaces/subnets/", + url : "/restconf/config/mef-interfaces:mef-interfaces/subnets/", data : data }).then(function successCallback(response) { if (callback != undefined) { @@ -400,9 +403,9 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { } }); }; - + svc.deleteIpUniSubnet = function(uniid, ipuni_id, subnet, callback) { - + $http({ method:'DELETE', url:"/restconf/config/mef-interfaces:mef-interfaces/subnets/subnet/"+uniid+"/"+ipuni_id+"/"+subnet.replace("/","%2F")+"/" @@ -413,7 +416,7 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { }); }; svc.deleteIpUni = function(uniid, ipuni_id, callback) { - + $http({ method:'DELETE', url:"/restconf/config/mef-interfaces:mef-interfaces/unis/uni/"+uniid+"/ip-unis/ip-uni/"+ipuni_id+"/" @@ -423,7 +426,7 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { } }); }; - + svc.getIpUniSubnets = function(uniid, ipuni_id, callback) { $http({ method:'GET', @@ -438,7 +441,7 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { }); }; - + // EVCs function getJsonUnis(unis) { var uni_json = []; @@ -448,17 +451,19 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { unis.forEach(function(i){uni_json.push({"uni-id":i});}); return uni_json; } - + svc.addEvc = function(evc, evc_type, tenant, callback) { var uni_json = getJsonUnis(evc.unis); // preserved-vlan + var evcId = Utils.randomId(); var data = { "mef-service" : { - "svc-id" : evc.id, + "svc-id" : evcId, + "name" : evc.svc_name, "svc-type" : evc.svc_type, "tenant-id" : tenant, "evc" : { - "evc-id" : evc.id, + "evc-id" : evcId, "evc-type" : evc_type, "preserve-ce-vlan-id" : evc.is_preserve_vlan, "max-svc-frame-size" : evc.mtu_size, @@ -590,7 +595,7 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { } }); }; - + svc.deleteIpvcUni = function(svcid, uni_id, ipuni_id, callback) { $http({ method:'DELETE', @@ -601,9 +606,9 @@ define(['app/cpeui/cpeui.module'],function(cpeui) { } }); }; - - - + + + svc.addEvcUni = function(svcid, uni_id, role, vlans, profile_name, callback) { var data = {"uni":{ "uni-id":uni_id, diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/services/utils.js b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/services/utils.js index c181d248..4dbe208f 100644 --- a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/services/utils.js +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/services/utils.js @@ -8,4 +8,14 @@ define([ 'app/cpeui/cpeui.module' ], function(cpeui) { return (item[field_name] == value) != to_filter_out; }); }; + + cpeui.factory('Utils', function() { + var svc = {}; + + svc.randomId = function () { + return Math.floor(Math.random() * Math.pow(2, 31)); + }; + return svc; + }); + }); diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenant.controller.js b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenant.controller.js index ab92668c..75dcc49c 100644 --- a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenant.controller.js +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenant.controller.js @@ -162,7 +162,7 @@ define([ 'app/cpeui/cpeui.module' ], function(cpeui) { }; $scope.ipUniDialog = new CpeuiDialogs.Dialog('AddIpUni', {}, function(obj) { - CpeuiSvc.addIpUni(obj['uni-id'], obj['ip-uni-id'], obj['ip-address'], obj.vlan, obj['segmentation-id'], function() { + CpeuiSvc.addIpUni(obj['uni-id'], obj['ip-address'], obj.vlan, obj['segmentation-id'], function() { var uni = $scope.unis.filterByField('uni-id',obj['uni-id'])[0]; if (uni['ip-unis'] == undefined || uni['ip-unis']['ip-uni'] == undefined){ uni['ip-unis'] = {'ip-uni':[]}; @@ -313,16 +313,9 @@ define([ 'app/cpeui/cpeui.module' ], function(cpeui) { $scope.editVlanDialog = new CpeuiDialogs.Dialog('EditVlans', {}, undefined, editVlanController); - $scope.sortEvc = function(evc) { - return evc.evc['evc-id']; - }; $scope.sortUni = function(uni) { return uni['uni-id']; }; - $scope.sortIpvc = function(ipvc) { - return ipvc['ipvc-id']; - }; - init(); }); }); diff --git a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenant.tpl.html b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenant.tpl.html index eb8b5e52..acfe1158 100644 --- a/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenant.tpl.html +++ b/dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenant.tpl.html @@ -1,305 +1,309 @@
-

Tenant {{ curTenant }}

- -
-
-
EVCs Table
- - - - - - - - - - - - - - - - - - - - - - - - - - -
EVC IDNetwork NameSVC TypeEVC TypeTenantUNIs
{{ item.evc['evc-id'] }}{{ networkNames[item['svc-id']] }}{{ item['svc-type'] }}{{ title(item.evc['evc-type']) }}{{ item['tenant-id'] }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - DeviceUNIRoleVLANs (click to edit)Profile - -
{{ cesDisplayNames[ce] }}{{ uni.prettyID }}{{ uni['role'] }} - {{ uni.vlans.join(', ') }} {{item.evc['preserve-ce-vlan-id'] ? '(Preserved)' : ''}} - {{ uni['ingress-bw-profile'] }} - -
{{ uni.prettyID }}{{ uni['role'] }} - {{ uni.vlans.join(', ') }} {{item.evc['preserve-ce-vlan-id'] ? '(Preserved)' : ''}} - {{ uni['ingress-bw-profile'] }} - -
-
- -
-
-
IPVCs Table
- - - - - - - - - - - - - - - - - - - -
IPVC IDIPVC TypeTenantUNIs
{{ ipvc.ipvc['ipvc-id'] }}{{ ipvc.ipvc['ipvc-type'] }}{{ ipvc['tenant-id'] }} - - - - - - - - - - - - - - - - - - - - - - - -
- - DeviceUNIIP AddressVlanProfile
{{ cesDisplayNames[ipuni.device] }}{{ ipuni.prettyID }}{{serviceIpuni['ip-address']}}{{serviceIpuni.vlan}}{{ ipuni['ingress-bw-profile'] }}
-
- -
-
-
Tenant UNIs
- - - - - - - - - - - - - - - -
DeviceUNIPorts
{{ cesDisplayNames[uni.device] }}{{ uni.prettyID }} - - - - - - - - - - - - - - - - - - - - - -
- - IP UNI IDVLANAddressRemote Subnets
{{ ipuni['ip-uni-id'] }}{{ ipuni.vlan }}{{ ipuni['ip-address'] }} - - - - - - - - - - - - - - - - - -
- - SubnetGateway
{{ subnet.subnet }}{{ subnet.gateway }}
-
-
-
-
-
- -
+

Tenant {{ curTenant }}

+ +
+
+
EVCs Table
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EVC NameEVC IDNetwork NameSVC TypeEVC TypeTenantUNIs
{{ item['name'] }}{{ item.evc['evc-id'] }}{{ networkNames[item['svc-id']] }}{{ item['svc-type'] }}{{ title(item.evc['evc-type']) }}{{ item['tenant-id'] }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + DeviceUNIRoleVLANs (click to edit)Profile + +
{{ cesDisplayNames[ce] }}{{ uni.prettyID }}{{ uni['role'] }} + {{ uni.vlans.join(', ') }} {{item.evc['preserve-ce-vlan-id'] ? '(Preserved)' : ''}} + {{ uni['ingress-bw-profile'] }} + +
{{ uni.prettyID }}{{ uni['role'] }} + {{ uni.vlans.join(', ') }} {{item.evc['preserve-ce-vlan-id'] ? '(Preserved)' : ''}} + {{ uni['ingress-bw-profile'] }} + +
+
+ +
+
+
IPVCs Table
+ + + + + + + + + + + + + + + + + + + + + +
IPVC NameIPVC IDIPVC TypeTenantUNIs
{{ ipvc['name'] }}{{ ipvc.ipvc['ipvc-id'] }}{{ ipvc.ipvc['ipvc-type'] }}{{ ipvc['tenant-id'] }} + + + + + + + + + + + + + + + + + + + + + + + +
+ + DeviceUNIIP AddressVlanProfile
{{ cesDisplayNames[ipuni.device] }}{{ ipuni.prettyID }}{{serviceIpuni['ip-address']}}{{serviceIpuni.vlan}}{{ ipuni['ingress-bw-profile'] }}
+
+ +
+
+
Tenant UNIs
+ + + + + + + + + + + + + + + +
DeviceUNIPorts
{{ cesDisplayNames[uni.device] }}{{ uni.prettyID }} + + + + + + + + + + + + + + + + + + + + + +
+ + IP UNI IDVLANAddressRemote Subnets
{{ ipuni['ip-uni-id'] }}{{ ipuni.vlan }}{{ ipuni['ip-address'] }} + + + + + + + + + + + + + + + + + +
+ + SubnetGateway
{{ subnet.subnet }}{{ subnet.gateway }}
+
+
+
+
+
+ +
diff --git a/legato-api/src/main/yang/mef-services.yang b/legato-api/src/main/yang/mef-services.yang index b0237594..8a23c835 100644 --- a/legato-api/src/main/yang/mef-services.yang +++ b/legato-api/src/main/yang/mef-services.yang @@ -1609,11 +1609,16 @@ module mef-services { } } leaf svc-id { - type mef-types:retail-svc-id-type; - description - "The MEF Service ID is a simple key used to " + - "distinguish MEF Service Configuration Groups."; - reference "[MEF10.3] Section 7."; + type mef-types:retail-svc-id-type; + description + "The MEF Service ID is a simple key used to " + + "distinguish MEF Service Configuration Groups."; + reference "[MEF10.3] Section 7."; + } + leaf name { + type mef-types:identifier45; + description + "The MEF Service name."; } leaf sp-id { when "/mef-global:mef-global/mef-global:svc-providers" {