").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),s=i.uniqueId().attr("id");return e("
").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),this.tooltips[s]={element:t,tooltip:i}},_find:function(e){var t=e.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur"),a=s.element;n.target=n.currentTarget=a[0],t.close(n,!0),e("#"+i).remove(),a.data("ui-tooltip-title")&&(a.attr("title")||a.attr("title",a.data("ui-tooltip-title")),a.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}})});
\ No newline at end of file
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/bower_components/ngTraverse/ngTraverse.js b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/bower_components/ngTraverse/ngTraverse.js
new file mode 100644
index 00000000..b9664da3
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/bower_components/ngTraverse/ngTraverse.js
@@ -0,0 +1,392 @@
+(function (root, factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(['angular'], factory);
+ } else if (typeof exports === 'object') {
+ // Node. Does not work with strict CommonJS, but
+ // only CommonJS-like environments that support module.exports,
+ // like Node.
+ module.exports = factory(require('angular'));
+ } else {
+ // Browser globals (root is window)
+ root.returnExports = factory(root.angular);
+ }
+}(this, function (angular) {
+
+ /**
+ * Define our ngTraverse module
+ * @type {module}
+ */
+ var app = angular.module('ngTraverse', []);
+
+
+ app.factory('traverse', ['$q', '$log', function ($q, $log) {
+
+ var traverse = function (obj) {
+ return new Traverse(obj);
+ };
+
+ function Traverse(obj) {
+ this.value = obj;
+ }
+
+ Traverse.prototype.get = function (ps) {
+ var node = this.value;
+ for (var i = 0; i < ps.length; i++) {
+ var key = ps[i];
+ if (!node || !hasOwnProperty.call(node, key)) {
+ node = undefined;
+ break;
+ }
+ node = node[key];
+ }
+ return node;
+ };
+
+ Traverse.prototype.has = function (ps) {
+ var node = this.value;
+ for (var i = 0; i < ps.length; i++) {
+ var key = ps[i];
+ if (!node || !hasOwnProperty.call(node, key)) {
+ return false;
+ }
+ node = node[key];
+ }
+ return true;
+ };
+
+ Traverse.prototype.set = function (ps, value) {
+ var node = this.value;
+ for (var i = 0; i < ps.length - 1; i++) {
+ var key = ps[i];
+ if (!hasOwnProperty.call(node, key)) node[key] = {};
+ node = node[key];
+ }
+ node[ps[i]] = value;
+ return value;
+ };
+
+ Traverse.prototype.map = function (cb) {
+ return walk(this.value, cb, true);
+ };
+
+ Traverse.prototype.forEach = function (cb) {
+ this.value = walk(this.value, cb, false);
+ return this.value;
+ };
+
+ Traverse.prototype.reduce = function (cb, init) {
+ var skip = arguments.length === 1;
+ var acc = skip ? this.value : init;
+ this.forEach(function (x) {
+ if (!this.isRoot || !skip) {
+ acc = cb.call(this, acc, x);
+ }
+ });
+ return acc;
+ };
+
+ Traverse.prototype.paths = function () {
+ var acc = [];
+ this.forEach(function (x) {
+ acc.push(this.path);
+ });
+ return acc;
+ };
+
+ Traverse.prototype.nodes = function () {
+ var acc = [];
+ this.forEach(function (x) {
+ acc.push(this.node);
+ });
+ return acc;
+ };
+
+ Traverse.prototype.clone = function () {
+ var parents = [], nodes = [];
+
+ return (function clone(src) {
+ for (var i = 0; i < parents.length; i++) {
+ if (parents[i] === src) {
+ return nodes[i];
+ }
+ }
+
+ if (typeof src === 'object' && src !== null) {
+ var dst = copy(src);
+
+ parents.push(src);
+ nodes.push(dst);
+
+ forEach(objectKeys(src), function (key) {
+ dst[key] = clone(src[key]);
+ });
+
+ parents.pop();
+ nodes.pop();
+ return dst;
+ }
+ else {
+ return src;
+ }
+ })(this.value);
+ };
+
+ function walk(root, cb, immutable) {
+ var path = [];
+ var parents = [];
+ var alive = true;
+
+ return (function walker(node_) {
+ var node = immutable ? copy(node_) : node_;
+ var modifiers = {};
+
+ var keepGoing = true;
+
+ var state = {
+ node: node,
+ node_: node_,
+ path: [].concat(path),
+ parent: parents[parents.length - 1],
+ parents: parents,
+ key: path.slice(-1)[0],
+ isRoot: path.length === 0,
+ level: path.length,
+ circular: null,
+ update: function (x, stopHere) {
+ if (!state.isRoot) {
+ state.parent.node[state.key] = x;
+ }
+ state.node = x;
+ if (stopHere) keepGoing = false;
+ },
+ 'delete': function (stopHere) {
+ delete state.parent.node[state.key];
+ if (stopHere) keepGoing = false;
+ },
+ remove: function (stopHere) {
+ if (isArray(state.parent.node)) {
+ state.parent.node.splice(state.key, 1);
+ }
+ else {
+ delete state.parent.node[state.key];
+ }
+ if (stopHere) keepGoing = false;
+ },
+ keys: null,
+ before: function (f) {
+ modifiers.before = f
+ },
+ after: function (f) {
+ modifiers.after = f
+ },
+ pre: function (f) {
+ modifiers.pre = f
+ },
+ post: function (f) {
+ modifiers.post = f
+ },
+ stop: function () {
+ alive = false
+ },
+ block: function () {
+ keepGoing = false
+ }
+ };
+
+ if (!alive) return state;
+
+ function updateState() {
+ if (typeof state.node === 'object' && state.node !== null) {
+ if (!state.keys || state.node_ !== state.node) {
+ state.keys = objectKeys(state.node)
+ }
+
+ state.isLeaf = state.keys.length == 0;
+
+ for (var i = 0; i < parents.length; i++) {
+ if (parents[i].node_ === node_) {
+ state.circular = parents[i];
+ break;
+ }
+ }
+ }
+ else {
+ state.isLeaf = true;
+ state.keys = null;
+ }
+
+ state.notLeaf = !state.isLeaf;
+ state.notRoot = !state.isRoot;
+ }
+
+ updateState();
+
+ // use return values to update if defined
+ var ret = cb.call(state, state.node);
+ if (ret !== undefined && state.update) state.update(ret);
+
+ if (modifiers.before) modifiers.before.call(state, state.node);
+
+ if (!keepGoing) return state;
+
+ if (typeof state.node == 'object'
+ && state.node !== null && !state.circular) {
+ parents.push(state);
+
+ updateState();
+
+ forEach(state.keys, function (key, i) {
+ path.push(key);
+
+ if (modifiers.pre) modifiers.pre.call(state, state.node[key], key);
+
+ var child = walker(state.node[key]);
+ if (immutable && hasOwnProperty.call(state.node, key)) {
+ state.node[key] = child.node;
+ }
+
+ child.isLast = i == state.keys.length - 1;
+ child.isFirst = i == 0;
+
+ if (modifiers.post) modifiers.post.call(state, child);
+
+ path.pop();
+ });
+ parents.pop();
+ }
+
+ if (modifiers.after) modifiers.after.call(state, state.node);
+
+ return state;
+ })(root).node;
+ }
+
+ function copy(src) {
+ if (typeof src === 'object' && src !== null) {
+ var dst;
+
+ if (isArray(src)) {
+ dst = [];
+ }
+ else if (isDate(src)) {
+ dst = new Date(src.getTime ? src.getTime() : src);
+ }
+ else if (isRegExp(src)) {
+ dst = new RegExp(src);
+ }
+ else if (isError(src)) {
+ dst = { message: src.message };
+ }
+ else if (isBoolean(src)) {
+ dst = new Boolean(src);
+ }
+ else if (isNumber(src)) {
+ dst = new Number(src);
+ }
+ else if (isString(src)) {
+ dst = new String(src);
+ }
+ else if (Object.create && Object.getPrototypeOf) {
+ dst = Object.create(Object.getPrototypeOf(src));
+ }
+ else if (src.constructor === Object) {
+ dst = {};
+ }
+ else {
+ var proto =
+ (src.constructor && src.constructor.prototype)
+ || src.__proto__
+ || {}
+ ;
+ var T = function () {
+ };
+ T.prototype = proto;
+ dst = new T;
+ }
+
+ forEach(objectKeys(src), function (key) {
+ dst[key] = src[key];
+ });
+ return dst;
+ }
+ else return src;
+ }
+
+ var objectKeys = Object.keys || function keys(obj) {
+ var res = [];
+ for (var key in obj) res.push(key)
+ return res;
+ };
+
+ function toS(obj) {
+ return Object.prototype.toString.call(obj)
+ }
+
+ function isDate(obj) {
+ return toS(obj) === '[object Date]'
+ }
+
+ function isRegExp(obj) {
+ return toS(obj) === '[object RegExp]'
+ }
+
+ function isError(obj) {
+ return toS(obj) === '[object Error]'
+ }
+
+ function isBoolean(obj) {
+ return toS(obj) === '[object Boolean]'
+ }
+
+ function isNumber(obj) {
+ return toS(obj) === '[object Number]'
+ }
+
+ function isString(obj) {
+ return toS(obj) === '[object String]'
+ }
+
+ var isArray = Array.isArray || function isArray(xs) {
+ return Object.prototype.toString.call(xs) === '[object Array]';
+ };
+
+ var forEach = function (xs, fn) {
+ if (xs.forEach) return xs.forEach(fn)
+ else for (var i = 0; i < xs.length; i++) {
+ fn(xs[i], i, xs);
+ }
+ };
+
+ forEach(objectKeys(Traverse.prototype), function (key) {
+ traverse[key] = function (obj) {
+ var args = [].slice.call(arguments, 1);
+ var t = new Traverse(obj);
+ return t[key].apply(t, args);
+ };
+ });
+
+ var hasOwnProperty = Object.hasOwnProperty || function (obj, key) {
+ return key in obj;
+ };
+
+ return traverse;
+
+ }]);
+
+
+ //return the app
+ return app;
+
+}));
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/config.rb b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/config.rb
new file mode 100644
index 00000000..67390ed9
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/config.rb
@@ -0,0 +1,26 @@
+require 'compass/import-once/activate'
+# Require any additional compass plugins here.
+
+# Set this to the root of your project when deployed:
+http_path = "/"
+css_dir = "stylesheets"
+sass_dir = "sass"
+images_dir = "images"
+javascripts_dir = "javascripts"
+
+# You can select your preferred output style here (can be overridden via the command line):
+# output_style = :expanded or :nested or :compact or :compressed
+output_style = :compact
+
+# To enable relative paths to assets via compass helper functions. Uncomment:
+# relative_assets = true
+
+# To disable debugging comments that display the original location of your selectors. Uncomment:
+line_comments = false
+
+
+# If you prefer the indented syntax, you might want to regenerate this
+# project again passing --syntax sass, or you can uncomment this:
+# preferred_syntax = :sass
+# and then run:
+# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/fonts b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/fonts
new file mode 120000
index 00000000..df97cffa
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/fonts
@@ -0,0 +1 @@
+../bower_components/font-awesome-sass/assets/fonts
\ No newline at end of file
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/sass/ie.scss b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/sass/ie.scss
new file mode 100644
index 00000000..5cd5b6c5
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/sass/ie.scss
@@ -0,0 +1,5 @@
+/* Welcome to Compass. Use this file to write IE specific override styles.
+ * Import this file using the following HTML or equivalent:
+ * */
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/sass/print.scss b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/sass/print.scss
new file mode 100644
index 00000000..b0e9e456
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/sass/print.scss
@@ -0,0 +1,3 @@
+/* Welcome to Compass. Use this file to define print styles.
+ * Import this file using the following HTML or equivalent:
+ *
*/
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/sass/screen.scss b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/sass/screen.scss
new file mode 100644
index 00000000..553f81b4
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/sass/screen.scss
@@ -0,0 +1,153 @@
+//@import "compass/reset";
+@import "compass/css3";
+
+$fa-font-path: "../netopeer-gui/bundles/fitmoduledefault/netopeerangular/css/fonts/font-awesome/";
+
+@import "../../bower_components/font-awesome-sass/assets/stylesheets/font-awesome-compass";
+@import "../../bower_components/font-awesome-sass/assets/stylesheets/font-awesome";
+
+/* JSON VIEW */
+
+/* striped background */
+
+.jsonView { padding: 30px 0 0 5px;
+ select.form-control { margin: 0; padding: 0; width: 100px; display: inline; padding-left: 5px;
+ }
+ input, select { position: relative; z-index: 10; }
+
+ input { margin: 0; padding: 0;
+ &.form-control { width: 100px; display: inline; padding-left: 5px; position: relative; z-index: 2; }
+ &[type="text"], &[type="number"] { margin: 0; border: 1px solid #ccc; background: #fff; }
+ &[type="checkbox"] { position: absolute; }
+ &.keyinput { font-weight: bold; }
+
+ &[type="text"] {
+ &.addItemKeyInput, &.addItemValueInput { border: 1px solid #ccc; background: white; margin-left: 0; }
+ }
+ }
+ .addItemKeyInput { font-weight: bold; }
+ .toggle-control { float: left; cursor: pointer; position: relative; right: 22px; margin-right: -15px; background: #f0f0f0; }
+ > json > .fa-minus-square-o { display: none; }
+ .addObjectItemBtn { background-color: transparent; border-color: transparent; padding: 0; border: 0;display: block;
+ i { display: block; }
+ }
+ .editbar { margin-left: 0px; }
+
+ .iconButton { margin-left: 2px; position: relative; top: -1px; z-index: 0; cursor: pointer; @include opacity(0.2);
+ &:hover { @include opacity(1); }
+ }
+ .jsonObjectKey { font-weight: bold;
+ .key-name { margin-right: 25px; min-width: 130px; display: inline-block; }
+ &.objectOrArrayCover {
+ > .key-name { min-width: 0; }
+ }
+ }
+ .strike { text-decoration: line-through; }
+}
+
+/* inputs */
+
+/* chevrons */
+
+/* add and delete */
+
+/* basic layout */
+
+.jsonContents { margin-left: 25px; position: relative;
+ &:before { content: ""; position: absolute; border-left: 1px solid #ccc; z-index: 0; top: 0; bottom: 0; left: -17px; }
+ li .jsonContents { margin-left: 0px; }
+ li .jsonContents .jsonContents { margin-left: 25px; }
+ li .jsonContents {
+ .arrayOl, .listOl {
+ .jsonContents { margin-left: 0px; }
+ }
+ }
+}
+
+
+.jsonView {
+ .block { clear: both; display: block; margin-top: 0.5em; margin-bottom: 0.5em; }
+ .block, .arrayItem { /*position: relative; z-index: 1;*/
+ &:before { content: ""; position: absolute; left: -100%; right: 0; padding: 3px 0px;
+ margin-top: -3px; height: 14px; z-index: 0; }
+ //> * { position: static; z-index: 2; }
+ &:hover {
+ &:before { background: rgba(#000, 0.1); }
+ }
+ &.modified {
+ &:before { background: rgba(blue, 0.2); }
+ }
+ }
+ .jsonItemDesc { color: grey; cursor: default; line-height: 30px; }
+ .objectDesc { cursor: default; }
+ > json > .jsonItemDesc { display: block; float: left; position: relative; bottom: 25px; height: 0; width: 0; }
+ add-item { display: block; min-height: 20px;
+ .addObjectItemBtn { position: relative; z-index: 10; @include opacity(0.3);
+ &:hover { @include opacity(1); }
+ }
+ }
+ //switch-item { margin-right: 15px; }
+ .arrayItem {
+ //.jsonContents { margin-top: -14px; }
+ }
+ //ol.arrayOl { margin: 0; padding-left: 20px; }
+ li {clear: both; min-height: 26px; }
+ ol.listOl > .arrayItem, ul.dropdown-menu li { list-style: none !important; }
+ ol.arrayOl, ol.listOl {
+ .toggle-control { margin-left: -20px; top: 1.3em; display: none; }
+ //.fa-minus-square-o { top: 7px; }
+ //.fa-plus-square-o { top: -16px; }
+ > li > span > span > json > {
+ .toggle-control { left: -40px; }
+ }
+ li, li li { color: grey; list-style-type: decimal;
+ input { font-style: normal; }
+ }
+ ol.arrayOl, ol.listOl { margin-top: 0.5em;
+ & + add-item .block { margin-left: 25px; }
+ }
+ }
+ li {
+ select, button { font-style: normal;}
+ }
+ ol.listOl {
+ > li {
+ &.arrayItem {
+ &:before { display: none; }
+ }
+ + li { border-top: 1px dotted #ccc; padding-top: 1em; }
+ }
+
+ }
+ ol.arrayOl {
+ margin-left: 25px; margin-top: 15px;
+ }
+ ol.arrayOl, ol.listOl {
+ li *:not(.btn):not(.jsonItemDesc):not(.tooltip-inner) { color: black; }
+ }
+ li li {
+ list-style-type: lower-roman;
+ li {
+ list-style-type: upper-roman;
+ li {
+ list-style-type: lower-latin;
+ li {
+ list-style-type: upper-latin;
+ li {
+ list-style-type: lower-greek;
+ li {
+ list-style-type: decimal;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+/* first brace */
+
+/* array numbering */
+
+.sortable-placeholder { height: 20px; display: block; }
+
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/stylesheets/ie.css b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/stylesheets/ie.css
new file mode 100644
index 00000000..595d0558
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/stylesheets/ie.css
@@ -0,0 +1 @@
+/* Welcome to Compass. Use this file to write IE specific override styles. Import this file using the following HTML or equivalent: */
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/stylesheets/print.css b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/stylesheets/print.css
new file mode 100644
index 00000000..0a6606ce
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/stylesheets/print.css
@@ -0,0 +1 @@
+/* Welcome to Compass. Use this file to define print styles. Import this file using the following HTML or equivalent:
*/
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/stylesheets/screen.css b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/stylesheets/screen.css
new file mode 100644
index 00000000..8baf3d91
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/css/stylesheets/screen.css
@@ -0,0 +1,1354 @@
+@charset "UTF-8";
+/*!
+ * Font Awesome 4.5.0 by @davegandy - http://fontawesome.io - @fontawesome
+ * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
+ */
+/* FONT PATH -------------------------- */
+@font-face { font-family: 'FontAwesome'; src: url(/fonts/../netopeer-gui/bundles/fitmoduledefault/netopeerangular/css/fonts/font-awesome/fontawesome-webfont.eot?v=4.5.0); src: url(/fonts/../netopeer-gui/bundles/fitmoduledefault/netopeerangular/css/fonts/font-awesome/fontawesome-webfont.eot?v=4.5.0#iefix) format("embedded-opentype"), url(/fonts/../netopeer-gui/bundles/fitmoduledefault/netopeerangular/css/fonts/font-awesome/fontawesome-webfont.woff2?v=4.5.0) format("woff2"), url(/fonts/../netopeer-gui/bundles/fitmoduledefault/netopeerangular/css/fonts/font-awesome/fontawesome-webfont.woff?v=4.5.0) format("woff"), url(/fonts/../netopeer-gui/bundles/fitmoduledefault/netopeerangular/css/fonts/font-awesome/fontawesome-webfont.ttf?v=4.5.0) format("truetype"), url(/fonts/../netopeer-gui/bundles/fitmoduledefault/netopeerangular/css/fonts/font-awesome/fontawesome-webfont.svg?v=4.5.0#fontawesomeregular) format("svg"); font-weight: normal; font-style: normal; }
+.fa { display: inline-block; font: normal normal normal 14px/1 FontAwesome; font-size: inherit; text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
+
+/* makes the font 33% larger relative to the icon container */
+.fa-lg { font-size: 1.33333em; line-height: 0.75em; vertical-align: -15%; }
+
+.fa-2x { font-size: 2em; }
+
+.fa-3x { font-size: 3em; }
+
+.fa-4x { font-size: 4em; }
+
+.fa-5x { font-size: 5em; }
+
+.fa-fw { width: 1.28571em; text-align: center; }
+
+.fa-ul { padding-left: 0; margin-left: 2.14286em; list-style-type: none; }
+.fa-ul > li { position: relative; }
+
+.fa-li { position: absolute; left: -2.14286em; width: 2.14286em; top: 0.14286em; text-align: center; }
+.fa-li.fa-lg { left: -1.85714em; }
+
+.fa-border { padding: .2em .25em .15em; border: solid 0.08em #eee; border-radius: .1em; }
+
+.fa-pull-left { float: left; }
+
+.fa-pull-right { float: right; }
+
+.fa.fa-pull-left { margin-right: .3em; }
+.fa.fa-pull-right { margin-left: .3em; }
+
+/* Deprecated as of 4.4.0 */
+.pull-right { float: right; }
+
+.pull-left { float: left; }
+
+.fa.pull-left { margin-right: .3em; }
+.fa.pull-right { margin-left: .3em; }
+
+.fa-spin { -webkit-animation: fa-spin 2s infinite linear; animation: fa-spin 2s infinite linear; }
+
+.fa-pulse { -webkit-animation: fa-spin 1s infinite steps(8); animation: fa-spin 1s infinite steps(8); }
+
+@-webkit-keyframes fa-spin { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
+ 100% { -webkit-transform: rotate(359deg); transform: rotate(359deg); } }
+@keyframes fa-spin { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
+ 100% { -webkit-transform: rotate(359deg); transform: rotate(359deg); } }
+.fa-rotate-90 { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); -webkit-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg); }
+
+.fa-rotate-180 { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); -webkit-transform: rotate(180deg); -ms-transform: rotate(180deg); transform: rotate(180deg); }
+
+.fa-rotate-270 { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); -webkit-transform: rotate(270deg); -ms-transform: rotate(270deg); transform: rotate(270deg); }
+
+.fa-flip-horizontal { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0); -webkit-transform: scale(-1, 1); -ms-transform: scale(-1, 1); transform: scale(-1, 1); }
+
+.fa-flip-vertical { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); -webkit-transform: scale(1, -1); -ms-transform: scale(1, -1); transform: scale(1, -1); }
+
+:root .fa-rotate-90, :root .fa-rotate-180, :root .fa-rotate-270, :root .fa-flip-horizontal, :root .fa-flip-vertical { filter: none; }
+
+.fa-stack { position: relative; display: inline-block; width: 2em; height: 2em; line-height: 2em; vertical-align: middle; }
+
+.fa-stack-1x, .fa-stack-2x { position: absolute; left: 0; width: 100%; text-align: center; }
+
+.fa-stack-1x { line-height: inherit; }
+
+.fa-stack-2x { font-size: 2em; }
+
+.fa-inverse { color: #fff; }
+
+/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen readers do not read off random characters that represent icons */
+.fa-glass:before { content: ""; }
+
+.fa-music:before { content: ""; }
+
+.fa-search:before { content: ""; }
+
+.fa-envelope-o:before { content: ""; }
+
+.fa-heart:before { content: ""; }
+
+.fa-star:before { content: ""; }
+
+.fa-star-o:before { content: ""; }
+
+.fa-user:before { content: ""; }
+
+.fa-film:before { content: ""; }
+
+.fa-th-large:before { content: ""; }
+
+.fa-th:before { content: ""; }
+
+.fa-th-list:before { content: ""; }
+
+.fa-check:before { content: ""; }
+
+.fa-remove:before, .fa-close:before, .fa-times:before { content: ""; }
+
+.fa-search-plus:before { content: ""; }
+
+.fa-search-minus:before { content: ""; }
+
+.fa-power-off:before { content: ""; }
+
+.fa-signal:before { content: ""; }
+
+.fa-gear:before, .fa-cog:before { content: ""; }
+
+.fa-trash-o:before { content: ""; }
+
+.fa-home:before { content: ""; }
+
+.fa-file-o:before { content: ""; }
+
+.fa-clock-o:before { content: ""; }
+
+.fa-road:before { content: ""; }
+
+.fa-download:before { content: ""; }
+
+.fa-arrow-circle-o-down:before { content: ""; }
+
+.fa-arrow-circle-o-up:before { content: ""; }
+
+.fa-inbox:before { content: ""; }
+
+.fa-play-circle-o:before { content: ""; }
+
+.fa-rotate-right:before, .fa-repeat:before { content: ""; }
+
+.fa-refresh:before { content: ""; }
+
+.fa-list-alt:before { content: ""; }
+
+.fa-lock:before { content: ""; }
+
+.fa-flag:before { content: ""; }
+
+.fa-headphones:before { content: ""; }
+
+.fa-volume-off:before { content: ""; }
+
+.fa-volume-down:before { content: ""; }
+
+.fa-volume-up:before { content: ""; }
+
+.fa-qrcode:before { content: ""; }
+
+.fa-barcode:before { content: ""; }
+
+.fa-tag:before { content: ""; }
+
+.fa-tags:before { content: ""; }
+
+.fa-book:before { content: ""; }
+
+.fa-bookmark:before { content: ""; }
+
+.fa-print:before { content: ""; }
+
+.fa-camera:before { content: ""; }
+
+.fa-font:before { content: ""; }
+
+.fa-bold:before { content: ""; }
+
+.fa-italic:before { content: ""; }
+
+.fa-text-height:before { content: ""; }
+
+.fa-text-width:before { content: ""; }
+
+.fa-align-left:before { content: ""; }
+
+.fa-align-center:before { content: ""; }
+
+.fa-align-right:before { content: ""; }
+
+.fa-align-justify:before { content: ""; }
+
+.fa-list:before { content: ""; }
+
+.fa-dedent:before, .fa-outdent:before { content: ""; }
+
+.fa-indent:before { content: ""; }
+
+.fa-video-camera:before { content: ""; }
+
+.fa-photo:before, .fa-image:before, .fa-picture-o:before { content: ""; }
+
+.fa-pencil:before { content: ""; }
+
+.fa-map-marker:before { content: ""; }
+
+.fa-adjust:before { content: ""; }
+
+.fa-tint:before { content: ""; }
+
+.fa-edit:before, .fa-pencil-square-o:before { content: ""; }
+
+.fa-share-square-o:before { content: ""; }
+
+.fa-check-square-o:before { content: ""; }
+
+.fa-arrows:before { content: ""; }
+
+.fa-step-backward:before { content: ""; }
+
+.fa-fast-backward:before { content: ""; }
+
+.fa-backward:before { content: ""; }
+
+.fa-play:before { content: ""; }
+
+.fa-pause:before { content: ""; }
+
+.fa-stop:before { content: ""; }
+
+.fa-forward:before { content: ""; }
+
+.fa-fast-forward:before { content: ""; }
+
+.fa-step-forward:before { content: ""; }
+
+.fa-eject:before { content: ""; }
+
+.fa-chevron-left:before { content: ""; }
+
+.fa-chevron-right:before { content: ""; }
+
+.fa-plus-circle:before { content: ""; }
+
+.fa-minus-circle:before { content: ""; }
+
+.fa-times-circle:before { content: ""; }
+
+.fa-check-circle:before { content: ""; }
+
+.fa-question-circle:before { content: ""; }
+
+.fa-info-circle:before { content: ""; }
+
+.fa-crosshairs:before { content: ""; }
+
+.fa-times-circle-o:before { content: ""; }
+
+.fa-check-circle-o:before { content: ""; }
+
+.fa-ban:before { content: ""; }
+
+.fa-arrow-left:before { content: ""; }
+
+.fa-arrow-right:before { content: ""; }
+
+.fa-arrow-up:before { content: ""; }
+
+.fa-arrow-down:before { content: ""; }
+
+.fa-mail-forward:before, .fa-share:before { content: ""; }
+
+.fa-expand:before { content: ""; }
+
+.fa-compress:before { content: ""; }
+
+.fa-plus:before { content: ""; }
+
+.fa-minus:before { content: ""; }
+
+.fa-asterisk:before { content: ""; }
+
+.fa-exclamation-circle:before { content: ""; }
+
+.fa-gift:before { content: ""; }
+
+.fa-leaf:before { content: ""; }
+
+.fa-fire:before { content: ""; }
+
+.fa-eye:before { content: ""; }
+
+.fa-eye-slash:before { content: ""; }
+
+.fa-warning:before, .fa-exclamation-triangle:before { content: ""; }
+
+.fa-plane:before { content: ""; }
+
+.fa-calendar:before { content: ""; }
+
+.fa-random:before { content: ""; }
+
+.fa-comment:before { content: ""; }
+
+.fa-magnet:before { content: ""; }
+
+.fa-chevron-up:before { content: ""; }
+
+.fa-chevron-down:before { content: ""; }
+
+.fa-retweet:before { content: ""; }
+
+.fa-shopping-cart:before { content: ""; }
+
+.fa-folder:before { content: ""; }
+
+.fa-folder-open:before { content: ""; }
+
+.fa-arrows-v:before { content: ""; }
+
+.fa-arrows-h:before { content: ""; }
+
+.fa-bar-chart-o:before, .fa-bar-chart:before { content: ""; }
+
+.fa-twitter-square:before { content: ""; }
+
+.fa-facebook-square:before { content: ""; }
+
+.fa-camera-retro:before { content: ""; }
+
+.fa-key:before { content: ""; }
+
+.fa-gears:before, .fa-cogs:before { content: ""; }
+
+.fa-comments:before { content: ""; }
+
+.fa-thumbs-o-up:before { content: ""; }
+
+.fa-thumbs-o-down:before { content: ""; }
+
+.fa-star-half:before { content: ""; }
+
+.fa-heart-o:before { content: ""; }
+
+.fa-sign-out:before { content: ""; }
+
+.fa-linkedin-square:before { content: ""; }
+
+.fa-thumb-tack:before { content: ""; }
+
+.fa-external-link:before { content: ""; }
+
+.fa-sign-in:before { content: ""; }
+
+.fa-trophy:before { content: ""; }
+
+.fa-github-square:before { content: ""; }
+
+.fa-upload:before { content: ""; }
+
+.fa-lemon-o:before { content: ""; }
+
+.fa-phone:before { content: ""; }
+
+.fa-square-o:before { content: ""; }
+
+.fa-bookmark-o:before { content: ""; }
+
+.fa-phone-square:before { content: ""; }
+
+.fa-twitter:before { content: ""; }
+
+.fa-facebook-f:before, .fa-facebook:before { content: ""; }
+
+.fa-github:before { content: ""; }
+
+.fa-unlock:before { content: ""; }
+
+.fa-credit-card:before { content: ""; }
+
+.fa-feed:before, .fa-rss:before { content: ""; }
+
+.fa-hdd-o:before { content: ""; }
+
+.fa-bullhorn:before { content: ""; }
+
+.fa-bell:before { content: ""; }
+
+.fa-certificate:before { content: ""; }
+
+.fa-hand-o-right:before { content: ""; }
+
+.fa-hand-o-left:before { content: ""; }
+
+.fa-hand-o-up:before { content: ""; }
+
+.fa-hand-o-down:before { content: ""; }
+
+.fa-arrow-circle-left:before { content: ""; }
+
+.fa-arrow-circle-right:before { content: ""; }
+
+.fa-arrow-circle-up:before { content: ""; }
+
+.fa-arrow-circle-down:before { content: ""; }
+
+.fa-globe:before { content: ""; }
+
+.fa-wrench:before { content: ""; }
+
+.fa-tasks:before { content: ""; }
+
+.fa-filter:before { content: ""; }
+
+.fa-briefcase:before { content: ""; }
+
+.fa-arrows-alt:before { content: ""; }
+
+.fa-group:before, .fa-users:before { content: ""; }
+
+.fa-chain:before, .fa-link:before { content: ""; }
+
+.fa-cloud:before { content: ""; }
+
+.fa-flask:before { content: ""; }
+
+.fa-cut:before, .fa-scissors:before { content: ""; }
+
+.fa-copy:before, .fa-files-o:before { content: ""; }
+
+.fa-paperclip:before { content: ""; }
+
+.fa-save:before, .fa-floppy-o:before { content: ""; }
+
+.fa-square:before { content: ""; }
+
+.fa-navicon:before, .fa-reorder:before, .fa-bars:before { content: ""; }
+
+.fa-list-ul:before { content: ""; }
+
+.fa-list-ol:before { content: ""; }
+
+.fa-strikethrough:before { content: ""; }
+
+.fa-underline:before { content: ""; }
+
+.fa-table:before { content: ""; }
+
+.fa-magic:before { content: ""; }
+
+.fa-truck:before { content: ""; }
+
+.fa-pinterest:before { content: ""; }
+
+.fa-pinterest-square:before { content: ""; }
+
+.fa-google-plus-square:before { content: ""; }
+
+.fa-google-plus:before { content: ""; }
+
+.fa-money:before { content: ""; }
+
+.fa-caret-down:before { content: ""; }
+
+.fa-caret-up:before { content: ""; }
+
+.fa-caret-left:before { content: ""; }
+
+.fa-caret-right:before { content: ""; }
+
+.fa-columns:before { content: ""; }
+
+.fa-unsorted:before, .fa-sort:before { content: ""; }
+
+.fa-sort-down:before, .fa-sort-desc:before { content: ""; }
+
+.fa-sort-up:before, .fa-sort-asc:before { content: ""; }
+
+.fa-envelope:before { content: ""; }
+
+.fa-linkedin:before { content: ""; }
+
+.fa-rotate-left:before, .fa-undo:before { content: ""; }
+
+.fa-legal:before, .fa-gavel:before { content: ""; }
+
+.fa-dashboard:before, .fa-tachometer:before { content: ""; }
+
+.fa-comment-o:before { content: ""; }
+
+.fa-comments-o:before { content: ""; }
+
+.fa-flash:before, .fa-bolt:before { content: ""; }
+
+.fa-sitemap:before { content: ""; }
+
+.fa-umbrella:before { content: ""; }
+
+.fa-paste:before, .fa-clipboard:before { content: ""; }
+
+.fa-lightbulb-o:before { content: ""; }
+
+.fa-exchange:before { content: ""; }
+
+.fa-cloud-download:before { content: ""; }
+
+.fa-cloud-upload:before { content: ""; }
+
+.fa-user-md:before { content: ""; }
+
+.fa-stethoscope:before { content: ""; }
+
+.fa-suitcase:before { content: ""; }
+
+.fa-bell-o:before { content: ""; }
+
+.fa-coffee:before { content: ""; }
+
+.fa-cutlery:before { content: ""; }
+
+.fa-file-text-o:before { content: ""; }
+
+.fa-building-o:before { content: ""; }
+
+.fa-hospital-o:before { content: ""; }
+
+.fa-ambulance:before { content: ""; }
+
+.fa-medkit:before { content: ""; }
+
+.fa-fighter-jet:before { content: ""; }
+
+.fa-beer:before { content: ""; }
+
+.fa-h-square:before { content: ""; }
+
+.fa-plus-square:before { content: ""; }
+
+.fa-angle-double-left:before { content: ""; }
+
+.fa-angle-double-right:before { content: ""; }
+
+.fa-angle-double-up:before { content: ""; }
+
+.fa-angle-double-down:before { content: ""; }
+
+.fa-angle-left:before { content: ""; }
+
+.fa-angle-right:before { content: ""; }
+
+.fa-angle-up:before { content: ""; }
+
+.fa-angle-down:before { content: ""; }
+
+.fa-desktop:before { content: ""; }
+
+.fa-laptop:before { content: ""; }
+
+.fa-tablet:before { content: ""; }
+
+.fa-mobile-phone:before, .fa-mobile:before { content: ""; }
+
+.fa-circle-o:before { content: ""; }
+
+.fa-quote-left:before { content: ""; }
+
+.fa-quote-right:before { content: ""; }
+
+.fa-spinner:before { content: ""; }
+
+.fa-circle:before { content: ""; }
+
+.fa-mail-reply:before, .fa-reply:before { content: ""; }
+
+.fa-github-alt:before { content: ""; }
+
+.fa-folder-o:before { content: ""; }
+
+.fa-folder-open-o:before { content: ""; }
+
+.fa-smile-o:before { content: ""; }
+
+.fa-frown-o:before { content: ""; }
+
+.fa-meh-o:before { content: ""; }
+
+.fa-gamepad:before { content: ""; }
+
+.fa-keyboard-o:before { content: ""; }
+
+.fa-flag-o:before { content: ""; }
+
+.fa-flag-checkered:before { content: ""; }
+
+.fa-terminal:before { content: ""; }
+
+.fa-code:before { content: ""; }
+
+.fa-mail-reply-all:before, .fa-reply-all:before { content: ""; }
+
+.fa-star-half-empty:before, .fa-star-half-full:before, .fa-star-half-o:before { content: ""; }
+
+.fa-location-arrow:before { content: ""; }
+
+.fa-crop:before { content: ""; }
+
+.fa-code-fork:before { content: ""; }
+
+.fa-unlink:before, .fa-chain-broken:before { content: ""; }
+
+.fa-question:before { content: ""; }
+
+.fa-info:before { content: ""; }
+
+.fa-exclamation:before { content: ""; }
+
+.fa-superscript:before { content: ""; }
+
+.fa-subscript:before { content: ""; }
+
+.fa-eraser:before { content: ""; }
+
+.fa-puzzle-piece:before { content: ""; }
+
+.fa-microphone:before { content: ""; }
+
+.fa-microphone-slash:before { content: ""; }
+
+.fa-shield:before { content: ""; }
+
+.fa-calendar-o:before { content: ""; }
+
+.fa-fire-extinguisher:before { content: ""; }
+
+.fa-rocket:before { content: ""; }
+
+.fa-maxcdn:before { content: ""; }
+
+.fa-chevron-circle-left:before { content: ""; }
+
+.fa-chevron-circle-right:before { content: ""; }
+
+.fa-chevron-circle-up:before { content: ""; }
+
+.fa-chevron-circle-down:before { content: ""; }
+
+.fa-html5:before { content: ""; }
+
+.fa-css3:before { content: ""; }
+
+.fa-anchor:before { content: ""; }
+
+.fa-unlock-alt:before { content: ""; }
+
+.fa-bullseye:before { content: ""; }
+
+.fa-ellipsis-h:before { content: ""; }
+
+.fa-ellipsis-v:before { content: ""; }
+
+.fa-rss-square:before { content: ""; }
+
+.fa-play-circle:before { content: ""; }
+
+.fa-ticket:before { content: ""; }
+
+.fa-minus-square:before { content: ""; }
+
+.fa-minus-square-o:before { content: ""; }
+
+.fa-level-up:before { content: ""; }
+
+.fa-level-down:before { content: ""; }
+
+.fa-check-square:before { content: ""; }
+
+.fa-pencil-square:before { content: ""; }
+
+.fa-external-link-square:before { content: ""; }
+
+.fa-share-square:before { content: ""; }
+
+.fa-compass:before { content: ""; }
+
+.fa-toggle-down:before, .fa-caret-square-o-down:before { content: ""; }
+
+.fa-toggle-up:before, .fa-caret-square-o-up:before { content: ""; }
+
+.fa-toggle-right:before, .fa-caret-square-o-right:before { content: ""; }
+
+.fa-euro:before, .fa-eur:before { content: ""; }
+
+.fa-gbp:before { content: ""; }
+
+.fa-dollar:before, .fa-usd:before { content: ""; }
+
+.fa-rupee:before, .fa-inr:before { content: ""; }
+
+.fa-cny:before, .fa-rmb:before, .fa-yen:before, .fa-jpy:before { content: ""; }
+
+.fa-ruble:before, .fa-rouble:before, .fa-rub:before { content: ""; }
+
+.fa-won:before, .fa-krw:before { content: ""; }
+
+.fa-bitcoin:before, .fa-btc:before { content: ""; }
+
+.fa-file:before { content: ""; }
+
+.fa-file-text:before { content: ""; }
+
+.fa-sort-alpha-asc:before { content: ""; }
+
+.fa-sort-alpha-desc:before { content: ""; }
+
+.fa-sort-amount-asc:before { content: ""; }
+
+.fa-sort-amount-desc:before { content: ""; }
+
+.fa-sort-numeric-asc:before { content: ""; }
+
+.fa-sort-numeric-desc:before { content: ""; }
+
+.fa-thumbs-up:before { content: ""; }
+
+.fa-thumbs-down:before { content: ""; }
+
+.fa-youtube-square:before { content: ""; }
+
+.fa-youtube:before { content: ""; }
+
+.fa-xing:before { content: ""; }
+
+.fa-xing-square:before { content: ""; }
+
+.fa-youtube-play:before { content: ""; }
+
+.fa-dropbox:before { content: ""; }
+
+.fa-stack-overflow:before { content: ""; }
+
+.fa-instagram:before { content: ""; }
+
+.fa-flickr:before { content: ""; }
+
+.fa-adn:before { content: ""; }
+
+.fa-bitbucket:before { content: ""; }
+
+.fa-bitbucket-square:before { content: ""; }
+
+.fa-tumblr:before { content: ""; }
+
+.fa-tumblr-square:before { content: ""; }
+
+.fa-long-arrow-down:before { content: ""; }
+
+.fa-long-arrow-up:before { content: ""; }
+
+.fa-long-arrow-left:before { content: ""; }
+
+.fa-long-arrow-right:before { content: ""; }
+
+.fa-apple:before { content: ""; }
+
+.fa-windows:before { content: ""; }
+
+.fa-android:before { content: ""; }
+
+.fa-linux:before { content: ""; }
+
+.fa-dribbble:before { content: ""; }
+
+.fa-skype:before { content: ""; }
+
+.fa-foursquare:before { content: ""; }
+
+.fa-trello:before { content: ""; }
+
+.fa-female:before { content: ""; }
+
+.fa-male:before { content: ""; }
+
+.fa-gittip:before, .fa-gratipay:before { content: ""; }
+
+.fa-sun-o:before { content: ""; }
+
+.fa-moon-o:before { content: ""; }
+
+.fa-archive:before { content: ""; }
+
+.fa-bug:before { content: ""; }
+
+.fa-vk:before { content: ""; }
+
+.fa-weibo:before { content: ""; }
+
+.fa-renren:before { content: ""; }
+
+.fa-pagelines:before { content: ""; }
+
+.fa-stack-exchange:before { content: ""; }
+
+.fa-arrow-circle-o-right:before { content: ""; }
+
+.fa-arrow-circle-o-left:before { content: ""; }
+
+.fa-toggle-left:before, .fa-caret-square-o-left:before { content: ""; }
+
+.fa-dot-circle-o:before { content: ""; }
+
+.fa-wheelchair:before { content: ""; }
+
+.fa-vimeo-square:before { content: ""; }
+
+.fa-turkish-lira:before, .fa-try:before { content: ""; }
+
+.fa-plus-square-o:before { content: ""; }
+
+.fa-space-shuttle:before { content: ""; }
+
+.fa-slack:before { content: ""; }
+
+.fa-envelope-square:before { content: ""; }
+
+.fa-wordpress:before { content: ""; }
+
+.fa-openid:before { content: ""; }
+
+.fa-institution:before, .fa-bank:before, .fa-university:before { content: ""; }
+
+.fa-mortar-board:before, .fa-graduation-cap:before { content: ""; }
+
+.fa-yahoo:before { content: ""; }
+
+.fa-google:before { content: ""; }
+
+.fa-reddit:before { content: ""; }
+
+.fa-reddit-square:before { content: ""; }
+
+.fa-stumbleupon-circle:before { content: ""; }
+
+.fa-stumbleupon:before { content: ""; }
+
+.fa-delicious:before { content: ""; }
+
+.fa-digg:before { content: ""; }
+
+.fa-pied-piper:before { content: ""; }
+
+.fa-pied-piper-alt:before { content: ""; }
+
+.fa-drupal:before { content: ""; }
+
+.fa-joomla:before { content: ""; }
+
+.fa-language:before { content: ""; }
+
+.fa-fax:before { content: ""; }
+
+.fa-building:before { content: ""; }
+
+.fa-child:before { content: ""; }
+
+.fa-paw:before { content: ""; }
+
+.fa-spoon:before { content: ""; }
+
+.fa-cube:before { content: ""; }
+
+.fa-cubes:before { content: ""; }
+
+.fa-behance:before { content: ""; }
+
+.fa-behance-square:before { content: ""; }
+
+.fa-steam:before { content: ""; }
+
+.fa-steam-square:before { content: ""; }
+
+.fa-recycle:before { content: ""; }
+
+.fa-automobile:before, .fa-car:before { content: ""; }
+
+.fa-cab:before, .fa-taxi:before { content: ""; }
+
+.fa-tree:before { content: ""; }
+
+.fa-spotify:before { content: ""; }
+
+.fa-deviantart:before { content: ""; }
+
+.fa-soundcloud:before { content: ""; }
+
+.fa-database:before { content: ""; }
+
+.fa-file-pdf-o:before { content: ""; }
+
+.fa-file-word-o:before { content: ""; }
+
+.fa-file-excel-o:before { content: ""; }
+
+.fa-file-powerpoint-o:before { content: ""; }
+
+.fa-file-photo-o:before, .fa-file-picture-o:before, .fa-file-image-o:before { content: ""; }
+
+.fa-file-zip-o:before, .fa-file-archive-o:before { content: ""; }
+
+.fa-file-sound-o:before, .fa-file-audio-o:before { content: ""; }
+
+.fa-file-movie-o:before, .fa-file-video-o:before { content: ""; }
+
+.fa-file-code-o:before { content: ""; }
+
+.fa-vine:before { content: ""; }
+
+.fa-codepen:before { content: ""; }
+
+.fa-jsfiddle:before { content: ""; }
+
+.fa-life-bouy:before, .fa-life-buoy:before, .fa-life-saver:before, .fa-support:before, .fa-life-ring:before { content: ""; }
+
+.fa-circle-o-notch:before { content: ""; }
+
+.fa-ra:before, .fa-rebel:before { content: ""; }
+
+.fa-ge:before, .fa-empire:before { content: ""; }
+
+.fa-git-square:before { content: ""; }
+
+.fa-git:before { content: ""; }
+
+.fa-y-combinator-square:before, .fa-yc-square:before, .fa-hacker-news:before { content: ""; }
+
+.fa-tencent-weibo:before { content: ""; }
+
+.fa-qq:before { content: ""; }
+
+.fa-wechat:before, .fa-weixin:before { content: ""; }
+
+.fa-send:before, .fa-paper-plane:before { content: ""; }
+
+.fa-send-o:before, .fa-paper-plane-o:before { content: ""; }
+
+.fa-history:before { content: ""; }
+
+.fa-circle-thin:before { content: ""; }
+
+.fa-header:before { content: ""; }
+
+.fa-paragraph:before { content: ""; }
+
+.fa-sliders:before { content: ""; }
+
+.fa-share-alt:before { content: ""; }
+
+.fa-share-alt-square:before { content: ""; }
+
+.fa-bomb:before { content: ""; }
+
+.fa-soccer-ball-o:before, .fa-futbol-o:before { content: ""; }
+
+.fa-tty:before { content: ""; }
+
+.fa-binoculars:before { content: ""; }
+
+.fa-plug:before { content: ""; }
+
+.fa-slideshare:before { content: ""; }
+
+.fa-twitch:before { content: ""; }
+
+.fa-yelp:before { content: ""; }
+
+.fa-newspaper-o:before { content: ""; }
+
+.fa-wifi:before { content: ""; }
+
+.fa-calculator:before { content: ""; }
+
+.fa-paypal:before { content: ""; }
+
+.fa-google-wallet:before { content: ""; }
+
+.fa-cc-visa:before { content: ""; }
+
+.fa-cc-mastercard:before { content: ""; }
+
+.fa-cc-discover:before { content: ""; }
+
+.fa-cc-amex:before { content: ""; }
+
+.fa-cc-paypal:before { content: ""; }
+
+.fa-cc-stripe:before { content: ""; }
+
+.fa-bell-slash:before { content: ""; }
+
+.fa-bell-slash-o:before { content: ""; }
+
+.fa-trash:before { content: ""; }
+
+.fa-copyright:before { content: ""; }
+
+.fa-at:before { content: ""; }
+
+.fa-eyedropper:before { content: ""; }
+
+.fa-paint-brush:before { content: ""; }
+
+.fa-birthday-cake:before { content: ""; }
+
+.fa-area-chart:before { content: ""; }
+
+.fa-pie-chart:before { content: ""; }
+
+.fa-line-chart:before { content: ""; }
+
+.fa-lastfm:before { content: ""; }
+
+.fa-lastfm-square:before { content: ""; }
+
+.fa-toggle-off:before { content: ""; }
+
+.fa-toggle-on:before { content: ""; }
+
+.fa-bicycle:before { content: ""; }
+
+.fa-bus:before { content: ""; }
+
+.fa-ioxhost:before { content: ""; }
+
+.fa-angellist:before { content: ""; }
+
+.fa-cc:before { content: ""; }
+
+.fa-shekel:before, .fa-sheqel:before, .fa-ils:before { content: ""; }
+
+.fa-meanpath:before { content: ""; }
+
+.fa-buysellads:before { content: ""; }
+
+.fa-connectdevelop:before { content: ""; }
+
+.fa-dashcube:before { content: ""; }
+
+.fa-forumbee:before { content: ""; }
+
+.fa-leanpub:before { content: ""; }
+
+.fa-sellsy:before { content: ""; }
+
+.fa-shirtsinbulk:before { content: ""; }
+
+.fa-simplybuilt:before { content: ""; }
+
+.fa-skyatlas:before { content: ""; }
+
+.fa-cart-plus:before { content: ""; }
+
+.fa-cart-arrow-down:before { content: ""; }
+
+.fa-diamond:before { content: ""; }
+
+.fa-ship:before { content: ""; }
+
+.fa-user-secret:before { content: ""; }
+
+.fa-motorcycle:before { content: ""; }
+
+.fa-street-view:before { content: ""; }
+
+.fa-heartbeat:before { content: ""; }
+
+.fa-venus:before { content: ""; }
+
+.fa-mars:before { content: ""; }
+
+.fa-mercury:before { content: ""; }
+
+.fa-intersex:before, .fa-transgender:before { content: ""; }
+
+.fa-transgender-alt:before { content: ""; }
+
+.fa-venus-double:before { content: ""; }
+
+.fa-mars-double:before { content: ""; }
+
+.fa-venus-mars:before { content: ""; }
+
+.fa-mars-stroke:before { content: ""; }
+
+.fa-mars-stroke-v:before { content: ""; }
+
+.fa-mars-stroke-h:before { content: ""; }
+
+.fa-neuter:before { content: ""; }
+
+.fa-genderless:before { content: ""; }
+
+.fa-facebook-official:before { content: ""; }
+
+.fa-pinterest-p:before { content: ""; }
+
+.fa-whatsapp:before { content: ""; }
+
+.fa-server:before { content: ""; }
+
+.fa-user-plus:before { content: ""; }
+
+.fa-user-times:before { content: ""; }
+
+.fa-hotel:before, .fa-bed:before { content: ""; }
+
+.fa-viacoin:before { content: ""; }
+
+.fa-train:before { content: ""; }
+
+.fa-subway:before { content: ""; }
+
+.fa-medium:before { content: ""; }
+
+.fa-yc:before, .fa-y-combinator:before { content: ""; }
+
+.fa-optin-monster:before { content: ""; }
+
+.fa-opencart:before { content: ""; }
+
+.fa-expeditedssl:before { content: ""; }
+
+.fa-battery-4:before, .fa-battery-full:before { content: ""; }
+
+.fa-battery-3:before, .fa-battery-three-quarters:before { content: ""; }
+
+.fa-battery-2:before, .fa-battery-half:before { content: ""; }
+
+.fa-battery-1:before, .fa-battery-quarter:before { content: ""; }
+
+.fa-battery-0:before, .fa-battery-empty:before { content: ""; }
+
+.fa-mouse-pointer:before { content: ""; }
+
+.fa-i-cursor:before { content: ""; }
+
+.fa-object-group:before { content: ""; }
+
+.fa-object-ungroup:before { content: ""; }
+
+.fa-sticky-note:before { content: ""; }
+
+.fa-sticky-note-o:before { content: ""; }
+
+.fa-cc-jcb:before { content: ""; }
+
+.fa-cc-diners-club:before { content: ""; }
+
+.fa-clone:before { content: ""; }
+
+.fa-balance-scale:before { content: ""; }
+
+.fa-hourglass-o:before { content: ""; }
+
+.fa-hourglass-1:before, .fa-hourglass-start:before { content: ""; }
+
+.fa-hourglass-2:before, .fa-hourglass-half:before { content: ""; }
+
+.fa-hourglass-3:before, .fa-hourglass-end:before { content: ""; }
+
+.fa-hourglass:before { content: ""; }
+
+.fa-hand-grab-o:before, .fa-hand-rock-o:before { content: ""; }
+
+.fa-hand-stop-o:before, .fa-hand-paper-o:before { content: ""; }
+
+.fa-hand-scissors-o:before { content: ""; }
+
+.fa-hand-lizard-o:before { content: ""; }
+
+.fa-hand-spock-o:before { content: ""; }
+
+.fa-hand-pointer-o:before { content: ""; }
+
+.fa-hand-peace-o:before { content: ""; }
+
+.fa-trademark:before { content: ""; }
+
+.fa-registered:before { content: ""; }
+
+.fa-creative-commons:before { content: ""; }
+
+.fa-gg:before { content: ""; }
+
+.fa-gg-circle:before { content: ""; }
+
+.fa-tripadvisor:before { content: ""; }
+
+.fa-odnoklassniki:before { content: ""; }
+
+.fa-odnoklassniki-square:before { content: ""; }
+
+.fa-get-pocket:before { content: ""; }
+
+.fa-wikipedia-w:before { content: ""; }
+
+.fa-safari:before { content: ""; }
+
+.fa-chrome:before { content: ""; }
+
+.fa-firefox:before { content: ""; }
+
+.fa-opera:before { content: ""; }
+
+.fa-internet-explorer:before { content: ""; }
+
+.fa-tv:before, .fa-television:before { content: ""; }
+
+.fa-contao:before { content: ""; }
+
+.fa-500px:before { content: ""; }
+
+.fa-amazon:before { content: ""; }
+
+.fa-calendar-plus-o:before { content: ""; }
+
+.fa-calendar-minus-o:before { content: ""; }
+
+.fa-calendar-times-o:before { content: ""; }
+
+.fa-calendar-check-o:before { content: ""; }
+
+.fa-industry:before { content: ""; }
+
+.fa-map-pin:before { content: ""; }
+
+.fa-map-signs:before { content: ""; }
+
+.fa-map-o:before { content: ""; }
+
+.fa-map:before { content: ""; }
+
+.fa-commenting:before { content: ""; }
+
+.fa-commenting-o:before { content: ""; }
+
+.fa-houzz:before { content: ""; }
+
+.fa-vimeo:before { content: ""; }
+
+.fa-black-tie:before { content: ""; }
+
+.fa-fonticons:before { content: ""; }
+
+.fa-reddit-alien:before { content: ""; }
+
+.fa-edge:before { content: ""; }
+
+.fa-credit-card-alt:before { content: ""; }
+
+.fa-codiepie:before { content: ""; }
+
+.fa-modx:before { content: ""; }
+
+.fa-fort-awesome:before { content: ""; }
+
+.fa-usb:before { content: ""; }
+
+.fa-product-hunt:before { content: ""; }
+
+.fa-mixcloud:before { content: ""; }
+
+.fa-scribd:before { content: ""; }
+
+.fa-pause-circle:before { content: ""; }
+
+.fa-pause-circle-o:before { content: ""; }
+
+.fa-stop-circle:before { content: ""; }
+
+.fa-stop-circle-o:before { content: ""; }
+
+.fa-shopping-bag:before { content: ""; }
+
+.fa-shopping-basket:before { content: ""; }
+
+.fa-hashtag:before { content: ""; }
+
+.fa-bluetooth:before { content: ""; }
+
+.fa-bluetooth-b:before { content: ""; }
+
+.fa-percent:before { content: ""; }
+
+/* JSON VIEW */
+/* striped background */
+.jsonView { padding: 30px 0 0 5px; }
+.jsonView select.form-control { margin: 0; padding: 0; width: 100px; display: inline; padding-left: 5px; }
+.jsonView input, .jsonView select { position: relative; z-index: 10; }
+.jsonView input { margin: 0; padding: 0; }
+.jsonView input.form-control { width: 100px; display: inline; padding-left: 5px; position: relative; z-index: 2; }
+.jsonView input[type="text"], .jsonView input[type="number"] { margin: 0; border: 1px solid #ccc; background: #fff; }
+.jsonView input[type="checkbox"] { position: absolute; }
+.jsonView input.keyinput { font-weight: bold; }
+.jsonView input[type="text"].addItemKeyInput, .jsonView input[type="text"].addItemValueInput { border: 1px solid #ccc; background: white; margin-left: 0; }
+.jsonView .addItemKeyInput { font-weight: bold; }
+.jsonView .toggle-control { float: left; cursor: pointer; position: relative; right: 22px; margin-right: -15px; background: #f0f0f0; }
+.jsonView > json > .fa-minus-square-o { display: none; }
+.jsonView .addObjectItemBtn { background-color: transparent; border-color: transparent; padding: 0; border: 0; display: block; }
+.jsonView .addObjectItemBtn i { display: block; }
+.jsonView .editbar { margin-left: 0px; }
+.jsonView .iconButton { margin-left: 2px; position: relative; top: -1px; z-index: 0; cursor: pointer; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=20); opacity: 0.2; }
+.jsonView .iconButton:hover { filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false); opacity: 1; }
+.jsonView .jsonObjectKey { font-weight: bold; }
+.jsonView .jsonObjectKey .key-name { margin-right: 25px; min-width: 130px; display: inline-block; }
+.jsonView .jsonObjectKey.objectOrArrayCover > .key-name { min-width: 0; }
+.jsonView .strike { text-decoration: line-through; }
+
+/* inputs */
+/* chevrons */
+/* add and delete */
+/* basic layout */
+.jsonContents { margin-left: 25px; position: relative; }
+.jsonContents:before { content: ""; position: absolute; border-left: 1px solid #ccc; z-index: 0; top: 0; bottom: 0; left: -17px; }
+.jsonContents li .jsonContents { margin-left: 0px; }
+.jsonContents li .jsonContents .jsonContents { margin-left: 25px; }
+.jsonContents li .jsonContents .arrayOl .jsonContents, .jsonContents li .jsonContents .listOl .jsonContents { margin-left: 0px; }
+
+.jsonView .block { clear: both; display: block; margin-top: 0.5em; margin-bottom: 0.5em; }
+.jsonView .block, .jsonView .arrayItem { /*position: relative; z-index: 1;*/ }
+.jsonView .block:before, .jsonView .arrayItem:before { content: ""; position: absolute; left: -100%; right: 0; padding: 3px 0px; margin-top: -3px; height: 14px; z-index: 0; }
+.jsonView .block:hover:before, .jsonView .arrayItem:hover:before { background: rgba(0, 0, 0, 0.1); }
+.jsonView .block.modified:before, .jsonView .arrayItem.modified:before { background: rgba(0, 0, 255, 0.2); }
+.jsonView .jsonItemDesc { color: grey; cursor: default; line-height: 30px; }
+.jsonView .objectDesc { cursor: default; }
+.jsonView > json > .jsonItemDesc { display: block; float: left; position: relative; bottom: 25px; height: 0; width: 0; }
+.jsonView add-item { display: block; min-height: 20px; }
+.jsonView add-item .addObjectItemBtn { position: relative; z-index: 10; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=30); opacity: 0.3; }
+.jsonView add-item .addObjectItemBtn:hover { filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false); opacity: 1; }
+.jsonView li { clear: both; min-height: 26px; }
+.jsonView ol.listOl > .arrayItem, .jsonView ul.dropdown-menu li { list-style: none !important; }
+.jsonView ol.arrayOl .toggle-control, .jsonView ol.listOl .toggle-control { margin-left: -20px; top: 1.3em; display: none; }
+.jsonView ol.arrayOl > li > span > span > json > .toggle-control, .jsonView ol.listOl > li > span > span > json > .toggle-control { left: -40px; }
+.jsonView ol.arrayOl li, .jsonView ol.arrayOl li li, .jsonView ol.listOl li, .jsonView ol.listOl li li { color: grey; list-style-type: decimal; }
+.jsonView ol.arrayOl li input, .jsonView ol.arrayOl li li input, .jsonView ol.listOl li input, .jsonView ol.listOl li li input { font-style: normal; }
+.jsonView ol.arrayOl ol.arrayOl, .jsonView ol.arrayOl ol.listOl, .jsonView ol.listOl ol.arrayOl, .jsonView ol.listOl ol.listOl { margin-top: 0.5em; }
+.jsonView ol.arrayOl ol.arrayOl + add-item .block, .jsonView ol.arrayOl ol.listOl + add-item .block, .jsonView ol.listOl ol.arrayOl + add-item .block, .jsonView ol.listOl ol.listOl + add-item .block { margin-left: 25px; }
+.jsonView li select, .jsonView li button { font-style: normal; }
+.jsonView ol.listOl > li.arrayItem:before { display: none; }
+.jsonView ol.listOl > li + li { border-top: 1px dotted #ccc; padding-top: 1em; }
+.jsonView ol.arrayOl { margin-left: 25px; margin-top: 15px; }
+.jsonView ol.arrayOl li *:not(.btn):not(.jsonItemDesc):not(.tooltip-inner), .jsonView ol.listOl li *:not(.btn):not(.jsonItemDesc):not(.tooltip-inner) { color: black; }
+.jsonView li li { list-style-type: lower-roman; }
+.jsonView li li li { list-style-type: upper-roman; }
+.jsonView li li li li { list-style-type: lower-latin; }
+.jsonView li li li li li { list-style-type: upper-latin; }
+.jsonView li li li li li li { list-style-type: lower-greek; }
+.jsonView li li li li li li li { list-style-type: decimal; }
+
+/* first brace */
+/* array numbering */
+.sortable-placeholder { height: 20px; display: block; }
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/get.json b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/get.json
new file mode 100644
index 00000000..debf537e
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/get.json
@@ -0,0 +1,76 @@
+{
+ "$@ietf-interfaces:interfaces": {
+ "eltype": "leaf",
+ "config": "false",
+ "type": "enumeration",
+ "enumval": ["int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", "uint64", "float", "string"],
+ "description": "The data type of the parameters argument.",
+ "mandatory": "false",
+ "iskey": "false",
+ "children": ["interface", "interface-state"]
+ },
+ "ietf-interfaces:interfaces": {
+
+ "$@interface": {
+ "eltype": "list",
+ "config": "true",
+ "type": "enumeration",
+ "iskey": "false"
+ },
+ "interface": [
+ {
+ "$@name": {
+ "config": "true",
+ "type": "string",
+ "description": "The data type of the parameters argument."
+ },
+ "name": "eth0",
+
+ "$@type": {
+ "typedef": {
+ "type": "uint8",
+ "range": "0 .. 100",
+ "description": "Percentage"
+ }
+ },
+ "type": "iana-if-type:ethernetCsmacd",
+
+ "$@enabled": {
+ "type": "boolean"
+ },
+ "enabled": false
+ },
+ {
+ "$@name": {
+ "config": "true",
+ "type": "string"
+ },
+ "name": "eth1",
+
+ "$@type": {
+ "typedef": {
+ "type": "uint8",
+ "range": "0 .. 100",
+ "description": "Percentage"
+ }
+ },
+ "type": "iana-if-type:ethernetCsmacd",
+ "enabled": true,
+ "ex-vlan:vlan-tagging": true
+ }
+ ]
+ },
+
+ "$@ietf-interfaces:interfaces-state": {
+ "eltype": "leaf",
+ "config": "false",
+ "type": "enumeration",
+ "enumval": ["int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", "uint64", "float", "string"],
+ "description": "The data type of the parameters argument.",
+ "mandatory": "false",
+ "iskey": "false"
+ },
+ "ietf-interfaces:interfaces-state": {
+
+ }
+}
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/get.xml b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/get.xml
new file mode 100644
index 00000000..b937b218
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/get.xml
@@ -0,0 +1,173 @@
+
+
+
+ profile_name
+ true
+
+ nfreader
+ true
+ /data/svepes/bin/nfdump_reader
+ /data/svepes/nfreader_input.dat
+
+
+ SERVICE
+ SERVICE
+ nfreader_service
+
+
+ UNIXSOCKET
+ OUT
+ nfreader_out
+
+
+ false
+ 0
+
+
+ flowcounter
+ true
+ /data/svepes/bin/flowcounter
+
+
+ SERVICE
+ SERVICE
+ flowcounter_service
+
+
+ UNIXSOCKET
+ IN
+ nfreader_out
+ 7708881
+ 0
+ 0
+ 0
+
+
+ true
+ 0
+
+
+
+
+ /data/svepes/bin/
+
+
+
+ flowcounter
+ Example module for counting number of incoming flow records.
+ 1
+ 0
+
+ -u
+ --
+ Specify UniRec template expected on the input interface.
+ false
+
+
+
+ -p
+ --
+ Show progress - print a dot every N flows.
+ true
+ int32
+
+
+ -P
+ --
+ When showing progress, print CHAR instead of dot.
+ true
+ string
+
+
+ -o
+ --
+ Send @VOLUME record filled with current counters every SEC second(s).
+ true
+ int32
+
+
+
+ amplification_detection
+
+
+ nfdump_reader
+ This module reads a given nfdump file and outputs flow records in UniRec format. If more files are specified, all flows from the first file are read, then all flows from second file and so on.
+ 0
+ 1
+
+ -F
+ --
+ A file in nfdump format.
+ true
+ string
+
+
+ -f
+ --
+ A nfdump-like filter expression. Only records matching the filter will be sent to the output.
+ true
+ string
+
+
+ -c
+ --
+ Read only the first N flow records.
+ true
+ uint64
+
+
+ -n
+ --
+ Don't send EOF message at the end.
+ false
+
+
+
+ -T
+ --
+ Replace original timestamps by record actual sending time.
+ false
+
+
+
+ -D
+ --
+ Fill DIR_BIT_FIELD according to record direction.
+ false
+
+
+
+ -l
+ --
+ Use link mask m for LINK_BIT_FIELD. m is 8-bit hexadecimal number e.g. m should be 1, c2, AB,...
+ true
+ string
+
+
+ -p
+ --
+ Show progress - print a dot every N flows.
+ true
+ uint64
+
+
+ -r
+ --
+ Rate limiting. Limiting sending flow rate to N records/sec.
+ true
+ uint64
+
+
+ -R
+ --
+ Real time re-sending. Resending records from given files in real time, respecting original timestamps (seconds). Since this mode is timestamp order dependent, real time re-sending is done only at approximate time.
+ false
+
+
+
+
+ brute_force_detector
+
+
+
+
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/get2.xml b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/get2.xml
new file mode 100644
index 00000000..25e9a8b1
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/get2.xml
@@ -0,0 +1,195 @@
+
+
+
+ false
+ permit
+ 0
+ 0
+ ano
+
+
+
+
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/model.yin b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/model.yin
new file mode 100644
index 00000000..8c51f43c
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/model.yin
@@ -0,0 +1,413 @@
+
+
+
+
+ CESNET, z.s.p.o.
+
+
+ cejkat@cesnet.cz
+
+
+ Module specifying configuration of Nemea supervisor.
+
+
+
+ Model with state information and notification.
+
+
+
+
+
+
+ IP/TCP for intermachine connections.
+
+
+
+
+ UNIX socket for local connections.
+
+
+
+
+ Service communication interface for module-supervisor communication.
+
+
+
+
+
+
+
+
+ Input interface.
+
+
+
+
+ Output interface.
+
+
+
+
+ Service interface.
+
+
+
+
+
+
+
+
+
+
+ Verbose level of supervisor log.
+
+
+
+
+
+
+ Global number of automatic restarts of a module that ends.
+
+
+
+
+
+
+ Path to supervisor logs directory (also with outputs of started modules)
+
+
+
+
+
+
+ Directories searched by supervisor for Nemea modules
+
+
+
+
+ Individual path with nemea modules.
+
+
+
+
+
+ All Nemea modules that were found in search-paths
+
+
+
+
+ Describes one available module.
+
+
+
+
+
+
+ Name that is presented by the module.
+
+
+
+
+
+
+ Description of the module.
+
+
+
+
+
+
+ Number of module output interfaces.
+
+
+
+
+
+
+ Number of module input interfaces.
+
+
+
+
+
+ Contains information about one particular parameter of the module.
+
+
+
+
+
+
+ Short version of the module parameter.
+
+
+
+
+
+
+ Long version of the module parameter.
+
+
+
+
+
+
+
+ Description of the module parameter
+
+
+
+
+
+
+ Information, whether the parameter has mandatory argument.
+
+
+
+
+
+
+
+ int8 is expected for the parameter
+
+
+
+
+ int16 is expected for the parameter
+
+
+
+
+ int32 is expected for the parameter
+
+
+
+
+ int64 is expected for the parameter
+
+
+
+
+ uint8 is expected for the parameter
+
+
+
+
+ uint16 is expected for the parameter
+
+
+
+
+ uint32 is expected for the parameter
+
+
+
+
+ uint64 is expected for the parameter
+
+
+
+
+ Float argument is expected for the parameter.
+
+
+
+
+ String argument is expected for the parameter.
+
+
+
+
+ The data type of the parameters argument.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name of group of Nemea modules.
+
+
+
+
+
+ Activation of group of Nemea modules.
+
+
+
+
+
+
+
+ Unique name of the module.
+
+
+
+
+
+ Additional parameters of the module (program).
+
+
+
+
+
+
+ Specify whether to start the module or not.
+
+
+
+
+
+
+ Specify whether the module is running.
+
+
+
+
+
+
+ The number of repeated starts of the module.
+
+
+
+
+
+
+ Path to module (executable file).
+
+
+
+
+
+
+ Global number of automatic restarts of a module that ends.
+
+
+
+
+
+
+
+
+
+ Type of libtrap communication interface.
+
+
+
+
+
+
+ Type of libtrap communication interface.
+
+
+
+
+
+
+ Parameters of libtrap interface: hostname,port for input interface; port for output interface.
+
+
+
+
+
+ Optional note for interface
+
+
+
+
+
+
+ Number of sent messages.
+
+
+
+
+
+
+ Number of received messages.
+
+
+
+
+
+
+ Number of sent buffers.
+
+
+
+
+
+
+ Number of Auto-Flush calls.
+
+
+
+
+
+
+ Number of dropped buffers.
+
+
+
+
+
+
+ Number of dropped messages.
+
+
+
+
+
+
+
+
+
+ Indicates that the status of module has changed.
+
+
+
+
+ Module unique name.
+
+
+
+
+ Indicates the actual module status
+
+
+
+
+ The module was started.
+
+
+
+
+ The module was stopped.
+
+
+
+
+ The module was restarted.
+
+
+
+
+ The module was disabled.
+
+
+
+
+
+
+
+ Reason of changing the status of module.
+
+
+
+
\ No newline at end of file
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/real.json b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/real.json
new file mode 100644
index 00000000..000058d4
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/real.json
@@ -0,0 +1,3284 @@
+{
+ "netopeer-cfgnetopeer:netopeer": {
+ "tls": {
+ "server-cert": "MIID+TCCAuGgAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBjDELMAkGA1UEBhMCQ1ox\nFjAUBgNVBAgMDVNvdXRoIE1vcmF2aWExDTALBgNVBAcMBEJybm8xDzANBgNVBAoM\nBkNFU05FVDEMMAoGA1UECwwDVE1DMRMwEQYDVQQDDApleGFtcGxlIENBMSIwIAYJ\nKoZIhvcNAQkBFhNleGFtcGxlY2FAbG9jYWxob3N0MB4XDTE0MDcyNDE0MzI0NVoX\nDTE1MDcyNDE0MzI0NVowdjELMAkGA1UEBhMCQ1oxFjAUBgNVBAgMDVNvdXRoIE1v\ncmF2aWExDzANBgNVBAoMBkNFU05FVDEMMAoGA1UECwwDVE1DMQ8wDQYDVQQDDAZz\nZXJ2ZXIxHzAdBgkqhkiG9w0BCQEWEHNlcnZlckBsb2NhbGhvc3QwggEiMA0GCSqG\nSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCx0jVMGPNfU+BBcW48LDn+RDBTuqSuGKsx\nwUBeEjwShd6k9r18oBW4yMdbfY\/qc3MOmeEV7RgZ02WggQ3eEknztxU6qPijvNkx\nurfNUbYvwCzsxMDy1hebZ9IL\/SsjHFFF6ZwZRczSr7gsQAKNmPak4qidqK8XlVuG\nA2M8I7UmP9NqZRzRpWITnvsL0v0SI5sYz5sZtptaT8pYouy\/FRz6wpldonumxNWC\nmCAkCRSzOWbA5CAWIxJHncT38ICRBiHMZUKYfjhWzofOzdFmM5Ntx7jCviieCIDk\nts95I1IIWPL2WgqloTWu06OQ0FV2I08JBOYu44NdRMqCR4v72\/87AgMBAAGjezB5\nMAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENl\ncnRpZmljYXRlMB0GA1UdDgQWBBTzeoS1AMXMO8uhogi+qJTqTuPW6zAfBgNVHSME\nGDAWgBRzVhAiqNmwdXCV5rQAHg36KU0jaDANBgkqhkiG9w0BAQUFAAOCAQEAnyBQ\nx\/5caVqR2S0kBD8VG4BER5mIk3biDY2urzKHVG2GubvsFgrct1+vDUToFHyYwZtP\neRBORApiugqIP2WhKTIs1SDJ41X4IDnT\/ChNpZ89b31zja1TnuJTzTdXEebBGkb9\nns98BH8Tg2+QIFcNB0eXqIiG5HG++MVoc4WzKB12fvfVJHKm9iHPpAC+EyTVScVv\nL5otbwVhwp0MiaMDjEqoUJEbrT4JhtZh1BgCXzhw7LcNOD8Ukr6Q1uRue\/jjpJbC\nN6ofbnrSras5tJH9QWaW6tT5iDdIlKPExfrwHUqC4YHO0+3Q15yttwfh7wCwNU2H\ndP4VfSRdn\/LaTmR68Q==",
+ "server-key": {
+ "key-data": "MIIEowIBAAKCAQEAsdI1TBjzX1PgQXFuPCw5\/kQwU7qkrhirMcFAXhI8EoXepPa9\nfKAVuMjHW32P6nNzDpnhFe0YGdNloIEN3hJJ87cVOqj4o7zZMbq3zVG2L8As7MTA\n8tYXm2fSC\/0rIxxRRemcGUXM0q+4LEACjZj2pOKonaivF5VbhgNjPCO1Jj\/TamUc\n0aViE577C9L9EiObGM+bGbabWk\/KWKLsvxUc+sKZXaJ7psTVgpggJAkUszlmwOQg\nFiMSR53E9\/CAkQYhzGVCmH44Vs6Hzs3RZjOTbce4wr4ongiA5LbPeSNSCFjy9loK\npaE1rtOjkNBVdiNPCQTmLuODXUTKgkeL+9v\/OwIDAQABAoIBAG\/4MG1JbL4C\/7vV\npBcpth7Aaznd1eJ2UB4VVOWnT8JOH2L6p1h5KRRhAP9AMkXsCnAQPyZiVAG3FlAZ\n01SZaY2YJDr6uQ3JVW4155TWtgSdWux\/\/Ass+lJ17lJ0SRxjsV13ez6CsDWeRjc+\n2xy0S+KJgqk71XzhJG9fZLYyuddp3U\/i3xFPUAcQM9xXKxcaD7g6LJf+a9pt6rim\nEqq\/pjJxDgTsRLARsazYuxrlOB445mvnLiYhOf2\/MvI80jIUKaj8BeAhg49UIg\/k\nmIh0xdevkcxBFer\/BjBjscWaFjx14D6nkFMw7vtCum5KfalLN2edZKAzByOudGD4\n5KnRp3ECgYEA6vnSoNGg9Do80JOpXRGYWhcR1lIDO5yRW5rVagncCcW5Pn\/GMtNd\nx2q6k1ks8mXKR9CxZrxZGqeYObZ9a\/5SLih7ZkpiVWXG8ZiBIPhP6lnwm5OeIqLa\nhr0BYWcRfrGg1phj5uySZgsVBE+D8jH42O9ccdvrWv1OiryAHfKIcwMCgYEAwbs+\nHfQtvHOQXSYNhtOeA7IetkGy3cKVg2oILNcROvI96hS0MZKt1Rko0UAapx96eCIr\nel7vfdT0eUzNqt2wTKp1zmiG+SnX3fMDJNzMwu\/jb\/b4wQ20IHWNDnqcqTUVRUnL\niksLFoHbTxsN5NpEQExcSt\/zzP4qi1W2Bmo18WkCgYEAnhrk16LVux9ohiulHONW\n8N9u+BeM51JtGAcxrDzgGo85Gs2czdwc0K6GxdiN\/rfxCKtqgqcfCWlVaxfYgo7I\nOxiwF17blXx7BVrJICcUlqpX1Ebac5HCmkCYqjJQuj\/I6jv1lI7\/3rt8M79RF+j5\n+PXt7Qq97SZd78nwJrZni4MCgYAiPjZ8lOyAouyhilhZvI3xmUpUbMhw6jQDRnqr\nclhZUvgeqAoxuPuA7zGHywzq\/WVoVqHYv28Vjs6noiu4R\/chlf+8vD0fTYYadRnZ\nKi4HRt+sqrrNZN6x3hVQudt3DSr1VFXl293Z3JonIWETUoE93EFz+qHdWg+rETtb\nZuqiAQKBgD+HI\/syLECyO8UynuEaDD7qPl87PJ\/CmZLMxa2\/ZZUjhaXAW7CJMaS6\n9PIzsLk33y3O4Qer0wx\/tEdfnxMTBJrgGt\/lFFdAKhSJroZ45l5apiavg1oZYp89\njSd0lVxWSmrBjBZLnqOl336gzaBVkBD5ND+XUPdR1UuVQExJlem4",
+ "key-type": "RSA",
+ "$@key-data": {
+ "eltype": "leaf",
+ "description": "Server private key (in base64-encoded DER) matching\n the server certificate.",
+ "config": true,
+ "status": "current",
+ "mandatory": true,
+ "type": "binary",
+ "iskey": false
+ },
+ "$@key-type": {
+ "eltype": "leaf",
+ "description": "The type of the server private key.",
+ "config": true,
+ "status": "current",
+ "mandatory": true,
+ "type": "enumeration",
+ "enumval": [
+ "DSA",
+ "RSA"
+ ],
+ "iskey": false
+ }
+ },
+ "trusted-ca-certs": {
+ "trusted-ca-cert": [
+ "MIID7TCCAtWgAwIBAgIJAMtE1NGAR5KoMA0GCSqGSIb3DQEBBQUAMIGMMQswCQYD\nVQQGEwJDWjEWMBQGA1UECAwNU291dGggTW9yYXZpYTENMAsGA1UEBwwEQnJubzEP\nMA0GA1UECgwGQ0VTTkVUMQwwCgYDVQQLDANUTUMxEzARBgNVBAMMCmV4YW1wbGUg\nQ0ExIjAgBgkqhkiG9w0BCQEWE2V4YW1wbGVjYUBsb2NhbGhvc3QwHhcNMTQwNzI0\nMTQxOTAyWhcNMjQwNzIxMTQxOTAyWjCBjDELMAkGA1UEBhMCQ1oxFjAUBgNVBAgM\nDVNvdXRoIE1vcmF2aWExDTALBgNVBAcMBEJybm8xDzANBgNVBAoMBkNFU05FVDEM\nMAoGA1UECwwDVE1DMRMwEQYDVQQDDApleGFtcGxlIENBMSIwIAYJKoZIhvcNAQkB\nFhNleGFtcGxlY2FAbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEArD3TDHPAMT2Z84orK4lMlarbgooIUCcRZyLe+QM+8KY8Hn+mGaxPEOTS\nL3ywszqefB\/Utm2hPKLHX684iRC14ID9WDGHxPjvoPArhgFhfV+qnPfxKTgxZC12\nuOj4u1V9y+SkTCocFbRfXVBGpojrBuDHXkDMDEWNvr8\/52YCv7bGaiBwUHolcLCU\nbmtKILCG0RNJyTaJpXQdAeq5Z1SJotpbfYFFtAXB32hVoLug1dzl2tjG9sb1wq3Q\naDExcbC5w6P65qOkNoyym9ne6QlQagCqVDyFn3vcqkRaTjvZmxauCeUxXgJoXkyW\ncm0lM1KMHdoTArmchw2Dz0yHHSyDAQIDAQABo1AwTjAdBgNVHQ4EFgQUc1YQIqjZ\nsHVwlea0AB4N+ilNI2gwHwYDVR0jBBgwFoAUc1YQIqjZsHVwlea0AB4N+ilNI2gw\nDAYDVR0TBAUwAwEB\/zANBgkqhkiG9w0BAQUFAAOCAQEAI\/1KH60qnw9Xs2RGfi0\/\nIKf5EynXt4bQX8EIyVKwSkYKe04zZxYfLIl\/Q2HOPYoFmm3daj5ddr0ZS1i4p4fT\nUhstjsYWvXs3W\/HhVmFUslakkn3PrswhP77fCk6eEJLxdfyJ1C7Uudq2m1isZbKi\nh+XF0mG1LxJaDMocSz4eAya7M5brwjy8DoOmA1TnLQFCVcpn+sCr7VC4wE\/JqxyV\nhBCk\/MuGqqM3B1j90bGFZ112ZOecyE0EDSr6IbiRBtmeNbEwOFjKXhNLYdxpBZ9D\n8A\/368OckZkCrVLGuJNxK9UwCVTe8IhotHUqU9EqFDmxdV8oIdU\/OzUwwNPA\/Bd\/\n9g=="
+ ],
+ "$@trusted-ca-cert": {
+ "eltype": "leaf-list",
+ "description": "The binary certificate structure (DER) encoded\n in base64.",
+ "config": true,
+ "status": "current",
+ "mandatory": false,
+ "type": "binary"
+ }
+ },
+ "cert-maps": {
+ "cert-to-name": [
+ {
+ "id": 1,
+ "fingerprint": "02:E9:38:1F:F6:8B:62:DE:0A:0B:C5:03:81:A8:03:49:A0:00:7F:8B:F3",
+ "map-type": "ietf-x509-cert-to-name:specified",
+ "name": "default_ca",
+ "$@id": {
+ "eltype": "leaf",
+ "description": "The id specifies the order in which the entries in the\ncert-to-name list are searched. Entries with lower\nnumbers are searched first.",
+ "reference": "SNMP-TLS-TM-MIB.snmpTlstmCertToTSNID",
+ "config": true,
+ "status": "current",
+ "mandatory": false,
+ "type": "uint32",
+ "iskey": true
+ },
+ "$@fingerprint": {
+ "eltype": "leaf",
+ "description": "Specifies a value with which the fingerprint of the\ncertificate presented by the peer is compared. If the\nfingerprint of the certificate presented by the peer does\nnot match the fingerprint configured, then the entry is\nskipped and the search for a match continues.",
+ "reference": "SNMP-TLS-TM-MIB.snmpTlstmCertToTSNFingerprint",
+ "config": true,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-x509-cert-to-name:tls-fingerprint",
+ "typedef": {
+ "description": "A fingerprint value that can be used to uniquely reference\nother data of potentially arbitrary length.\n\nAn tls-fingerprint value is composed of a 1-octet hashing\nalgorithm identifier followed by the fingerprint value. The\nfirst octet value identifying the hashing algorithm is taken\nfrom the IANA TLS HashAlgorithm Registry (RFC 5246). The\nremaining octets are filled using the results of the hashing\nalgorithm.",
+ "reference": "SNMP-TLS-TM-MIB.SnmpTLSFingerprint",
+ "status": "current",
+ "type": "ietf-yang-types:hex-string",
+ "typedef": {
+ "description": "A hexadecimal string with octets represented as hex digits\nseparated by colons. The canonical representation uses\nlowercase characters.",
+ "status": "current",
+ "type": "string",
+ "pattern": [
+ "([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?"
+ ]
+ }
+ },
+ "iskey": false
+ },
+ "$@map-type": {
+ "eltype": "leaf",
+ "description": "Specifies the algorithm used to map the certificate\npresented by the peer to a name.\n\nMappings that need additional configuration objects should\nuse the 'when' statement to make them conditional based on\nthe 'map-type'.",
+ "reference": "SNMP-TLS-TM-MIB.snmpTlstmCertToTSNMapType",
+ "config": true,
+ "status": "current",
+ "mandatory": true,
+ "type": "identityref",
+ "identityval": [
+ "cert-to-name",
+ "specified",
+ "san-rfc822-name",
+ "san-dns-name",
+ "san-ip-address",
+ "san-any",
+ "common-name"
+ ],
+ "iskey": false
+ },
+ "$@name": {
+ "eltype": "leaf",
+ "description": "Directly specifies the NETCONF username when the\n'map-type' is 'specified'.",
+ "reference": "SNMP-TLS-TM-MIB.snmpTlstmCertToTSNData",
+ "config": true,
+ "status": "current",
+ "mandatory": true,
+ "type": "string",
+ "when": "..\/map-type = 'ietf-x509-cert-to-name:specified'",
+ "iskey": false
+ }
+ }
+ ],
+ "$@cert-to-name": {
+ "eltype": "list",
+ "description": "This list defines how certificates are mapped to names.\nThe name is derived by considering each cert-to-name\nlist entry in order. The cert-to-name entry's fingerprint\ndetermines whether the list entry is a match:\n\n1) If the cert-to-name list entry's fingerprint value\n matches that of the presented certificate, then consider\n the list entry as a successful match.\n\n2) If the cert-to-name list entry's fingerprint value\n matches that of a locally held copy of a trusted CA\n certificate, and that CA certificate was part of the CA\n certificate chain to the presented certificate, then\n consider the list entry as a successful match.\n\nOnce a matching cert-to-name list entry has been found, the\nmap-type is used to determine how the name associated with\nthe certificate should be determined. See the map-type\nleaf's description for details on determining the name value.\nIf it is impossible to determine a name from the cert-to-name\nlist entry's data combined with the data presented in the\ncertificate, then additional cert-to-name list entries MUST\nbe searched looking for another potential match.\n\nSecurity administrators are encouraged to make use of\ncertificates with subjectAltName fields that can be mapped to\nnames so that a single root CA certificate can allow all\nchild certificate's subjectAltName to map directly to a name\nvia a 1:1 transformation.",
+ "reference": "SNMP-TLS-TM-MIB.snmpTlstmCertToTSNEntry",
+ "config": true,
+ "status": "current",
+ "mandatory": false,
+ "keys": [
+ "id"
+ ]
+ }
+ },
+ "$@server-cert": {
+ "eltype": "leaf",
+ "description": "Server certificate (in base64-encoded DER) presented to clients.",
+ "config": true,
+ "status": "current",
+ "mandatory": false,
+ "type": "binary",
+ "iskey": false
+ },
+ "$@server-key": {
+ "eltype": "container",
+ "config": true,
+ "status": "current",
+ "mandatory": false,
+ "children": [
+ "key-data",
+ "key-type"
+ ]
+ },
+ "$@trusted-ca-certs": {
+ "eltype": "container",
+ "description": "A list of Certificate Authority (CA) certificates that a\nNETCONF server can use to authenticate a NETCONF client's\ncertificate. A client's certificate is authenticated if\nits Issuer matches one of the configured trusted CA\ncertificates.",
+ "config": true,
+ "status": "current",
+ "mandatory": false,
+ "children": [
+ "trusted-ca-cert"
+ ]
+ },
+ "$@cert-maps": {
+ "eltype": "container",
+ "description": "The cert-maps container is used by a NETCONF server to\nmap the NETCONF client's presented X.509 certificate to\na NETCONF username.\n\nIf no matching and valid cert-to-name list entry can be\nfound, then the NETCONF server MUST close the connection,\nand MUST NOT accept NETCONF messages over it.",
+ "config": true,
+ "status": "current",
+ "mandatory": false
+ }
+ },
+ "$@tls": {
+ "eltype": "container",
+ "description": "Netopeer TLS options.",
+ "config": true,
+ "status": "current",
+ "mandatory": false,
+ "children": [
+ "server-cert",
+ "server-key",
+ "trusted-ca-certs",
+ "trusted-client-certs",
+ "crl-dir",
+ "cert-maps"
+ ]
+ }
+ },
+ "ietf-netconf-monitoring:netconf-state": {
+ "capabilities": {
+ "capability": [
+ "urn:ietf:params:netconf:base:1.0",
+ "urn:ietf:params:netconf:base:1.1",
+ "urn:ietf:params:netconf:capability:writable-running:1.0",
+ "urn:ietf:params:netconf:capability:candidate:1.0",
+ "urn:ietf:params:netconf:capability:startup:1.0",
+ "urn:ietf:params:netconf:capability:rollback-on-error:1.0",
+ "urn:ietf:params:netconf:capability:interleave:1.0",
+ "urn:ietf:params:netconf:capability:notification:1.0",
+ "urn:ietf:params:netconf:capability:validate:1.0",
+ "urn:ietf:params:netconf:capability:validate:1.1",
+ "urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=explicit&also-supported=report-all,report-all-tagged,trim,explicit",
+ "urn:ietf:params:netconf:capability:url:1.0?scheme=scp,file",
+ "urn:cesnet:tmc:netopeer:1.0?module=netopeer-cfgnetopeer&revision=2015-05-19&features=ssh,tls,dynamic-modules",
+ "urn:ietf:params:xml:ns:yang:ietf-netconf-server?module=ietf-netconf-server&revision=2014-01-24&features=ssh,inbound-ssh,outbound-ssh,tls,inbound-tls,outbound-tls",
+ "urn:ietf:params:xml:ns:yang:ietf-x509-cert-to-name?module=ietf-x509-cert-to-name&revision=2013-03-26",
+ "urn:ietf:params:xml:ns:yang:ietf-netconf-acm?module=ietf-netconf-acm&revision=2012-02-22",
+ "urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults?module=ietf-netconf-with-defaults&revision=2010-06-09",
+ "urn:ietf:params:xml:ns:netconf:notification:1.0?module=notifications&revision=2008-07-14",
+ "urn:ietf:params:xml:ns:netmod:notification?module=nc-notifications&revision=2008-07-14",
+ "urn:ietf:params:xml:ns:yang:ietf-netconf-notifications?module=ietf-netconf-notifications&revision=2012-02-06",
+ "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?module=ietf-netconf-monitoring&revision=2010-10-04",
+ "urn:ietf:params:xml:ns:netconf:base:1.0?module=ietf-netconf&revision=2011-03-08&features=writable-running,candidate,rollback-on-error,validate,startup,url",
+ "urn:ietf:params:xml:ns:yang:ietf-yang-types?module=ietf-yang-types&revision=2013-07-15",
+ "urn:ietf:params:xml:ns:yang:ietf-inet-types?module=ietf-inet-types&revision=2013-07-15"
+ ],
+ "$@capability": {
+ "eltype": "leaf-list",
+ "description": "List of NETCONF capabilities supported by the server.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ },
+ "datastores": {
+ "datastore": [
+ {
+ "name": "running",
+ "$@name": {
+ "eltype": "leaf",
+ "description": "Name of the datastore associated with this list entry.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "netconf-datastore-type",
+ "typedef": {
+ "description": "Enumeration of possible NETCONF datastore types.",
+ "reference": "RFC 4741: NETCONF Configuration Protocol",
+ "status": "current",
+ "type": "enumeration",
+ "enumval": [
+ "running",
+ "candidate",
+ "startup"
+ ]
+ },
+ "iskey": true
+ }
+ },
+ {
+ "name": "startup",
+ "$@name": {
+ "eltype": "leaf",
+ "description": "Name of the datastore associated with this list entry.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "netconf-datastore-type",
+ "typedef": {
+ "description": "Enumeration of possible NETCONF datastore types.",
+ "reference": "RFC 4741: NETCONF Configuration Protocol",
+ "status": "current",
+ "type": "enumeration",
+ "enumval": [
+ "running",
+ "candidate",
+ "startup"
+ ]
+ },
+ "iskey": true
+ }
+ },
+ {
+ "name": "candidate",
+ "$@name": {
+ "eltype": "leaf",
+ "description": "Name of the datastore associated with this list entry.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "netconf-datastore-type",
+ "typedef": {
+ "description": "Enumeration of possible NETCONF datastore types.",
+ "reference": "RFC 4741: NETCONF Configuration Protocol",
+ "status": "current",
+ "type": "enumeration",
+ "enumval": [
+ "running",
+ "candidate",
+ "startup"
+ ]
+ },
+ "iskey": true
+ }
+ }
+ ],
+ "$@datastore": {
+ "eltype": "list",
+ "description": "List of NETCONF configuration datastores supported by\nthe NETCONF server and related information.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "keys": [
+ "name"
+ ]
+ }
+ },
+ "sessions": {
+ "session": [
+ {
+ "session-id": 8,
+ "transport": "netconf-ssh",
+ "username": "vasko",
+ "source-host": "UNKNOWN",
+ "login-time": "0000-01-01T00:00:00Z",
+ "in-rpcs": 13,
+ "in-bad-rpcs": 0,
+ "out-rpc-errors": 0,
+ "out-notifications": 0,
+ "$@session-id": {
+ "eltype": "leaf",
+ "description": "Unique identifier for the session. This value is the\nNETCONF session identifier, as defined in RFC 4741.",
+ "reference": "RFC 4741: NETCONF Configuration Protocol",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "uint32",
+ "range": "1..max",
+ "iskey": true
+ },
+ "$@transport": {
+ "eltype": "leaf",
+ "description": "Identifies the transport for each session, e.g.,\n'netconf-ssh', 'netconf-soap', etc.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "identityref",
+ "identityval": [
+ "transport",
+ "netconf-ssh",
+ "netconf-soap-over-beep",
+ "netconf-soap-over-https",
+ "netconf-beep",
+ "netconf-tls"
+ ],
+ "iskey": false
+ },
+ "$@username": {
+ "eltype": "leaf",
+ "description": "The username is the client identity that was authenticated\nby the NETCONF transport protocol. The algorithm used to\nderive the username is NETCONF transport protocol specific\nand in addition specific to the authentication mechanism\nused by the NETCONF transport protocol.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "string",
+ "iskey": false
+ },
+ "$@source-host": {
+ "eltype": "leaf",
+ "description": "Host identifier of the NETCONF client. The value\nreturned is implementation specific (e.g., hostname,\nIPv4 address, IPv6 address)",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "ietf-inet-types:host",
+ "typedef": {
+ "description": "The host type represents either an IP address or a DNS\ndomain name.",
+ "status": "current",
+ "type": "union",
+ "types": [
+ {
+ "type": "ip-address",
+ "typedef": {
+ "description": "The ip-address type represents an IP address and is IP\nversion neutral. The format of the textual representation\nimplies the IP version. This type supports scoped addresses\nby allowing zone identifiers in the address format.",
+ "reference": "RFC 4007: IPv6 Scoped Address Architecture",
+ "status": "current",
+ "type": "union",
+ "types": [
+ {
+ "type": "ipv4-address",
+ "typedef": {
+ "description": "The ipv4-address type represents an IPv4 address in\ndotted-quad notation. The IPv4 address may include a zone\nindex, separated by a % sign.\n\nThe zone index is used to disambiguate identical address\nvalues. For link-local addresses, the zone index will\ntypically be the interface index number or the name of an\ninterface. If the zone index is not present, the default\nzone of the device will be used.\n\nThe canonical format for the zone index is the numerical\nformat",
+ "status": "current",
+ "type": "string",
+ "pattern": [
+ "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?"
+ ]
+ }
+ },
+ {
+ "type": "ipv6-address",
+ "typedef": {
+ "description": "The ipv6-address type represents an IPv6 address in full,\nmixed, shortened, and shortened-mixed notation. The IPv6\naddress may include a zone index, separated by a % sign.\n\nThe zone index is used to disambiguate identical address\nvalues. For link-local addresses, the zone index will\ntypically be the interface index number or the name of an\ninterface. If the zone index is not present, the default\nzone of the device will be used.\n\n\n\nThe canonical format of IPv6 addresses uses the textual\nrepresentation defined in Section 4 of RFC 5952. The\ncanonical format for the zone index is the numerical\nformat as described in Section 11.2 of RFC 4007.",
+ "reference": "RFC 4291: IP Version 6 Addressing Architecture\nRFC 4007: IPv6 Scoped Address Architecture\nRFC 5952: A Recommendation for IPv6 Address Text\n Representation",
+ "status": "current",
+ "type": "string",
+ "pattern": [
+ "((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?",
+ "((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?"
+ ]
+ }
+ }
+ ]
+ }
+ },
+ {
+ "type": "domain-name",
+ "typedef": {
+ "description": "The domain-name type represents a DNS domain name. The\nname SHOULD be fully qualified whenever possible.\n\nInternet domain names are only loosely specified. Section\n3.5 of RFC 1034 recommends a syntax (modified in Section\n2.1 of RFC 1123). The pattern above is intended to allow\nfor current practice in domain name use, and some possible\nfuture expansion. It is designed to hold various types of\ndomain names, including names used for A or AAAA records\n(host names) and other records, such as SRV records. Note\nthat Internet host names have a stricter syntax (described\nin RFC 952) than the DNS recommendations in RFCs 1034 and\n1123, and that systems that want to store host names in\nschema nodes using the domain-name type are recommended to\nadhere to this stricter standard to ensure interoperability.\n\nThe encoding of DNS names in the DNS protocol is limited\nto 255 characters. Since the encoding consists of labels\nprefixed by a length bytes and there is a trailing NULL\nbyte, only 253 characters can appear in the textual dotted\nnotation.\n\nThe description clause of schema nodes using the domain-name\ntype MUST describe when and how these names are resolved to\nIP addresses. Note that the resolution of a domain-name value\nmay require to query multiple DNS records (e.g., A for IPv4\nand AAAA for IPv6). The order of the resolution process and\nwhich DNS record takes precedence can either be defined\nexplicitly or may depend on the configuration of the\nresolver.\n\nDomain-name values use the US-ASCII encoding. Their canonical\nformat uses lowercase US-ASCII characters. Internationalized\ndomain names MUST be A-labels as per RFC 5890.",
+ "reference": "RFC 952: DoD Internet Host Table Specification\nRFC 1034: Domain Names - Concepts and Facilities\nRFC 1123: Requirements for Internet Hosts -- Application\n and Support\nRFC 2782: A DNS RR for specifying the location of services\n (DNS SRV)\nRFC 5890: Internationalized Domain Names in Applications\n (IDNA): Definitions and Document Framework",
+ "status": "current",
+ "type": "string",
+ "length": "1..253",
+ "pattern": [
+ "((([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.)*([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.?)|\\."
+ ]
+ }
+ }
+ ]
+ },
+ "iskey": false
+ },
+ "$@login-time": {
+ "eltype": "leaf",
+ "description": "Time at the server at which the session was established.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-yang-types:date-and-time",
+ "typedef": {
+ "description": "The date-and-time type is a profile of the ISO 8601\nstandard for representation of dates and times using the\nGregorian calendar. The profile is defined by the\ndate-time production in Section 5.6 of RFC 3339.\n\nThe date-and-time type is compatible with the dateTime XML\nschema type with the following notable exceptions:\n\n(a) The date-and-time type does not allow negative years.\n\n(b) The date-and-time time-offset -00:00 indicates an unknown\n time zone (see RFC 3339) while -00:00 and +00:00 and Z\n all represent the same time zone in dateTime.\n\n(c) The canonical format (see below) of data-and-time values\n differs from the canonical format used by the dateTime XML\n schema type, which requires all times to be in UTC using\n the time-offset 'Z'.\n\nThis type is not equivalent to the DateAndTime textual\nconvention of the SMIv2 since RFC 3339 uses a different\nseparator between full-date and full-time and provides\nhigher resolution of time-secfrac.\n\nThe canonical format for date-and-time values with a known time\nzone uses a numeric time zone offset that is calculated using\nthe device's configured known offset to UTC time. A change of\nthe device's offset to UTC time will cause date-and-time values\nto change accordingly. Such changes might happen periodically\nin case a server follows automatically daylight saving time\n(DST) time zone offset changes. The canonical format for\ndate-and-time values with an unknown time zone (usually\nreferring to the notion of local time) uses the time-offset\n-00:00.",
+ "reference": "RFC 3339: Date and Time on the Internet: Timestamps\nRFC 2579: Textual Conventions for SMIv2\nXSD-TYPES: XML Schema Part 2: Datatypes Second Edition",
+ "status": "current",
+ "type": "string",
+ "pattern": [
+ "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})"
+ ]
+ },
+ "iskey": false
+ },
+ "$@in-rpcs": {
+ "eltype": "leaf",
+ "description": "Number of correct
messages received.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "ietf-yang-types:zero-based-counter32",
+ "typedef": {
+ "description": "The zero-based-counter32 type represents a counter32\nthat has the defined 'initial' value zero.\n\nA schema node of this type will be set to zero (0) on creation\nand will thereafter increase monotonically until it reaches\na maximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nProvided that an application discovers a new schema node\nof this type within the minimum time to wrap, it can use the\n'initial' value as a delta. It is important for a management\nstation to be aware of this minimum time and the actual time\nbetween polls, and to discard data if the actual time is too\nlong or there is no defined minimum time.\n\nIn the value set and its semantics, this type is equivalent\nto the ZeroBasedCounter32 textual convention of the SMIv2.",
+ "reference": "RFC 4502: Remote Network Monitoring Management Information\n Base Version 2",
+ "status": "current",
+ "type": "counter32",
+ "typedef": {
+ "description": "The counter32 type represents a non-negative integer\nthat monotonically increases until it reaches a\nmaximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nCounters have no defined 'initial' value, and thus, a\nsingle value of a counter has (in general) no information\ncontent. Discontinuities in the monotonically increasing\nvalue normally occur at re-initialization of the\nmanagement system, and at other times as specified in the\ndescription of a schema node using this type. If such\nother times can occur, for example, the creation of\na schema node of type counter32 at times other than\nre-initialization, then a corresponding schema node\nshould be defined, with an appropriate type, to indicate\nthe last discontinuity.\n\nThe counter32 type should not be used for configuration\nschema nodes. A default statement SHOULD NOT be used in\ncombination with the type counter32.\n\nIn the value set and its semantics, this type is equivalent\nto the Counter32 type of the SMIv2.",
+ "reference": "RFC 2578: Structure of Management Information Version 2\n (SMIv2)",
+ "status": "current",
+ "type": "uint32"
+ },
+ "default": "0"
+ },
+ "iskey": false
+ },
+ "$@in-bad-rpcs": {
+ "eltype": "leaf",
+ "description": "Number of messages received when an message was expected,\nthat were not correct messages. This includes XML parse\nerrors and errors on the rpc layer.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "ietf-yang-types:zero-based-counter32",
+ "typedef": {
+ "description": "The zero-based-counter32 type represents a counter32\nthat has the defined 'initial' value zero.\n\nA schema node of this type will be set to zero (0) on creation\nand will thereafter increase monotonically until it reaches\na maximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nProvided that an application discovers a new schema node\nof this type within the minimum time to wrap, it can use the\n'initial' value as a delta. It is important for a management\nstation to be aware of this minimum time and the actual time\nbetween polls, and to discard data if the actual time is too\nlong or there is no defined minimum time.\n\nIn the value set and its semantics, this type is equivalent\nto the ZeroBasedCounter32 textual convention of the SMIv2.",
+ "reference": "RFC 4502: Remote Network Monitoring Management Information\n Base Version 2",
+ "status": "current",
+ "type": "counter32",
+ "typedef": {
+ "description": "The counter32 type represents a non-negative integer\nthat monotonically increases until it reaches a\nmaximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nCounters have no defined 'initial' value, and thus, a\nsingle value of a counter has (in general) no information\ncontent. Discontinuities in the monotonically increasing\nvalue normally occur at re-initialization of the\nmanagement system, and at other times as specified in the\ndescription of a schema node using this type. If such\nother times can occur, for example, the creation of\na schema node of type counter32 at times other than\nre-initialization, then a corresponding schema node\nshould be defined, with an appropriate type, to indicate\nthe last discontinuity.\n\nThe counter32 type should not be used for configuration\nschema nodes. A default statement SHOULD NOT be used in\ncombination with the type counter32.\n\nIn the value set and its semantics, this type is equivalent\nto the Counter32 type of the SMIv2.",
+ "reference": "RFC 2578: Structure of Management Information Version 2\n (SMIv2)",
+ "status": "current",
+ "type": "uint32"
+ },
+ "default": "0"
+ },
+ "iskey": false
+ },
+ "$@out-rpc-errors": {
+ "eltype": "leaf",
+ "description": "Number of messages sent that contained an\n element.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "ietf-yang-types:zero-based-counter32",
+ "typedef": {
+ "description": "The zero-based-counter32 type represents a counter32\nthat has the defined 'initial' value zero.\n\nA schema node of this type will be set to zero (0) on creation\nand will thereafter increase monotonically until it reaches\na maximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nProvided that an application discovers a new schema node\nof this type within the minimum time to wrap, it can use the\n'initial' value as a delta. It is important for a management\nstation to be aware of this minimum time and the actual time\nbetween polls, and to discard data if the actual time is too\nlong or there is no defined minimum time.\n\nIn the value set and its semantics, this type is equivalent\nto the ZeroBasedCounter32 textual convention of the SMIv2.",
+ "reference": "RFC 4502: Remote Network Monitoring Management Information\n Base Version 2",
+ "status": "current",
+ "type": "counter32",
+ "typedef": {
+ "description": "The counter32 type represents a non-negative integer\nthat monotonically increases until it reaches a\nmaximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nCounters have no defined 'initial' value, and thus, a\nsingle value of a counter has (in general) no information\ncontent. Discontinuities in the monotonically increasing\nvalue normally occur at re-initialization of the\nmanagement system, and at other times as specified in the\ndescription of a schema node using this type. If such\nother times can occur, for example, the creation of\na schema node of type counter32 at times other than\nre-initialization, then a corresponding schema node\nshould be defined, with an appropriate type, to indicate\nthe last discontinuity.\n\nThe counter32 type should not be used for configuration\nschema nodes. A default statement SHOULD NOT be used in\ncombination with the type counter32.\n\nIn the value set and its semantics, this type is equivalent\nto the Counter32 type of the SMIv2.",
+ "reference": "RFC 2578: Structure of Management Information Version 2\n (SMIv2)",
+ "status": "current",
+ "type": "uint32"
+ },
+ "default": "0"
+ },
+ "iskey": false
+ },
+ "$@out-notifications": {
+ "eltype": "leaf",
+ "description": "Number of messages sent.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "ietf-yang-types:zero-based-counter32",
+ "typedef": {
+ "description": "The zero-based-counter32 type represents a counter32\nthat has the defined 'initial' value zero.\n\nA schema node of this type will be set to zero (0) on creation\nand will thereafter increase monotonically until it reaches\na maximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nProvided that an application discovers a new schema node\nof this type within the minimum time to wrap, it can use the\n'initial' value as a delta. It is important for a management\nstation to be aware of this minimum time and the actual time\nbetween polls, and to discard data if the actual time is too\nlong or there is no defined minimum time.\n\nIn the value set and its semantics, this type is equivalent\nto the ZeroBasedCounter32 textual convention of the SMIv2.",
+ "reference": "RFC 4502: Remote Network Monitoring Management Information\n Base Version 2",
+ "status": "current",
+ "type": "counter32",
+ "typedef": {
+ "description": "The counter32 type represents a non-negative integer\nthat monotonically increases until it reaches a\nmaximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nCounters have no defined 'initial' value, and thus, a\nsingle value of a counter has (in general) no information\ncontent. Discontinuities in the monotonically increasing\nvalue normally occur at re-initialization of the\nmanagement system, and at other times as specified in the\ndescription of a schema node using this type. If such\nother times can occur, for example, the creation of\na schema node of type counter32 at times other than\nre-initialization, then a corresponding schema node\nshould be defined, with an appropriate type, to indicate\nthe last discontinuity.\n\nThe counter32 type should not be used for configuration\nschema nodes. A default statement SHOULD NOT be used in\ncombination with the type counter32.\n\nIn the value set and its semantics, this type is equivalent\nto the Counter32 type of the SMIv2.",
+ "reference": "RFC 2578: Structure of Management Information Version 2\n (SMIv2)",
+ "status": "current",
+ "type": "uint32"
+ },
+ "default": "0"
+ },
+ "iskey": false
+ }
+ }
+ ],
+ "$@session": {
+ "eltype": "list",
+ "description": "All NETCONF sessions managed by the NETCONF server\nMUST be reported in this list.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "keys": [
+ "session-id"
+ ]
+ }
+ },
+ "schemas": {
+ "schema": [
+ {
+ "identifier": "netopeer-cfgnetopeer",
+ "version": "2015-05-19",
+ "format": "yin",
+ "namespace": "urn:cesnet:tmc:netopeer:1.0",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "netopeer-cfgnetopeer",
+ "version": "2015-05-19",
+ "format": "yang",
+ "namespace": "urn:cesnet:tmc:netopeer:1.0",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "ietf-netconf-server",
+ "version": "2014-01-24",
+ "format": "yin",
+ "namespace": "urn:ietf:params:xml:ns:yang:ietf-netconf-server",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "ietf-netconf-server",
+ "version": "2014-01-24",
+ "format": "yang",
+ "namespace": "urn:ietf:params:xml:ns:yang:ietf-netconf-server",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "ietf-x509-cert-to-name",
+ "version": "2013-03-26",
+ "format": "yin",
+ "namespace": "urn:ietf:params:xml:ns:yang:ietf-x509-cert-to-name",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "ietf-x509-cert-to-name",
+ "version": "2013-03-26",
+ "format": "yang",
+ "namespace": "urn:ietf:params:xml:ns:yang:ietf-x509-cert-to-name",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "ietf-netconf-acm",
+ "version": "2012-02-22",
+ "format": "yin",
+ "namespace": "urn:ietf:params:xml:ns:yang:ietf-netconf-acm",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "ietf-netconf-acm",
+ "version": "2012-02-22",
+ "format": "yang",
+ "namespace": "urn:ietf:params:xml:ns:yang:ietf-netconf-acm",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "ietf-netconf-with-defaults",
+ "version": "2010-06-09",
+ "format": "yin",
+ "namespace": "urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "ietf-netconf-with-defaults",
+ "version": "2010-06-09",
+ "format": "yang",
+ "namespace": "urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "notifications",
+ "version": "2008-07-14",
+ "format": "yin",
+ "namespace": "urn:ietf:params:xml:ns:netconf:notification:1.0",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "notifications",
+ "version": "2008-07-14",
+ "format": "yang",
+ "namespace": "urn:ietf:params:xml:ns:netconf:notification:1.0",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "nc-notifications",
+ "version": "2008-07-14",
+ "format": "yin",
+ "namespace": "urn:ietf:params:xml:ns:netmod:notification",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "nc-notifications",
+ "version": "2008-07-14",
+ "format": "yang",
+ "namespace": "urn:ietf:params:xml:ns:netmod:notification",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "ietf-netconf-notifications",
+ "version": "2012-02-06",
+ "format": "yin",
+ "namespace": "urn:ietf:params:xml:ns:yang:ietf-netconf-notifications",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "ietf-netconf-notifications",
+ "version": "2012-02-06",
+ "format": "yang",
+ "namespace": "urn:ietf:params:xml:ns:yang:ietf-netconf-notifications",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "ietf-netconf-monitoring",
+ "version": "2010-10-04",
+ "format": "yin",
+ "namespace": "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "ietf-netconf-monitoring",
+ "version": "2010-10-04",
+ "format": "yang",
+ "namespace": "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "ietf-netconf",
+ "version": "2011-03-08",
+ "format": "yin",
+ "namespace": "urn:ietf:params:xml:ns:netconf:base:1.0",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "ietf-netconf",
+ "version": "2011-03-08",
+ "format": "yang",
+ "namespace": "urn:ietf:params:xml:ns:netconf:base:1.0",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "ietf-yang-types",
+ "version": "2013-07-15",
+ "format": "yin",
+ "namespace": "urn:ietf:params:xml:ns:yang:ietf-yang-types",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "ietf-yang-types",
+ "version": "2013-07-15",
+ "format": "yang",
+ "namespace": "urn:ietf:params:xml:ns:yang:ietf-yang-types",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "ietf-inet-types",
+ "version": "2013-07-15",
+ "format": "yin",
+ "namespace": "urn:ietf:params:xml:ns:yang:ietf-inet-types",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "identifier": "ietf-inet-types",
+ "version": "2013-07-15",
+ "format": "yang",
+ "namespace": "urn:ietf:params:xml:ns:yang:ietf-inet-types",
+ "location": [
+ "NETCONF"
+ ],
+ "$@identifier": {
+ "eltype": "leaf",
+ "description": "Identifier to uniquely reference the schema. The\nidentifier is used in the operation and may\nbe used for other purposes such as file retrieval.\n\nFor modeling languages that support or require a data\nmodel name (e.g., YANG module name) the identifier MUST\nmatch that name. For YANG data models, the identifier is\nthe name of the module or submodule. In other cases, an\nidentifier such as a filename MAY be used instead.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@version": {
+ "eltype": "leaf",
+ "description": "Version of the schema supported. Multiple versions MAY be\nsupported simultaneously by a NETCONF server. Each\nversion MUST be reported individually in the schema list,\ni.e., with same identifier, possibly different location,\nbut different version.\n\nFor YANG data models, version is the value of the most\nrecent YANG 'revision' statement in the module or\nsubmodule, or the empty string if no 'revision' statement\nis present.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "string",
+ "iskey": true
+ },
+ "$@format": {
+ "eltype": "leaf",
+ "description": "The data modeling language the schema is written\nin (currently xsd, yang, yin, rng, or rnc).\nFor YANG data models, 'yang' format MUST be supported and\n'yin' format MAY also be provided.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "identityref",
+ "identityval": [
+ "schema-format",
+ "xsd",
+ "yang",
+ "yin",
+ "rng",
+ "rnc"
+ ],
+ "iskey": true
+ },
+ "$@namespace": {
+ "eltype": "leaf",
+ "description": "The XML namespace defined by the data model.\n\nFor YANG data models, this is the module's namespace.\nIf the list entry describes a submodule, this field\ncontains the namespace of the module to which the\nsubmodule belongs.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": false
+ },
+ "$@location": {
+ "eltype": "leaf-list",
+ "description": "One or more locations from which the schema can be\nretrieved. This list SHOULD contain at least one\nentry per schema.\n\nA schema entry may be located on a remote file system\n(e.g., reference to file system for ftp retrieval) or\nretrieved directly from a server supporting the\n operation (denoted by the value 'NETCONF').",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "union",
+ "types": [
+ {
+ "type": "enumeration",
+ "enumval": [
+ "NETCONF"
+ ]
+ },
+ {
+ "type": "ietf-inet-types:uri",
+ "typedef": {
+ "description": "The uri type represents a Uniform Resource Identifier\n(URI) as defined by STD 66.\n\nObjects using the uri type MUST be in US-ASCII encoding,\nand MUST be normalized as described by RFC 3986 Sections\n6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\npercent-encoding is removed, and all case-insensitive\ncharacters are set to lowercase except for hexadecimal\ndigits, which are normalized to uppercase as described in\nSection 6.2.2.1.\n\nThe purpose of this normalization is to help provide\nunique URIs. Note that this normalization is not\nsufficient to provide uniqueness. Two URIs that are\ntextually distinct after this normalization may still be\nequivalent.\n\nObjects using the uri type may restrict the schemes that\nthey permit. For example, 'data:' and 'urn:' schemes\nmight not be appropriate.\n\nA zero-length URI is not a valid URI. This can be used to\nexpress 'URI absent' where required.\n\nIn the value set and its semantics, this type is equivalent\nto the Uri SMIv2 textual convention defined in RFC 5017.",
+ "reference": "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\nRFC 3305: Report from the Joint W3C\/IETF URI Planning Interest\n Group: Uniform Resource Identifiers (URIs), URLs,\n and Uniform Resource Names (URNs): Clarifications\n and Recommendations\nRFC 5017: MIB Textual Conventions for Uniform Resource\n Identifiers (URIs)",
+ "status": "current",
+ "type": "string"
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "$@schema": {
+ "eltype": "list",
+ "description": "List of data model schemas supported by the server.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "keys": [
+ "identifier",
+ "version",
+ "format"
+ ]
+ }
+ },
+ "statistics": {
+ "netconf-start-time": "2015-11-23T08:31:36Z",
+ "in-bad-hellos": 0,
+ "in-sessions": 8,
+ "dropped-sessions": 6,
+ "in-rpcs": 105,
+ "in-bad-rpcs": 6,
+ "out-rpc-errors": 0,
+ "out-notifications": 0,
+ "$@netconf-start-time": {
+ "eltype": "leaf",
+ "description": "Date and time at which the management subsystem was\nstarted.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "ietf-yang-types:date-and-time",
+ "typedef": {
+ "description": "The date-and-time type is a profile of the ISO 8601\nstandard for representation of dates and times using the\nGregorian calendar. The profile is defined by the\ndate-time production in Section 5.6 of RFC 3339.\n\nThe date-and-time type is compatible with the dateTime XML\nschema type with the following notable exceptions:\n\n(a) The date-and-time type does not allow negative years.\n\n(b) The date-and-time time-offset -00:00 indicates an unknown\n time zone (see RFC 3339) while -00:00 and +00:00 and Z\n all represent the same time zone in dateTime.\n\n(c) The canonical format (see below) of data-and-time values\n differs from the canonical format used by the dateTime XML\n schema type, which requires all times to be in UTC using\n the time-offset 'Z'.\n\nThis type is not equivalent to the DateAndTime textual\nconvention of the SMIv2 since RFC 3339 uses a different\nseparator between full-date and full-time and provides\nhigher resolution of time-secfrac.\n\nThe canonical format for date-and-time values with a known time\nzone uses a numeric time zone offset that is calculated using\nthe device's configured known offset to UTC time. A change of\nthe device's offset to UTC time will cause date-and-time values\nto change accordingly. Such changes might happen periodically\nin case a server follows automatically daylight saving time\n(DST) time zone offset changes. The canonical format for\ndate-and-time values with an unknown time zone (usually\nreferring to the notion of local time) uses the time-offset\n-00:00.",
+ "reference": "RFC 3339: Date and Time on the Internet: Timestamps\nRFC 2579: Textual Conventions for SMIv2\nXSD-TYPES: XML Schema Part 2: Datatypes Second Edition",
+ "status": "current",
+ "type": "string",
+ "pattern": [
+ "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})"
+ ]
+ },
+ "iskey": false
+ },
+ "$@in-bad-hellos": {
+ "eltype": "leaf",
+ "description": "Number of sessions silently dropped because an\ninvalid message was received. This includes \nmessages with a 'session-id' attribute, bad namespace, and\nbad capability declarations.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "ietf-yang-types:zero-based-counter32",
+ "typedef": {
+ "description": "The zero-based-counter32 type represents a counter32\nthat has the defined 'initial' value zero.\n\nA schema node of this type will be set to zero (0) on creation\nand will thereafter increase monotonically until it reaches\na maximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nProvided that an application discovers a new schema node\nof this type within the minimum time to wrap, it can use the\n'initial' value as a delta. It is important for a management\nstation to be aware of this minimum time and the actual time\nbetween polls, and to discard data if the actual time is too\nlong or there is no defined minimum time.\n\nIn the value set and its semantics, this type is equivalent\nto the ZeroBasedCounter32 textual convention of the SMIv2.",
+ "reference": "RFC 4502: Remote Network Monitoring Management Information\n Base Version 2",
+ "status": "current",
+ "type": "counter32",
+ "typedef": {
+ "description": "The counter32 type represents a non-negative integer\nthat monotonically increases until it reaches a\nmaximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nCounters have no defined 'initial' value, and thus, a\nsingle value of a counter has (in general) no information\ncontent. Discontinuities in the monotonically increasing\nvalue normally occur at re-initialization of the\nmanagement system, and at other times as specified in the\ndescription of a schema node using this type. If such\nother times can occur, for example, the creation of\na schema node of type counter32 at times other than\nre-initialization, then a corresponding schema node\nshould be defined, with an appropriate type, to indicate\nthe last discontinuity.\n\nThe counter32 type should not be used for configuration\nschema nodes. A default statement SHOULD NOT be used in\ncombination with the type counter32.\n\nIn the value set and its semantics, this type is equivalent\nto the Counter32 type of the SMIv2.",
+ "reference": "RFC 2578: Structure of Management Information Version 2\n (SMIv2)",
+ "status": "current",
+ "type": "uint32"
+ },
+ "default": "0"
+ },
+ "iskey": false
+ },
+ "$@in-sessions": {
+ "eltype": "leaf",
+ "description": "Number of sessions started. This counter is incremented\nwhen a message with a is sent.\n\n'in-sessions' - 'in-bad-hellos' =\n 'number of correctly started netconf sessions'",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "ietf-yang-types:zero-based-counter32",
+ "typedef": {
+ "description": "The zero-based-counter32 type represents a counter32\nthat has the defined 'initial' value zero.\n\nA schema node of this type will be set to zero (0) on creation\nand will thereafter increase monotonically until it reaches\na maximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nProvided that an application discovers a new schema node\nof this type within the minimum time to wrap, it can use the\n'initial' value as a delta. It is important for a management\nstation to be aware of this minimum time and the actual time\nbetween polls, and to discard data if the actual time is too\nlong or there is no defined minimum time.\n\nIn the value set and its semantics, this type is equivalent\nto the ZeroBasedCounter32 textual convention of the SMIv2.",
+ "reference": "RFC 4502: Remote Network Monitoring Management Information\n Base Version 2",
+ "status": "current",
+ "type": "counter32",
+ "typedef": {
+ "description": "The counter32 type represents a non-negative integer\nthat monotonically increases until it reaches a\nmaximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nCounters have no defined 'initial' value, and thus, a\nsingle value of a counter has (in general) no information\ncontent. Discontinuities in the monotonically increasing\nvalue normally occur at re-initialization of the\nmanagement system, and at other times as specified in the\ndescription of a schema node using this type. If such\nother times can occur, for example, the creation of\na schema node of type counter32 at times other than\nre-initialization, then a corresponding schema node\nshould be defined, with an appropriate type, to indicate\nthe last discontinuity.\n\nThe counter32 type should not be used for configuration\nschema nodes. A default statement SHOULD NOT be used in\ncombination with the type counter32.\n\nIn the value set and its semantics, this type is equivalent\nto the Counter32 type of the SMIv2.",
+ "reference": "RFC 2578: Structure of Management Information Version 2\n (SMIv2)",
+ "status": "current",
+ "type": "uint32"
+ },
+ "default": "0"
+ },
+ "iskey": false
+ },
+ "$@dropped-sessions": {
+ "eltype": "leaf",
+ "description": "Number of sessions that were abnormally terminated, e.g.,\ndue to idle timeout or transport close. This counter is not\nincremented when a session is properly closed by a\n operation, or killed by a \noperation.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "ietf-yang-types:zero-based-counter32",
+ "typedef": {
+ "description": "The zero-based-counter32 type represents a counter32\nthat has the defined 'initial' value zero.\n\nA schema node of this type will be set to zero (0) on creation\nand will thereafter increase monotonically until it reaches\na maximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nProvided that an application discovers a new schema node\nof this type within the minimum time to wrap, it can use the\n'initial' value as a delta. It is important for a management\nstation to be aware of this minimum time and the actual time\nbetween polls, and to discard data if the actual time is too\nlong or there is no defined minimum time.\n\nIn the value set and its semantics, this type is equivalent\nto the ZeroBasedCounter32 textual convention of the SMIv2.",
+ "reference": "RFC 4502: Remote Network Monitoring Management Information\n Base Version 2",
+ "status": "current",
+ "type": "counter32",
+ "typedef": {
+ "description": "The counter32 type represents a non-negative integer\nthat monotonically increases until it reaches a\nmaximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nCounters have no defined 'initial' value, and thus, a\nsingle value of a counter has (in general) no information\ncontent. Discontinuities in the monotonically increasing\nvalue normally occur at re-initialization of the\nmanagement system, and at other times as specified in the\ndescription of a schema node using this type. If such\nother times can occur, for example, the creation of\na schema node of type counter32 at times other than\nre-initialization, then a corresponding schema node\nshould be defined, with an appropriate type, to indicate\nthe last discontinuity.\n\nThe counter32 type should not be used for configuration\nschema nodes. A default statement SHOULD NOT be used in\ncombination with the type counter32.\n\nIn the value set and its semantics, this type is equivalent\nto the Counter32 type of the SMIv2.",
+ "reference": "RFC 2578: Structure of Management Information Version 2\n (SMIv2)",
+ "status": "current",
+ "type": "uint32"
+ },
+ "default": "0"
+ },
+ "iskey": false
+ },
+ "$@in-rpcs": {
+ "eltype": "leaf",
+ "description": "Number of correct messages received.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "ietf-yang-types:zero-based-counter32",
+ "typedef": {
+ "description": "The zero-based-counter32 type represents a counter32\nthat has the defined 'initial' value zero.\n\nA schema node of this type will be set to zero (0) on creation\nand will thereafter increase monotonically until it reaches\na maximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nProvided that an application discovers a new schema node\nof this type within the minimum time to wrap, it can use the\n'initial' value as a delta. It is important for a management\nstation to be aware of this minimum time and the actual time\nbetween polls, and to discard data if the actual time is too\nlong or there is no defined minimum time.\n\nIn the value set and its semantics, this type is equivalent\nto the ZeroBasedCounter32 textual convention of the SMIv2.",
+ "reference": "RFC 4502: Remote Network Monitoring Management Information\n Base Version 2",
+ "status": "current",
+ "type": "counter32",
+ "typedef": {
+ "description": "The counter32 type represents a non-negative integer\nthat monotonically increases until it reaches a\nmaximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nCounters have no defined 'initial' value, and thus, a\nsingle value of a counter has (in general) no information\ncontent. Discontinuities in the monotonically increasing\nvalue normally occur at re-initialization of the\nmanagement system, and at other times as specified in the\ndescription of a schema node using this type. If such\nother times can occur, for example, the creation of\na schema node of type counter32 at times other than\nre-initialization, then a corresponding schema node\nshould be defined, with an appropriate type, to indicate\nthe last discontinuity.\n\nThe counter32 type should not be used for configuration\nschema nodes. A default statement SHOULD NOT be used in\ncombination with the type counter32.\n\nIn the value set and its semantics, this type is equivalent\nto the Counter32 type of the SMIv2.",
+ "reference": "RFC 2578: Structure of Management Information Version 2\n (SMIv2)",
+ "status": "current",
+ "type": "uint32"
+ },
+ "default": "0"
+ },
+ "iskey": false
+ },
+ "$@in-bad-rpcs": {
+ "eltype": "leaf",
+ "description": "Number of messages received when an message was expected,\nthat were not correct messages. This includes XML parse\nerrors and errors on the rpc layer.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "ietf-yang-types:zero-based-counter32",
+ "typedef": {
+ "description": "The zero-based-counter32 type represents a counter32\nthat has the defined 'initial' value zero.\n\nA schema node of this type will be set to zero (0) on creation\nand will thereafter increase monotonically until it reaches\na maximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nProvided that an application discovers a new schema node\nof this type within the minimum time to wrap, it can use the\n'initial' value as a delta. It is important for a management\nstation to be aware of this minimum time and the actual time\nbetween polls, and to discard data if the actual time is too\nlong or there is no defined minimum time.\n\nIn the value set and its semantics, this type is equivalent\nto the ZeroBasedCounter32 textual convention of the SMIv2.",
+ "reference": "RFC 4502: Remote Network Monitoring Management Information\n Base Version 2",
+ "status": "current",
+ "type": "counter32",
+ "typedef": {
+ "description": "The counter32 type represents a non-negative integer\nthat monotonically increases until it reaches a\nmaximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nCounters have no defined 'initial' value, and thus, a\nsingle value of a counter has (in general) no information\ncontent. Discontinuities in the monotonically increasing\nvalue normally occur at re-initialization of the\nmanagement system, and at other times as specified in the\ndescription of a schema node using this type. If such\nother times can occur, for example, the creation of\na schema node of type counter32 at times other than\nre-initialization, then a corresponding schema node\nshould be defined, with an appropriate type, to indicate\nthe last discontinuity.\n\nThe counter32 type should not be used for configuration\nschema nodes. A default statement SHOULD NOT be used in\ncombination with the type counter32.\n\nIn the value set and its semantics, this type is equivalent\nto the Counter32 type of the SMIv2.",
+ "reference": "RFC 2578: Structure of Management Information Version 2\n (SMIv2)",
+ "status": "current",
+ "type": "uint32"
+ },
+ "default": "0"
+ },
+ "iskey": false
+ },
+ "$@out-rpc-errors": {
+ "eltype": "leaf",
+ "description": "Number of messages sent that contained an\n element.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "ietf-yang-types:zero-based-counter32",
+ "typedef": {
+ "description": "The zero-based-counter32 type represents a counter32\nthat has the defined 'initial' value zero.\n\nA schema node of this type will be set to zero (0) on creation\nand will thereafter increase monotonically until it reaches\na maximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nProvided that an application discovers a new schema node\nof this type within the minimum time to wrap, it can use the\n'initial' value as a delta. It is important for a management\nstation to be aware of this minimum time and the actual time\nbetween polls, and to discard data if the actual time is too\nlong or there is no defined minimum time.\n\nIn the value set and its semantics, this type is equivalent\nto the ZeroBasedCounter32 textual convention of the SMIv2.",
+ "reference": "RFC 4502: Remote Network Monitoring Management Information\n Base Version 2",
+ "status": "current",
+ "type": "counter32",
+ "typedef": {
+ "description": "The counter32 type represents a non-negative integer\nthat monotonically increases until it reaches a\nmaximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nCounters have no defined 'initial' value, and thus, a\nsingle value of a counter has (in general) no information\ncontent. Discontinuities in the monotonically increasing\nvalue normally occur at re-initialization of the\nmanagement system, and at other times as specified in the\ndescription of a schema node using this type. If such\nother times can occur, for example, the creation of\na schema node of type counter32 at times other than\nre-initialization, then a corresponding schema node\nshould be defined, with an appropriate type, to indicate\nthe last discontinuity.\n\nThe counter32 type should not be used for configuration\nschema nodes. A default statement SHOULD NOT be used in\ncombination with the type counter32.\n\nIn the value set and its semantics, this type is equivalent\nto the Counter32 type of the SMIv2.",
+ "reference": "RFC 2578: Structure of Management Information Version 2\n (SMIv2)",
+ "status": "current",
+ "type": "uint32"
+ },
+ "default": "0"
+ },
+ "iskey": false
+ },
+ "$@out-notifications": {
+ "eltype": "leaf",
+ "description": "Number of messages sent.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "ietf-yang-types:zero-based-counter32",
+ "typedef": {
+ "description": "The zero-based-counter32 type represents a counter32\nthat has the defined 'initial' value zero.\n\nA schema node of this type will be set to zero (0) on creation\nand will thereafter increase monotonically until it reaches\na maximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nProvided that an application discovers a new schema node\nof this type within the minimum time to wrap, it can use the\n'initial' value as a delta. It is important for a management\nstation to be aware of this minimum time and the actual time\nbetween polls, and to discard data if the actual time is too\nlong or there is no defined minimum time.\n\nIn the value set and its semantics, this type is equivalent\nto the ZeroBasedCounter32 textual convention of the SMIv2.",
+ "reference": "RFC 4502: Remote Network Monitoring Management Information\n Base Version 2",
+ "status": "current",
+ "type": "counter32",
+ "typedef": {
+ "description": "The counter32 type represents a non-negative integer\nthat monotonically increases until it reaches a\nmaximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nCounters have no defined 'initial' value, and thus, a\nsingle value of a counter has (in general) no information\ncontent. Discontinuities in the monotonically increasing\nvalue normally occur at re-initialization of the\nmanagement system, and at other times as specified in the\ndescription of a schema node using this type. If such\nother times can occur, for example, the creation of\na schema node of type counter32 at times other than\nre-initialization, then a corresponding schema node\nshould be defined, with an appropriate type, to indicate\nthe last discontinuity.\n\nThe counter32 type should not be used for configuration\nschema nodes. A default statement SHOULD NOT be used in\ncombination with the type counter32.\n\nIn the value set and its semantics, this type is equivalent\nto the Counter32 type of the SMIv2.",
+ "reference": "RFC 2578: Structure of Management Information Version 2\n (SMIv2)",
+ "status": "current",
+ "type": "uint32"
+ },
+ "default": "0"
+ },
+ "iskey": false
+ }
+ },
+ "$@capabilities": {
+ "eltype": "container",
+ "description": "Contains the list of NETCONF capabilities supported by the\nserver.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "children": [
+ "capability"
+ ]
+ },
+ "$@datastores": {
+ "eltype": "container",
+ "description": "Contains the list of NETCONF configuration datastores.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "children": [
+ "datastore"
+ ]
+ },
+ "$@sessions": {
+ "eltype": "container",
+ "description": "The sessions container includes session-specific data for\nNETCONF management sessions. The session list MUST include\nall currently active NETCONF sessions.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "children": [
+ "session"
+ ]
+ },
+ "$@schemas": {
+ "eltype": "container",
+ "description": "Contains the list of data model schemas supported by the\nserver.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "children": [
+ "schema"
+ ]
+ },
+ "$@statistics": {
+ "eltype": "container",
+ "description": "Statistical data pertaining to the NETCONF server.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "children": [
+ "netconf-start-time",
+ "in-bad-hellos",
+ "in-sessions",
+ "dropped-sessions"
+ ]
+ }
+ },
+ "nc-notifications:netconf": {
+ "streams": {
+ "stream": [
+ {
+ "name": "NETCONF",
+ "description": "NETCONF Base Notifications",
+ "replaySupport": true,
+ "replayLogCreationTime": "2014-09-22T09:25:33Z",
+ "$@name": {
+ "eltype": "leaf",
+ "description": "The name of the event stream. If this is the default\nNETCONF stream, this must have the value 'NETCONF'.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "notifications:streamNameType",
+ "typedef": {
+ "description": "The name of an event stream.",
+ "status": "current",
+ "type": "string"
+ },
+ "iskey": true
+ },
+ "$@description": {
+ "eltype": "leaf",
+ "description": "A description of the event stream, including such\ninformation as the type of events that are sent over\nthis stream.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "string",
+ "iskey": false
+ },
+ "$@replaySupport": {
+ "eltype": "leaf",
+ "description": "A description of the event stream, including such\ninformation as the type of events that are sent over\nthis stream.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "type": "bool",
+ "iskey": false
+ },
+ "$@replayLogCreationTime": {
+ "eltype": "leaf",
+ "description": "The timestamp of the creation of the log used to support\nthe replay function on this stream. Note that this might\nbe earlier then the earliest available notification in\nthe log. This object is updated if the log resets for \nsome reason. This object MUST be present if replay is\nsupported.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "type": "ietf-yang-types:date-and-time",
+ "typedef": {
+ "description": "The date-and-time type is a profile of the ISO 8601\nstandard for representation of dates and times using the\nGregorian calendar. The profile is defined by the\ndate-time production in Section 5.6 of RFC 3339.\n\nThe date-and-time type is compatible with the dateTime XML\nschema type with the following notable exceptions:\n\n(a) The date-and-time type does not allow negative years.\n\n(b) The date-and-time time-offset -00:00 indicates an unknown\n time zone (see RFC 3339) while -00:00 and +00:00 and Z\n all represent the same time zone in dateTime.\n\n(c) The canonical format (see below) of data-and-time values\n differs from the canonical format used by the dateTime XML\n schema type, which requires all times to be in UTC using\n the time-offset 'Z'.\n\nThis type is not equivalent to the DateAndTime textual\nconvention of the SMIv2 since RFC 3339 uses a different\nseparator between full-date and full-time and provides\nhigher resolution of time-secfrac.\n\nThe canonical format for date-and-time values with a known time\nzone uses a numeric time zone offset that is calculated using\nthe device's configured known offset to UTC time. A change of\nthe device's offset to UTC time will cause date-and-time values\nto change accordingly. Such changes might happen periodically\nin case a server follows automatically daylight saving time\n(DST) time zone offset changes. The canonical format for\ndate-and-time values with an unknown time zone (usually\nreferring to the notion of local time) uses the time-offset\n-00:00.",
+ "reference": "RFC 3339: Date and Time on the Internet: Timestamps\nRFC 2579: Textual Conventions for SMIv2\nXSD-TYPES: XML Schema Part 2: Datatypes Second Edition",
+ "status": "current",
+ "type": "string",
+ "pattern": [
+ "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[\\+\\-]\\d{2}:\\d{2})"
+ ]
+ },
+ "iskey": false
+ }
+ }
+ ],
+ "$@stream": {
+ "eltype": "list",
+ "description": "Stream name, description and other information.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "min-elements": 1,
+ "keys": [
+ "name"
+ ]
+ }
+ },
+ "$@streams": {
+ "eltype": "container",
+ "description": "The list of event streams supported by the system. When\na query is issued, the returned set of streams is \ndetermined based on user privileges.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "children": [
+ "stream"
+ ]
+ }
+ },
+ "ietf-netconf-acm:nacm": {
+ "rule-list": [
+ {
+ "name": "almighty",
+ "group": [
+ "almighty"
+ ],
+ "rule": [
+ {
+ "name": "almighty",
+ "module-name": "*",
+ "access-operations": "*",
+ "action": "permit",
+ "$@name": {
+ "eltype": "leaf",
+ "description": "Arbitrary name assigned to the rule.",
+ "config": true,
+ "status": "current",
+ "mandatory": false,
+ "ext": "default-deny-all",
+ "type": "string",
+ "length": "1..max",
+ "iskey": true
+ },
+ "$@module-name": {
+ "eltype": "leaf",
+ "description": "Name of the module associated with this rule.\n\nThis leaf matches if it has the value '*' or if the\nobject being accessed is defined in the module with the\nspecified module name.",
+ "config": true,
+ "status": "current",
+ "mandatory": false,
+ "ext": "default-deny-all",
+ "type": "union",
+ "types": [
+ {
+ "type": "matchall-string-type",
+ "typedef": {
+ "description": "The string containing a single asterisk '*' is used\nto conceptually represent all possible values\nfor the particular leaf using this data type.",
+ "status": "current",
+ "type": "string",
+ "pattern": [
+ "\\*"
+ ]
+ }
+ },
+ {
+ "type": "string"
+ }
+ ],
+ "default": "*",
+ "iskey": false
+ },
+ "$@access-operations": {
+ "eltype": "leaf",
+ "description": "Access operations associated with this rule.\n\nThis leaf matches if it has the value '*' or if the\nbit corresponding to the requested operation is set.",
+ "config": true,
+ "status": "current",
+ "mandatory": false,
+ "ext": "default-deny-all",
+ "type": "union",
+ "types": [
+ {
+ "type": "matchall-string-type",
+ "typedef": {
+ "description": "The string containing a single asterisk '*' is used\nto conceptually represent all possible values\nfor the particular leaf using this data type.",
+ "status": "current",
+ "type": "string",
+ "pattern": [
+ "\\*"
+ ]
+ }
+ },
+ {
+ "type": "access-operations-type",
+ "typedef": {
+ "description": "NETCONF Access Operation.",
+ "status": "current",
+ "type": "bits",
+ "bits": [
+ {
+ "name": "create",
+ "position": 0
+ },
+ {
+ "name": "read",
+ "position": 1
+ },
+ {
+ "name": "update",
+ "position": 2
+ },
+ {
+ "name": "delete",
+ "position": 3
+ },
+ {
+ "name": "exec",
+ "position": 4
+ }
+ ]
+ }
+ }
+ ],
+ "default": "*",
+ "iskey": false
+ },
+ "$@action": {
+ "eltype": "leaf",
+ "description": "The access control action associated with the\nrule. If a rule is determined to match a\nparticular request, then this object is used\nto determine whether to permit or deny the\nrequest.",
+ "config": true,
+ "status": "current",
+ "mandatory": true,
+ "ext": "default-deny-all",
+ "type": "action-type",
+ "typedef": {
+ "description": "Action taken by the server when a particular\nrule matches.",
+ "status": "current",
+ "type": "enumeration",
+ "enumval": [
+ "permit",
+ "deny"
+ ]
+ },
+ "iskey": false
+ }
+ }
+ ],
+ "$@name": {
+ "eltype": "leaf",
+ "description": "Arbitrary name assigned to the rule-list.",
+ "config": true,
+ "status": "current",
+ "mandatory": false,
+ "ext": "default-deny-all",
+ "type": "string",
+ "length": "1..max",
+ "iskey": true
+ },
+ "$@group": {
+ "eltype": "leaf-list",
+ "description": "List of administrative groups that will be\nassigned the associated access rights\ndefined by the 'rule' list.\n\nThe string '*' indicates that all groups apply to the\nentry.",
+ "config": true,
+ "status": "current",
+ "mandatory": false,
+ "ext": "default-deny-all",
+ "type": "union",
+ "types": [
+ {
+ "type": "matchall-string-type",
+ "typedef": {
+ "description": "The string containing a single asterisk '*' is used\nto conceptually represent all possible values\nfor the particular leaf using this data type.",
+ "status": "current",
+ "type": "string",
+ "pattern": [
+ "\\*"
+ ]
+ }
+ },
+ {
+ "type": "group-name-type",
+ "typedef": {
+ "description": "Name of administrative group to which\nusers can be assigned.",
+ "status": "current",
+ "type": "string",
+ "length": "1..max",
+ "pattern": [
+ "[^\\*].*"
+ ]
+ }
+ }
+ ]
+ },
+ "$@rule": {
+ "eltype": "list",
+ "description": "One access control rule.\n\nRules are processed in user-defined order until a match is\nfound. A rule matches if 'module-name', 'rule-type', and\n'access-operations' match the request. If a rule\nmatches, the 'action' leaf determines if access is granted\nor not.",
+ "config": true,
+ "status": "current",
+ "mandatory": false,
+ "ext": "default-deny-all",
+ "keys": [
+ "name"
+ ]
+ }
+ }
+ ],
+ "groups": {
+ "group": [
+ {
+ "name": "almighty",
+ "user-name": [
+ "vasko"
+ ],
+ "$@name": {
+ "eltype": "leaf",
+ "description": "Group name associated with this entry.",
+ "config": true,
+ "status": "current",
+ "mandatory": false,
+ "ext": "default-deny-all",
+ "type": "group-name-type",
+ "typedef": {
+ "description": "Name of administrative group to which\nusers can be assigned.",
+ "status": "current",
+ "type": "string",
+ "length": "1..max",
+ "pattern": [
+ "[^\\*].*"
+ ]
+ },
+ "iskey": true
+ },
+ "$@user-name": {
+ "eltype": "leaf-list",
+ "description": "Each entry identifies the username of\na member of the group associated with\nthis entry.",
+ "config": true,
+ "status": "current",
+ "mandatory": false,
+ "ext": "default-deny-all",
+ "type": "user-name-type",
+ "typedef": {
+ "description": "General Purpose Username string.",
+ "status": "current",
+ "type": "string",
+ "length": "1..max"
+ }
+ }
+ }
+ ],
+ "$@group": {
+ "eltype": "list",
+ "description": "One NACM Group Entry. This list will only contain\nconfigured entries, not any entries learned from\nany transport protocols.",
+ "config": true,
+ "status": "current",
+ "mandatory": false,
+ "ext": "default-deny-all",
+ "keys": [
+ "name"
+ ]
+ }
+ },
+ "denied-operations": 0,
+ "denied-data-writes": 0,
+ "denied-notifications": 0,
+ "$@rule-list": {
+ "eltype": "list",
+ "description": "An ordered collection of access control rules.",
+ "config": true,
+ "status": "current",
+ "mandatory": false,
+ "ext": "default-deny-all",
+ "keys": [
+ "name"
+ ]
+ },
+ "$@groups": {
+ "eltype": "container",
+ "description": "NETCONF Access Control Groups.",
+ "config": true,
+ "status": "current",
+ "mandatory": false,
+ "ext": "default-deny-all",
+ "children": [
+ "group"
+ ]
+ },
+ "$@denied-operations": {
+ "eltype": "leaf",
+ "description": "Number of times since the server last restarted that a\nprotocol operation request was denied.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "ext": "default-deny-all",
+ "type": "ietf-yang-types:zero-based-counter32",
+ "typedef": {
+ "description": "The zero-based-counter32 type represents a counter32\nthat has the defined 'initial' value zero.\n\nA schema node of this type will be set to zero (0) on creation\nand will thereafter increase monotonically until it reaches\na maximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nProvided that an application discovers a new schema node\nof this type within the minimum time to wrap, it can use the\n'initial' value as a delta. It is important for a management\nstation to be aware of this minimum time and the actual time\nbetween polls, and to discard data if the actual time is too\nlong or there is no defined minimum time.\n\nIn the value set and its semantics, this type is equivalent\nto the ZeroBasedCounter32 textual convention of the SMIv2.",
+ "reference": "RFC 4502: Remote Network Monitoring Management Information\n Base Version 2",
+ "status": "current",
+ "type": "counter32",
+ "typedef": {
+ "description": "The counter32 type represents a non-negative integer\nthat monotonically increases until it reaches a\nmaximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nCounters have no defined 'initial' value, and thus, a\nsingle value of a counter has (in general) no information\ncontent. Discontinuities in the monotonically increasing\nvalue normally occur at re-initialization of the\nmanagement system, and at other times as specified in the\ndescription of a schema node using this type. If such\nother times can occur, for example, the creation of\na schema node of type counter32 at times other than\nre-initialization, then a corresponding schema node\nshould be defined, with an appropriate type, to indicate\nthe last discontinuity.\n\nThe counter32 type should not be used for configuration\nschema nodes. A default statement SHOULD NOT be used in\ncombination with the type counter32.\n\nIn the value set and its semantics, this type is equivalent\nto the Counter32 type of the SMIv2.",
+ "reference": "RFC 2578: Structure of Management Information Version 2\n (SMIv2)",
+ "status": "current",
+ "type": "uint32"
+ },
+ "default": "0"
+ },
+ "iskey": false
+ },
+ "$@denied-data-writes": {
+ "eltype": "leaf",
+ "description": "Number of times since the server last restarted that a\nprotocol operation request to alter\na configuration datastore was denied.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "ext": "default-deny-all",
+ "type": "ietf-yang-types:zero-based-counter32",
+ "typedef": {
+ "description": "The zero-based-counter32 type represents a counter32\nthat has the defined 'initial' value zero.\n\nA schema node of this type will be set to zero (0) on creation\nand will thereafter increase monotonically until it reaches\na maximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nProvided that an application discovers a new schema node\nof this type within the minimum time to wrap, it can use the\n'initial' value as a delta. It is important for a management\nstation to be aware of this minimum time and the actual time\nbetween polls, and to discard data if the actual time is too\nlong or there is no defined minimum time.\n\nIn the value set and its semantics, this type is equivalent\nto the ZeroBasedCounter32 textual convention of the SMIv2.",
+ "reference": "RFC 4502: Remote Network Monitoring Management Information\n Base Version 2",
+ "status": "current",
+ "type": "counter32",
+ "typedef": {
+ "description": "The counter32 type represents a non-negative integer\nthat monotonically increases until it reaches a\nmaximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nCounters have no defined 'initial' value, and thus, a\nsingle value of a counter has (in general) no information\ncontent. Discontinuities in the monotonically increasing\nvalue normally occur at re-initialization of the\nmanagement system, and at other times as specified in the\ndescription of a schema node using this type. If such\nother times can occur, for example, the creation of\na schema node of type counter32 at times other than\nre-initialization, then a corresponding schema node\nshould be defined, with an appropriate type, to indicate\nthe last discontinuity.\n\nThe counter32 type should not be used for configuration\nschema nodes. A default statement SHOULD NOT be used in\ncombination with the type counter32.\n\nIn the value set and its semantics, this type is equivalent\nto the Counter32 type of the SMIv2.",
+ "reference": "RFC 2578: Structure of Management Information Version 2\n (SMIv2)",
+ "status": "current",
+ "type": "uint32"
+ },
+ "default": "0"
+ },
+ "iskey": false
+ },
+ "$@denied-notifications": {
+ "eltype": "leaf",
+ "description": "Number of times since the server last restarted that\na notification was dropped for a subscription because\naccess to the event type was denied.",
+ "config": false,
+ "status": "current",
+ "mandatory": true,
+ "ext": "default-deny-all",
+ "type": "ietf-yang-types:zero-based-counter32",
+ "typedef": {
+ "description": "The zero-based-counter32 type represents a counter32\nthat has the defined 'initial' value zero.\n\nA schema node of this type will be set to zero (0) on creation\nand will thereafter increase monotonically until it reaches\na maximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nProvided that an application discovers a new schema node\nof this type within the minimum time to wrap, it can use the\n'initial' value as a delta. It is important for a management\nstation to be aware of this minimum time and the actual time\nbetween polls, and to discard data if the actual time is too\nlong or there is no defined minimum time.\n\nIn the value set and its semantics, this type is equivalent\nto the ZeroBasedCounter32 textual convention of the SMIv2.",
+ "reference": "RFC 4502: Remote Network Monitoring Management Information\n Base Version 2",
+ "status": "current",
+ "type": "counter32",
+ "typedef": {
+ "description": "The counter32 type represents a non-negative integer\nthat monotonically increases until it reaches a\nmaximum value of 2^32-1 (4294967295 decimal), when it\nwraps around and starts increasing again from zero.\n\nCounters have no defined 'initial' value, and thus, a\nsingle value of a counter has (in general) no information\ncontent. Discontinuities in the monotonically increasing\nvalue normally occur at re-initialization of the\nmanagement system, and at other times as specified in the\ndescription of a schema node using this type. If such\nother times can occur, for example, the creation of\na schema node of type counter32 at times other than\nre-initialization, then a corresponding schema node\nshould be defined, with an appropriate type, to indicate\nthe last discontinuity.\n\nThe counter32 type should not be used for configuration\nschema nodes. A default statement SHOULD NOT be used in\ncombination with the type counter32.\n\nIn the value set and its semantics, this type is equivalent\nto the Counter32 type of the SMIv2.",
+ "reference": "RFC 2578: Structure of Management Information Version 2\n (SMIv2)",
+ "status": "current",
+ "type": "uint32"
+ },
+ "default": "0"
+ },
+ "iskey": false
+ }
+ },
+ "$@netopeer-cfgnetopeer:netopeer": {
+ "eltype": "container",
+ "config": true,
+ "status": "current",
+ "mandatory": false,
+ "children": [
+ "hello-timeout",
+ "idle-timeout",
+ "max-sessions",
+ "response-time",
+ "ssh",
+ "tls",
+ "modules"
+ ]
+ },
+ "$@ietf-netconf-monitoring:netconf-state": {
+ "eltype": "container",
+ "description": "The netconf-state container is the root of the monitoring\ndata model.",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "children": [
+ "capabilities",
+ "datastores",
+ "schemas",
+ "sessions",
+ "statistics"
+ ]
+ },
+ "$@nc-notifications:netconf": {
+ "eltype": "container",
+ "description": "Top-level element in the notification namespace",
+ "config": false,
+ "status": "current",
+ "mandatory": false,
+ "children": [
+ "streams"
+ ]
+ },
+ "$@ietf-netconf-acm:nacm": {
+ "eltype": "container",
+ "description": "Parameters for NETCONF Access Control Model.",
+ "config": true,
+ "status": "current",
+ "mandatory": false,
+ "ext": "default-deny-all",
+ "children": [
+ "enable-nacm",
+ "read-default",
+ "write-default",
+ "exec-default",
+ "enable-external-groups",
+ "denied-operations",
+ "denied-data-writes",
+ "denied-notifications",
+ "groups",
+ "rule-list"
+ ]
+ }
+}
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/test.json b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/test.json
new file mode 100644
index 00000000..739e5409
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/test.json
@@ -0,0 +1,515 @@
+{
+ "jsonQ_root": {
+ "$@ietf-interfaces:interfaces": {
+ "eltype": "leaf",
+ "config": "false",
+ "type": "enumeration",
+ "enumval": [
+ "int8",
+ "int16",
+ "int32",
+ "int64",
+ "uint8",
+ "uint16",
+ "uint32",
+ "uint64",
+ "float",
+ "string"
+ ],
+ "description": "The data type of the parameters argument.",
+ "mandatory": "false",
+ "iskey": "false",
+ "children": [
+ "interface",
+ "interface-state"
+ ]
+ },
+ "ietf-interfaces:interfaces": {
+ "$@interface": {
+ "eltype": "list",
+ "config": "true",
+ "type": "enumeration",
+ "iskey": "false"
+ },
+ "interface": [
+ {
+ "$@name": {
+ "config": "true",
+ "type": "string"
+ },
+ "name": "eth0",
+ "$@type": {
+ "typedef": {
+ "type": "uint8",
+ "range": "0 .. 100",
+ "description": "Percentage"
+ }
+ },
+ "type": "iana-if-type:ethernetCsmacd",
+ "$@enabled": {
+ "type": "boolean"
+ },
+ "enabled": false
+ },
+ {
+ "$@name": {
+ "config": "true",
+ "type": "string"
+ },
+ "name": "eth1",
+ "$@type": {
+ "typedef": {
+ "type": "uint8",
+ "range": "0 .. 100",
+ "description": "Percentage"
+ }
+ },
+ "type": "iana-if-type:ethernetCsmacd",
+ "enabled": true,
+ "ex-vlan:vlan-tagging": true
+ }
+ ]
+ },
+ "$@ietf-interfaces:interfaces-state": {
+ "eltype": "leaf",
+ "config": "false",
+ "type": "enumeration",
+ "enumval": [
+ "int8",
+ "int16",
+ "int32",
+ "int64",
+ "uint8",
+ "uint16",
+ "uint32",
+ "uint64",
+ "float",
+ "string"
+ ],
+ "description": "The data type of the parameters argument.",
+ "mandatory": "false",
+ "iskey": "false"
+ },
+ "ietf-interfaces:interfaces-state": {}
+ },
+ "jsonQ_current": [
+ {
+ "path": []
+ }
+ ],
+ "$@ietf-interfaces:interfaces": [
+ {
+ "path": [
+ "$@ietf-interfaces:interfaces"
+ ]
+ }
+ ],
+ "eltype": [
+ {
+ "path": [
+ "$@ietf-interfaces:interfaces",
+ "eltype"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "$@interface",
+ "eltype"
+ ]
+ },
+ {
+ "path": [
+ "$@ietf-interfaces:interfaces-state",
+ "eltype"
+ ]
+ }
+ ],
+ "config": [
+ {
+ "path": [
+ "$@ietf-interfaces:interfaces",
+ "config"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "$@interface",
+ "config"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "0",
+ "$@name",
+ "config"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "1",
+ "$@name",
+ "config"
+ ]
+ },
+ {
+ "path": [
+ "$@ietf-interfaces:interfaces-state",
+ "config"
+ ]
+ }
+ ],
+ "type": [
+ {
+ "path": [
+ "$@ietf-interfaces:interfaces",
+ "type"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "$@interface",
+ "type"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "0",
+ "$@name",
+ "type"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "0",
+ "$@type",
+ "typedef",
+ "type"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "0",
+ "type"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "0",
+ "$@enabled",
+ "type"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "1",
+ "$@name",
+ "type"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "1",
+ "$@type",
+ "typedef",
+ "type"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "1",
+ "type"
+ ]
+ },
+ {
+ "path": [
+ "$@ietf-interfaces:interfaces-state",
+ "type"
+ ]
+ }
+ ],
+ "enumval": [
+ {
+ "path": [
+ "$@ietf-interfaces:interfaces",
+ "enumval"
+ ]
+ },
+ {
+ "path": [
+ "$@ietf-interfaces:interfaces-state",
+ "enumval"
+ ]
+ }
+ ],
+ "description": [
+ {
+ "path": [
+ "$@ietf-interfaces:interfaces",
+ "description"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "0",
+ "$@type",
+ "typedef",
+ "description"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "1",
+ "$@type",
+ "typedef",
+ "description"
+ ]
+ },
+ {
+ "path": [
+ "$@ietf-interfaces:interfaces-state",
+ "description"
+ ]
+ }
+ ],
+ "mandatory": [
+ {
+ "path": [
+ "$@ietf-interfaces:interfaces",
+ "mandatory"
+ ]
+ },
+ {
+ "path": [
+ "$@ietf-interfaces:interfaces-state",
+ "mandatory"
+ ]
+ }
+ ],
+ "iskey": [
+ {
+ "path": [
+ "$@ietf-interfaces:interfaces",
+ "iskey"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "$@interface",
+ "iskey"
+ ]
+ },
+ {
+ "path": [
+ "$@ietf-interfaces:interfaces-state",
+ "iskey"
+ ]
+ }
+ ],
+ "children": [
+ {
+ "path": [
+ "$@ietf-interfaces:interfaces",
+ "children"
+ ]
+ }
+ ],
+ "ietf-interfaces:interfaces": [
+ {
+ "path": [
+ "ietf-interfaces:interfaces"
+ ]
+ }
+ ],
+ "$@interface": [
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "$@interface"
+ ]
+ }
+ ],
+ "interface": [
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface"
+ ]
+ }
+ ],
+ "$@name": [
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "0",
+ "$@name"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "1",
+ "$@name"
+ ]
+ }
+ ],
+ "name": [
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "0",
+ "name"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "1",
+ "name"
+ ]
+ }
+ ],
+ "$@type": [
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "0",
+ "$@type"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "1",
+ "$@type"
+ ]
+ }
+ ],
+ "typedef": [
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "0",
+ "$@type",
+ "typedef"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "1",
+ "$@type",
+ "typedef"
+ ]
+ }
+ ],
+ "range": [
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "0",
+ "$@type",
+ "typedef",
+ "range"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "1",
+ "$@type",
+ "typedef",
+ "range"
+ ]
+ }
+ ],
+ "$@enabled": [
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "0",
+ "$@enabled"
+ ]
+ }
+ ],
+ "enabled": [
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "0",
+ "enabled"
+ ]
+ },
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "1",
+ "enabled"
+ ]
+ }
+ ],
+ "ex-vlan:vlan-tagging": [
+ {
+ "path": [
+ "ietf-interfaces:interfaces",
+ "interface",
+ "1",
+ "ex-vlan:vlan-tagging"
+ ]
+ }
+ ],
+ "$@ietf-interfaces:interfaces-state": [
+ {
+ "path": [
+ "$@ietf-interfaces:interfaces-state"
+ ]
+ }
+ ],
+ "ietf-interfaces:interfaces-state": [
+ {
+ "path": [
+ "ietf-interfaces:interfaces-state"
+ ]
+ }
+ ],
+ "length": 1,
+ "selector": []
+}
\ No newline at end of file
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/test.xml b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/test.xml
new file mode 100644
index 00000000..7c6496e2
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/data/test.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+ QWZ5671
+ 39.95
+
+ Red
+ Burgundy
+
+
+ Red
+ Burgundy
+
+
+
+ RRX9856
+ Dec 25, 1995
+ 42.50
+
+ Black
+
+
+
+
+
\ No newline at end of file
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/gulpfile.js b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/gulpfile.js
new file mode 100644
index 00000000..a51708e5
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/gulpfile.js
@@ -0,0 +1,21 @@
+var gulp = require('gulp')
+ watch = require('gulp-watch')
+ templateCache = require('gulp-angular-templatecache');
+
+gulp.task('default', function () {
+ return gulp.src('templates/**/*.html')
+ .pipe(templateCache('templates.js', {
+ standalone: true,
+ module: 'configurationTemplates'
+ }))
+ .pipe(gulp.dest('public'));
+});
+
+gulp.task('watch', function () {
+ gulp.watch('templates/**/*.html', ['default'])
+ .on('change', function(evt) {
+ console.log(
+ '[watcher] File ' + evt.path + ' was ' + evt.type + ', compiling...'
+ );
+ });
+});
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/index.html b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/index.html
new file mode 100644
index 00000000..540617dc
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/index.html
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
NetopeerGUI - JSON test
+
+
+
+
+
+
+
+
+
+
+
+ JSON not well-formed!
+
+
+
+
+
+
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/js/JSONedit.js b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/js/JSONedit.js
new file mode 100644
index 00000000..15ad8b57
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/js/JSONedit.js
@@ -0,0 +1,230 @@
+var storage;
+var historyIndex = 0,
+ historyUndo = 0;
+
+var app = angular.module('NetopeerGUIApp', ['JSONedit', 'ngRoute', 'ngTraverse', 'NetopeerGUIServices'])
+
+ .controller('ConfigurationController', function ($rootScope, $scope, $filter, $http, $routeParams, $location, $window, $timeout, traverse, AjaxService) {
+
+ $rootScope.$on("$routeChangeStart", function (event, next, current) {
+ $.netopeergui.createSpinner();
+ $.netopeergui.showSpinner();
+ });
+
+ $rootScope.$on("$routeChangeSuccess", function (event, next, current) {
+ $.netopeergui.hideSpinner();
+ $("#block--topMenu a.active").removeClass('active');
+ $('#block--topMenu a[href="'+window.location.hash+'"]').addClass('active');
+ });
+
+ var resetRevisions = function() {
+ storage = Rhaboo.perishable(window.location.href);
+ historyIndex = 0;
+ historyUndo = 0;
+ storage.write('revisions', []);
+ storage.erase('revisions');
+ storage.write('revisions', []);
+ };
+ var revisionsExists = function() {
+ return !(angular.isUndefined(storage) || angular.isUndefined(storage.revisions));
+ }
+ $scope.moduleName = $routeParams.moduleName;
+
+ $scope.hasUndo = function() {
+ return (historyIndex - historyUndo - 1) <= 0;
+ };
+ $scope.hasRedo = function() {
+ if (!revisionsExists()) {
+ return true;
+ }
+ return (historyIndex - historyUndo) >= storage.revisions.length;
+ };
+ var isUndo = false,
+ isRedo = false;
+
+ $scope.reloadData = function () {
+ //console.log('reload');
+ var targetUrl;
+ if (typeof $routeParams.action !== "undefined") {
+ targetUrl = window.location.origin + window.location.pathname.replace('sections', 'info-page') + $routeParams.action + '/';
+ } else {
+ targetUrl = window.location.origin + window.location.pathname + $scope.moduleName + '/';
+ }
+
+ $.netopeergui.showSpinner();
+ AjaxService.reloadData(targetUrl)
+ .then(function successCallback(data) {
+ $scope.jsonEditable = jsonEditable = data.data.variables.jsonEditable;
+ //$scope.jsonString = JSON.stringify(data.data.configuration);
+ $scope.jsonData = data.data.configuration;
+
+ var tmpData = data.data;
+ $.netopeergui.processResponseData(tmpData, function() {
+ //$scope.reload();
+ $.netopeergui.hideSpinner();
+ });
+ //console.log('success reload');
+ }, function errorCallback(data) {
+ //$scope.jsonData = {};
+ //console.log(data);
+ //alert('error1');
+ $.netopeergui.hideSpinner();
+ });
+ };
+ $scope.resetRevisions = resetRevisions;
+
+ $scope.$watch('jsonData', function (newValue, oldValue) {
+ //$scope.jsonString = JSON.stringify(newValue);
+ if ( !isUndo && !isRedo && newValue !== oldValue ) {
+ historyIndex = historyIndex - historyUndo;
+ historyUndo = 0;
+
+ // prevent the future
+ if (revisionsExists()) {
+ storage.revisions.slice(0, historyIndex + 1);
+ storage.revisions.push(JSON.stringify(newValue));
+ }
+
+ historyIndex++;
+ }
+ isUndo = false;
+ isRedo = false;
+ }, true);
+
+ //$scope.$watch('jsonString', function (json) {
+ // try {
+ // $scope.jsonData = JSON.parse(json);
+ // $scope.wellFormed = true;
+ // } catch (e) {
+ // $scope.wellFormed = false;
+ // }
+ //}, true);
+
+ var cleanupJSON = function(jsonData) {
+ var cleanJson = $filter('json')(jsonData);
+ var jsonObj = angular.fromJson(cleanJson);
+ var removeSchemaNodes = function(obj) {
+ traverse(obj).forEach(function (element, index, array) {
+ if (typeof this.key !== "undefined") {
+ var schemaPath = this.path.slice(0, -1);
+ var attrPath = this.path.slice(0, -1);
+ var attrChildPath = this.path.slice(0); // clone an array
+ schemaPath.push('$@'+this.key);
+ attrPath.push('@'+this.key);
+ attrChildPath.push('@');
+ var schema = traverse(obj).get(schemaPath);
+ var attr = traverse(obj).get(attrPath);
+ var attrChild = traverse(obj).get(attrChildPath);
+ //if (this.key == 'groups') {
+ // console.log(attrChildPath);
+ // console.log(attrChild);
+ //}
+ if ((!angular.isUndefined(attr) || !angular.isUndefined(attrChild)) || (!angular.isUndefined(schema) && schema['iskey'] == true)) {
+ // leave key elements
+
+ } else if (this.key.indexOf('$@') !== -1 || this.key.indexOf('@') !== -1) {
+ // leave attributes
+
+ } else if (this.notRoot && !angular.isUndefined(this.parent.key) && this.path.toString().indexOf('@') === -1 && this.isLeaf && !Array.isArray(this.parent.node)) {
+ this.remove();
+ }
+ }
+ });
+
+ // remove schema nodes
+ traverse(obj).forEach(function (element, index, array) {
+ if (typeof this.key !== "undefined") {
+ if (this.key.indexOf('$@') !== -1 || this.key.indexOf('netopeergui:status') !== -1) {
+ this.remove();
+ }
+ }
+ });
+
+ // remove empty atribute nodes
+ traverse(obj).forEach(function (element, index, array) {
+ if (typeof this.key !== "undefined") {
+ if ((this.key.indexOf('@') !== -1 && this.isLeaf) || (Object.prototype.toString.call(this.node) == '[object Array]' && !this.node.length)){
+ this.delete(true);
+ }
+ }
+ });
+ };
+ removeSchemaNodes(jsonObj);
+ cleanJson = $filter('json')(jsonObj);
+ return cleanJson;
+ };
+
+ $scope.download = function (jsonData) {
+ var cleanJson = cleanupJSON(jsonData);
+ $window.open("data:application/json;charset=utf-8," + encodeURIComponent(cleanJson));
+ };
+
+ $scope.undo = function() {
+ var json = storage.revisions[historyIndex - historyUndo - 2];
+ isUndo = true;
+ //$scope.jsonString = '{}';
+ $scope.jsonData = {};
+
+ $timeout(function() {
+ isUndo = true;
+ //$scope.jsonString = json;
+ $scope.jsonData = JSON.parse(json);
+ historyUndo++;
+ }, 1);
+ };
+
+ $scope.redo = function() {
+ var json = storage.revisions[historyIndex - historyUndo];
+ isRedo = true;
+ //$scope.jsonString = '{}';
+ $scope.jsonData = {};
+
+ $timeout(function() {
+ isRedo = true;
+ //$scope.jsonString = json;
+ $scope.jsonData = JSON.parse(json);
+ historyUndo--;
+ }, 1);
+ };
+
+ $scope.submitConfiguration = function(jsonData) {
+ $.netopeergui.createSpinner();
+ $.netopeergui.showSpinner();
+ var cleanJson = cleanupJSON(jsonData);
+ cleanJson = JSON.parse(cleanJson);
+
+ AjaxService.submitConfiguration(cleanJson, window.location.href)
+ .then(function successCallback(data) {
+ var tmpData = data.data;
+ //console.log(tmpData);
+ if (typeof tmpData.snippets['block--state'] !== "undefined") {
+ delete(tmpData.snippets['block--state']);
+ }
+ $.netopeergui.processResponseData(tmpData, function() {
+ //$scope.reload();
+ $.netopeergui.hideSpinner();
+ });
+ }, function errorCallback(data) {
+ //console.log(data);
+ //alert('error2');
+ $.netopeergui.hideSpinner();
+ });
+ };
+ })
+
+ .config(['$rootScopeProvider', '$routeProvider', function ($rootScopeProvider, $routeProvider) {
+ $rootScopeProvider.digestTtl(20);
+
+ $routeProvider
+ .when('/module/:moduleName', {
+ templateUrl: 'main/view.html',
+ controller: 'ConfigurationController'
+ })
+ .when('/action/:action', {
+ templateUrl: 'main/view.html',
+ controller: 'ConfigurationController'
+ })
+ .otherwise($("#block--topMenu .nth-0").attr('href').replace('#', ''))
+ ;
+ }])
+;
\ No newline at end of file
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/js/directives/addItem.js b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/js/directives/addItem.js
new file mode 100644
index 00000000..604d32b1
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/js/directives/addItem.js
@@ -0,0 +1,6 @@
+NetopeerGUI.directive('addItem', function() {
+ return {
+ restrict: 'E',
+ templateUrl: 'directives/addItem.html'
+ };
+})
\ No newline at end of file
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/js/directives/switchItem.js b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/js/directives/switchItem.js
new file mode 100644
index 00000000..076a1aaf
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/js/directives/switchItem.js
@@ -0,0 +1,6 @@
+NetopeerGUI.directive('switchItem', function() {
+ return {
+ restrict: 'E',
+ templateUrl: 'directives/switchItem.html'
+ };
+});
\ No newline at end of file
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/js/directives2.js b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/js/directives2.js
new file mode 100644
index 00000000..10aff70c
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/js/directives2.js
@@ -0,0 +1,649 @@
+'use strict';
+
+var counts = {
+ object: 0
+};
+
+var schemaAjaxBlacklist = [];
+
+var NetopeerGUI = angular.module('JSONedit', ['ui.sortable', 'ui.bootstrap', 'configurationTemplates', 'NetopeerGUIServices']);
+
+NetopeerGUI.directive('ngModelOnblur', function() {
+ // override the default input to update on blur
+ // from http://jsfiddle.net/cn8VF/
+ return {
+ restrict: 'EAC',
+ require: 'ngModel',
+ link: function(scope, elm, attr, ngModelCtrl) {
+ if (attr.type === 'radio' || attr.type === 'checkbox') return;
+
+ elm.unbind('input').unbind('keydown').unbind('change');
+ elm.bind('blur', function() {
+ scope.$apply(function() {
+ ngModelCtrl.$setViewValue(elm.val());
+ });
+ });
+ }
+ };
+})
+.directive('json', function($compile, $log, AjaxService, $cacheFactory, $rootScope) {
+ return {
+ restrict: 'E',
+ scope: {
+ child: '=',
+ type: '@',
+ defaultCollapsed: '=',
+ hideCollapse: '=',
+ key: '=',
+ valueType: '=?valueType'
+ },
+ controller: function($scope) {},
+ templateUrl: function(elem, attr){
+ var type = attr.type;
+ if (typeof type === 'undefined') {
+ type = 'object';
+ }
+ type = type.charAt(0).toUpperCase() + type.slice(1);
+ //return baseURL + '/bundles/fitmoduledefault/netopeerangular/templates/types/'+type+'.html';
+ return 'types/'+type+'.html';
+ },
+ link: function(scope, element, attributes) {
+ var stringName = "Text";
+ var objectName = "Object";
+ var arrayName = "Array";
+ var listName = "List";
+ var numberName = "Number";
+ var urlName = "Url";
+ var refName = "Reference";
+ var boolName = "Boolean";
+ var enumerationName = "Enumeration";
+ var literalName = "Literal";
+
+ scope.valueTypes = [stringName, objectName, arrayName, listName, numberName, urlName, refName, boolName, enumerationName, literalName];
+ scope.sortableOptions = {
+ axis: 'y',
+ update: function(e, ui) {
+ setParentChanged(scope.$parent);
+ setIetfOperation('replace', scope.$parent.$parent.newkey, getParents($parent, 4).child, scope.$parent);
+ }
+ };
+ if (scope.$parent.defaultCollapsed === undefined) {
+ scope.collapsed = false;
+ } else {
+ scope.collapsed = scope.defaultCollapsed;
+ }
+ if (scope.collapsed) {
+ scope.chevron = "fa-plus-square-o";
+ } else {
+ scope.chevron = "fa-minus-square-o";
+ }
+
+ scope.jsonEditable = jsonEditable;
+ scope.contentStatus = '';
+
+ //////
+ // Helper functions
+ //////
+ var isNumberType = function(type) {
+ if (!type) return false;
+ return type.indexOf('int') >= 0;
+ };
+
+ var isUrlType = function(type) {
+ return type === "inet:uri";
+ };
+
+ var getType = function(key, child, parent) {
+ // get custom yang datatype
+ var type = Object.prototype.toString.call(child);
+
+ if (!scope.jsonEditable) {
+ if (type === "[object Object]") {
+ return objectName;
+ } else if (type === "[object Array]") {
+ return arrayName;
+ } else if (type === "Boolean" || type === "[object Boolean]") {
+ return boolName;
+ } else if (isNumberType(type) || type === "[object Number]") {
+ return numberName;
+ } else {
+ return stringName;
+ }
+ }
+
+ var eltype = getEltype(key, parent);
+
+ if (eltype === "list") {
+ return listName;
+ } else if (eltype === "container") {
+ return objectName;
+ } else if (eltype === "leaf-list") {
+ return arrayName;
+ } else if (eltype === "boolean" || type === "[object Boolean]") {
+ return boolName;
+ } else if (eltype === 'enumeration') {
+ return enumerationName;
+ } else if (eltype === 'string') {
+ return stringName;
+ } else if (isNumberType(eltype) || type === "[object Number]") {
+ return numberName;
+ } else if (type === "[object Object]") {
+ return objectName;
+ } else if (type === "[object Array]") {
+ return arrayName;
+ } else {
+ return stringName;
+ }
+ };
+ var getEltype = function(key, parent) {
+ if (!scope.jsonEditable) return;
+
+ var schema = getSchemaFromKey(key, parent);
+ // get custom yang datatype
+ var eltype = '';
+
+ if (schema && typeof schema['eltype'] !== "undefined") {
+ eltype = schema['eltype'];
+ if (eltype == 'leaf' && typeof schema['typedef'] !== "undefined") {
+ eltype = schema['typedef']['type'];
+ }
+ }
+
+ return eltype;
+ };
+ var isNumber = function(n) {
+ return !isNaN(parseFloat(n)) && isFinite(n);
+ };
+
+ scope.getType = getType;
+ scope.getEltype = getEltype;
+ scope.log = function(data) {
+ console.log(data);
+ };
+
+ var getSchemaFromKey = function(key, parent, child) {
+ if (!scope.jsonEditable) return;
+
+ if (typeof parent === "undefined" || typeof parent['$@'+key] === "undefined") {
+ if (typeof key === "undefined" || typeof parent === "undefined") return false;
+
+ var path = getPath(parent, 'key');
+
+ var parentKey = path.replace('/', '').split(':');
+ var ns = parentKey[0] + ":";
+ var rootElem = parentKey[1];
+ path = path + '/' + key;
+
+ //console.log(child);
+ //console.log(parent);
+ //console.log(path);
+
+ if (angular.isUndefined($rootScope.cache)) {
+ $rootScope.cache = {};
+ }
+ if (angular.isUndefined($rootScope.cache[window.location.href])) {
+ //try {
+ $rootScope.cache[window.location.href] = $cacheFactory(window.location.href);
+ //} catch (exception) {};
+ }
+ if (angular.isUndefined($rootScope.cache[window.location.href].get(path))) {
+ var schemaBlacklistKey = connId + path;
+ if (schemaAjaxBlacklist.indexOf(schemaBlacklistKey) === -1) {
+ AjaxService.loadSchema([connId], [path])
+ .then(function successCallback(data) {
+ var schema = data.data;
+
+ if (typeof schema === "undefined" || typeof schema['$@'+ns+key] === "undefined") {
+ schemaAjaxBlacklist.push(schemaBlacklistKey);
+ return false;
+ }
+ //insert loaded schema into current object
+ //$rootScope.cache[window.location.href].put(path, parent['$@'+key]);
+ if (!angular.isUndefined(child)) {
+ child['$@'+key] = schema['$@'+ns+key];
+ } else {
+ parent['$@'+key] = schema['$@'+ns+key];
+ }
+ return schema['$@'+ns+key];
+ }, function errorCallback(data) {
+ schemaAjaxBlacklist.push(schemaBlacklistKey);
+ return false;
+ });
+ }
+
+ } else {
+ return $rootScope.cache[window.location.href].get(path);
+ }
+
+ return false;
+ } else {
+ return parent['$@'+key];
+ }
+ };
+
+ scope.isConfig = function(key, parent) {
+ if (!scope.jsonEditable) return false;
+
+ var schema = getSchemaFromKey(key, parent);
+ return (schema && typeof schema['config'] !== "undefined" && schema['config'] === true);
+ };
+
+ scope.isKey = function(key, parent) {
+ if (!scope.jsonEditable) return false;
+
+ var schema = getSchemaFromKey(key, parent);
+ return (schema &&
+ (typeof schema['iskey'] !== "undefined" && schema['iskey'] === true)
+ );
+ };
+
+ scope.isMandatory = function(key, parent) {
+ if (!scope.jsonEditable) return false;
+
+ var schema = getSchemaFromKey(key, parent);
+ return (schema &&
+ (
+ (typeof schema['iskey'] !== "undefined" && schema['iskey'] === true)
+ ||
+ (typeof schema['mandatory'] !== "undefined" && schema['mandatory'] === true)
+ )
+ );
+ };
+
+ //scope.editBarVisible = function(key, parent) {
+ // if (!scope.jsonEditable) return false;
+ //
+ // var eltype = getEltype(key, parent);
+ // if (eltype) {
+ // return (eltype == "list" || eltype == "leaf-list" || eltype == "container");
+ // }
+ //
+ // return false;
+ //};
+ scope.isObjectOrArray = function(key, val, parent) {
+ var type = getType(key, val, parent);
+ return (type == objectName || type == arrayName || type == listName);
+ };
+ scope.getEnumValues = function(key, child, parent) {
+ var schema = getSchemaFromKey(key, child);
+ if (schema && typeof schema['enumval'] !== "undefined") {
+ return schema['enumval'];
+ } else if (schema && typeof schema['typedef'] !== "undefined" && typeof schema['typedef']['enumval'] !== "undefined") {
+ return schema['typedef']['enumval'];
+ } else {
+ return [];
+ }
+ };
+ scope.toggleCollapse = function() {
+ if (scope.collapsed) {
+ scope.collapsed = false;
+ scope.chevron = "fa-minus-square-o";
+ } else {
+ scope.collapsed = true;
+ scope.chevron = "fa-plus-square-o";
+ }
+ };
+ scope.deleteKey = function(key, obj, parent) {
+ if (getType(key, obj, parent) == "Object") {
+ if( confirm('Delete "'+key+'" and all it contains?') ) {
+ setParentChanged(parent);
+ setIetfOperation('remove', key, obj);
+ //delete obj[key]; // TODO delete children
+
+ }
+ } else if (getType(key, obj, parent) == "Array") {
+ if( confirm('Delete "'+obj[key]+'"?') ) {
+ setParentChanged(parent);
+ setIetfOperation('remove', key, obj);
+ //obj.splice(key, 1); // TODO delete children
+ }
+ } else {
+ console.error("object to delete from was " + obj);
+ }
+ };
+ scope.addItem = function(key, obj, parent) {
+ if (typeof parent.valueType === "undefined") {
+ var type = getType(parent.keyName, undefined, obj);
+ } else {
+ parent.valueType = parent.valueType.replace('string:', '');
+ var type = parent.valueType;
+ }
+
+ var parentType = objectName;
+ //if (typeof parent.$parent.$parent !== "undefined") {
+ parentType = getType(getParents(parent, 4).key, obj);
+ //}
+ //console.log(key);
+ //console.log(obj);
+ //console.log(parent);
+ //console.log(type);
+ //console.log(parentType);
+ //console.log(scope);
+
+ if (parentType == "Object") {
+ // check input for key
+ if (parent.keyName == undefined || parent.keyName.length == 0){
+ //console.log(parent.keyName);
+ //console.log(parent);
+ alert("Please fill in a name");
+ } else if (parent.keyName.indexOf("$") == 0){
+ alert("The name may not start with $ (the dollar sign)");
+ } else if (parent.keyName.indexOf("_") == 0){
+ alert("The name may not start with _ (the underscore)");
+ } else {
+ if (obj[parent.keyName]) {
+ if( !confirm('An item with the name "'+parent.keyName
+ +'" exists already. Do you really want to replace it?') ) {
+ return;
+ } else {
+ removeIetfOperation(parent.keyName, obj, parent);
+ setParentChanged(parent);
+ setIetfOperation('create', key, obj);
+ }
+ }
+ // add item to object
+ switch(type) {
+ case stringName:
+ case numberName:
+ case enumerationName:
+ obj[parent.keyName] = parent.valueName ? parent.possibleNumber(parent.valueName) : "";
+ break;
+ case objectName:
+ obj[parent.keyName] = {};
+ break;
+ case arrayName:
+ obj[parent.keyName] = [];
+ break;
+ case refName:
+ obj[parent.keyName] = {"Reference!!!!": "todo"};
+ break;
+ case boolName:
+ obj[parent.keyName] = parent.valueName ? true : false;
+ break;
+ default:
+ console.log('not implemented type: ' + type + ' or parentType ' + parent.valueType); // TOOD
+ }
+ setParentChanged(parent);
+ setIetfOperation('create', parent.keyName, obj);
+ //clean-up
+ parent.keyName = "";
+ parent.valueName = "";
+ parent.showAddKey = false;
+ }
+ } else if (parentType == "Array") {
+ // add item to array
+ switch(type) {
+ case stringName:
+ case numberName:
+ obj.push(parent.valueName ? parent.valueName : "");
+ break;
+ case objectName: obj.push({});
+ break;
+ case arrayName: obj.push([]);
+ break;
+ case boolName: obj.push(false);
+ break;
+ case refName: obj.push({"Reference!!!!": "todo"});
+ break;
+ default:
+ console.log('2not implemented ' + parent.valueType); // TOOD
+ }
+ setParentChanged(parent);
+ setIetfOperation('replace', getParents(parent, 3).key, getParents(parent, 1).child, parent); // TODO replace order in array
+ parent.valueName = "";
+ parent.showAddKey = false;
+ } else {
+ console.error("object to add to was " + obj);
+ }
+ };
+ scope.possibleNumber = function(val) {
+ return isNumber(val) ? parseFloat(val) : val;
+ };
+
+ scope.changeValue = function(val, key, child, parent) {
+ child[key] = val;
+ setParentChanged(parent);
+ setIetfOperation('replace', key, child, parent);
+ scope.contentStatus = 'modified';
+ };
+
+ scope.isVisible = function(key, obj) {
+ var attr = getAttribute('ietf-netconf:operation', key, obj);
+ return !(attr && attr === "remove");
+ };
+
+ scope.changeParentKeyName = function(key, child, $parent) {
+ getSchemaFromKey(key, $parent, child);
+ var val = getType(key, null, child);
+ if (val) {
+ $parent.valueType = val;
+ }
+ };
+
+ scope.initParentValueType = function($parent) {
+ switch ($parent.type) {
+ case listName:
+ $parent.valueType = objectName;
+ break;
+ case arrayName:
+ $parent.valueType = stringName;
+ break;
+ }
+ };
+
+ scope.getAvailableNodeNames = function (key, child, parent) {
+ //console.log(key);console.log(child);console.log(parent);
+ try {
+ var parentKeyName = getParents(parent, 4).key;
+ if (typeof parentKeyName === "undefined") {
+ parentKeyName = getParents(parent, 3).key;
+ }
+ var parents = getParents(parent, 6);
+ if (typeof parents.child['$@'+ parentKeyName] !== "undefined") {
+ var children = parents.child['$@'+ parentKeyName]['children'];
+ } else {
+ var children = parents.val['$@'+ parentKeyName]['children'];
+ }
+ //console.log(parents);console.log(children);
+ angular.forEach(child, function(value, key) {
+ if (key.indexOf('@') !== 0 && children.indexOf(key) !== -1) {
+ children.splice(children.indexOf(key), 1);
+ }
+ });
+
+ angular.forEach(children, function (key, value) {
+ getSchemaFromKey(key, parent, child);
+ });
+
+ return children;
+ } catch (err) {
+ return [];
+ }
+ };
+
+ var getAttributeType = function(key, obj) {
+ var eltype = getEltype(key, obj);
+
+ if (eltype === "container" || eltype === 'anydata') {
+ return 'anydata';
+ } else if (eltype === 'list') {
+ return 'list';
+ } else if (eltype === 'leaf' || eltype === 'anyxml' || eltype === 'enumeration' || isNumberType(eltype)) {
+ return 'anyxml';
+ } else if (eltype === "leaf-list") {
+ return 'leaf-list';
+ }
+ return 'not-supported';
+ };
+
+ scope.getAttributesNode = function(key, obj, generateEmpty) {
+ if (typeof generateEmpty === "undefined") {
+ generateEmpty = false;
+ }
+ var eltype = getAttributeType(key, obj);
+ //if (key == 'state') {
+ // console.log(getEltype(key, obj));
+ // console.log(eltype);
+ //}
+ switch (eltype) {
+ case 'container':
+ case 'anydata':
+ if (typeof obj[key] !== "undefined") {
+ if (generateEmpty && typeof obj[key]['@'] === "undefined") {
+ try {
+ obj[key]['@'] = {}; // create empty attributes object
+ } catch (exception) {};
+ }
+ if (typeof obj[key]['@'] !== "undefined") {
+ return obj[key]['@'];
+ }
+ }
+ break;
+ case 'list':
+ obj = getParents(obj, 2);
+ if (generateEmpty && typeof obj['@'] === "undefined") {
+ //console.log(obj);
+ //console.log(scope);
+ try {
+ obj['@'] = {}; // create empty attributes object
+ } catch (exception) {};
+ }
+ if (typeof obj['@'] !== "undefined") {
+ return obj['@'];
+ }
+ break;
+ case 'leaf-list':
+ case 'anyxml':
+ if (generateEmpty && typeof obj['@'+key] === "undefined") {
+ try {
+ obj['@'+key] = {}; // create empty attributes object
+ } catch (exception) {};
+ }
+ if (typeof obj['@'+key] !== "undefined") {
+ return obj['@'+key];
+ }
+ break;
+ }
+
+ return false;
+ };
+
+ var getParents = function(obj, number) {
+ if (typeof obj === "undefined") return false;
+ var parent = obj;
+
+ for (var i = 0; i < number; i++) {
+ if (typeof parent.$parent === "undefined" || parent.$parent === null) {
+ return parent;
+ }
+ parent = parent.$parent;
+ }
+ return parent;
+ };
+
+ var getPath = function(obj, target) {
+ if (typeof obj === "undefined") return false;
+ var parent = obj;
+ var res = '';
+
+ while (typeof parent.$parent !== "undefined" && parent.$parent !== null) {
+ parent = parent.$parent;
+ //if (typeof parent[target] !== "undefined") console.log(parent[target]);
+ if (parent.hasOwnProperty(target) && typeof parent[target] !== 'undefined') {
+ res = '/' + parent[target] + res;
+ }
+ }
+ return res;
+ };
+
+ var getAttribute = function(attr, key, obj) {
+ var node = scope.getAttributesNode(key, obj);
+ if (node !== false && typeof node[attr] !== "undefined") {
+ return node[attr];
+ }
+
+ return false;
+ };
+
+ var setAttribute = function(attr, val, key, obj) {
+ var node = scope.getAttributesNode(key, obj, true);
+ if (node !== false) {
+ node[attr] = val;
+ return true;
+ }
+
+ return false;
+ };
+
+ var unsetAttribute = function(attr, key, obj) {
+ var node = scope.getAttributesNode(key, obj);
+ if (node !== false) {
+ if (typeof node[attr] !== "undefined") delete node[attr];
+ return true;
+ }
+ return false;
+ };
+
+ var setIetfOperation = function(operation, key, obj, parent) {
+ var tmpParent = getParents(parent, 11);
+ if (tmpParent.hasOwnProperty('key') && typeof getParents(tmpParent, 2)['child'] !== 'undefined') {
+ } else {
+ tmpParent = getParents(parent, 2);
+ }
+
+ if (tmpParent.hasOwnProperty('key') && typeof getParents(tmpParent, 2)['child'] !== 'undefined') {
+ if (getAttributeType(tmpParent['key'], getParents(tmpParent, 2)['child']) == 'list') {
+ //key = tmpParent['key'];
+ //obj = getParents(tmpParent, 2)['child'];
+ //if (operation == 'replace') {
+ // operation = 'merge';
+ //}
+ }
+ }
+ setAttribute('ietf-netconf:operation', operation, key, obj);
+ };
+
+ var setParentChanged = function(parent) {
+ if (typeof parent === "undefined") return false;
+ var target = 'key';
+ while (typeof parent.$parent !== "undefined" && parent.$parent !== null) {
+ var obj = parent;
+ parent = parent.$parent;
+ var parentToSet = getParents(parent, 2);
+ //console.log(parentToSet);
+ if (parent.hasOwnProperty(target) && typeof parent[target] !== 'undefined' && typeof parentToSet['child'] !== 'undefined') {
+ setAttribute('netopeergui:status', 'changed', parent[target], parent['child']);
+ }
+ }
+ };
+
+ var removeIetfOperation = function(key, obj) {
+ unsetAttribute('ietf-netconf:operation', key, obj);
+ };
+
+ //////
+ // Template Generation
+ //////
+
+ // Note:
+ // sometimes having a different ng-model and then saving it on ng-change
+ // into the object or array is necessary for all updates to work
+
+ //var newElement = '
';
+ //newElement = angular.element(newElement);
+ //$compile(newElement)(scope);
+ //element.replaceWith ( newElement );
+ }
+ };
+})
+.filter('skipAttributes', function() {
+ return function(items) {
+ var result = {};
+ angular.forEach(items, function(value, key) {
+ if (typeof key === "string" && key.indexOf('@') !== 0) {
+ result[key] = value;
+ }
+ });
+ return result;
+ };
+});
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/js/services/ajaxService.js b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/js/services/ajaxService.js
new file mode 100644
index 00000000..dd2249be
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/js/services/ajaxService.js
@@ -0,0 +1,29 @@
+var services = angular.module('NetopeerGUIServices', [])
+
+.service('AjaxService', function ($http) {
+ $http.defaults.cache = true;
+
+ this.reloadData = function(targetUrl) {
+ var url = targetUrl || window.location.href;
+ return $http({
+ url: url + '?angular=true',
+ method: 'GET'
+ });
+ };
+
+ this.loadSchema = function(connIds, filters) {
+ return $http({
+ url: baseURL + '/ajax/schema/',
+ method: 'POST',
+ data: {'angular': true, 'connIds': connIds, 'filters': filters}
+ });
+ };
+
+ this.submitConfiguration = function(cleanJson, targetUrl) {
+ return $http({
+ url: targetUrl || window.location.href,
+ method: 'POST',
+ data: cleanJson
+ });
+ };
+});
\ No newline at end of file
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/node_modules/rhaboo/rhaboo.min.js b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/node_modules/rhaboo/rhaboo.min.js
new file mode 100644
index 00000000..a6ccf085
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/node_modules/rhaboo/rhaboo.min.js
@@ -0,0 +1 @@
+!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g
a){for(var f=a;e>f;f++)c.storeProp(this,f);c.updateSlot(this)}return b},Array.prototype.pop=function(){var a=this.length;void 0!==this._rhaboo&&a>0&&c.forgetProp(this,a-1);var b=d.pop.apply(this,arguments);return void 0!==this._rhaboo&&a>0&&c.updateSlot(this),b},Object.defineProperty(Array.prototype,"write",{value:function(a,b){Object.prototype.write.call(this,a,b),c.updateSlot(this)}}),Array.prototype.shift=e("shift"),Array.prototype.unshift=e("unshift"),Array.prototype.splice=e("splice"),Array.prototype.reverse=e("reverse"),Array.prototype.sort=e("sort"),Array.prototype.fill=e("fill"),b.exports={persistent:c.persistent,perishable:c.perishable,algorithm:"sand"}},{"./core":3}],3:[function(a,b){(function(c){"use strict";function d(a){return f(localStorage,a)}function e(a){return f(sessionStorage,a)}function f(a,b){var c=a.getItem(s+b);if(c){var d=A(a)(!1)(c);return t={},d[0]}var e=n({_rhaboo:{storage:a}});return a.setItem(s+b,y(a)(!0)(e)),e}function g(a){return function(b){if(void 0!==t[b])return n(t[b]);var c=a.getItem(s+b);if(void 0===c)return void 0;var d=z(!1)(c);return d[0]._rhaboo={storage:a,slotnum:b,refs:1,kids:{}},t[b]=d[0],d.length>1?h(d[0],d[1][0],d[1][1]):d[0]}}function h(a,b,c){var d=a._rhaboo.storage.getItem(s+c);if(void 0===d)return a;var e=A(a._rhaboo.storage)(!1)(d);return a[b]=e[0],i(a,b,c),e.length>1?h(a,e[1][0],e[1][1]):a}function i(a,b,c){var d=void 0!==a._rhaboo.prev?a._rhaboo.kids[a._rhaboo.prev]:a._rhaboo;a._rhaboo.kids[b]={slotnum:c,prev:a._rhaboo.prev},d.next=a._rhaboo.prev=b}function j(a,b){var c=a._rhaboo.kids[b];(a._rhaboo.kids[c.prev]||a._rhaboo).next=c.next,(a._rhaboo.kids[c.next]||a._rhaboo).prev=c.prev,delete a._rhaboo.kids[b]}function k(a,b){var c=[];c.push(void 0!==b?a[b]:a);var d=void 0!==b?a._rhaboo.kids[b]:a._rhaboo;void 0!==d.next&&c.push([d.next,a._rhaboo.kids[d.next].slotnum]);var e=(void 0!==b?A(a._rhaboo.storage):z)(!0)(c);try{a._rhaboo.storage.setItem(s+d.slotnum,e)}catch(f){l(f)&&a._rhaboo.storage.removeItem(s+d.slotnum,e),console.log("Local storage quota exceeded by rhaboo")}}function l(a){var b=!1;if(a)if(a.code)switch(a.code){case 22:b=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===a.name&&(b=!0)}else-2147024882===a.number&&(b=!0);return b}function m(a,b){if(void 0===a._rhaboo.kids[b]){var c=r(a._rhaboo.storage);i(a,b,c),k(a,a._rhaboo.kids[b].prev)}}function n(a,b,c,d){if(void 0!==a._rhaboo&&void 0!==a._rhaboo.slotnum)a._rhaboo.refs++;else{void 0===a._rhaboo&&(a._rhaboo={}),void 0!==b&&(a._rhaboo.storage=b),a._rhaboo.slotnum=void 0!==c?c:r(a._rhaboo.storage),a._rhaboo.refs=void 0!==d?d:1,a._rhaboo.kids={},k(a);for(var e in a)a.hasOwnProperty(e)&&"_rhaboo"!==e&&o(a,e)}return a}function o(a,b){m(a,b),"object"===u.typeOf(a[b])&&(void 0===a[b]._rhaboo&&(a[b]._rhaboo={storage:a._rhaboo.storage}),n(a[b])),k(a,b)}function p(a,b){var c,d;if(a._rhaboo.refs--,b||0===a._rhaboo.refs){for(d=void 0,c=a._rhaboo;c;c=a._rhaboo.kids[d=c.next])a._rhaboo.storage.removeItem(s+c.slotnum),void 0!==d&&"object"==u.typeOf(a[d])&&p(a[d]);delete a._rhaboo}}function q(a,b){var c=a._rhaboo.kids[b];if(void 0!==c){var d=c.prev;a._rhaboo.storage.removeItem(s+c.slotnum),"object"==u.typeOf(a[b])&&p(a[b]),j(a,b),k(a,d)}}function r(a){var b=a===localStorage?0:1,c=C[b];return C[b]++,a.setItem(B,C[b]),c}void 0===Function.prototype.name&&void 0!==Object.defineProperty&&Object.defineProperty(Function.prototype,"name",{get:function(){var a=/function\s([^(]{1,})\(/,b=a.exec(this.toString());return b&&b.length>1?b[1].trim():""},set:function(){}});var s="_rhaboo_",t={},u=a("parunpar"),v=u.sepByEsc("=",":"),w=v([u.string_pp,u.number_pp]),x=u.pipe(function(a){return function(b){return a?"Date"===b.constructor.name?[b.constructor.name,b.toString()]:void 0!==b.length?[b.constructor.name,b.length.toString()]:[b.constructor.name]:new c[b[0]]("Date"==b[0]?b[1]:b[1]?Number(b[1]):void 0)}})(v([u.string_pp,u.string_pp])),y=function(a){return u.pipe(function(b){return function(c){return b?u.runSnd({string:["$",u.id],number:["#",String],"boolean":["?",function(a){return a?"t":"f"}],"null":["~"],undefined:["_"],object:["&",function(a){return a._rhaboo.slotnum}]}[u.typeOf(c)])(c):{$:u.id,"#":Number,"?":u.eq("t"),"~":u.konst(null),_:u.konst(void 0),"&":g(a)}[c[0]](c[1])}})(u.fixedWidth([1])([u.string_pp,u.string_pp]))},z=u.tuple([x,w]),A=function(a){return u.tuple([y(a),w])};Object.defineProperty(Object.prototype,"write",{value:function(a,b){return m(this,a),"object"===u.typeOf(this[a])&&p(this[a]),this[a]=b,"object"===u.typeOf(b)&&(void 0===b._rhaboo&&(b._rhaboo={storage:this._rhaboo.storage}),n(b)),k(this,a),this}}),Object.defineProperty(Object.prototype,"erase",{value:function(a){if(!this.hasOwnProperty(a))return this;"object"===u.typeOf(this[a])&&p(this[a]);var b=this._rhaboo.kids[a];this._rhaboo.storage.removeItem(s+b.slotnum);var c=b.prev;return j(this,a),k(this,c),delete this[a],this}});for(var B="_RHABOO_NEXT_SLOT",C=[0,0],D=0;2>D;D++)C[D]=localStorage.getItem(B)||0,C[D]=Number(C[D]);var E=Object.prototype.hasOwnProperty;Object.prototype.hasOwnProperty=function(a){return"_rhaboo"!=a&&E.call(this,a)},b.exports={persistent:d,perishable:e,addRef:n,release:p,storeProp:o,forgetProp:q,updateSlot:k}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{parunpar:1}],4:[function(a){(function(b){b.Rhaboo=a("./arr")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./arr":2}]},{},[4]);
\ No newline at end of file
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/package.json b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/package.json
new file mode 100644
index 00000000..aa51f85f
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/package.json
@@ -0,0 +1,21 @@
+{
+ "name": "netopeerangular",
+ "version": "0.0.0",
+ "description": "angular frontend for netopeer",
+ "main": "gulpfile.js",
+ "dependencies": {
+ "gulp": "~3.9.1",
+ "gulp-watch": "~4.3.5",
+ "gulp-angular-templatecache": "~1.8.0",
+ "gulp-templatecache": "~0.0.4",
+ "rhaboo": "~3.2.2"
+ },
+ "devDependencies": {
+ "gulp": "^3.9.1"
+ },
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "",
+ "license": "BSD"
+}
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/public/templates.js b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/public/templates.js
new file mode 100644
index 00000000..58d7bae5
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/public/templates.js
@@ -0,0 +1,6 @@
+angular.module("configurationTemplates", []).run(["$templateCache", function($templateCache) {$templateCache.put("main/view.html","Config & State data
\n\n
\n\n
\n
\n\n
\n
\n
\n\n
\n \n
\n\n \n \n \n \n \n
");
+$templateCache.put("types/Array.html","\n");
+$templateCache.put("types/List.html","\n");
+$templateCache.put("types/Object.html","\n\n
\n \n \n {{ key }}\n \n \n \n \n \n \n \n \n \n \n \n \n
\n
");
+$templateCache.put("directives/addItem.html","\n\n \n :\n \n\n \n\n \n \n \n\n \n\n \n \n \n\n \n \n \n\n \n \n \n\n\n \n \n\n\n \n");
+$templateCache.put("directives/switchItem.html","\n \n \n \n\n \n \n {{ val }}\n \n \n \n {{ val }}\n \n \n \n {{ val }}\n \n \n \n {{ val }}\n \n\n \n");}]);
\ No newline at end of file
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/templates/directives/addItem.html b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/templates/directives/addItem.html
new file mode 100644
index 00000000..eb2dd0c7
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/templates/directives/addItem.html
@@ -0,0 +1,42 @@
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/templates/directives/switchItem.html b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/templates/directives/switchItem.html
new file mode 100644
index 00000000..cabf6ff8
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/templates/directives/switchItem.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+ {{ val }}
+
+
+
+ {{ val }}
+
+
+
+ {{ val }}
+
+
+
+ {{ val }}
+
+
+
+
\ No newline at end of file
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/templates/main/view.html b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/templates/main/view.html
new file mode 100644
index 00000000..40ae50f9
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/templates/main/view.html
@@ -0,0 +1,21 @@
+Config & State data
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/templates/types/Array.html b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/templates/types/Array.html
new file mode 100644
index 00000000..61f9f627
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/templates/types/Array.html
@@ -0,0 +1,10 @@
+
+
\ No newline at end of file
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/templates/types/List.html b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/templates/types/List.html
new file mode 100644
index 00000000..a7d38ad9
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/templates/types/List.html
@@ -0,0 +1,10 @@
+
+
\ No newline at end of file
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/templates/types/Object.html b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/templates/types/Object.html
new file mode 100644
index 00000000..f418f5e6
--- /dev/null
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/public/netopeerangular/templates/types/Object.html
@@ -0,0 +1,20 @@
+
+
+
+
+
+ {{ key }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/FIT/Bundle/ModuleDefaultBundle/Resources/views/Module/section.html.twig b/src/FIT/Bundle/ModuleDefaultBundle/Resources/views/Module/section.html.twig
index 6feb650e..6c9569f9 100644
--- a/src/FIT/Bundle/ModuleDefaultBundle/Resources/views/Module/section.html.twig
+++ b/src/FIT/Bundle/ModuleDefaultBundle/Resources/views/Module/section.html.twig
@@ -39,151 +39,84 @@ if advised of the possibility of such damage.
{% extends 'FITModuleDefaultBundle::layout.html.twig' %}
{% block title %}Section {% if sectionName is defined and not(sectionName is empty) %}- {{sectionName}}{% endif %}{% endblock title %}
-{% block leftColumnAdditional %}
- {% if (hideColumnControl is not defined) or (hideColumnControl is defined and hideColumnControl != true) %}
-
- {% endif %}
-{% endblock leftColumnAdditional %}
-
{% set stateDefined = 'false' %}
-{% block state %}
-{% block singleContent %}
- {##}
- {#new node#}
- {#
#}
-
- {% set stateDefined = 'true' %}
- {% if configSingleContent is defined %}
- {{ configSingleContent|raw }}
- {% else %}
- {% if stateSectionTitle is defined %}{{stateSectionTitle}}{% else %}Config & State data{% endif %}
- {% if stateArr is defined and (not(stateArr is empty) or (isEmptyModule is defined and isEmptyModule == true)) %}
-
- You can not change the values of existing configuration while adding new configuration. Apply your changes first.
-
-
- {% if modelTreeDump is defined %}
-
-
-{{ modelTreeDump|raw }}
-
-
- {% endif %}
+{% block htmlAdditions %} ng-app="NetopeerGUIApp"{% endblock %}
+{#{% block singlecontentAdditions %} ng-controller="ConfigurationController"{% endblock %}#}
+
+{% block topMenu %}
+ {% if not isSingleInstance %}
+ Connections
+ {% endif %}
+ {% if app.request.get('key') is defined and not (app.request.get('key') is empty) and lockedConn is defined %}
+ {% if lockedConn == false %}
+
{% else %}
-
- No results found.
-
- {% if additionalForm is defined %}
- {{ additionalForm|raw }}
- {% endif %}
+
+ {% endif %}
+
+
+
+ {% if topmenu is defined %}
+ {% set i = 0 %}
+ {% for section in topmenu %}
+ {{section.name}}
+ {% set i = i + 1 %}
+ {% endfor %}
+ All
+ {# TODO: make empty module working #}
+ {#+#}
+ {#+#}
{% endif %}
{% endif %}
-{% endblock singleContent %}
-{% endblock state %}
-{% block config %}
- {% if configSectionTitle is defined %}{{configSectionTitle}}{% else %}Config data only{% endif %}
-
-
- {% if (configArr is defined and not(configArr is empty)) or (isEmptyModule is defined and isEmptyModule == true) %}
-
- {% else %}
-
- No results found.
-
- {% if additionalForm is defined %}
- {{ additionalForm|raw }}
- {% endif %}
+
+
+
+
+ {% if app.request.get('key') is defined and not (app.request.get('key') is empty) and
+ not isSingleInstance %}
+ Disconnect
{% endif %}
- {% if modelTreeDump is defined %}
-
-
-{{ modelTreeDump|raw }}
-
+
+
+
+
- {% endif %}
-{% endblock config %}
+
+{% endblock topMenu %}
+
+{% block state %}
+{% block singleContent %}
+
+
+{% endblock singleContent %}
+{% endblock state %}
{% block notifications %}
{% if ncFeatures is defined and ncFeatures["nc_feature_notification"] is defined %}
{% if (app.request.get('key') is defined) and (not (app.request.get('key') is empty)) and (lockedConn is defined) %}
#}
+
+
+
+
+
+
+
+
+
+ {#'@FITModuleDefaultBundle/Resources/public/js/tooltip/gips.js'#}
+ {#'@FITModuleDefaultBundle/Resources/public/js/*'#}
{% javascripts
- '@FITModuleDefaultBundle/Resources/public/js/tooltip/gips.js'
+ '@FITModuleDefaultBundle/Resources/public/netopeerangular/js/directives2.js'
+ '@FITModuleDefaultBundle/Resources/public/netopeerangular/js/directives/*'
+ '@FITModuleDefaultBundle/Resources/public/netopeerangular/js/services/*'
+ '@FITModuleDefaultBundle/Resources/public/netopeerangular/js/*'
+ '@FITModuleDefaultBundle/Resources/public/netopeerangular/public/*'
'@FITModuleDefaultBundle/Resources/public/js/*'
output='js/compiled/module-default.js'
%}
{% endjavascripts %}
+
+
{% endblock %}
{% block moduleStylesheet %}
{% stylesheets
- 'bundles/fitmoduledefault/style/*'
+ 'bundles/fitmoduledefault/netopeerangular/css/stylesheets/screen.css'
filter='cssrewrite'
output='css/module-default.css'
%}
diff --git a/src/FIT/Bundle/ModuleXmlBundle/Controller/ModuleController.php b/src/FIT/Bundle/ModuleXmlBundle/Controller/ModuleController.php
index b45344e1..be62497e 100644
--- a/src/FIT/Bundle/ModuleXmlBundle/Controller/ModuleController.php
+++ b/src/FIT/Bundle/ModuleXmlBundle/Controller/ModuleController.php
@@ -17,7 +17,7 @@ class ModuleController extends \FIT\NetopeerBundle\Controller\ModuleController i
*/
public function moduleAction($key, $module = null, $subsection = null)
{
- $res = $this->prepareDataForModuleAction("FITModuleXmlBundle", $key, $module, $subsection);
+ $res = $this->prepareVariablesForModuleAction("FITModuleXmlBundle", $key, $module, $subsection);
/* parent module did not prepares data, but returns redirect response,
* so we will follow this redirect
diff --git a/src/FIT/NetopeerBundle/Controller/AjaxController.php b/src/FIT/NetopeerBundle/Controller/AjaxController.php
index 134fa389..5facbd2a 100644
--- a/src/FIT/NetopeerBundle/Controller/AjaxController.php
+++ b/src/FIT/NetopeerBundle/Controller/AjaxController.php
@@ -43,10 +43,9 @@
namespace FIT\NetopeerBundle\Controller;
use FIT\NetopeerBundle\Controller\BaseController;
-use FIT\NetopeerBundle\Models\AjaxSharedData;
-use FIT\NetopeerBundle\Models\XMLoperations;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
+use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
@@ -55,59 +54,6 @@
*/
class AjaxController extends BaseController
{
- /**
- * Change session value for showing single or double column layout
- *
- * @Route("/ajax/get-schema/{key}", name="getSchema")
- *
- * @param int $key session key of current connection
- * @return \Symfony\Component\HttpFoundation\Response
- */
- public function getSchemaAction($key)
- {
- /**
- * @var \FIT\NetopeerBundle\Models\Data $dataClass
- */
- $dataClass = $this->get('DataModel');
- $schemaData = AjaxSharedData::getInstance();
-
- ob_start();
- $data = $schemaData->getDataForKey($key);
- if (!(isset($data['isInProgress']) && $data['isInProgress'] === true)) {
- $dataClass->updateLocalModels($key);
- }
- $output = ob_get_clean();
- $result['output'] = $output;
-
- return $this->getSchemaStatusAction($key, $result);
- }
-
- /**
- * Get status of get-schema operation
- *
- * @Route("/ajax/get-schema-status/{key}", name="getSchemaStatus")
- *
- * @param int $key session key of current connection
- * @param array $result
- * @return \Symfony\Component\HttpFoundation\Response
- */
- public function getSchemaStatusAction($key, $result = array())
- {
- $schemaData = AjaxSharedData::getInstance();
-
- $data = $schemaData->getDataForKey($key);
- if (isset($data['isInProgress']) && $data['isInProgress'] === true) {
- $schemaData->setDataForKey($key, 'status', "in progress");
- }
-
- $data = $schemaData->getDataForKey($key);
- $flashes = $this->getRequest()->getSession()->getFlashBag()->all();
- $result['message'] = $flashes;
- $result['key'] = $key;
-
- return new Response(json_encode($result));
- }
-
/**
* Get history of connected devices
*
@@ -238,96 +184,6 @@ public function connectedDeviceAttrAction($connectedDeviceId)
}
}
- /**
- * Get available values for label name from model based on xPath selector.
- *
- * @Route("/ajax/get-values-for-label/{formId}/{key}/{xPath}/", name="getValuesForLabel")
- * @Route("/ajax/get-values-for-label/{formId}/{key}/{module}/{xPath}/", name="getValuesForLabelWithModule")
- * @Route("/ajax/get-values-for-label/{formId}/{key}/{module}/{subsection}/{xPath}/", name="getValuesForLabelWithSubsection")
- * @Template()
- *
- * @param int $key
- * @param string $formId unique identifier of form
- * @param null|string $module name of the module
- * @param null|string $subsection name of the subsection
- * @param string $xPath encoded xPath selector
- * @return Response $result
- */
- public function getValuesForLabelAction($key, $formId, $xPath = "", $module = null, $subsection = null)
- {
- $this->setActiveSectionKey($key);
- $this->get('DataModel')->buildMenuStructure($key);
-
- /**
- * @var XMLoperations $xmlOp
- */
- $xmlOp = $this->get('XMLoperations');
- $formParams = $this->get('DataModel')->loadFilters($module, $subsection);
-
- $res = $xmlOp->getAvailableLabelValuesForXPath($formId, $xPath);
-
- // path for creating node typeahead
- $typeaheadParams = array(
- 'formId' => "FORMID",
- 'key' => $key,
- 'xPath' => "XPATH"
- );
- $valuesTypeaheadPath = $this->generateUrl('getValuesForLabel', $typeaheadParams);
- if (!is_null($module)) {
- $typeaheadParams['module'] = $module;
- $valuesTypeaheadPath = $this->generateUrl('getValuesForLabelWithModule', $typeaheadParams);
- }
- if (!is_null($subsection)) {
- $typeaheadParams['subsection'] = $subsection;
- $valuesTypeaheadPath = $this->generateUrl('getValuesForLabelWithSubsection', $typeaheadParams);
- }
-
- if (is_array($res)) {
- if (isset($_GET['command']) && isset($_GET['label'])) {
- if ($_GET['command'] == 'attributesAndValueElem') {
- $retArr = array();
- if (isset($res['labelsAttributes'][$_GET['label']])) {
- $retArr['labelAttributes'] = $res['labelsAttributes'][$_GET['label']];
- }
-
- if (isset($res['elems'][$_GET['label']])) {
- $template = $this->get('twig')->loadTemplate('FITModuleDefaultBundle:Config:leaf.html.twig');
- $twigArr = array();
-
- $twigArr['key'] = "";
- $twigArr['xpath'] = "";
- $twigArr['valuesTypeaheadPath'] = $valuesTypeaheadPath;
- $twigArr['element'] = $res['elems'][$_GET['label']];
- $twigArr['useHiddenInput'] = true;
-
- // load identity refs array
- $identities = $this->get('DataModel')->loadIdentityRefsForModule($key, $module);
- if ($identities) {
- $twigArr['moduleIdentityRefs'] = $identities;
- }
-
- $html = $xmlOp->removeMultipleWhitespaces($template->renderBlock('configInputElem', $twigArr));
- $retArr['valueElem'] = $html;
-
- $html = $xmlOp->removeMultipleWhitespaces($template->renderBlock('editBar', $twigArr));
- $retArr['editBar'] = $html;
-
- $children = $xmlOp->getChildrenValues($twigArr['element'], $template, $formId, $xPath, "", $identities);
- $retArr['children'] = $children;
- }
-
- return new Response(json_encode($retArr));
- } else {
- return new Response(false);
- }
- } else {
- return new Response(json_encode($res['labels']));
- }
- } else {
- return new Response(false);
- }
- }
-
/**
* Process getting history of notifications
*
@@ -345,19 +201,14 @@ public function getValuesForLabelAction($key, $formId, $xPath = "", $module = nu
*/
public function getNotificationsHistoryAction($connectedDeviceId, $from = null, $to = 0, $max = 50)
{
- //return $this->getTwigArr(); // TODO: remove, when will be working fine
-
- /**
- * @var \FIT\NetopeerBundle\Models\Data $dataClass
- */
- $dataClass = $this->get('DataModel');
+ $netconfFunc = $this->get('fitnetopeerbundle.service.netconf.functionality');
$params['key'] = $connectedDeviceId;
$params['from'] = ($from ? $from : time() - 12 * 60 * 60);
$params['to'] = $to;
$params['max'] = $max;
- $history = $dataClass->handle("notificationsHistory", $params);
+ $history = $netconfFunc->handle("notificationsHistory", $params);
// $history is 1 on error (we will show flash message) or array on success
if ($history !== 1) {
@@ -379,20 +230,22 @@ public function getNotificationsHistoryAction($connectedDeviceId, $from = null,
*/
public function validateSource($key, $target, $module)
{
- $dataClass = $this->get('DataModel');
+ $netconfFunc = $this->get('fitnetopeerbundle.service.netconf.functionality');
+ $connectionFunc = $this->get('fitnetopeerbundle.service.connection.functionality');
$subsection = null;
- $filters = $dataClass->loadFilters($module, $subsection);
+ $filters = $connectionFunc->loadFilters($module, $subsection);
$params = array(
- 'key' => $key,
+ 'connIds' => array($key),
'filter' => $filters['state'],
'target' => $target
);
- $res = $dataClass->handle('validate', $params, false);
+ $res = $netconfFunc->handle('validate', $params, false);
$this->getRequest()->getSession()->getFlashBag()->add('state '.(!$res ? 'success' : 'error'), 'Datastore '.$target.' is '.($res ? 'in' : '').'valid.');
$this->addAjaxBlock('FITModuleDefaultBundle:Module:section.html.twig', 'alerts');
+ $this->removeAjaxBlock('state');
$this->assign('dataStore', $target);
return $this->getTwigArr();
}
@@ -458,4 +311,32 @@ public function lookupipAction($ip)
return $this->getAssignedVariablesArr();
}
}
+
+ /**
+ * @param $key
+ * @param $filter
+ *
+ * @Route("/ajax/schema/", name="loadSchemaByFilter")
+ *
+ * @return JsonResponse
+ */
+ public function loadSchemaByFilterAction() {
+ $netconfFunc = $this->get('fitnetopeerbundle.service.netconf.functionality');
+ if ($this->getRequest()->getContent() !== "") {
+ $requestParams = json_decode($this->getRequest()->getContent(), true);
+ } else {
+ $requestParams['filters'] = $this->getRequest()->get('filters');
+ $requestParams['connIds'] = $this->getRequest()->get('connIds');
+ }
+
+ if (isset($requestParams['filters']) && array_key_exists(0, $requestParams['filters']) && $requestParams['filters'][0] !== '/') {
+ $params = array(
+ 'connIds' => $requestParams['connIds'],
+ 'filters' => array($requestParams['filters'])
+ );
+ $res = $netconfFunc->handle('query', $params);
+ return new JsonResponse(json_decode($res));
+ }
+ return new JsonResponse([]);
+ }
}
diff --git a/src/FIT/NetopeerBundle/Controller/BaseController.php b/src/FIT/NetopeerBundle/Controller/BaseController.php
index 90605e29..ba7b27c6 100644
--- a/src/FIT/NetopeerBundle/Controller/BaseController.php
+++ b/src/FIT/NetopeerBundle/Controller/BaseController.php
@@ -159,23 +159,20 @@ protected function prepareGlobalTwigVariables() {
);
$this->assign('app', $app);
- /**
- * @var \FIT\NetopeerBundle\Models\Data $dataClass
- */
- $dataClass = $this->get('DataModel');
+ $connectionFunc = $this->get('fitnetopeerbundle.service.connection.functionality');
if (!in_array($this->getRequest()->get('_route'), array('connections', '_login')) &&
!strpos($this->getRequest()->get('_controller'), 'AjaxController')) {
if (!in_array($this->getRequest()->get('_route'), array('createEmptyModule'))) {
- $dataClass->buildMenuStructure($this->activeSectionKey);
+ $connectionFunc->buildMenuStructure($this->getActiveSectionKey());
}
- $this->assign('topmenu', $dataClass->getModels());
- $this->assign('submenu', $dataClass->getSubmenu($this->submenuUrl, $this->getRequest()->get('key')));
+ $this->assign('topmenu', $connectionFunc->getModels($this->getActiveSectionKey()));
+ $this->assign('submenu', $connectionFunc->getSubmenu($this->submenuUrl, $this->getRequest()->get('key')));
}
try {
$key = $this->getRequest()->get('key');
if ($key != "") {
- $conn = $dataClass->getConnectionSessionForKey($key);
+ $conn = $connectionFunc->getConnectionSessionForKey($key);
if ($conn !== false) {
$this->assign('lockedConn', $conn->getLockForDatastore());
$this->assign('sessionStatus', $conn->sessionStatus);
@@ -187,7 +184,7 @@ protected function prepareGlobalTwigVariables() {
$session->getFlashBag()->add('error', "Trying to use unknown connection. Please, connect to the device.");
}
- $this->assign("ncFeatures", $dataClass->getCapabilitiesArrForKey($key));
+ $this->assign("ncFeatures", $connectionFunc->getCapabilitiesArrForKey($key));
}
/**
@@ -199,24 +196,26 @@ protected function prepareGlobalTwigVariables() {
* @param string $sourceConfig source param of config
*/
protected function setSectionFormsParams($key, $filterState = "", $filterConfig = "", $sourceConfig = "") {
- /**
- * @var $dataClass \FIT\NetopeerBundle\Models\Data
- */
- $dataClass = $this->get('DataModel');
- $conn = $dataClass->getConnectionSessionForKey($key);
+ $connectionFunc = $this->get('fitnetopeerbundle.service.connection.functionality');
+ $conn = $connectionFunc->getConnectionSessionForKey($key);
if ($conn) {
if ($sourceConfig !== "") {
$conn->setCurrentDatastore($sourceConfig);
}
$this->setConfigParams('source', $conn->getCurrentDatastore());
+ $this->setStateParams('source', $conn->getCurrentDatastore());
}
- $this->setStateParams('key', $key);
- $this->setStateParams('filter', $filterState);
+ $this->setStateParams('connIds', array($key));
+ if ($filterState !== "") {
+ $this->setStateParams('filter', $filterState);
+ }
- $this->setConfigParams('key', $key);
- $this->setConfigParams('filter', $filterConfig);
+ $this->setConfigParams('connIds', array($key));
+ if ($filterConfig !== "") {
+ $this->setConfigParams('filter', $filterConfig);
+ }
}
/**
@@ -225,31 +224,30 @@ protected function setSectionFormsParams($key, $filterState = "", $filterConfig
* @param $key Identifier of connection (connected device ID)
*/
protected function setEmptyModuleForm($key) {
- $dataClass = $this->get("DataModel");
- $tmpArr = $dataClass->getModuleIdentifiersForCurrentDevice($key);
- $tmpArr = $dataClass->getRootNamesForModuleIdentifiers($key, $tmpArr);
+ $connectionFunc = $this->get("fitnetopeerbundle.service.connection.functionality");
+ $tmpArr = $connectionFunc->getModuleIdentifiersForCurrentDevice($key);
// use small hack when appending space at the end of key, which will fire all options in typeahead
$nsArr = array();
if (!empty($tmpArr)) {
foreach ($tmpArr as $key => $item) {
- if ($item['rootElem'] != "") {
- $modulesArr[$item['rootElem']] = (array)$key;
- $nsArr[] = $key;
+ if ($item['moduleName'] != "") {
+ $modulesArr[$item['moduleName']] = '';// TODO
+ $nsArr[] = '';
}
}
}
$form = $this->createFormBuilder()
- ->add('name', 'text', array(
- 'label' => "Module name",
+ ->add('modulePrefix', 'text', array(
+ 'label' => "Prefix",
'attr' => array(
'class' => 'typeaheadName percent-width w-50',
'autocomplete' => 'off'
)
))
- ->add('namespace', 'text', array(
- 'label' => "Namespace",
+ ->add('moduleName', 'text', array(
+ 'label' => "Module name",
'attr' => array(
'class' => 'typeaheadNS percent-width w-50',
'autocomplete' => 'off'
@@ -269,13 +267,13 @@ protected function setEmptyModuleForm($key) {
protected function setOnlyConfigSection() {
$this->get('session')->set('singleColumnLayout', false);
$this->assign('singleColumnLayout', false);
- $this->addAjaxBlock('FITModuleDefaultBundle:Module:section.html.twig', 'state');
+// $this->addAjaxBlock('FITModuleDefaultBundle:Module:section.html.twig', 'state');
$this->assign('hideColumnControl', true);
$this->assign('showConfigFilter', true);
- $template = $this->get('twig')->loadTemplate('FITModuleDefaultBundle:Module:section.html.twig');
- $html = $template->renderBlock('config', $this->getAssignedVariablesArr());
- $this->assign('configSingleContent', $html);
+// $template = $this->get('twig')->loadTemplate('FITModuleDefaultBundle:Module:section.html.twig');
+// $html = $template->renderBlock('config', $this->getAssignedVariablesArr());
+// $this->assign('configSingleContent', $html);
$this->get('session')->set('singleColumnLayout', true);
$this->assign('singleColumnLayout', true);
@@ -289,14 +287,19 @@ protected function setOnlyConfigSection() {
*
* @return array
*/
- protected function createRPCListFromModel($module, $subsection = "")
+ protected function createRPCListFromModel($key, $module)
{
- if (!empty($this::$rpcs)) return $this::$rpcs;
- /**
- * @var \FIT\NetopeerBundle\Models\Data $dataClass
- */
- $dataClass = $this->get('DataModel');
- $rpcs = $dataClass->loadRPCsModel($module, $subsection);
+ $connectionFunc = $this->get("fitnetopeerbundle.service.connection.functionality");
+ $model = $connectionFunc->getModelMetadata($key, $module);
+
+ if ($model) {
+ return $model['rpcs'];
+ } else {
+ return array();
+ }
+
+
+ return;
$rpcxml = simplexml_load_string($rpcs["rpcs"]);
$rpcs = array();
if ($rpcxml) {
@@ -347,11 +350,8 @@ private function getRPCinputAttributesAndChildren(\SimpleXMLElement $root_elem,
* @return bool|string
*/
protected function getCurrentDatastoreForKey($key) {
- /**
- * @var $dataClass \FIT\NetopeerBundle\Models\Data
- */
- $dataClass = $this->get('DataModel');
- $conn = $dataClass->getConnectionSessionForKey($key);
+ $connectionFunc = $this->get('fitnetopeerbundle.service.connection.functionality');
+ $conn = $connectionFunc->getConnectionSessionForKey($key);
if ($conn) {
return $conn->getCurrentDatastore();
@@ -413,6 +413,10 @@ public function setActiveSectionKey($key) {
* @return int|null section key
*/
public function getActiveSectionKey() {
+ $requestKey = intval($this->getRequest()->get('key'));
+ if (is_null($this->activeSectionKey) && isset($requestKey)) {
+ return $requestKey;
+ }
return $this->activeSectionKey;
}
@@ -436,6 +440,13 @@ protected function addAjaxBlock($templateNamespace, $blockId) {
);
}
+ /**
+ * @param string $blockId block name from template
+ */
+ protected function removeAjaxBlock($blockId) {
+ unset($this->ajaxBlocksArr[$blockId]);
+ }
+
/**
* @return array array with definition of ajax blocks
*/
diff --git a/src/FIT/NetopeerBundle/Controller/DefaultController.php b/src/FIT/NetopeerBundle/Controller/DefaultController.php
index 333089b0..2f85e6ad 100644
--- a/src/FIT/NetopeerBundle/Controller/DefaultController.php
+++ b/src/FIT/NetopeerBundle/Controller/DefaultController.php
@@ -44,11 +44,10 @@
namespace FIT\NetopeerBundle\Controller;
-use FIT\NetopeerBundle\Models\Array2XML;
-
-// these import the "@Route" and "@Template" annotations
+use FIT\NetopeerBundle\Services\Functionality\NetconfFunctionality;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
+use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session\Session;
@@ -92,11 +91,11 @@ public function connectionsAction($connectedDeviceId = NULL)
*/
$session = $this->getRequest()->getSession();
$singleInstance = $this->container->getParameter('fit_netopeer.single_instance');
- // DependencyInjection (DI) - defined in Resources/config/services.yml
+
/**
- * @var \FIT\NetopeerBundle\Models\Data $dataClass
+ * @var NetconfFunctionality
*/
- $dataClass = $this->get('DataModel');
+ $netconfFunc = $this->get('fitnetopeerbundle.service.netconf.functionality');
$this->addAjaxBlock('FITNetopeerBundle:Default:connections.html.twig', 'title');
$this->addAjaxBlock('FITNetopeerBundle:Default:connections.html.twig', 'additionalTitle');
@@ -166,7 +165,7 @@ public function connectionsAction($connectedDeviceId = NULL)
// state flash = state -> left column in the layout
$result = "";
- $res = $dataClass->handle("connect", $params, false, $result);
+ $res = $netconfFunc->handle("connect", $params, false, $result);
// if connection is broken (Could not connect)
if ($res == 0) {
@@ -190,7 +189,7 @@ public function connectionsAction($connectedDeviceId = NULL)
$baseConn->saveConnectionIntoDB($post_vals['host'], $post_vals['port'], $post_vals['user']);
} else {
// update models
- $dataClass->updateLocalModels($result);
+ $netconfFunc->updateLocalModels($result);
setcookie("singleInstanceLoginFailed", false);
return $this->redirect($this->generateUrl('handleConnection', array('command' => 'get', 'key' => $result)));
}
@@ -256,18 +255,15 @@ public function changeColumnLayoutAction($newValue)
*/
public function reloadDeviceAction($key)
{
- /**
- * @var \FIT\NetopeerBundle\Models\Data $dataClass
- */
- $dataClass = $this->get('DataModel');
+ $connectionFunc = $this->get('fitnetopeerbundle.service.connection.functionality');
+ $netconfFunc = $this->get('fitnetopeerbundle.service.netconf.functionality');
/* reload hello message */
- $params = array('key' => $key);
- if (($res = $dataClass->handle("reloadhello", $params) == 0)) {
+ $params = array('sessions' => array($key));
+ if (($res = $netconfFunc->handle("reloadhello", $params) == 0)) {
}
- $dataClass->updateLocalModels($key);
- $dataClass->invalidateAndRebuildMenuStructureForKey($key);
+ $connectionFunc->invalidateAndRebuildMenuStructureForKey($key);
//reconstructs a routing path and gets a routing array called $route_params
if ($this->getRequest()->isXmlHttpRequest()) {
@@ -298,10 +294,9 @@ public function reloadDeviceAction($key)
*/
public function handleConnectionAction($command, $key, $identifier = "")
{
- $dataClass = $this->get('DataModel');
+ $netconfFunc = $this->get('fitnetopeerbundle.service.netconf.functionality');
$params = array(
- 'key' => $key,
- 'filter' => '',
+ 'connIds' => array($key)
);
if ($command === "getschema") {
@@ -319,8 +314,7 @@ public function handleConnectionAction($command, $key, $identifier = "")
$params['target'] = $this->getCurrentDatastoreForKey($key);
$this->getRequest()->getSession()->set('isLocking', true);
}
-
- $res = $dataClass->handle($command, $params, false);
+ $res = $netconfFunc->handle($command, $params, false);
if ( $res != 1 && !in_array($command, array("connect", "disconnect"))) {
return $this->redirect($this->generateUrl('section', array('key' => $key)));
@@ -345,19 +339,19 @@ public function handleConnectionAction($command, $key, $identifier = "")
*/
public function handleBackupAction($key)
{
- $dataClass = $this->get('DataModel');
+ $netconfFunc = $this->get('fitnetopeerbundle.service.netconf.functionality');
+ $connectionFunc = $this->get('fitnetopeerbundle.service.connection.functionality');
$params = array(
- 'key' => $key,
- 'filter' => '',
+ 'connIds' => array($key)
);
- $res = $dataClass->handle('backup', $params, false);
+ $res = $netconfFunc->handle('get', $params, false);
$resp = new Response();
$resp->setStatusCode(200);
$resp->headers->set('Cache-Control', 'private');
$resp->headers->set('Content-Length', strlen($res));
$resp->headers->set('Content-Type', 'application/force-download');
- $resp->headers->set('Content-Disposition', sprintf('attachment; filename="%s-%s.xml"', date("Y-m-d"), $dataClass->getHostFromKey($key)));
+ $resp->headers->set('Content-Disposition', sprintf('attachment; filename="%s-%s.json"', date("Y-m-d"), $connectionFunc->getHostFromKey($key)));
$resp->sendHeaders();
$resp->setContent($res);
$resp->sendContent();
@@ -376,14 +370,12 @@ public function handleBackupAction($key)
*/
public function sessionInfoAction($key, $action)
{
- /**
- * @var \FIT\NetopeerBundle\Models\Data $dataClass
- */
- $dataClass = $this->get('DataModel');
- parent::setActiveSectionKey($key);
- $dataClass->buildMenuStructure($key);
+ $connectionFunc = $this->get('fitnetopeerbundle.service.connection.functionality');
+ $netconfFunc = $this->get('fitnetopeerbundle.service.netconf.functionality');
+ $this->setActiveSectionKey($key);
+ $connectionFunc->buildMenuStructure($key);
- $this->addAjaxBlock('FITModuleDefaultBundle:Module:section.html.twig', 'moduleJavascripts');
+// $this->addAjaxBlock('FITModuleDefaultBundle:Module:section.html.twig', 'moduleJavascripts');
$this->addAjaxBlock('FITModuleDefaultBundle:Module:section.html.twig', 'moduleStylesheet');
$this->addAjaxBlock('FITModuleDefaultBundle:Module:section.html.twig', 'title');
$this->addAjaxBlock('FITModuleDefaultBundle:Module:section.html.twig', 'additionalTitle');
@@ -392,6 +384,8 @@ public function sessionInfoAction($key, $action)
$this->addAjaxBlock('FITModuleDefaultBundle:Module:section.html.twig', 'topMenu');
$this->addAjaxBlock('FITModuleDefaultBundle:Module:section.html.twig', 'leftColumn');
+ // TODO
+
if ( $action == "session" ) {
/**
* @var Session $session
@@ -428,7 +422,7 @@ public function sessionInfoAction($key, $action)
}
}
- $connVarsArr['connection-'.$connKey][$connKey]['nc_features'] = $dataClass->getCapabilitiesArrForKey($connKey);
+ $connVarsArr['connection-'.$connKey][$connKey]['nc_features'] = $connectionFunc->getCapabilitiesArrForKey($connKey);
}
$sessionArr['session-connections'] = $connVarsArr;
}
@@ -436,14 +430,22 @@ public function sessionInfoAction($key, $action)
unset($sessionArr['_security_secured_area']);
unset($sessionArr['_security_commont_context']);
- $xml = Array2XML::createXML("session", $sessionArr);
- $xml = simplexml_load_string($xml->saveXml(), 'SimpleXMLIterator');
+ if ($this->getRequest()->get('angular') == "true") {
+ $res = array(
+ 'variables' => array(
+ 'jsonEditable' => false,
+ ),
+ 'configuration' => $sessionArr,
+ );
+ return new JsonResponse($res);
+ }
- $this->assign("stateArr", $xml);
+ $this->assign('jsonEditable', false);
+ $this->assign("stateJson", json_encode($sessionArr));
$this->assign('hideStateSubmitButton', true);
} else if ($action == "reload") {
$params = array('key' => $key);
- $dataClass->handle("reloadhello", $params);
+ $netconfFunc->handle("reloadhello", $params);
}
$this->assign('singleColumnLayout', true);
@@ -468,9 +470,11 @@ public function sessionInfoAction($key, $action)
*
* @return bool
*/
- private function getRPCXmlForMethod($rpcMethod, $module, $subsection = "") {
- $rpcs = $this->createRPCListFromModel($module, $subsection);
- return isset($rpcs[$rpcMethod]) ? $rpcs[$rpcMethod] : false;
+ private function getRPCXmlForMethod($rpcMethod, $key, $module) {
+ $netconfFunc = $this->get('fitnetopeerbundle.service.netconf.functionality');
+ $rpc = $module.':'.$rpcMethod;
+ $json = $netconfFunc->handle('query', array('connIds' => array($key), 'load_children' => true, 'filters' => array(array('/'.$rpc))));
+ return $json;
}
/**
@@ -496,9 +500,6 @@ public function showRPCFormAction($key, $module, $rpcName) {
$this->assign('key', $key);
$this->assign('module', $module);
$this->assign('rpcName', $rpcName);
- // path for creating node typeahead
- $valuesTypeaheadPath = $this->generateUrl("getValuesForLabel", array('formId' => "FORMID", 'key' => $key, 'xPath' => "XPATH"));
- $this->assign('valuesTypeaheadPath', $valuesTypeaheadPath);
if ($this->getRequest()->getMethod() == 'POST') {
$xmlOperations = $this->get("XMLoperations");
@@ -510,7 +511,7 @@ public function showRPCFormAction($key, $module, $rpcName) {
return new RedirectResponse($url);
}
- $this->assign('rpcArr', $this->getRPCXmlForMethod($rpcName, $module));
+ $this->assign('rpcData', $this->getRPCXmlForMethod($rpcName, $key, $module));
return $this->getTwigArr();
}
@@ -535,11 +536,18 @@ public function createEmptyModuleAction($key) {
$this->assign('key', $key);
if ($this->getRequest()->getMethod() == 'POST') {
- $xmlOperations = $this->get("XMLoperations");
- $postVals = $this->getRequest()->get("form");
- $this->setSectionFormsParams($key);
-
- $res = $xmlOperations->handleCreateEmptyModuleForm($key, $this->getConfigParams(), $postVals);
+ $netconfFunc = $this->get('fitnetopeerbundle.service.netconf.functionality');
+ $arr = [];
+ $formData = $this->getRequest()->get('form');
+ $moduleName = $formData['modulePrefix'] . ':' . $formData['moduleName'];
+ $json = '{"'.$moduleName.'":{},"@'.$moduleName.'":{"ietf-netconf:operation":"create"}}';
+// var_dump($this->getStateParams());exit;
+ $params = array(
+ 'connIds' => array($key),
+ 'target' => 'running',
+ 'configs' => array($json)
+ );
+ $res = $netconfFunc->handle('editconfig', $params);
if ($res != 0) {
return $this->forward('FITNetopeerBundle:Default:reloadDevice', array('key' => $key));
}
diff --git a/src/FIT/NetopeerBundle/Controller/ModuleController.php b/src/FIT/NetopeerBundle/Controller/ModuleController.php
index ffb76fd3..bd243192 100644
--- a/src/FIT/NetopeerBundle/Controller/ModuleController.php
+++ b/src/FIT/NetopeerBundle/Controller/ModuleController.php
@@ -65,25 +65,22 @@ class ModuleController extends BaseController {
static protected $defaultModuleAction = "FIT\Bundle\ModuleDefaultBundle\Controller\ModuleController::moduleAction";
/**
- * base method for getting data for module action
+ * base method for preparing variables for module action
*
* @param $bundleName
* @param $key
* @param null $module
* @param null $subsection
*
- * @return \SimpleXMLIterator|RedirectResponse|null SimpleXMLIterator with state XML, redirectResponse when current page is not correct, null on some failure
+ * * @return RedirectResponse|null redirectResponse when current page is not correct, null on some failure
*/
- protected function prepareDataForModuleAction($bundleName, $key, $module = null, $subsection = null)
+ protected function prepareVariablesForModuleAction($bundleName, $key, $module = null, $subsection = null)
{
- /**
- * @var Data $dataClass
- */
- $dataClass = $this->get('DataModel');
+ $connectionFunc = $this->get('fitnetopeerbundle.service.connection.functionality');
$this->bundleName = $bundleName;
if ($this->getRequest()->getSession()->get('isLocking') !== true) {
- $this->addAjaxBlock($bundleName.':Module:section.html.twig', 'moduleJavascripts');
+// $this->addAjaxBlock($bundleName.':Module:section.html.twig', 'moduleJavascripts');
$this->addAjaxBlock($bundleName.':Module:section.html.twig', 'moduleStylesheet');
$this->addAjaxBlock($bundleName.':Module:section.html.twig', 'title');
$this->addAjaxBlock($bundleName.':Module:section.html.twig', 'additionalTitle');
@@ -95,7 +92,7 @@ protected function prepareDataForModuleAction($bundleName, $key, $module = null,
$this->addAjaxBlock($bundleName.':Module:section.html.twig', 'alerts');
$this->addAjaxBlock($bundleName.':Module:section.html.twig', 'topMenu');
- if ($dataClass->checkLoggedKeys() === 1) {
+ if ($connectionFunc->checkLoggedKeys() === 1) {
$url = $this->get('request')->headers->get('referer');
if (!strlen($url)) {
$url = $this->generateUrl('connections');
@@ -104,32 +101,33 @@ protected function prepareDataForModuleAction($bundleName, $key, $module = null,
}
/* build correct menu structure for this module, generates module structure too */
- $dataClass->buildMenuStructure($key);
+ $connectionFunc->buildMenuStructure($key);
/* Show the first module we have */
if ( $module == null ) {
- return $this->redirectToFirstModule($key);
+// in angular we want to show the only section route
+// return $this->redirectToFirstModule($key);
}
// now, we could set forms params with filter (even if we don't have module or subsection)
// filter will be empty
- $filters = $dataClass->loadFilters($module, $subsection);
+ $filters = $connectionFunc->loadFilters($module, $subsection);
$this->setSectionFormsParams($key, $filters['state'], $filters['config']);
/** prepare necessary data for left column */
$this->setActiveSectionKey($key);
$this->setModuleOrSectionName($key, $module, $subsection);
- $this->assign('rpcMethods', $this->createRPCListFromModel($module, $subsection));
+ $this->assign('rpcMethods', $this->createRPCListFromModel($key, $module));
$this->setModuleOutputStyles($key, $module);
// if form has been send, we well process it
if ($this->getRequest()->getMethod() == 'POST') {
return $this->processSectionForms($key, $module, $subsection);
+// return;
}
// we will prepare filter form in column
$this->setSectionFilterForms($key);
- $this->generateTypeaheadPath($key, $module, $subsection);
$activeNotifications = $this->getRequest()->getSession()->get('activeNotifications');
if ( !isset($activeNotifications[$key]) || $activeNotifications[$key] !== true ) {
@@ -139,31 +137,42 @@ protected function prepareDataForModuleAction($bundleName, $key, $module = null,
}
// load model tree dump
- $modelTree = $dataClass->getModelTreeDump($module);
+ $modelTree = $connectionFunc->getModelTreeDump($module);
if ($modelTree) {
$this->assign('modelTreeDump', $modelTree);
}
- // load identity refs array
- $identities = $dataClass->loadIdentityRefsForModule($key, $module);
- if ($identities) {
- $this->assign('moduleIdentityRefs', $identities);
- }
+ return null;
+ }
+
+ /**
+ * base method for getting data for module action
+ *
+ * @param $bundleName
+ * @param $key
+ * @param null $module
+ * @param null $subsection
+ *
+ * @return json|null JSON with state data
+ */
+ protected function loadDataForModuleAction($bundleName, $key, $module = null, $subsection = null) {
+ $netconfFunc = $this->get('fitnetopeerbundle.service.netconf.functionality');
// loading state part = get Action
// we will load it every time, because state column will we show everytime
try {
- if ($module === 'all') {
- $merge = false;
- } else {
- $merge = true;
+ // we can not call get on other than running datastore
+ $params = $this->getStateParams();
+ $command = 'get';
+ if ( isset($params['source']) && $params['source'] !== 'running' ) {
+ $command = 'getconfig';
+ $params = $this->getConfigParams();
}
- if ( ($xml = $dataClass->handle('get', $this->getStateParams(), $merge)) != 1 ) {
- $xml = simplexml_load_string($xml, 'SimpleXMLIterator');
- $this->assign("stateArr", $xml);
- return $xml;
+ if ( ($json = $netconfFunc->handle($command, $params)) != 1 ) {
+ $this->assign("stateJson", $json);
+ return $json;
}
} catch (\ErrorException $e) {
$this->get('data_logger')->err("State: Could not parse filter correctly.", array("message" => $e->getMessage()));
@@ -180,14 +189,11 @@ protected function prepareDataForModuleAction($bundleName, $key, $module = null,
* @return array
*/
protected function setModuleOutputStyles($key, $module) {
- /**
- * @var \FIT\NetopeerBundle\Models\Data $dataClass
- */
- $dataClass = $this->get('DataModel');
+ $connectionFunc = $this->get('fitnetopeerbundle.service.connection.functionality');
$controllers = array();
- $namespace = $dataClass->getNamespaceForModule($key, $module);
- $record = $dataClass->getModuleControllers($module, $namespace);
+ $namespace = $connectionFunc->getNamespaceForModule($key, $module);
+ $record = $connectionFunc->getModuleControllers($module, $namespace);
if ($record) {
$controllers = $record->getControllerActions();
}
@@ -206,8 +212,8 @@ protected function setModuleOutputStyles($key, $module) {
}
// build form for controller output change
- $conn = $dataClass->getConnectionSessionForKey($key);
- $controllerAction = $conn->getActiveControllersForNS($dataClass->getNamespaceForModule($key, $module));
+ $conn = $connectionFunc->getConnectionSessionForKey($key);
+ $controllerAction = $conn->getActiveControllersForNS($connectionFunc->getNamespaceForModule($key, $module));
$form = $this->createFormBuilder(null, array('csrf_protection' => false))
->add('controllerAction', 'choice', array(
@@ -226,7 +232,7 @@ protected function setModuleOutputStyles($key, $module) {
$postVals = $this->getRequest()->get("form");
if ( isset($postVals['controllerAction']) ) {
$conn->setActiveController($namespace, $postVals['controllerAction']);
- $dataClass->persistConnectionSessionForKey($key, $conn);
+ $connectionFunc->persistConnectionSessionForKey($key, $conn);
}
}
@@ -243,14 +249,14 @@ protected function setModuleOutputStyles($key, $module) {
* @return null|RedirectResponse
*/
protected function setModuleOrSectionName($key, $module, $subsection) {
- $dataClass = $this->get('DataModel');
+ $connectionFunc = $this->get('fitnetopeerbundle.service.connection.functionality');
// if we have module, we are definitely in module or subsection action, so we could load names
if ( $module ) {
parent::setSubmenuUrl($module);
- $this->assign('sectionName', $dataClass->getSectionName($module));
+ $this->assign('sectionName', $connectionFunc->getSectionName($module));
if ( $subsection ) {
- $this->assign('subsectionName', $dataClass->getSubsectionName($subsection));
+ $this->assign('subsectionName', $connectionFunc->getSubsectionName($subsection));
}
// we are in section
@@ -270,33 +276,6 @@ protected function setModuleOrSectionName($key, $module, $subsection) {
$this->assign('isModule', true);
}
- /**
- * generates and assign typeahead placeholder path (for using in JS typeadhead function)
- *
- * @param $key
- * @param $module
- * @param $subsection
- */
- protected function generateTypeaheadPath($key, $module, $subsection) {
- // path for creating node typeahead
- $typeaheadParams = array(
- 'formId' => "FORMID",
- 'key' => $key,
- 'xPath' => "XPATH"
- );
- $valuesTypeaheadPath = $this->generateUrl('getValuesForLabel', $typeaheadParams);
- if (!is_null($module)) {
- $typeaheadParams['module'] = $module;
- $valuesTypeaheadPath = $this->generateUrl('getValuesForLabelWithModule', $typeaheadParams);
- }
- if (!is_null($subsection)) {
- $typeaheadParams['subsection'] = $subsection;
- $valuesTypeaheadPath = $this->generateUrl('getValuesForLabelWithSubsection', $typeaheadParams);
- }
-
- $this->assign('valuesTypeaheadPath', $valuesTypeaheadPath);
- }
-
/**
* Redirect to first available module or All section if no module is available
*
@@ -305,19 +284,19 @@ protected function generateTypeaheadPath($key, $module, $subsection) {
* @return RedirectResponse
*/
protected function redirectToFirstModule($key) {
- $dataClass = $this->get('DataModel');
+ $connectionFunc = $this->get('fitnetopeerbundle.service.connection.functionality');
$retArr['key'] = $key;
$routeName = 'module';
- $modules = $dataClass->getModels();
+ $modules = $connectionFunc->getModuleIdentifiersForCurrentDevice($key);
if (count($modules)) {
- $module1st = array_shift($modules);
- if (!isset($module1st["params"]["module"])) {
+ $first = array_shift($modules);
+ if (!isset($first["moduleName"])) {
/* ERROR - wrong structure of model entry */
$this->get('data_logger')
->err("Cannot get first model (redirect to 1st tab).",
- array("message" => "\$module1st[\"params\"][\"module\"] is not set"));
+ array("message" => "\$first[\"moduleName\"] is not set"));
}
- $retArr['module'] = $module1st["params"]["module"];
+ $retArr['module'] = $first["moduleName"];
return $this->redirect($this->generateUrl($routeName, $retArr));
} else {
return $this->redirect($this->generateUrl("module", array('key' => $key, 'module' => 'all')));
@@ -339,37 +318,18 @@ protected function processSectionForms($key, $module = null, $subsection = null)
$this->setSectionFilterForms($key);
}
- // processing filter on state part
- if ( isset($post_vals['formType']) && $post_vals['formType'] == "formState") {
- $res = $this->handleFilterState($key, $post_vals);
- $this->addAjaxBlock('FITNetopeerBundle:Default:connections.html.twig', 'topMenu');
-
- // processing filter on config part
- } elseif ( isset($post_vals['formType']) && $post_vals['formType'] == "formConfig" ) {
+ // processing filter on config part
+ if ( isset($post_vals['formType']) && $post_vals['formType'] == "formConfig" ) {
$res = $this->handleFilterConfig($key);
$this->addAjaxBlock('FITNetopeerBundle:Default:connections.html.twig', 'topMenu');
// processing form on config - edit Config
} elseif ( isset($post_vals['formType']) && $post_vals['formType'] == "formCopyConfig" ) {
$res = $this->handleCopyConfig($key);
-
- // processing form on config - edit Config
- } elseif ( is_array($this->getRequest()->get('configDataForm')) ) {
- $res = $this->get('XMLoperations')->handleEditConfigForm($key, $this->getConfigParams());
-
- // processing duplicate node form
- } elseif ( is_array($this->getRequest()->get('duplicatedNodeForm')) ) {
- $res = $this->get('XMLoperations')->handleDuplicateNodeForm($key, $this->getConfigParams());
-
- // processing new node form
- } elseif ( is_array($this->getRequest()->get('newNodeForm')) ) {
- $res = $this->get('XMLoperations')->handleNewNodeForm($key, $this->getConfigParams());
-
- // processing remove node form
- } elseif ( is_array($this->getRequest()->get('removeNodeForm')) ) {
- $res = $this->get('XMLoperations')->handleRemoveNodeForm($key, $this->getConfigParams());
}
+ /*
+ * TODO: remove?
// we will redirect page after completion, because we want to load edited get and get-config
// and what's more, flash message lives exactly one redirect, so without redirect flash message
// would stay on the next page, what we do not want...
@@ -388,6 +348,7 @@ protected function processSectionForms($key, $module = null, $subsection = null)
$this->getRequest()->getSession()->set('isAjax', true);
}
return $this->redirect($this->generateUrl($routeName, $retArr));
+ */
}
/**
@@ -463,14 +424,17 @@ protected function loadConfigArr($addConfigSection = true, $merge = true, $bundl
$bundleName = $this->bundleName;
}
try {
- $dataClass = $this->get('dataModel');
+ $netconfFunc = $this->get('fitnetopeerbundle.service.netconf.functionality');
if ($addConfigSection) {
$this->addAjaxBlock($bundleName.':Module:section.html.twig', 'config');
}
// getcofig part
- if ( ($xml = $dataClass->handle('getconfig', $this->getConfigParams(), $merge)) != 1 ) {
- $xml = simplexml_load_string($xml, 'SimpleXMLIterator');
+ if ( ($json = $netconfFunc->handle('getconfig', $this->getConfigParams(), $merge)) != 1 ) {
+
+ $this->assign("configJson", $json);
+ return;
+ // TODO;
// we have only root module
if ($xml->count() == 0 && $xml->getName() == XMLoperations::$customRootElement) {
@@ -505,7 +469,7 @@ protected function loadConfigArr($addConfigSection = true, $merge = true, $bundl
* Checks if we have empty module in XML
*
* @param int $key
- * @param string $xml result of prepareDataForModuleAction()
+ * @param string $xml result of prepareVariablesForModuleAction()
*/
protected function checkEmptyRootModule($key, $xml) {
if ($xml instanceof \SimpleXMLIterator && $xml->count() == 0) {
@@ -542,7 +506,7 @@ private function handleFilterState(&$key, $post_vals) {
$this->filterForms['state']->bind($this->getRequest());
if ( $this->filterForms['state']->isValid() ) {
- $this->setStateParams("key", $key);
+ $this->setStateParams("connIds", array($key));
$this->setStateParams("filter", $post_vals["filter"]);
return 0;
} else {
@@ -563,16 +527,13 @@ private function handleFilterConfig(&$key) {
if ( $this->filterForms['config']->isValid() ) {
$post_vals = $this->getRequest()->get("form");
- $this->setConfigParams("key", $key);
+ $this->setConfigParams("connIds", array($key));
// $this->setConfigParams("filter", $post_vals["filter"]);
- /**
- * @var $dataClass \FIT\NetopeerBundle\Models\Data
- */
- $dataClass = $this->get('DataModel');
- $conn = $dataClass->getConnectionSessionForKey($key);
+ $connectionFunc = $this->get('fitnetopeerbundle.service.connection.functionality');
+ $conn = $connectionFunc->getConnectionSessionForKey($key);
$conn->setCurrentDatastore($post_vals['source']);
- $dataClass->persistConnectionSessionForKey($key, $conn);
+ $connectionFunc->persistConnectionSessionForKey($key, $conn);
$this->setConfigParams("source", $post_vals['source']);
@@ -593,24 +554,24 @@ private function handleFilterConfig(&$key) {
* @return int 1 on error, 0 on success
*/
private function handleCopyConfig(&$key) {
- $dataClass = $this->get('DataModel');
+ $netconfFunc = $this->get('fitnetopeerbundle.service.netconf.functionality');
$this->filterForms['copyConfig']->bind($this->getRequest());
if ( $this->filterForms['copyConfig']->isValid() ) {
$post_vals = $this->getRequest()->get("form");
- $this->setConfigParams("key", $key);
+ $this->setConfigParams("connIds", array($key));
$source = $this->getCurrentDatastoreForKey($key);
if ($source === null) {
$source = 'running';
}
$target = $post_vals['target'];
- $params = array('key' => $key, 'source' => $source, 'target' => $target);
- $dataClass->handle('copyconfig', $params, false);
+ $params = array('connIds' => array($key), 'source' => $source, 'target' => $target);
+ $netconfFunc->handle('copyconfig', $params, false);
return 0;
} else {
$this->getRequest()->getSession()->getFlashBag()->add('error', 'Copy config - you have not filled up form correctly.');
return 1;
}
}
-}
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/src/FIT/NetopeerBundle/Data/models/.gitignore b/src/FIT/NetopeerBundle/Data/models/.gitignore
deleted file mode 100644
index 13e4d83e..00000000
--- a/src/FIT/NetopeerBundle/Data/models/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-[^.]*
diff --git a/src/FIT/NetopeerBundle/Data/models/tmp/.gitignore b/src/FIT/NetopeerBundle/Data/models/tmp/.gitignore
deleted file mode 100644
index 13e4d83e..00000000
--- a/src/FIT/NetopeerBundle/Data/models/tmp/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-[^.]*
diff --git a/src/FIT/NetopeerBundle/Entity/SamlUser.php b/src/FIT/NetopeerBundle/Entity/SamlUser.php
index 24c45877..b98e3d47 100644
--- a/src/FIT/NetopeerBundle/Entity/SamlUser.php
+++ b/src/FIT/NetopeerBundle/Entity/SamlUser.php
@@ -274,7 +274,7 @@ public function getNameIDFormat()
*
* @return SamlUser
*/
- public function setCreatedOn($createdOn)
+ public function setCreatedOn(\DateTime $createdOn)
{
$this->createdOn = $createdOn;
diff --git a/src/FIT/NetopeerBundle/EventListener/ModuleListener.php b/src/FIT/NetopeerBundle/EventListener/ModuleListener.php
index 6a86730a..79e862b8 100644
--- a/src/FIT/NetopeerBundle/EventListener/ModuleListener.php
+++ b/src/FIT/NetopeerBundle/EventListener/ModuleListener.php
@@ -56,19 +56,19 @@ class ModuleListener
*/
private $logger;
/**
- * @var Data
+ * @var ConnectionFunctionality
*/
- private $dataModel;
+ private $connectionFunc;
/**
- * @param Data $dataModel
+ * @param Data $connectionFunc
* @param EntityManager $em
* @param Logger $logger
* @param
*/
- public function __construct($dataModel = null, $em = null, $logger = null)
+ public function __construct($connectionFunc = null, $em = null, $logger = null)
{
- $this->dataModel = $dataModel;
+ $this->connectionFunc = $connectionFunc;
$this->em = $em;
$this->logger = $logger;
}
@@ -86,9 +86,9 @@ public function onKernelController(GetResponseEvent $event)
if (in_array($attributes->get("_route"), array("module", "subsection"))) {
// get available namespaces for this connection
- $namespace = $this->dataModel->getNamespaceForModule($attributes->get('key'), $attributes->get('module'));
+ $namespace = $this->connectionFunc->getNamespaceForModule($attributes->get('key'), $attributes->get('module'));
if ($namespace !== false) {
- $record = $this->dataModel->getModuleControllers($attributes->get('module'), $namespace);
+ $record = $this->connectionFunc->getModuleControllers($attributes->get('module'), $namespace);
if ($record) {
// get all saved controllers from DB
@@ -97,7 +97,7 @@ public function onKernelController(GetResponseEvent $event)
/**
* @var ConnectionSession $conn
*/
- $conn = $this->dataModel->getConnectionSessionForKey($attributes->get('key'));
+ $conn = $this->connectionFunc->getConnectionSessionForKey($attributes->get('key'));
$activeController = $conn->getActiveControllersForNS($namespace);
// if we don't have any saved (preferred) controller, we will use first from DB
diff --git a/src/FIT/NetopeerBundle/Models/AjaxSharedData.php b/src/FIT/NetopeerBundle/Models/AjaxSharedData.php
deleted file mode 100644
index f3bd58c4..00000000
--- a/src/FIT/NetopeerBundle/Models/AjaxSharedData.php
+++ /dev/null
@@ -1,105 +0,0 @@
-
- *
- * Copyright (C) 2012-2015 CESNET
- *
- * LICENSE TERMS
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name of the Company nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * ALTERNATIVELY, provided that this notice is retained in full, this
- * product may be distributed under the terms of the GNU General Public
- * License (GPL) version 2 or later, in which case the provisions
- * of the GPL apply INSTEAD OF those given above.
- *
- * This software is provided ``as is'', and any express or implied
- * warranties, including, but not limited to, the implied warranties of
- * merchantability and fitness for a particular purpose are disclaimed.
- * In no event shall the company or contributors be liable for any
- * direct, indirect, incidental, special, exemplary, or consequential
- * damages (including, but not limited to, procurement of substitute
- * goods or services; loss of use, data, or profits; or business
- * interruption) however caused and on any theory of liability, whether
- * in contract, strict liability, or tort (including negligence or
- * otherwise) arising in any way out of the use of this software, even
- * if advised of the possibility of such damage.
- */
-namespace FIT\NetopeerBundle\Models;
-
-/**
- * This class holds shared data for Ajax operations
- */
-class AjaxSharedData {
- /**
- * @var array shared data
- */
- protected $data;
-
- /**
- * @var AjaxSharedData instance for singleton
- */
- protected static $instance;
-
- /**
- * Constructor
- */
- protected function __construct() {
-
- }
-
- /**
- * Get instance of this class
- *
- * @todo Is not working correctly, creates new instance every time.
- * @return AjaxSharedData
- */
- public static function getInstance() {
- if (!isset(static::$instance)) {
- static::$instance = new static;
- }
- return static::$instance;
- }
-
- /**
- * Set keys and values of shared data array
- *
- * @param mixed $key
- * @param mixed $arrayKey
- * @param mixed $value
- */
- public function setDataForKey($key, $arrayKey, $value) {
- if (!isset($this->data[$key])) {
- $this->data[$key] = array();
- }
- $this->data[$key][$arrayKey] = $value;
- }
-
- /**
- * Get value from shared data array
- *
- * @param mixed $key key of shared array
- * @return mixed
- */
- public function getDataForKey($key) {
- return $this->data[$key];
- }
-}
diff --git a/src/FIT/NetopeerBundle/Models/Array2XML.php b/src/FIT/NetopeerBundle/Models/Array2XML.php
deleted file mode 100644
index cbd7f4ef..00000000
--- a/src/FIT/NetopeerBundle/Models/Array2XML.php
+++ /dev/null
@@ -1,225 +0,0 @@
-saveXML();
- *
- *
- *
- * Additional functions:
- * mergeXml
- */
-
-namespace FIT\NetopeerBundle\Models;
-
-class Array2XML {
-
- private static $xml = null;
- private static $encoding = 'UTF-8';
-
- /**
- * Initialize the root XML node [optional]
- * @param $version
- * @param $encoding
- * @param $format_output
- */
- public static function init($version = '1.0', $encoding = 'UTF-8', $format_output = true) {
- self::$xml = new \DomDocument($version, $encoding);
- self::$xml->formatOutput = $format_output;
- self::$encoding = $encoding;
- }
-
- /**
- * Convert an Array to XML
- * @param string $node_name - name of the root node to be converted
- * @param array $arr - aray to be converterd
- * @return DomDocument
- */
- public static function &createXML($node_name, $arr=array()) {
- $xml = self::getXMLRoot();
- $xml->appendChild(self::convert($node_name, $arr));
-
- self::$xml = null; // clear the xml node in the class for 2nd time use.
- return $xml;
- }
-
- /**
- * Convert an Array to XML
- * @param string $node_name - name of the root node to be converted
- * @param array $arr - aray to be converterd
- * @return DOMNode
- */
- private static function &convert($node_name, $arr=array()) {
-
- //print_arr($node_name);
- $xml = self::getXMLRoot();
- $node = $xml->createElement($node_name);
-
- if(is_array($arr)){
- // get the attributes first.;
- if(isset($arr['@attributes'])) {
- foreach($arr['@attributes'] as $key => $value) {
- if(!self::isValidTagName($key)) {
- throw new \Exception('[Array2XML] Illegal character in attribute name. attribute: '.$key.' in node: '.$node_name);
- }
- $node->setAttribute($key, self::bool2str($value));
- }
- unset($arr['@attributes']); //remove the key from the array once done.
- }
-
- // check if it has a value stored in @value, if yes store the value and return
- // else check if its directly stored as string
- if(isset($arr['@value'])) {
- $node->appendChild($xml->createTextNode(self::bool2str($arr['@value'])));
- unset($arr['@value']); //remove the key from the array once done.
- //return from recursion, as a note with value cannot have child nodes.
- return $node;
- } else if(isset($arr['@cdata'])) {
- $node->appendChild($xml->createCDATASection(self::bool2str($arr['@cdata'])));
- unset($arr['@cdata']); //remove the key from the array once done.
- //return from recursion, as a note with cdata cannot have child nodes.
- return $node;
- }
- }
-
- //create subnodes using recursion
- if(is_array($arr)){
- // recurse to get the node for that key
- foreach($arr as $key=>$value){
- if(!self::isValidTagName($key)) {
- throw new \Exception('[Array2XML] Illegal character in tag name. tag: '.$key.' in node: '.$node_name);
- }
- if(is_array($value) && is_numeric(key($value))) {
- // MORE THAN ONE NODE OF ITS KIND;
- // if the new array is numeric index, means it is array of nodes of the same kind
- // it should follow the parent key name
- foreach($value as $k=>$v){
- $node->appendChild(self::convert($key, $v));
- }
- } else {
- // ONLY ONE NODE OF ITS KIND
- $node->appendChild(self::convert($key, $value));
- }
- unset($arr[$key]); //remove the key from the array once done.
- }
- }
-
- // after we are done with all the keys in the array (if it is one)
- // we check if it has any text value, if yes, append it.
- if(!is_array($arr)) {
- $node->appendChild($xml->createTextNode(self::bool2str($arr)));
- }
-
- return $node;
- }
-
- /*
- * Get the root XML node, if there isn't one, create it.
- */
- private static function getXMLRoot(){
- if(empty(self::$xml)) {
- self::init();
- }
- return self::$xml;
- }
-
- /*
- * Get string representation of boolean value
- */
- private static function bool2str($v){
- //convert boolean to text value.
- $v = $v === true ? 'true' : $v;
- $v = $v === false ? 'false' : $v;
- return $v;
- }
-
- /*
- * Check if the tag name or attribute name contains illegal characters
- * Ref: http://www.w3.org/TR/xml/#sec-common-syn
- */
- private static function isValidTagName($tag){
- $pattern = '/^[a-z_]+[a-z0-9\:\-\.\_]*[^:]*$/i';
- return preg_match($pattern, $tag, $matches) && $matches[0] == $tag;
- }
-
- /**
- * Pumps all child elements of second SimpleXML object into first one.
- *
- * @param object $xml1 SimpleXML object
- * @param object $xml2 SimpleXML object
- * @return xml
- */
- public static function mergeXML (\SimpleXMLIterator &$xml1, \SimpleXMLIterator $xml2)
- {
- $output = array_merge_recursive(json_decode(json_encode($xml1), true), json_decode(json_encode($xml2), true));
- $output = self::createXML('comet-testers', $output);
- return $output->saveXML();
- }
-
- /**
- * array_merge_recursive does indeed merge arrays, but it converts values with duplicate
- * keys to arrays rather than overwriting the value in the first array with the duplicate
- * value in the second array, as array_merge does. I.e., with array_merge_recursive,
- * this happens (documented behavior):
- *
- * array_merge_recursive(array('key' => 'org value'), array('key' => 'new value'));
- * => array('key' => array('org value', 'new value'));
- *
- * array_merge_recursive_distinct does not change the datatypes of the values in the arrays.
- * Matching keys' values in the second array overwrite those in the first array, as is the
- * case with array_merge, i.e.:
- *
- * array_merge_recursive_distinct(array('key' => 'org value'), array('key' => 'new value'));
- * => array('key' => array('new value'));
- *
- * Parameters are passed by reference, though only for performance reasons. They're not
- * altered by this function.
- *
- * @param array $array1
- * @param array $array2
- * @return array
- * @author Daniel
- * @author Gabriel Sobrinho
- */
- private static function array_merge_recursive_distinct ( array &$array1, array &$array2 ) {
- $merged = $array1;
-
- foreach ( $array2 as $key => &$value ) {
- if ( is_array ( $value ) && isset ( $merged [$key] ) && is_array ( $merged [$key] ) ) {
- $merged [$key] = self::array_merge_recursive_distinct ( $merged [$key], $value );
- } else {
- $merged [$key] = $value;
- }
- }
-
- return $merged;
- }
-}
diff --git a/src/FIT/NetopeerBundle/Models/Data.php b/src/FIT/NetopeerBundle/Models/Data.php
deleted file mode 100755
index 9955fe22..00000000
--- a/src/FIT/NetopeerBundle/Models/Data.php
+++ /dev/null
@@ -1,1993 +0,0 @@
-
- * @author Tomas Cejka
- *
- * Copyright (C) 2012-2015 CESNET
- *
- * LICENSE TERMS
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name of the Company nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * ALTERNATIVELY, provided that this notice is retained in full, this
- * product may be distributed under the terms of the GNU General Public
- * License (GPL) version 2 or later, in which case the provisions
- * of the GPL apply INSTEAD OF those given above.
- *
- * This software is provided ``as is'', and any express or implied
- * warranties, including, but not limited to, the implied warranties of
- * merchantability and fitness for a particular purpose are disclaimed.
- * In no event shall the company or contributors be liable for any
- * direct, indirect, incidental, special, exemplary, or consequential
- * damages (including, but not limited to, procurement of substitute
- * goods or services; loss of use, data, or profits; or business
- * interruption) however caused and on any theory of liability, whether
- * in contract, strict liability, or tort (including negligence or
- * otherwise) arising in any way out of the use of this software, even
- * if advised of the possibility of such damage.
- */
-namespace FIT\NetopeerBundle\Models;
-
-use FIT\Bundle\ModuleDefaultBundle\Controller\ModuleController;
-use Symfony\Component\Validator\Constraints as Assert;
-use Symfony\Component\Routing\RouterInterface;
-
-use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Component\Finder\Finder;
-use Doctrine\ORM\EntityManager;
-
-use FIT\NetopeerBundle\Entity\ConnectionSession;
-
-/**
- * Data service, handles all communication between webGUI and mod_netconf.
- */
-class Data {
-
- /* Enumeration of Message type (taken from mod_netconf.c) */
- const REPLY_OK = 0;
- const REPLY_DATA = 1;
- const REPLY_ERROR = 2;
- const REPLY_INFO = 3;
- const MSG_CONNECT = 4;
- const MSG_DISCONNECT = 5;
- const MSG_GET = 6;
- const MSG_GETCONFIG = 7;
- const MSG_EDITCONFIG = 8;
- const MSG_COPYCONFIG = 9;
- const MSG_DELETECONFIG = 10;
- const MSG_LOCK = 11;
- const MSG_UNLOCK = 12;
- const MSG_KILL = 13;
- const MSG_INFO = 14;
- const MSG_GENERIC = 15;
- const MSG_GETSCHEMA = 16;
- const MSG_RELOADHELLO = 17;
- const MSG_NTF_GETHISTORY = 18;
- const MSG_VALIDATE = 19;
-
- /* subscription of notifications */
- const CPBLT_NOTIFICATIONS = "urn:ietf:params:netconf:capability:notification:1.0";
- /*
- when this capability is missing, we cannot execute RPCs before
- notif subscribe finishes :-/
- */
- const CPBLT_REALTIME_NOTIFICATIONS = "urn:ietf:params:netconf:capability:interleave:1.0";
- /* modifications of running config */
- const CPBLT_WRITABLERUNNING = "urn:ietf:params:netconf:capability:writable-running:1.0";
- /* candidate datastore */
- const CPBLT_CANDIDATE = "urn:ietf:params:netconf:capability:candidate:1.0";
- /* startup datastore */
- const CPBLT_STARTUP = "urn:ietf:params:netconf:capability:startup:1.0";
- const CPBLT_NETOPEER = "urn:cesnet:tmc:netopeer:1.0?module=netopeer-cfgnetopeer";
- const CPBLT_NETCONF_BASE10 = "urn:ietf:params:netconf:base:1.0";
- const CPBLT_NETCONF_BASE11 = "urn:ietf:params:netconf:base:1.1";
-
- //"urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?module=ietf-netconf-monitoring&revision=2010-10-04"
- //"urn:ietf:params:xml:ns:netconf:base:1.0?module=ietf-netconf&revision=2011-03-08"
-
-
-
- /**
- * @var ContainerInterface base bundle container
- */
- protected $container;
- /**
- * @var \Symfony\Bridge\Monolog\Logger instance of logging class
- */
- protected $logger;
- /**
- * @var array array of namespaces for module name
- */
- private $modelNamespaces;
- /**
- * @var array|null array with names of models for creating top menu
- */
- private $models;
- /**
- * @var array|null array of hash identifiers (array of connected devices).
- */
- private $moduleIdentifiers;
- /**
- * @var array array of handle* result
- *
- * no need to call for example more than once
- */
- private $handleResultsArr;
- /**
- * @var array array of submenu structure for every module
- */
- private $submenu;
-
- /**
- * Constructor with DependencyInjection params.
- *
- * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
- * @param \Symfony\Bridge\Monolog\Logger $logger logging class
- */
- public function __construct(ContainerInterface $container, $logger) {
- $this->container = $container;
- $this->logger = $logger;
- $this->models = null;
- $this->modelNamespaces = array();
- }
-
- /**
- * Parse $message formatted by Chunked Framing Mechanism (RFC6242)
- *
- * @param string $message input message text
- * @return string unwrapped message
- *
- * @throws \ErrorException when message is not formatted correctly
- */
- private function unwrapRFC6242($message) {
- $response = "";
- if ($message == "") {
- return $response;
- }
- $chunks = explode("\n#", $message);
- $numchunks = sizeof($chunks);
- $i = 0;
- if ($numchunks > 0) {
- do {
- if ($i == 0 && $chunks[$i++] != "") {
- /* something is wrong, message should start by '\n#'
- */
- $this->logger->warn("Wrong message format, it is not according to RFC6242 (starting with \\n#).", array("message" => var_export($message, true)));
- throw new \ErrorException("Wrong message format, it is not according to RFC6242 (starting with \\n#).");
- }
- if ($i >= $numchunks) {
- $this->logger->warn("Malformed message (RFC6242) - Bad amount of parts.", array("message" => var_export($message, true)));
- throw new \ErrorException("Malformed message (RFC6242) - Bad amount of parts."); }
- /* echo "chunk length
\n"; */
- $len = 0;
- sscanf($chunks[$i], "%i", $len);
-
- /* echo "chunk data
\n"; */
- $nl = strpos($chunks[$i], "\n");
- if ($nl === false) {
- $this->logger->warn("Malformed message (RFC6242) - There is no \\n after chunk-data size.", array("message" => var_export($message, true)));
- throw new \ErrorException("Malformed message (RFC6242) - There is no \\n after chunk-data size.");
- }
- $data = substr($chunks[$i], $nl + 1);
- $realsize = strlen($data);
- if ($realsize != $len) {
- $this->logger->warn("Chunk $i has the length $realsize instead of $len.", array("message" => var_export($message, true)));
- throw new \ErrorException("Chunk $i has the length $realsize instead of $len.");
- }
- $response .= $data;
- $i++;
- if ($chunks[$i][0] == '#') {
- /* ending part */
- break;
- }
- } while ($i<$numchunks);
- }
-
- return $response;
- }
-
- /**
- * Get hash for current connection
- *
- * @param int $key session key
- * @return string
- */
- private function getHashFromKey($key) {
- $conn = $this->getConnectionSessionForKey($key);
-
- if (isset($conn->hash)) {
- return $conn->hash;
- }
- //throw new \ErrorException("No identification key was found.");
- return "NOHASH";
- }
-
- /**
- * Find hash identifiers from DB for key
- *
- * @param int $key session key
- * @return array return array of identifiers on success, false on error
- */
- public function getModuleIdentifiersForCurrentDevice($key) {
- $conn = $this->getConnectionSessionForKey($key);
- if (!$conn) {
- return false;
- }
- $sessionStatus = json_decode($conn->sessionStatus);
- $capabilities = $sessionStatus->capabilities;
-
- $arr = array();
- if (is_array($capabilities) && count($capabilities)) {
- foreach ($capabilities as $connKey => $value) {
- $regex = "/(.*)\?module=(.*)&revision=([0-9|-]*)/";
- preg_match($regex, $value, $matches);
- if ($matches !== null && count($matches) == 4) {
- $arr[$matches[1]] = array(
- 'hash' => $this->getModelIdentificator($matches[2], $matches[3], $matches[1]),
- 'ns' => $matches[1],
- 'moduleName' => $matches[2],
- 'revision' => $matches[3],
- );
- }
- }
- $this->moduleIdentifiers = $arr;
- return $arr;
- }
-
- return false;
- }
-
- /**
- * Get names of root element for specified module identifiers
- *
- * @param $key
- * @param array $identifiers
- *
- * @return array
- */
- public function getRootNamesForModuleIdentifiers($key, array $identifiers) {
- $newArr = array();
- foreach ($identifiers as $ns => $ident) {
- $ident['rootElem'] = $this->getRootNameForNS($key, $ident['ns']);
- $newArr[$ns] = $ident;
- }
-
- return $newArr;
- }
-
- /**
- * Get name of root element for module NS
- *
- * @param $key Identifier of connection (connected device ID)
- * @param $ns
- *
- * @return string
- */
- public function getRootNameForNS($key, $ns) {
- $path = $this->getModelsDir().$this->getModulePathByNS($key, $ns);
- $file = $path . '/filter.txt';
- $rootElem = "";
- if ( file_exists($file) ) {
- $dom = new \DomDocument;
- $dom->load($file);
- $rootElem = $dom->documentElement->tagName;
- }
-
- return $rootElem;
- }
-
- /**
- * get path for module name, includes identifier
- *
- * @param int $key session key
- * @param string $moduleName name of element
- * @param string $ns namespace of module will be used instead of module name
- *
- * @return string relative path on success, false on error
- */
- private function getModulePathByRootModuleName($key, $moduleName, $ns = '') {
- if (!is_array($this->moduleIdentifiers) || !count($this->moduleIdentifiers)) {
- $this->getModuleIdentifiersForCurrentDevice($key);
- }
-
- $modelNamespaces = $this->getModelNamespaces($key);
- if (isset($modelNamespaces[$moduleName])) {
- $cnt = count($modelNamespaces[$moduleName]);
- if ($cnt == 1) {
- $namespace = $modelNamespaces[$moduleName];
- if (isset($this->moduleIdentifiers[$namespace])) {
- return $this->getModulePathByNS($key, $namespace);
- }
- }
- } elseif (isset($this->moduleIdentifiers[$ns])) {
- return $this->getModulePathByNS($key, $ns);
- }
- return false;
- }
-
- /**
- * get path for module namespace
- *
- * @param $key Identifier of connection (connected device ID)
- * @param $ns
- *
- * @return bool|string
- */
- public function getModulePathByNS($key, $ns) {
- if (!is_array($this->moduleIdentifiers) || !count($this->moduleIdentifiers)) {
- $this->getModuleIdentifiersForCurrentDevice($key);
- }
- if (isset($this->moduleIdentifiers[$ns])) {
- return $this->moduleIdentifiers[$ns]['hash'] .
- "/" . $this->moduleIdentifiers[$ns]['moduleName'] .
- "/" . $this->moduleIdentifiers[$ns]['revision'];
- }
- return false;
- }
-
- /**
- * Find instance of SessionConnection.class for key.
- *
- * @param int $key session key
- * @return bool|ConnectionSession
- */
- public function getConnectionSessionForKey($key) {
- $session = $this->container->get('request')->getSession();
- $sessionConnections = $session->get('session-connections');
- if (isset($sessionConnections[$key]) && $key !== '') {
- return unserialize($sessionConnections[$key]);
- }
- return false;
- }
-
- /**
- * get ModuleControllers instance for given module namespace and ID of connection
- *
- * @param string $module module name
- * @param string $namespace module namespace
- *
- * @return ModuleController|null
- */
- public function getModuleControllers($module, $namespace) {
- $em = $this->container->get('doctrine')->getManager();
- $repository = $em->getRepository("FITNetopeerBundle:ModuleController");
-
- return $repository->findOneBy(array(
- 'moduleName' => $module,
- 'moduleNamespace' => $namespace
- ));
- }
-
- /**
- * Get port of SessionConnection for key.
- *
- * @param int $key session key
- * @return string
- */
- public function getPortFromKey($key) {
- $session = $this->container->get('request')->getSession();
- $sessionConnections = $session->get('session-connections');
- if (isset($sessionConnections[$key]) && $key !== '') {
- $con = unserialize($sessionConnections[$key]);
- return $con->port;
- }
- return "";
- }
-
- /**
- * Get user of SessionConnection for key.
- *
- * @param int $key session key
- * @return string
- */
- public function getUserFromKey($key) {
- $session = $this->container->get('request')->getSession();
- $sessionConnections = $session->get('session-connections');
- if (isset($sessionConnections[$key]) && $key !== '') {
- $con = unserialize($sessionConnections[$key]);
- return $con->user;
- }
- return "";
- }
-
- /**
- * Get host of SessionConnection for key.
- *
- * @param int $key session key
- * @return string
- */
- public function getHostFromKey($key) {
- $session = $this->container->get('request')->getSession();
- $sessionConnections = $session->get('session-connections');
- if (isset($sessionConnections[$key]) && $key !== '') {
- $con = unserialize($sessionConnections[$key]);
- return $con->host;
- }
- return "";
- }
-
- /**
- * Check if capability for feature is available.
- *
- * @param int $key session key
- * @param string $feature name of feature/capability that is checked (constants Data::CPBLT_* can be used)
- * @return bool
- */
- protected function checkCapabilityForKey($key, $feature) {
- $con = $this->getConnectionSessionForKey($key);
- if ($con) {
- $cpblts = json_decode($con->sessionStatus);
- foreach ($cpblts->capabilities as $cpblt) {
- if (strpos($cpblt, $feature, 0) === 0) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Gets array of available capabilities for all features.
- *
- * @param int $key session key
- * @return array array of nc features
- */
- public function getCapabilitiesArrForKey($key) {
- $ncFeatures = Array();
- if ($this->checkCapabilityForKey($key, $this::CPBLT_NOTIFICATIONS) === true &&
- $this->checkCapabilityForKey($key, $this::CPBLT_REALTIME_NOTIFICATIONS) === true) {
- $ncFeatures["nc_feature_notification"] = true;
- }
- if ($this->checkCapabilityForKey($key, $this::CPBLT_STARTUP) === true) {
- $ncFeatures["nc_feature_startup"] = true;
- }
- if ($this->checkCapabilityForKey($key, $this::CPBLT_CANDIDATE) === true) {
- $ncFeatures["nc_feature_candidate"] = true;
- }
- if ($this->checkCapabilityForKey($key, $this::CPBLT_WRITABLERUNNING) === true) {
- $ncFeatures["nc_feature_writablerunning"] = true;
- }
-
- return $ncFeatures;
- }
-
- /**
- * Updates array of SessionConnections.
- *
- * @param int $key session key
- * @param string $targetDataStore target datastore identifier
- */
- private function updateConnLock($key, $targetDataStore) {
- $conn = $this->getConnectionSessionForKey($key);
-
- if ($conn == false) {
- return;
- }
-
- $conn->toggleLockOfDatastore($targetDataStore);
- $this->persistConnectionSessionForKey($key, $conn);
- }
-
- /**
- * serializes ConnectionSession object into session
- *
- * @param int $key session key
- * @param ConnectionSession $conn
- */
- public function persistConnectionSessionForKey($key, $conn) {
- $session = $this->container->get('request')->getSession();
- $sessionConnections = $session->get('session-connections');
- $sessionConnections[$key] = serialize($conn);
- $session->set('session-connections', $sessionConnections);
- }
-
- /**
- * Read response from socket
- *
- * @param resource &$sock socket descriptor
- * @return string trimmed string that was read
- */
- private function readnetconf2(&$sock) {
- $response = "";
- do {
- $tmp = "";
- $tmp = fread($sock, 4096);
- if ($tmp != "") {
- $response .= $tmp;
- }
- if (strlen($tmp) < 4096) {
- break;
- }
- } while ($tmp != "");
- $status = stream_get_meta_data($sock);
- if (!$response && $status["timed_out"] == true) {
- $this->container->get('request')->getSession()->getFlashBag()->add('error', "Reached timeout for reading response.");
- }
- /* "unchunk" frames (RFC6242) */
- try {
- $response = $this->unwrapRFC6242($response);
- } catch (\ErrorException $e) {
- $this->container->get('request')->getSession()->getFlashBag()->add('error', "Could not read NetConf. Error: ".$e->getMessage());
- return 1;
- }
-
- return trim($response);
- }
-
- /**
- * Read response from socket
- *
- * @param resource &$sock socket descriptor
- * @return string trimmed string that was read
- */
- private function readnetconf(&$sock) {
- $response = "";
- $tmp = "";
- $tmp = fread($sock, 1024);
- if ($tmp === false) {
- $this->container->get('request')->getSession()->getFlashBag()->add('error', "Reading failure.");
- }
-
- $response = $tmp;
- // message is wrapped in "\n#strlen($m)\n$m\n##\n"
- // get size:
- $size = 0;
- $lines = explode("\n", $tmp);
- if (count($lines) >= 2) {
- $size = strlen($lines[0]) + 1 + strlen($lines[1]) + 1;
- $size += intval(substr($lines[1], 1)) + 5;
- }
-
- while (strlen($response) < $size) {
- $tmp = "";
- $tmp = fread($sock, $size - strlen($response));
- if ($tmp === false) {
- $this->container->get('request')->getSession()->getFlashBag()->add('error', "Reading failure.");
- break;
- }
- $response .= $tmp;
- //echo strlen($response) ."/". $size ."\n";
- }
- $status = stream_get_meta_data($sock);
- if (!$response && $status["timed_out"] == true) {
- $this->container->get('request')->getSession()->getFlashBag()->add('error', "Reached timeout for reading response.");
- //echo "Reached timeout for reading response.";
- }
- /* "unchunk" frames (RFC6242) */
- try {
- $response = $this->unwrapRFC6242($response);
- } catch (\ErrorException $e) {
- $this->container->get('request')->getSession()->getFlashBag()->add('error', "Could not read NetConf. Error: ".$e->getMessage());
- //echo "unwrap exception";
- return 1;
- }
- //echo "readnetconf time consumed: ". (microtime(true) - $start);
-
- return trim($response);
- }
-
- /**
- * Sets error message based on JSON ERROR CODE.
- *
- * @return array errorCode and message for this errorCode.
- */
- private function getJsonError() {
- $res = 0;
- switch ($errorCode = json_last_error()) {
- case JSON_ERROR_NONE:
- $res = 'No errors';
- break;
- case JSON_ERROR_DEPTH:
- $res = 'Maximum stack depth exceeded';
- break;
- case JSON_ERROR_STATE_MISMATCH:
- $res = 'Underflow or the modes mismatch';
- break;
- case JSON_ERROR_CTRL_CHAR:
- $res = 'Unexpected control character found';
- break;
- case JSON_ERROR_SYNTAX:
- $res = 'Syntax error, malformed JSON';
- break;
- case JSON_ERROR_UTF8:
- $res = 'Malformed UTF-8 characters, possibly incorrectly encoded';
- break;
- default:
- $res = 'Unknown error';
- break;
- }
- return array('errorCode' => $errorCode, 'message' => $res);
- }
-
- /**
- * Handles connection to the socket
- *
- * @param resource &$sock socket descriptor
- * @param array &$params connection params for mod_netconf
- * @param mixed &$result result of searching of new connection in all connections
- * @return int 0 on success
- */
- private function handle_connect(&$sock, &$params, &$result = null) {
- $session = $this->container->get('request')->getSession();
-
- $connect = json_encode(array(
- "type" => self::MSG_CONNECT,
- "host" => $params["host"],
- "port" => $params["port"],
- "user" => $params["user"],
- "pass" => $params["pass"],
- "capabilities" => $params["capabilities"],
- ));
- $this->write2socket($sock, $connect);
- $response = $this->readnetconf($sock);
- $decoded = json_decode($response, true);
-
- if ($decoded && ($decoded["type"] == self::REPLY_OK)) {
- $param = array( "session" => $decoded["session"] );
- $status = $this->handle_info($sock, $param);
- $newconnection = new ConnectionSession($decoded["session"], $params["host"], $params["port"], $params["user"]);
- $newconnection->sessionStatus = json_encode($status);
- $newconnection = serialize($newconnection);
-
- if ( !$sessionConnections = $session->get("session-connections") ) {
- $session->set("session-connections", array($newconnection));
- } else {
- $sessionConnections[] = $newconnection;
- $session->set("session-connections", $sessionConnections);
- }
-
- $session->getFlashBag()->add('success', "Successfully connected.");
- $result = array_search($newconnection, $session->get("session-connections"));
-
- return 0;
- } else {
- $this->logger->addError("Could not connect.", array("error" => (isset($decoded["errors"])?" Error: ".var_export($decoded["errors"], true) : var_export($this->getJsonError(), true))));
- if (isset($decoded['errors'])) {
- foreach ($decoded['errors'] as $error) {
- $session->getFlashBag()->add('error', $error);
- }
- } else {
- $session->getFlashBag()->add('error', "Could not connect. Unknown error.");
- }
- return 1;
- }
- }
-
- /**
- * handle get action
- *
- * @param resource &$sock socket descriptor
- * @param array &$params array of values for mod_netconf (type, params...)
- * @return mixed decoded data on success
- */
- public function handle_get(&$sock, &$params) {
- if ( $this->checkLoggedKeys() != 0) {
- return 1;
- }
-
- $sessionKey = $this->getHashFromKey($params['key']);
-
- $get_params = array(
- "type" => self::MSG_GET,
- "session" => $sessionKey,
- "source" => "running",
- );
- if ($params['filter'] !== "") {
- $get_params["filter"] = $params['filter'];
- }
-
- $decoded = $this->execute_operation($sock, $get_params);
-
- return $this->checkDecodedData($decoded);
- }
-
- /**
- * handle get config action
- *
- * @param resource &$sock socket descriptor
- * @param array &$params array of values for mod_netconf (type, params...)
- * @return mixed decoded data on success, 1 on error
- */
- public function handle_getconfig(&$sock, &$params) {
- if ( $this->checkLoggedKeys() != 0) {
- return 1;
- }
- $sessionKey = $this->getHashFromKey($params['key']);
-
- $getconfigparams = array(
- "type" => self::MSG_GETCONFIG,
- "session" => $sessionKey,
- "source" => $params['source'],
- );
- if(isset($params['filter']) && $params['filter'] !== "") {
- $getconfigparams["filter"] = $params['filter'];
- }
- $decoded = $this->execute_operation($sock, $getconfigparams);
- return $this->checkDecodedData($decoded);
- }
-
- /**
- * handle edit config action
- *
- * @param resource &$sock socket descriptor
- * @param array &$params array of values for mod_netconf (type, params...)
- * @return mixed decoded data on success, 1 on error
- */
- private function handle_editconfig(&$sock, &$params) {
- if ( $this->checkLoggedKeys() != 0) {
- return 1;
- }
- $sessionKey = $this->getHashFromKey($params['key']);
- /* syntax highlighting problem if XML def. is in one string */
- $replaceWhatArr = array(
- "",
- "<".XMLoperations::$customRootElement.">",
- "".XMLoperations::$customRootElement.">"
- );
- $replaceWithArr = array(
- "",
- "",
- ""
- );
- $params['config'] = str_replace($replaceWhatArr, $replaceWithArr, $params['config']);
-
- /* edit-config to store new values */
- $editparams = array(
- "type" => self::MSG_EDITCONFIG,
- "session" => $sessionKey,
- "target" => $params['target'],
- );
- if (isset($params['source']) && ($params['source'] === "url")) {
- /* required 'uri-source' when 'source' is 'url' */
- $editparams['source'] = 'url';
- $editparams['uri-source'] = $params['uri-source'];
- } else {
- /* source can be set to "config" or "url" */
- $editparams['source'] = 'config';
- $editparams['config'] = $params['config'];
- }
- if (isset($params['default-operation']) && ($params['default-operation'] !== "")) {
- $editparams['default-operation'] = $params['default-operation'];
- }
- if (isset($params['type']) && ($params['type'] !== "")) {
- $editparams['type'] = $params['type'];
- }
- if (isset($params['test-option']) && ($params['test-option'] !== "")) {
- $editparams['test-option'] = $params['test-option'];
- }
- $decoded = $this->execute_operation($sock, $editparams);
- return $this->checkDecodedData($decoded);
- }
-
- /**
- * handle copy config action
- *
- * @param resource &$sock socket descriptor
- * @param array &$params array of values for mod_netconf (type, params...)
- * @return mixed decoded data on success, 1 on error
- */
- private function handle_copyconfig(&$sock, &$params) {
- if ( $this->checkLoggedKeys() != 0) {
- return 1;
- }
- $sessionKey = $this->getHashFromKey($params['key']);
- /* copy-config parameters */
- $newparams = array(
- "type" => self::MSG_COPYCONFIG,
- "session" => $sessionKey,
- "source" => $params['source'],
- "target" => $params['target'],
- );
- if ($params['source'] === "url") {
- $newparams['uri-source'] = $params['uri-source'];
- }
- if ($params['target'] === "url") {
- $newparams['uri-target'] = $params['uri-target'];
- }
- $decoded = $this->execute_operation($sock, $newparams);
- return $this->checkDecodedData($decoded);
- }
-
- /**
- * handle get config action
- *
- * @param resource &$sock socket descriptor
- * @param array &$params array of values for mod_netconf (type, params...)
- * @return int 0 on success, 1 on error
- */
- private function handle_disconnect(&$sock, &$params) {
- if ($this->checkLoggedKeys() != 0) {
- return 1;
- }
- $session = $this->container->get('request')->getSession();
- $sessionConnections = $session->get('session-connections');
- $requestKey = $params['key'];
- $sessionKey = $this->getHashFromKey($params['key']);
-
- $decoded = $this->execute_operation($sock, array(
- "type" => self::MSG_DISCONNECT,
- "session" => $sessionKey
- ));
-
- if ($decoded["type"] === self::REPLY_OK) {
- $session->getFlashBag()->add('success', "Successfully disconnected.");
- } else {
- $this->logger->addError("Could not disconnecd.", array("error" => var_export($decoded, true)));
- $session->getFlashBag()->add('error', "Could not disconnect from server. ");
- }
-
- unset( $sessionConnections[ $requestKey] );
- $session->set("session-connections", $sessionConnections);
- }
-
- /**
- * handle lock action
- *
- * @param resource &$sock socket descriptor
- * @param array &$params array of values for mod_netconf (type, params...)
- * @return int 0 on success, 1 on error
- */
- private function handle_lock(&$sock, &$params) {
-
- if ($this->checkLoggedKeys() != 0) {
- return 1;
- }
- $session = $this->container->get('request')->getSession();
- $sessionKey = $this->getHashFromKey($params['key']);
-
- $decoded = $this->execute_operation($sock, array(
- "type" => self::MSG_LOCK,
- "target" => $params['target'],
- "session" => $sessionKey
- ));
-
- if ($decoded["type"] === self::REPLY_OK) {
- $session->getFlashBag()->add('success', "Successfully locked.");
- $this->updateConnLock($params['key'], $params['target']);
- } else {
- $this->logger->addError("Could not lock.", array("error" => var_export($decoded, true)));
- $session->getFlashBag()->add('error', "Could not lock datastore. ");
- }
- }
-
- /**
- * handle unlock action
- *
- * @param resource &$sock socket descriptor
- * @param array &$params array of values for mod_netconf (type, params...)
- * @return int 0 on success, 1 on error
- */
- private function handle_unlock(&$sock, &$params) {
- if ($this->checkLoggedKeys() != 0) {
- return 1;
- }
- $session = $this->container->get('request')->getSession();
- $sessionKey = $this->getHashFromKey($params['key']);
-
- $decoded = $this->execute_operation($sock, array(
- "type" => self::MSG_UNLOCK,
- "target" => $params['target'],
- "session" => $sessionKey
- ));
-
- if ($decoded["type"] === self::REPLY_OK) {
- $session->getFlashBag()->add('success', "Successfully unlocked.");
- $this->updateConnLock($params['key'], $params['target']);
- } else {
- $this->logger->addError("Could not unlock.", array("error" => var_export($decoded, true)));
- $session->getFlashBag()->add('error', "Could not unlock datastore. ");
- }
- }
-
- /**
- * handle User RPC method
- *
- * @param resource &$sock socket descriptor
- * @param array &$params must contain "identifier" of schema, can contain "version" and "format" of schema
- * @param mixed &$result decoded data from response
- * @return int 0 on success, 1 on error
- */
- private function handle_userrpc(&$sock, &$params, &$result) {
-
- if ($this->checkLoggedKeys() != 0) {
- return 1;
- }
- $session = $this->container->get('request')->getSession();
- $sessionKey = $this->getHashFromKey($params['key']);
-
- $decoded = $this->execute_operation($sock, array(
- "type" => self::MSG_GENERIC,
- "content" => $params['content'],
- "session" => $sessionKey
- ));
-
- if ($decoded["type"] === self::REPLY_OK) {
- $session->getFlashBag()->add('success', "Successful call of method.");
- } else if ($decoded["type"] === self::REPLY_DATA) {
- $result = $decoded["data"];
- return 0;
- } else {
- $this->logger->addError("User RPC call.", array("error" => var_export($decoded, true)));
- $session->getFlashBag()->add('error', "RPC error: ".
- ((isset($decoded["errors"]) && sizeof($decoded['errors'])) ? $decoded["errors"][0] : ""));
- return 1;
- }
- }
-
- /**
- * handle reload info action
- *
- * Result is the same as from handle_info()
- * @param resource &$sock socket descriptor
- * @param array &$params array of values for mod_netconf (type, params...)
- * @return int 0 on success, 1 on error
- */
- private function handle_reloadhello(&$sock, &$params) {
- $session = $this->container->get('request')->getSession();
-
- if (isset($params["session"]) && ($params["session"] !== "")) {
- $sessionKey = $params['session'];
- } else {
- if ($this->checkLoggedKeys() != 0) {
- return 1;
- }
- $sessionKey = $this->getHashFromKey($params['key']);
- }
-
- $decoded = $this->execute_operation($sock, array(
- "type" => self::MSG_RELOADHELLO,
- "session" => $sessionKey
- ));
-
- if (!$decoded) {
- /* error occurred, unexpected response */
- $this->logger->addError("Could get reload hello.", array("error" => var_export($decoded, true)));
- $session->getFlashBag()->add('error', "Could not reload device informations.");
- return 1;
- }
-
- return $decoded;
- }
-
- /**
- * handle getting notifications history
- *
- * @param resource &$sock socket descriptor
- * @param array &$params array of values for mod_netconf (type, params...)
- * @return int 0 on success, 1 on error
- */
- private function handle_ntf_gethistory(&$sock, &$params) {
- if (isset($params["session"]) && ($params["session"] !== "")) {
- $sessionKey = $params['session'];
- } else {
- $session = $this->container->get('request')->getSession();
- $sessionKey = $this->getHashFromKey($params['key']);
- }
-
- $decoded = $this->execute_operation($sock, array(
- "type" => self::MSG_NTF_GETHISTORY,
- "session" => $sessionKey,
- "from" => $params['from'],
- "to" => $params['to']
- ));
-
- if (!$decoded) {
- /* error occurred, unexpected response */
- $this->logger->addError("Could get notifications history.", array("error" => var_export($decoded, true)));
- $session->getFlashBag()->add('error', "Could not get notifications history.");
- return 1;
- }
-
- return $decoded;
- }
-
- /**
- * handle info action
- *
- * @param resource &$sock socket descriptor
- * @param array &$params array of values for mod_netconf (type, params...)
- * @return int 0 on success, 1 on error
- */
- private function handle_info(&$sock, &$params) {
- if (isset($params["session"]) && ($params["session"] !== "")) {
- $sessionKey = $params['session'];
- } else {
- if ($this->checkLoggedKeys() != 0) {
- return 1;
- }
- $session = $this->container->get('request')->getSession();
- $sessionKey = $this->getHashFromKey($params['key']);
- }
-
- $decoded = $this->execute_operation($sock, array(
- "type" => self::MSG_INFO,
- "session" => $sessionKey
- ));
-
- if (!$decoded) {
- /* error occurred, unexpected response */
- $this->logger->addError("Could get session info.", array("error" => var_export($decoded, true)));
- $session->getFlashBag()->add('error', "Could not get session info.");
- }
-
- return $decoded;
- }
-
- /**
- * handle getschema action
- *
- * @param resource &$sock socket descriptor
- * @param array &$params must contain "identifier" of schema, can contain "version" and "format" of schema
- * @param mixed &$result decoded data from response
- * @return int 0 on success, 1 on error
- */
- private function handle_getschema(&$sock, &$params, &$result) {
- if ($this->checkLoggedKeys() != 0) {
- return 1;
- }
- $session = $this->container->get('request')->getSession();
- $sessionKey = $this->getHashFromKey($params['key']);
- /* TODO check if: "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?module=ietf-netconf-monitoring"
- is in capabilities */
-
- $arguments = array(
- "type" => self::MSG_GETSCHEMA,
- "session" => $sessionKey,
- "identifier" => $params["identifier"], /* TODO escape string $params["identifier"]? */
- );
-
- if (isset($params["format"])) $arguments["format"] = $params["format"];
- if (isset($params["version"])) $arguments["version"] = $params["version"];
-
- $decoded = $this->execute_operation($sock, $arguments);
-
-
- if ($decoded["type"] === self::REPLY_DATA) {
- $result = $decoded["data"];
- return 0;
- } else {
- $this->logger->addError("Get-schema failed.", array("error" => var_export($decoded, true)));
- $session->getFlashBag()->add('error', "Get-schema failed."
- . ((isset($decoded["errors"]) && sizeof($decoded['errors'])) ? " Reason: ".$decoded["errors"][0] : "")
- . (isset($decoded["bad-element"])?" (". $decoded["bad-element"] .")":"")
- );
- return 1;
- }
- }
-
- /**
- * handle kill-session action
- *
- * @param resource &$sock socket descriptor
- * @param array &$params must contain "session-id"
- * @param mixed &$result decoded data from response
- * @return int 0 on success, 1 on error
- */
- private function handle_killsession(&$sock, &$params, &$result) {
- if ($this->checkLoggedKeys() != 0) {
- return 1;
- }
- $session = $this->container->get('request')->getSession();
- $sessionKey = $this->getHashFromKey($params['key']);
-
- $arguments = array(
- "type" => self::MSG_KILL,
- "session" => $sessionKey,
- "session-id" => $params["session-id"],
- );
-
- $decoded = $this->execute_operation($sock, $arguments);
-
- if ($decoded["type"] === self::REPLY_OK) {
- $session->getFlashBag()->add('success', "Session successfully killed.");
- $this->updateConnLock($params['key'], $params['target']);
- } else {
- $this->logger->addError("Could not kill session.", array("error" => var_export($decoded, true)));
- $session->getFlashBag()->add('error', "Could not kill session.");
- }
- }
-
- /**
- * validates datastore on server
- *
- * @param $sock
- * @param $params
- *
- * @return int|mixed
- */
- public function handle_validate(&$sock, &$params) {
- if ( $this->checkLoggedKeys() != 0) {
- return 1;
- }
-
- $sessionKey = $this->getHashFromKey($params['key']);
-
- $get_params = array(
- "type" => self::MSG_VALIDATE,
- "session" => $sessionKey,
- "target" => $params['target'],
- );
- if (isset($params['url']) && ($params['url'] != NULL) && ($params['target'] == 'url')) {
- $get_params["url"] = $params['url'];
- }
- if ($params['filter'] !== "") {
- $get_params["filter"] = $params['filter'];
- }
-
- $decoded = $this->execute_operation($sock, $get_params);
- return $this->checkDecodedData($decoded);
- }
-
- /**
- * checks, if logged keys are valid
- *
- * @return int 0 on success, 1 on error
- */
- public function checkLoggedKeys() {
- $session = $this->container->get('request')->getSession();
- if ( !count($session->get("session-connections")) ) {
- $session->getFlashBag()->add('error', "Not logged in.");
- return 1;
- }
- $req = $this->container->get('request');
-
- if ( !in_array( $req->get('key'), array_keys($session->get("session-connections")) ) ) {
- $session->getFlashBag()->add('error', "You are not allow to see this connection. Bad Index of key.");
- return 1;
- }
- return 0;
- }
-
- /**
- * checks decoded data, if there an error occurs
- *
- * @param mixed &$decoded decoded data
- * @return mixed decoded data on success, 1 on error
- */
- private function checkDecodedData(&$decoded) {
- $session = $this->container->get('request')->getSession();
- $status = $this->getJsonError();
-
- if ( $status['errorCode'] ) {
- $this->logger->warn('Checking decoded data:', array('error' => $status['message']));
- $session->getFlashBag()->add('error', $status['message']);
- return 1;
- //} elseif ( $decoded == null ) {
- // $this->logger->addError('Could not decode response from socket', array('error' => "Empty response."));
- // $session->getFlashBag()->add('error', "Could not decode response from socket. Error: Empty response.");
- // return 1;
- } elseif (($decoded['type'] != self::REPLY_OK) && ($decoded['type'] != self::REPLY_DATA)) {
- $this->logger->warn('Error: ', array('errors' => $decoded['errors']));
- if (sizeof($decoded['errors'])) {
- foreach ($decoded['errors'] as $error) {
- $session->getFlashBag()->add('error', $error);
- }
- }
- // throw new \ErrorException($decoded['error-message']);
- return 1;
- }
- return isset($decoded["data"]) ? $decoded["data"] : -1;
- }
-
- /**
- * Wrap message for Chunked Framing Mechanism (RFC6242) and write it into the socket.
- *
- * @param resource &$sock socket descriptor
- * @param string $message message text
- */
- private function write2socket(&$sock, $message) {
- $final_message = sprintf("\n#%d\n%s\n##\n", strlen($message), $message);
- fwrite($sock, $final_message);
- }
-
- /**
- * executes operation - sends message into the socket
- *
- * @param resource &$sock socket descriptor
- * @param array $params array of values for mod_netconf (type, params...)
- * @return array response from mod_netconf
- */
- private function execute_operation(&$sock, $params) {
- $operation = json_encode($params);
- $this->write2socket($sock, $operation);
- $response = $this->readnetconf($sock);
- return json_decode($response, true);
- }
-
- /**
- * Get path to directory of data models.
- *
- * @return string path to models folder
- */
- public function getModelsDir() {
- return __DIR__ . '/../Data/models/';
- }
-
- /**
- * gets model dir name for module
- * @param string $moduleName name of module
- * @return string dir name on success, false on error
- */
- public function getModelDirForName($moduleName) {
- $key = $this->container->get('request')->get('key');
- $res = $this->getModulePathByRootModuleName($key, $moduleName);
- if ($res) {
- return $res;
- }
- return false;
- }
-
- /**
- * checks if model dir for module exists
- * @param string $moduleName name of module
- * @return bool
- */
- public function existsModelDirForName($moduleName) {
- $key = $this->container->get('request')->get('key');
- $res = $this->getModulePathByRootModuleName($key, $moduleName);
- if ($res) {
- return true;
- }
- return false;
- }
-
- /**
- * get path to models in file system
- * @param string $moduleName name of the module
- * @return string path to wrapped model file
- */
- public function getPathToModels($moduleName = "") {
- $path = $this->getModelsDir();
-
- if ($moduleName == "") {
- $moduleName = $this->container->get('request')->get('module');
- }
- // add module directory if is set in route
- if ($moduleName != "") {
- $modelDir = $this->getModelDirForName($moduleName);
- if ($modelDir) {
- $path .= $modelDir . '/';
- }
- }
- // add subsection directory if is set in route and wrapped file in subsection directory exists
- if ( $this->container->get('request')->get('subsection') != null
- && file_exists($path . $this->container->get('request')->get('subsection').'/wrapped.wyin')) {
- $path .= $this->container->get('request')->get('subsection').'/';
- }
- return $path;
- }
-
- /**
- * handles all actions, which are allowed on socket
- * this is the only one entry point for calling methods such a , , ...
- *
- * @param string $command kind of action (command)
- * @param array $params parameters for mod_netconf
- * @param bool $merge should be action handle with merge with model
- * @param mixed $result
- * @return int 0 on success, 1 on error
- */
- public function handle($command, $params = array(), $merge = true, &$result = null) {
- $errno = 0;
- $errstr = "";
-
- $logParams = $params;
- if ( $command == "connect" ) {
- // we won't log password
- unset($logParams['pass']);
- }
- $this->logger->info('Handle: '.$command.' with params', array('params' => $logParams));
-
- /**
- * check, if current command had not been called in the past. If yes, we will
- * return previous response (and not ask again for response from server).
- */
- $hashedParams = sha1(json_encode($params));
-// if (isset($this->handleResultsArr[$command])) {
-//
-// if ($merge && isset($this->handleResultsArr[$command][$hashedParams]['merged'])) {
-// return $this->handleResultsArr[$command][$hashedParams]['merged'];
-// } elseif (isset($this->handleResultsArr[$command][$hashedParams]['unmerged'])) {
-// return $this->handleResultsArr[$command][$hashedParams]['unmerged'];
-// }
-// }
-
- $socket_path = '/var/run/mod_netconf.sock';
- if (!file_exists($socket_path)) {
- $this->logger->addError('Backend is not running or socket file does not exist.', array($socket_path));
- $this->container->get('request')->getSession()->getFlashBag()->add('error', "Backend is not running or socket file does not exist: ".$socket_path);
- return 1;
- }
- if (!is_readable($socket_path)) {
- $this->logger->addError('Socket is not readable.', array($socket_path));
- $this->container->get('request')->getSession()->getFlashBag()->add('error', "Socket is not readable: ".$socket_path);
- return 1;
- }
- if (!is_writable($socket_path)) {
- $this->logger->addError('Socket is not writable.', array($socket_path));
- $this->container->get('request')->getSession()->getFlashBag()->add('error', "Socket is not writable: ".$socket_path);
- return 1;
- }
- $socket_path = 'unix://'.$socket_path;
- try {
- $sock = fsockopen($socket_path, NULL, $errno, $errstr);
- } catch (\ErrorException $e) {
- $this->logger->addError('Could not connect to socket.', array($errstr));
- $this->container->get('request')->getSession()->getFlashBag()->add('error', "Could not connect to socket. Error: $errstr");
- return 1;
- }
-
- if ($errno != 0) {
- $this->logger->addError('Could not connect to socket.', array($errstr));
- $this->container->get('request')->getSession()->getFlashBag()->add('error', "Could not connect to socket. Error: $errstr");
- return 1;
- }
- //stream_set_timeout($sock, 5, 500);
- stream_set_blocking($sock, 1);
-
- switch ($command) {
- case "connect":
- $res = $this->handle_connect($sock, $params, $result);
- break;
- case "get":
- $res = $this->handle_get($sock, $params);
- break;
- case "getconfig":
- $res = $this->handle_getconfig($sock, $params);
- break;
- case "editconfig":
- $this->logger->info("Handle editConfig: ", array('configToSend' => $params['config']));
- $this->container->get('XMLoperations')->validateXml($params['config']);
- $res = $this->handle_editconfig($sock, $params);
- break;
- case "copyconfig":
- $res = $this->handle_copyconfig($sock, $params);
- break;
- case "disconnect":
- $res = $this->handle_disconnect($sock, $params);
- break;
- case "lock":
- $res = $this->handle_lock($sock, $params);
- break;
- case "unlock":
- $res = $this->handle_unlock($sock, $params);
- break;
- case "reloadhello":
- $res = $this->handle_reloadhello($sock, $params);
- break;
- case "notificationsHistory":
- // JSON encoded data OR 1 on error, so we can return it now
- return $this->handle_ntf_gethistory($sock, $params);
- break;
- case "info":
- $res = $this->handle_info($sock, $params);
- break;
- case "getschema":
- $res = $this->handle_getschema($sock, $params, $result);
- break;
- case "killsession":
- $res = $this->handle_killsession($sock, $params, $result);
- break;
- case "validate":
- $res = $this->handle_validate($sock, $params, $result);
- break;
- case "userrpc":
- $res = $this->handle_userrpc($sock, $params, $result);
- break;
- case "backup":
- $params["source"] = "startup";
- $res_startup = "".$this->handle_getconfig($sock, $params)."";
- $params["source"] = "running";
- $res_running = "".$this->handle_getconfig($sock, $params)."";
- $params["source"] = "candidate";
- $res_candidate = "".$this->handle_getconfig($sock, $params)."";
- $res = "".$res_startup.$res_running.$res_candidate."";
- return $res;
- default:
- $this->container->get('request')->getSession()->getFlashBag()->add('info', printf("Command not implemented yet. (%s)", $command));
- return 1;
- }
-
- fclose($sock);
- $this->logger->info("Handle result: ".$command, array('response' => $res));
-
- if ($command === "info") {
- $this->handleResultsArr['info'] = $res;
- }
-
- if ( isset($res) && $res !== 1 && $res !== -1) {
- if (!$this->container->get('XMLoperations')->isResponseValidXML($res)) {
- $this->container->get('request')->getSession()->getFlashBag()->add( 'error', "Requested XML from server is not valid.");
- return 0;
- }
-
- if ($merge) {
- $res = $this->container->get('XMLoperations')->mergeXMLWithModel($res);
- if ($res !== -1) {
- $this->handleResultsArr[$command][$hashedParams]['merged'] = $res;
- } else {
- return $res;
- }
- } else {
- $this->handleResultsArr[$command][$hashedParams]['unmerged'] = $res;
- }
-
- return $res;
- } else if ($res !== -1) {
- return 1;
- }
- return 0;
- }
-
-
- /**
- * Prepares top menu - gets items from server response
- *
- * @param int $key session key of current connection
- * @param string $path
- */
- public function buildMenuStructure($key, $path = "") {
-
- // we will build menu structure only if we have not build it before
- if ( !$this->getModels($key) || !$this->getModelNamespaces($key) ) {
- $finder = new Finder();
-
- $params = array(
- 'key' => $key,
- 'source' => 'running',
- 'filter' => "",
- );
-
- $allowedModels = array();
- $allowedSubmenu = array();
- $namespaces = array();
-
- try {
- // load GET XML from server
- if ( ($xml = $this->handle('get', $params, false)) != 1 ) {
- $xml = simplexml_load_string($xml, 'SimpleXMLIterator');
-
- $xmlNameSpaces = $xml->getNamespaces();
-
- if ( isset($xmlNameSpaces[""]) ) {
- $xml->registerXPathNamespace("xmlns", $xmlNameSpaces[""]);
- $nodes = $xml->xpath('/xmlns:*');
- } else {
- $nodes = $xml->xpath('/*');
- }
-
- // get first level nodes (so without root) as items for top menu
- foreach ($nodes as $node) {
- foreach ($node as $nodeKey => $submenu) {
- $ns = $submenu->getNameSpaces();
- $i = 0;
- if (isset($namespaces[$nodeKey])) {
- $i = 1;
- while(isset($namespaces[$nodeKey.$i])) {
- $i++;
- }
- $namespaces[$nodeKey.$i] = $ns[""];
- } else {
- $namespaces[$nodeKey] = $ns[""];
- }
-
- if (!in_array(array("name" => $nodeKey, 'index' => $i), $allowedModels) ) {
- $allowedModels[] = array("name" => $nodeKey, 'index' => $i);
- }
-
- foreach ($submenu as $subKey => $tmp) {
- if ( !in_array(array("name" => $subKey, 'index' => 0), $allowedSubmenu) ) {
- $allowedSubmenu[] = array("name" => $subKey, 'index' => 0);
- }
- }
- }
- }
- }
- } catch (\ErrorException $e) {
- $this->logger->addError("Could not build MenuStructure", array('key' => $key, 'path' => $path, 'error' => $e->getMessage()));
- // nothing
- }
- $this->setModelNamespaces($key, $namespaces);
-
-
- // we will check, if nodes from GET are same as models structure
- // if not, they won't be displayed
- $folders = array();
- sort($allowedModels);
- foreach ($allowedModels as $module) {
- $moduleWithIndex = $module['name'];
- if ($module['index'] !== 0) {
- $moduleWithIndex .= $module['index'];
- }
- if ($this->existsModelDirForName($moduleWithIndex)) {
- $folders[$moduleWithIndex] = array(
- 'path' => "module",
- "params" => array(
- 'key' => $key,
- 'module' => $moduleWithIndex,
- ),
- "title" => "detail of ".$this->getSectionName($module['name']),
- "name" => $this->getSectionName($module['name']),
- "children" => $this->buildSubmenu($key, $module, $allowedSubmenu),
- "namespace" => $namespaces[$moduleWithIndex],
- );
- }
- }
- $this->setModels($key, $folders);
- }
- }
-
- /**
- * prepares left submenu - modules of current top menu item
- *
- * @param int $key session key of current connection
- * @param array $module array with indexes: name and index
- * @param $allowedSubmenu
- * @param string $path
- * @return array
- */
- private function buildSubmenu($key, $module, $allowedSubmenu, $path = "") {
- $finder = new Finder();
-
- $moduleWithIndex = $module['name'];
- if ($module['index'] !== 0) {
- $moduleWithIndex .= $module['index'];
- }
-
- // we will check, if nodes from GET are same as models structure
- // if not, they won't be displayed
- $dir = $this->getPathToModels($moduleWithIndex);
- if ( !file_exists($dir) ) {
- $folders = array();
- } else {
- $iterator = $finder
- ->directories()
- ->sortByName()
- ->depth(0)
- ->in($dir);
-
- $folders = array();
- foreach ($iterator as $folder) {
- $subsection = $folder->getRelativePathname();
- if ( in_array(array("name" => $subsection, "index" => 0), $allowedSubmenu) ) {
- $folders[] = array(
- 'path' => "subsection",
- "params" => array(
- 'key' => $key,
- 'module' => $moduleWithIndex,
- 'subsection' => $subsection,
- ),
- "title" => "detail of ".$this->getSubsectionName($subsection),
- "name" => $this->getSubsectionName($subsection),
- // "children" => $this->getSubmenu($key, $completePath),
- );
- }
- }
- }
- return $folders;
- }
-
- /**
- * loading file with filter specification for current module or subsection
- *
- * @param string $module module name
- * @param string $subsection subsection name
- * @return array array with config and state filter
- */
- public function loadFilters(&$module, &$subsection) {
- // if file filter.txt exists in models, we will use it
- $filterState = $filterConfig = "";
-
- $namespaces = $this->getModelNamespaces($this->container->get('request')->get('key'));
- if (isset($namespaces[$module])) { $namespace = $namespaces[$module];
- $filter = new \SimpleXMLElement("<".$module.">".$module.">");
- $filter->addAttribute('xmlns', $namespace);
- if ( $subsection ) {
- $filter->addChild($subsection);
- }
-
- $filterState = $filterConfig = str_replace('', '', $filter->asXml());
- }
-
- return array(
- 'config' => $filterConfig,
- 'state' => $filterState
- );
- }
-
- /**
- * loading file with RPCs for current module or subsection
- *
- * @param string $module module name
- * @param string $subsection subsection name
- * @return array array with config and state filter
- */
- public function loadRPCsModel($module, $subsection) {
- $path = $this->getPathToModels($module);
- $file = $path.'rpc.wyin';
-
- $rpcs_model = "";
- if ( file_exists($file) ) {
- $rpcs_model = file_get_contents($file);
- }
-
- return array(
- 'rpcs' => $rpcs_model,
- );
- }
-
- /**
- * Get models.
- *
- * @param int $key session key of current connection
- * @return array|null
- */
- public function getModels($key = -1) {
- /**
- * @var \winzou\CacheBundle\Cache\LifetimeFileCache $cache
- */
- $cache = $this->container->get('winzou_cache');
-
- if ($key === -1) {
- $key = $this->container->get('request')->get('key');
- }
- $hashedKey = $this->getHashFromKey($key);
- if ($hashedKey && $cache->contains('menuStructure_'.$hashedKey)) {
-// $this->logger->addInfo("Cached file for menuStructure found.", array('key' => 'menuStructure_'.$hashedKey));
- return $cache->fetch('menuStructure_'.$hashedKey);
- }
- return $this->models;
- }
-
- /**
- * save model folder structure
- *
- * @param int $key session key of current connection
- * @param array $folders array to persist
- * @param int $lifetime cache lifetime in seconds
- */
- public function setModels($key, $folders, $lifetime = 6000) {
- /**
- * @var \winzou\CacheBundle\Cache\LifetimeFileCache $cache
- */
- $cache = $this->container->get('winzou_cache');
- $hashedKey = $this->getHashFromKey($key);
- $this->models = $folders;
- $cache->save('menuStructure_'.$hashedKey, $folders, $lifetime);
- }
-
- /**
- * Get model namespaces.
- *
- * @param int $key session key of current connection
- * @return array|null
- */
- public function getModelNamespaces($key) {
- /**
- * @var \winzou\CacheBundle\Cache\LifetimeFileCache $cache
- */
- $cache = $this->container->get('winzou_cache');
- $hashedKey = $this->getHashFromKey($key);
- if ($hashedKey && $cache->contains('modelNamespaces_'.$hashedKey)) {
-// $this->logger->addInfo("Cached file for modelNamespaces found.", array('key' => 'modelNamespaces_'.$hashedKey));
- return $cache->fetch('modelNamespaces_'.$hashedKey);
- }
- return $this->modelNamespaces;
- }
-
- /**
- * get namespace for given module name
- *
- * @param int $key ID of connection
- * @param string $module name of module
- *
- * @return bool
- */
- public function getNamespaceForModule($key, $module) {
- $namespaces = $this->getModelNamespaces($key);
- if (isset($namespaces[$module])) {
- return $namespaces[$module];
- } else {
- return false;
- }
- }
-
- /**
- * save model folder structure
- *
- * @param int $key session key of current connection
- * @param array $namespaces array of namespaces to persist
- * @param int $lifetime cache lifetime in seconds
- */
- public function setModelNamespaces($key, $namespaces, $lifetime = 6000) {
- /**
- * @var \winzou\CacheBundle\Cache\LifetimeFileCache $cache
- */
- $cache = $this->container->get('winzou_cache');
- $hashedKey = $this->getHashFromKey($key);
- $this->modelNamespaces = $namespaces;
- $cache->save('modelNamespaces_'.$hashedKey, $namespaces, $lifetime);
- }
-
- /**
- * Invalidates and rebuild menu structure
- *
- * @param $key Identifier of connection (connected device ID)
- */
- public function invalidateAndRebuildMenuStructureForKey($key) {
- $this->invalidateMenuStructureForKey($key);
- $this->buildMenuStructure($key);
- }
-
- /**
- * Invalidates cached files for menu structure
- *
- * @param int $key session key of current connection
- */
- public function invalidateMenuStructureForKey($key) {
- /**
- * @var \winzou\CacheBundle\Cache\LifetimeFileCache $cache
- */
- $cache = $this->container->get('winzou_cache');
- $hashedKey = $this->getHashFromKey($key);
- if ($hashedKey && $cache->contains('modelNamespaces_'.$hashedKey)) {
- $this->logger->addInfo("Invalidate cached file", array('key' => 'modelNamespaces_'.$hashedKey));
- $cache->delete('modelNamespaces_'.$hashedKey);
- }
- if ($hashedKey && $cache->contains('menuStructure_'.$hashedKey)) {
- $this->logger->addInfo("Invalidate cached file", array('key' => 'menuStructure_'.$hashedKey));
- $cache->delete('menuStructure_'.$hashedKey);
- }
- $cache->deleteDeads();
- }
-
- /**
- * Get model tree file from models dir.
- *
- * @param string $moduleName
- *
- * @return string|int
- */
- public function getModelTreeDump($moduleName = '')
- {
- $path = $this->getPathToModels($moduleName).'tree.txt';
-
- if (file_exists($path)) {
- return file_get_contents($path);
- }
-
- return 0;
- }
-
- /**
- * Loads file with identities for identity refs and loads content of this file with json_decode
- *
- * @return array|int 0 on error, json decoded array on success
- */
- public function loadIdentityRefs() {
- $path = $this->getModelsDir();
-
- // identites.json is located in tmp dir
- $path .= 'tmp/identities.json';
-
- if ($content = file_get_contents($path)) {
- return json_decode($content, true);
- }
-
- return 0;
- }
-
- /**
- * Loads only identity refs for given module
- *
- * @param $key
- * @param $module
- *
- * @return array|int
- */
- public function loadIdentityRefsForModule($key, $module) {
- $idrefs = $this->loadIdentityRefs();
- $identities = array();
-
- if ($idrefs) {
- $ns = $this->getNamespaceForModule($key, $module);
- $prefix = array_search($ns, $idrefs['prefixes']);
- if ($prefix) {
- foreach ($idrefs['identities'] as $key => $values) {
- if (strpos($key, $prefix.":") === 0) {
- asort($values);
- $identities[str_replace($prefix.":", '', $key)] = $values;
- }
- }
- }
-
- return $identities;
- }
-
- return 0;
- }
-
- /**
- * Get one model and process it.
- *
- * @param array &$schparams key, identifier, version, format for get-schema
- * @param string $identifier identifier of folder in modelsDir directory
- * @return int 0 on success, 1 on error
- */
- private function getschema(&$schparams, $identifier)
- {
- $data = "";
- $path = $this->getModelsDir()."/tmp/";
- @mkdir($path, 0700, true);
- $path .= "/$identifier";
-
- if (file_exists($path)) {
- /* already exists */
- $schparams["path"] = $path;
- return -1;
- }
-
- if ($this->handle("getschema", $schparams, false, $data) == 0) {
- $schparams["user"] = $this->getUserFromKey($schparams["key"]);
- file_put_contents($path, $data);
- $schparams["path"] = $path;
- return 0;
- } else {
- $this->container->get('request')->getSession()->getFlashBag()->add('error', 'Getting models failed.');
- return 1;
- }
- return 0;
- }
-
- /**
- * Process action based on schparams.
- *
- * @param array &$schparams get-schema parameters
- * @return int 0 on success, 1 on error
- */
- private function processSchema(&$schparams)
- {
- $path = $schparams["path"];
-
- $res = @system(__DIR__."/../bin/nmp.sh -i \"$path\" -o \"".$this->getModelsDir()."\"");
- ob_clean();
- $this->logger->addInfo("Process schema result (Pyang console): ", array('path' => $path, 'modelDir' => $this->getModelsDir(), 'res' => $res));
- return 1;
- }
-
- /**
- * Get available configuration data models,
- * store them and transform them.
- *
- * @param int $key index of session-connection
- * @return void
- */
- public function updateLocalModels($key)
- {
- $ns = "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring";
- $params = array(
- 'key' => $key,
- 'filter' => 'yinNETCONF',
- );
-
- $xml = $this->handle('get', $params, false);
- // TODO: try/catch na simplexml_load_string
- if (($xml !== 1) && ($xml !== "")) {
- $xml = simplexml_load_string($xml, 'SimpleXMLIterator');
- if ($xml === false) {
- /* invalid message received */
- $this->container->get('request')->getSession()->getFlashBag()->add('error', 'Getting the list of schemas failed.');
- return;
- }
- $xml->registerXPathNamespace("xmlns", $ns);
- $schemas = $xml->xpath("//xmlns:schema");
-
- $this->logger->addInfo("Trying to find models for namespaces: ", array('namespaces' => var_export($schemas, true)));
-
- $list = array();
- $lock = sem_get(12345678, 1, 0666, 1);
- sem_acquire($lock); /* critical section */
- foreach ($schemas as $sch) {
- $schparams = array("key" => $params["key"],
- "identifier" => (string)$sch->identifier,
- "version" => (string)$sch->version,
- "format" => (string)$sch->format);
- $ident = $schparams["identifier"]."@".$schparams["version"].".".$schparams["format"];
- if (file_exists($this->getModelsDir()."/$ident")) {
- $this->addLog("Model found, skipping: ", array('ident', $ident));
- continue;
- } else if ($this->getschema($schparams, $ident) == -1) {
- $this->logger->addInfo("Get schema file found, but no models.", array("ident" => $ident));
- $list[] = $schparams;
- } else if ($this->getschema($schparams, $ident) == 1) {
- continue; // get schema failed, skipping
- } else {
- $list[] = $schparams;
- }
- }
- sem_release($lock);
-
-
- $res = @system(__DIR__."/../bin/find-identities.sh '".$this->getModelsDir()."/tmp/'");
- ob_clean();
- /* non-critical - only models, that I downloaded will be processed, others already exist */
- foreach ($list as $schema) {
- $this->processSchema($schema);
- }
- $this->container->get('request')->getSession()->getFlashBag()->add('success', 'Configuration data models were updated.');
- } else {
- $this->container->get('request')->getSession()->getFlashBag()->add('error', 'Getting the list of schemas failed.');
- }
- }
-
- /**
- * Get submenu for key.
- *
- * @param string $index index in array of submenu structure
- * @param int $key session key of current connection
- * @return array
- */
- public function getSubmenu($index, $key) {
- $models = $this->getModels($key);
- return isset($models[$index]['children']) ? $models[$index]['children'] : array();
- }
-
- /**
- * Get name for section.
- *
- * @param $section
- * @return string
- */
- public function getSectionName($section) {
- return ucfirst( str_replace(array('-', '_'), ' ', $section) );
- }
-
- /**
- * Get name for subsection.
- *
- * @param $subsection
- * @return string
- */
- public function getSubsectionName($subsection) {
- return $this->getSectionName($subsection);
- }
-
- /**
- * Get identificator (hash) of model - it is used as directory name of model
- *
- * @param string $name module name from conf. model
- * @param string $version version of conf. model
- * @param string $ns namespace
- * @return string hashed identificator
- */
- public function getModelIdentificator($name, $version, $ns)
- {
-// $ident = "$name|$version|$ns";
- $ident = $ns;
- return sha1($ident);
- }
-
- /**
- * Add text to info log.
- *
- * @param $str
- */
- private function addLog($str) {
- $this->logger->addInfo($str);
- }
-
-}
diff --git a/src/FIT/NetopeerBundle/Models/MergeXML.php b/src/FIT/NetopeerBundle/Models/MergeXML.php
deleted file mode 100644
index 77ecdcad..00000000
--- a/src/FIT/NetopeerBundle/Models/MergeXML.php
+++ /dev/null
@@ -1,391 +0,0 @@
-stay = array('all');
- } else if (is_array($opts['stay'])) {
- $this->stay = $opts['stay'];
- } else {
- $this->stay = (array) $opts['stay'];
- }
- if (!isset($opts['clone'])) {
- $this->clon = array();
- } else if (is_array($opts['clone'])) {
- $this->clon = $opts['clone'];
- } else {
- $this->clon = (array) $opts['clone'];
- }
- $this->join = !isset($opts['join']) ? 'root' : (string) $opts['join'];
- $this->updn = !isset($opts['updn']) ? true : (bool) $opts['updn'];
- $this->error = (object) array('code' => '', 'text' => '');
- if (class_exists($this->cln)) {
- $this->dom = new $this->cln();
- $this->dom->preserveWhiteSpace = false;
- $this->dom->formatOutput = true;
- } else {
- $this->Error('nod');
- }
- }
-
- /**
- * add XML file
- * @param string $file -- pathed filename
- * @param string|array $stay
- * @return object|false
- */
- public function AddFile($file, $stay = null, $clone = null) {
- if (is_array($stay)) {
- $this->stay = array_merge($this->stay, $stay);
- } else if (!empty($stay)) {
- $this->stay[] = $stay;
- }
- if (is_array($clone)) {
- $this->clon = array_merge($this->clon, $clone);
- } else if (!empty($clone)) {
- $this->clon[] = $clone;
- }
- $data = @file_get_contents($file);
- if ($data === false) {
- $rlt = $this->Error('nof');
- } else if (empty($data)) {
- $rlt = $this->Error('emf');
- } else {
- $rlt = $this->AddSource($data);
- }
- return $rlt;
- }
-
- /**
- * add XML to result object
- * @param string|object $xml
- * @param string|array $stay
- * @return mixed -- false - bad content
- * object - result
- */
- public function AddSource($xml, $stay = null, $clone = null) {
- if (is_array($stay)) {
- $this->stay = array_merge($this->stay, $stay);
- } else if (!empty($stay)) {
- $this->stay[] = $stay;
- }
- if (is_array($clone)) {
- $this->clon = array_merge($this->clon, $clone);
- } else if (!empty($clone)) {
- $this->clon[] = $clone;
- }
- if (is_object($xml)) {
- if (get_class($xml) != $this->cln) {
- $dom = false;
- } else if ($this->dom->hasChildNodes()) {
- $dom = $xml;
- } else {
- $this->dom = $xml;
- $this->dom->formatOutput = true;
- $dom = true;
- }
- } else if ($this->dom->hasChildNodes()) { /* not first */
- $dom = new $this->cln();
- $dom->preserveWhiteSpace = false;
- if (!@$dom->loadXML($xml)) {
- $dom = false;
- }
- } else { /* first slot */
- $dom = @$this->dom->loadXML($xml) ? true : false;
- }
- if ($dom === false) {
- $rlt = $this->Error('inv');
- } else if ($dom === true && $this->NameSpaces()) {
- $this->count = 1;
- $rlt = $this->dom;
- } else if (is_object($dom) && $this->CheckSource($dom)) {
- $this->Merge($dom, '/'); /* add to existing */
- $this->count++;
- $rlt = $this->dom;
- } else {
- $rlt = false;
- }
- return $rlt;
- }
-
- /**
- * check/modify root and namespaces,
- * @param object $dom source
- * @return {bool}
- */
- private function CheckSource(&$dom) {
- $rlt = true;
- if ($dom->encoding != $this->dom->encoding) {
- $rlt = $this->Error('enc');
- } else if ($dom->documentElement->namespaceURI != $this->dom->documentElement->namespaceURI) { /* $dom->documentElement->lookupnamespaceURI(NULL) */
- $rlt = $this->Error('nse');
- } else if ($dom->documentElement->nodeName != $this->dom->documentElement->nodeName) {
- if (!$this->join) {
- $rlt = $this->Error('dif');
- } else if (is_string($this->join)) {
- $doc = new \DOMDocument();
- $doc->encoding = $this->dom->encoding;
- $doc->preserveWhiteSpace = false;
- $doc->formatOutput = true;
- $xml = "dom->xmlVersion}\" encoding=\"{$this->dom->encoding}\"?><$this->join>$this->join>";
- if (@$doc->loadXML($xml)) {
- $tmp = $doc->importNode($this->dom->documentElement, true);
- $doc->documentElement->appendChild($tmp);
- $this->dom = $doc;
- $this->join = true;
- } else {
- $rlt = $this->Error('jne');
- $this->join = null;
- }
- }
- }
- if ($rlt) {
- $doc = simplexml_import_dom($dom);
- $rlt = $this->NameSpaces($doc->getDocNamespaces(true));
- }
- return $rlt;
- }
-
- /**
- * register namespaces
- * @param array $nsp -- additional namespaces
- * @return bool
- */
- private function NameSpaces($nsp = array()) {
- $doc = simplexml_import_dom($this->dom);
- $nsps = $doc->getDocNamespaces(true);
- foreach ($nsp as $pfx => $url) {
- if (!isset($nsps[$pfx])) {
- $this->dom->createAttributeNS($url, "$pfx:attr");
- $nsps[$pfx] = $url;
- }
- }
- $this->dxp = new \DOMXPath($this->dom);
- $this->nsp = array();
- $rlt = true;
- foreach ($nsps as $pfx => $url) {
- if ($pfx == $this->nsd) {
- $rlt = $this->Error('nse');
- break;
- } else if (empty($pfx)) {
- $pfx = $this->nsd;
- }
- $this->nsp[$pfx] = $url;
- $this->dxp->registerNamespace($pfx, $url);
- }
- return $rlt;
- }
-
- /**
- * join 2 dom objects
- * @param object $src -- current source node
- * @param object $pth -- current source path
- */
- private function Merge($src, $pth) {
- $i = 0;
- foreach ($src->childNodes as $node) {
- $path = $this->GetNodePath($src->childNodes, $node, $pth, $i);
- $obj = $this->Query($path);
- if ($node->nodeType === XML_ELEMENT_NODE) {
- /* replace existing node by default */
- $flg = (array_search($obj->item(0)->tagName, $this->stay) !== false) ? false : true;
- /* not clone existing node by default */
- $cln = (array_search($obj->item(0)->tagName, $this->clon) === false) ? false : true;
- if ($obj->length == 0 || $obj->item(0)->namespaceURI != $node->namespaceURI || $cln) { /* add node */
- $tmp = $this->dom->importNode($node, true);
- $this->Query($pth)->item(0)->appendChild($tmp);
- } else if ($flg && !$cln){
- if ($node->hasAttributes()) { /* add/replace attributes */
- foreach ($node->attributes as $attr) {
- $obj->item(0)->setAttribute($attr->nodeName, $attr->nodeValue);
- }
- }
- if ($node->hasChildNodes()) {
- $this->Merge($node, $path); /* recurse to subnodes */
- }
- }
- } else if ($node->nodeType === XML_TEXT_NODE || $node->nodeType === XML_COMMENT_NODE) { /* leaf node */
- if ($obj->length == 0) {
- if ($node->nodeType === XML_TEXT_NODE) {
- $tmp = $this->dom->createTextNode($node->nodeValue);
- } else {
- $tmp = $this->dom->createComment($node->nodeValue);
- }
- $this->Query($pth)->item(0)->appendChild($tmp);
- } else {
- $obj->item(0)->nodeValue = $node->nodeValue;
- }
- }
- $i++;
- }
- }
-
- /**
- * form the node xPath expression
- * @param {object} $nodes -- child nodes
- * @param {object} $node -- current child
- * @param {string} $pth -- parent path
- * @param {int} $eln -- element sequence number
- * @return {string} query path
- */
- private function GetNodePath($nodes, $node, $pth, $eln) {
- $j = 0;
- if ($node->nodeType === XML_ELEMENT_NODE) {
- $i = 0;
- foreach ($nodes as $nde) {
- if ($i > $eln) {
- break;
- } else if (($this->updn && $nde->nodeType === $node->nodeType && $nde->nodeName === $node->nodeName && $nde->namespaceURI === $node->namespaceURI) ||
- (!$this->updn && $nde->nodeType !== XML_PI_NODE)) {
- $j++;
- }
- $i++;
- }
- if ($this->updn) {
- if ($node->prefix) {
- $p = $node->prefix . ':';
- } else if (isset($this->nsp[$this->nsd])) {
- $p = $this->nsd . ':';
- } else {
- $p = '';
- }
- $p .= $node->localName;
- } else {
- $p = 'node()';
- }
- } else if ($node->nodeType === XML_TEXT_NODE || $node->nodeType === XML_COMMENT_NODE) {
- $i = 0;
- foreach ($nodes as $nde) {
- if ($i > $eln) {
- break;
- } else if ($nde->nodeType === $node->nodeType) {
- $j++;
- }
- $i++;
- }
- $p = $node->nodeType === XML_TEXT_NODE ? 'text()' : 'comment()';
- } else {
- $p = $pth;
- }
- if ($j > 0) {
- $p = $pth . ($pth === '/' ? '' : '/') . $p . '[' . $j . ']';
- }
- return $p;
- }
-
- /**
- * xPath query
- * @param string $qry -- query statement
- * @return object
- */
- public function Query($qry) {
- if ($this->join === true) {
- $qry = "/{$this->dom->documentElement->nodeName}" . ($qry === '/' ? '' : $qry);
- }
- $rlt = $this->dxp->query($qry);
- return $rlt;
- }
-
- /**
- * get result
- * @param {int} flg -- 0 - object
- * 1 - xml
- * 2 - html
- * @return {mixed}
- */
- public function Get($flg = 0) {
- if ($flg == 0) {
- $rlt = $this->dom;
- } else {
- $rlt = $this->dom->saveXML();
- if ($flg == 2) {
- $r = str_replace(' ', ' ', htmlspecialchars($rlt));
- $rlt = str_replace(array("\r\n", "\n", "\r"), '
', $r);
- }
- }
- return $rlt;
- }
-
- /**
- * set error message
- * @param string $err token
- * @return false
- */
- private function Error($err = 'und') {
- $errs = array(
- 'nod' => "$this->cln is not supported",
- 'nof' => 'File not found',
- 'emf' => 'File is empty', /* possible delivery fault */
- 'inv' => 'Invalid XML source',
- 'enc' => 'Different encoding',
- 'dif' => 'Different root nodes',
- 'jne' => 'Invalid join parameter',
- 'nse' => 'Namespace incompatibility',
- 'und' => 'Undefined error');
- $this->error->code = isset($errs[$err]) ? $err : 'und';
- $this->error->text = $errs[$this->error->code];
- return false;
- }
-
- /**
- * get property value
- * @param string $name
- * @return mixed -- null - missing
- */
- public function __get($name) {
- return isset($this->$name) ? $this->$name : null;
- }
-
-}
-
-?>
diff --git a/src/FIT/NetopeerBundle/Models/XMLoperations.php b/src/FIT/NetopeerBundle/Models/XMLoperations.php
deleted file mode 100644
index fa39eaa6..00000000
--- a/src/FIT/NetopeerBundle/Models/XMLoperations.php
+++ /dev/null
@@ -1,1725 +0,0 @@
-
- * @author Tomas Cejka
- *
- * Copyright (C) 2012-2015 CESNET
- *
- * LICENSE TERMS
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name of the Company nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * ALTERNATIVELY, provided that this notice is retained in full, this
- * product may be distributed under the terms of the GNU General Public
- * License (GPL) version 2 or later, in which case the provisions
- * of the GPL apply INSTEAD OF those given above.
- *
- * This software is provided ``as is'', and any express or implied
- * warranties, including, but not limited to, the implied warranties of
- * merchantability and fitness for a particular purpose are disclaimed.
- * In no event shall the company or contributors be liable for any
- * direct, indirect, incidental, special, exemplary, or consequential
- * damages (including, but not limited to, procurement of substitute
- * goods or services; loss of use, data, or profits; or business
- * interruption) however caused and on any theory of liability, whether
- * in contract, strict liability, or tort (including negligence or
- * otherwise) arising in any way out of the use of this software, even
- * if advised of the possibility of such damage.
- *
- */
-namespace FIT\NetopeerBundle\Models;
-
-use Symfony\Component\Config\Definition\Exception\Exception;
-use Symfony\Component\Debug\Exception\ContextErrorException;
-use Symfony\Component\DependencyInjection\ContainerInterface;
-use FIT\NetopeerBundle\Models\Data as Data;
-use Symfony\Component\DependencyInjection\SimpleXMLElement;
-use Symfony\Component\Finder\Finder;
-use FIT\NetopeerBundle\Models\MergeXML;
-
-class XMLoperations {
- /**
- * @var ContainerInterface base bundle container
- */
- public $container;
- /**
- * @var \Symfony\Bridge\Monolog\Logger instance of logging class
- */
- public $logger;
- /**
- * @var \FIT\NetopeerBundle\Models\Data instance of data class
- */
- public $dataModel;
-
- public static $customRootElement = 'netopeer-root';
-
- /**
- * Constructor with DependencyInjection params.
- *
- * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
- * @param \Symfony\Bridge\Monolog\Logger $logger logging class
- * @param Data $dataModel data class
- */
- public function __construct(ContainerInterface $container, $logger, Data $dataModel) {
- $this->container = $container;
- $this->logger = $logger;
- $this->dataModel = $dataModel;
- }
-
-
-
- /**
- * divides string into the array (name, value) (according to the XML tree node => value)
- *
- * @param string $postKey post value
- * @return array in format ('name', 'value')
- */
- public function divideInputName($postKey)
- {
- $values = explode('_', $postKey);
- $cnt = count($values);
- if ($cnt > 2) {
- $last = $values[$cnt-1];
- $values = array(implode("_", array_slice($values, 0, $cnt-1)), $last);
- } elseif ($cnt == 2) {
-
- } elseif ($cnt == 1) {
- $values = array('name', $values[0]);
- } else {
- $values = array('name', 'value');
- }
- return $values;
- }
-
- /**
- * decodes XPath value (custom coding from JS)
- *
- * @param string $value encoded XPath string from JS form
- * @return string decoded XPath string
- */
- public function decodeXPath($value) {
- return str_replace(
- array('--', '?', '!'),
- array('/', '[', ']'),
- $value
- );
- }
-
- /**
- * Completes request tree (XML) with necessary parent nodes.
- * Tree must be valid for edit-config action.
- *
- * @param \SimpleXMLElement $parent current parent of new content to be completed (add all his parents)
- * @param string $newConfigString
- * @param null $wrappedPath
- *
- * @return \SimpleXMLElement
- */
- public function completeRequestTree(&$parent, $newConfigString, $wrappedPath = null) {
- if (is_null($wrappedPath)) {
- $wrappedPath = $this->dataModel->getPathToModels() . 'wrapped.wyin';
- }
- $subroot = simplexml_load_file($wrappedPath);
- $xmlNameSpaces = $subroot->getNamespaces();
-
- if ( isset($xmlNameSpaces[""]) ) {
- $subroot->registerXPathNamespace("xmlns", $xmlNameSpaces[""]);
- }
- $ns = $subroot->xpath("//xmlns:namespace");
- $namespace = "";
- if (sizeof($ns)>0) {
- $namespace = $ns[0]->attributes()->uri;
- }
-
- $parent = $parent->xpath("parent::*");
- while ($parent) {
- $pos_subroot[] = $parent[0];
- $parent = $parent[0]->xpath("parent::*");
- }
- $config = $newConfigString;
-
- if (isset($pos_subroot)) {
- for ($i = 0; $i < sizeof($pos_subroot); $i++) {
- /**
- * @var SimpleXMLElement $subroot
- */
- $subroot = $pos_subroot[$i];
- $domNode = dom_import_simplexml($subroot);
-
-
- // key elements must be added into config XML
- $newdoc = new \DOMDocument;
- $node = $newdoc->importNode($domNode, true);
- $newdoc->appendChild($node);
- $keyElems = $this->removeChildrenExceptOfKeyElements($node, $node->childNodes, true);
-
- $childrenConfig = "";
- if ($keyElems > 0) {
- $simpleSubRoot = simplexml_import_dom($node);
- foreach ($simpleSubRoot->children() as $child) {
- $childrenConfig .= $child->asXml();
- }
- }
-
- $tmp = $subroot->getName();
- $config .= "".$subroot->getName().">\n";
-
- if ($i == sizeof($pos_subroot) - 1) {
- $config = "<".$subroot->getName().
- ($namespace!==""?" xmlns=\"$namespace\"":"").
- " xmlns:xc=\"urn:ietf:params:xml:ns:netconf:base:1.0\"".
- ">\n".$childrenConfig.$config;
- } else {
- $config = "<".$subroot->getName().
- ">\n".$childrenConfig.$config;
- }
- }
- }
- $result = simplexml_load_string($config);
- $result->registerXPathNamespace('xmlns', $namespace);
-
- return $result;
- }
-
- /**
- * @param string $sourceXml
- * @param string $newXml
- * @param array $params parametrs for MergeXML constructor
- * @param int $output kind of output of MergeXML
- *
- * @return \DOMDocument|false
- */
- public function mergeXml ($sourceXml, $newXml, $params = array(), $output = 0) {
- $defaultParams = array(
- 'join' => false, // common root name if any source has different root name (default is *root*, specifying *false* denies different names)
- 'updn' => true, // traverse the nodes by name sequence (*true*, default) or overall sequence (*false*),
- 'stay' => 'all', // use the *stay* attribute value to deny overwriting of specific node (default is *all*, can be array of values, string or empty)
- 'clone' => '', // use the *clone* attribute value to clone specific nodes if they already exists (empty by default, can be array of values, string or empty)
- );
- $params = array_merge($defaultParams, $params);
-
- $sourceDoc = new \DOMDocument();
- $sourceDoc->loadXML($sourceXml);
-
- $newDoc = new \DOMDocument();
- $newDoc->loadXML($newXml);
-
- try {
- $mergeXml = new MergeXML();
- @$mergeXml->AddSource($sourceXml);
- @$mergeXml->AddSource($newDoc);
-
- if (@$mergeXml->error->code != "") {
- return false;
- }
- } catch (Exception $e) {
- return false;
- }
- return $mergeXml->Get($output);
- }
-
- /**
- * updates (modifies) value of XML node
- *
- * @param \SimpleXMLElement $configXml xml file
- * @param string $elementName name of the element
- * @param string $xpath XPath to the element (without trailing '/', which is added automatically)
- * @param string $val new value
- * @param string $xPathPrefix
- * @param int $newIndex new index of elem in parent cover (selectable plugin)
- *
- * @return \SimpleXMLElement|array modified node, empty array if element was not found
- */
- public function elementValReplace(&$configXml, $elementName, $xpath, $val, $xPathPrefix = "xmlns:", $newIndex = -1)
- {
- $isAttribute = false;
-
- // if element is an attribute, it will have prefix at-
- if ( strrpos($elementName, 'at-') === 0 ) {
- $elementName = substr($elementName, 3);
- $isAttribute = true;
- }
-
- // get node according to xPath query
- $node = $configXml->xpath('/'.$xPathPrefix.$xpath);
-
- if (isset($node[0])) {
- $node = $node[0];
- }
-
- // set new value for node
- if ( $isAttribute === true ) {
- $elem = $node[0];
- $elem[$elementName] = $val;
- } else {
- if (isset($node[0])) {
- $elem = $node[0];
- } else {
- $elem = $node;
- }
-
- if (isset($elem->$elementName) && (sizeof($elem->$elementName) > 0)) {
- $e = $elem->$elementName;
- if ($val != "") {
- $e[0] = str_replace("\r", '', $val); // removes \r from value
- }
- if ($newIndex !== -1) {
- $elem->addAttribute($xPathPrefix."index", $newIndex);
- }
- } else {
- if ( !is_array($elem) ) {
- if ($val != "") {
- $elem[0] = str_replace("\r", '', $val);
- }
- if ($newIndex !== -1) {
- $elem[0]->addAttribute($xPathPrefix."index", $newIndex);
- }
- }
- }
- }
-
- return $elem;
- }
-
-
- /**
- * handles edit config form - changes config values into the $_POST values
- * and sends them to editConfig process
- *
- * @param int $key session key of current connection
- * @param array $configParams array of config params
- * @return int result code
- */
- public function handleEditConfigForm(&$key, $configParams) {
- $post_vals = $this->container->get('request')->get('configDataForm');
- $res = 0;
-
- try {
-
- if ( ($originalXml = $this->dataModel->handle('getconfig', $configParams, false)) != 1 ) {
-
- $configXml = simplexml_load_string($originalXml, 'SimpleXMLIterator');
-
- // save to temp file - for debugging
- if ($this->container->getParameter('kernel.environment') == 'dev') {
- @file_put_contents($this->container->get('kernel')->getRootDir().'/logs/tmp-files/original.yin', $configXml->asXml());
- }
-
- // we will get namespaces from original getconfig and set them to simpleXml object, 'cause we need it for XPath queries
- $xmlNameSpaces = $configXml->getNamespaces();
-
- if ( isset($xmlNameSpaces[""]) ) {
- $configXml->registerXPathNamespace("xmlns", $xmlNameSpaces[""]);
- $xmlNamespace = $xmlNameSpaces[""];
- $xPathPrefix = "xmlns:";
- } else {
- // we will use this xmlns as backup for XPath request
- $configXml->registerXPathNamespace("xmlns", "urn:cesnet:tmc:hanicprobe:1.0");
- $xmlNamespace = "urn:cesnet:tmc:hanicprobe:1.0";
- $xPathPrefix = "";
- }
-
- // foreach over all post values
- $parentNodesForSorting = array();
- $processSorting = false;
- foreach ( $post_vals as $postKey => $val ) {
- if ($postKey == 'commit_all_button') continue;
-
- $index = -1;
-
- // divide string, if index is set
- if (strpos($postKey, "|") !== false) {
- $arr = explode("|", $postKey);
-
- if (sizeof($arr) == 2 && strpos($postKey, "index") !== false) {
- $postKey = $arr[1];
- $index = str_replace("index", "", $arr[0]);
-
- $processSorting = true;
- }
- }
-
- $values = $this->divideInputName($postKey);
- $elementName = $values[0];
- $xpath = $this->decodeXPath($values[1]);
- $xpath = substr($xpath, 1); // removes slash at the begining
-
- $modifiedElem = $this->elementValReplace($configXml, $elementName, $xpath, $val, $xPathPrefix, $index);
- if ($index != -1 && $modifiedElem instanceof \SimpleXMLIterator) {
- array_push($parentNodesForSorting, $modifiedElem);
- }
- }
-
- if (sizeof($parentNodesForSorting)) {
- $items = array();
- $parent = false;
- foreach ($parentNodesForSorting as $child) {
- $childDOM = dom_import_simplexml($child[0]);
- $items[] = $childDOM;
- $par = $child->xpath("parent::*");
- $parent = dom_import_simplexml($par[0]);
- }
-
- // deleting must be separated
- foreach ($items as $child) {
- if ($parent) $parent->removeChild($child);
- }
-
- usort($items, function($a, $b) {
- $indA = 0;
- $indB = 0;
-
- foreach($a->attributes as $name => $node) {
- if ($name == "index") {
- $indA = $node->nodeValue;
- break;
- }
- }
-
- foreach($b->attributes as $name => $node) {
- if ($name == "index") {
- $indB = $node->nodeValue;
- break;
- }
- }
-
-
- return $indA - $indB;
- });
-
- foreach ($items as $child) {
- $child->removeAttribute('index');
- if ($parent) $parent->appendChild($child);
- }
-
- if ($parent) {
- $parentSimple = simplexml_import_dom($parent);
- $parentSimple->addAttribute("xc:operation", "replace", "urn:ietf:params:xml:ns:netconf:base:1.0");
- }
- }
-
- // for debugging, edited configXml will be saved into temp file
- if ($this->container->getParameter('kernel.environment') == 'dev') {
- @file_put_contents($this->container->get('kernel')->getRootDir().'/logs/tmp-files/edited.yin', $configXml->asXml());
- }
-
- // check, if newNodeForm was send too
- if (sizeof($this->container->get('request')->get('newNodeForm'))) {
- $newNodeForms = $this->container->get('request')->get('newNodeForm');
- @file_put_contents($this->container->get('kernel')->getRootDir().'/logs/tmp-files/testing.yin', var_export($newNodeForms, true));
-
- // create empty simpleXmlObject for adding all newNodeForms
- $currentRoot = $configXml->xpath("/xmlns:*");
- $newNodesXML = new SimpleXMLElement("<".$currentRoot[0]->getName()." xmlns='".$xmlNamespace."'>".$currentRoot[0]->getName().">");
-
- $modelXml = $this->mergeXMLWithModel($originalXml);
- foreach ($newNodeForms as $newNodeFormVals) {
- $newNodeConfigXML = simplexml_load_string($modelXml, 'SimpleXMLIterator');
-
-
- // we will get namespaces from original getconfig and set them to simpleXml object, 'cause we need it for XPath queries
- $xmlNameSpaces = $newNodeConfigXML->getNamespaces();
-
- if ( isset($xmlNameSpaces[""]) ) {
- $newNodeConfigXML->registerXPathNamespace("xmlns", $xmlNameSpaces[""]);
- $newNodesXML->registerXPathNamespace("xmlns", $xmlNameSpaces[""]);
- } else {
- // we will use this xmlns as backup for XPath request
- $newNodeConfigXML->registerXPathNamespace("xmlns", "urn:cesnet:tmc:hanicprobe:1.0");
- $newNodesXML->registerXPathNamespace("xmlns", "urn:cesnet:tmc:hanicprobe:1.0");
- }
- $toAdd = $this->processNewNodeForm($newNodeConfigXML, $newNodeFormVals);
-
- // merge new node XML with previous one
- if (($out = $this->mergeXml($newNodesXML->asXML(), $toAdd)) !== false) {
- $newNodesXML = simplexml_load_string($out->saveXML());
- }
- }
-
- // finally merge the request with edited values
- // EDIT: do not merge new node form witch edited values (because it causes merge errors)
- // if (($out = $this->mergeXml($configXml->asXML(), $newNodesXML->asXML())) !== false) {
- // $configXml = simplexml_load_string($out->saveXML());
- // }
- $configXml = $newNodesXML;
- }
-
- // sort final config xml
- $params['attributesWhiteList'] = array('model-level-index');
- $xmlString = $configXml->asXML();
- $xmlString = $this->mergeXMLWithModel($xmlString, $params);
- $sortedXml = $this->sortXMLByModelLevelIndex($xmlString, true);
-
- $res = $this->executeEditConfig($key, $sortedXml, $configParams['source']);
- if ($res !== 1) {
- $this->container->get('session')->getFlashBag()->add('success', "Config has been edited successfully.");
- }
- } else {
- throw new \ErrorException("Could not load config.");
- }
-
- } catch (\ErrorException $e) {
- $this->logger->warn('Could not save config correctly.', array('error' => $e->getMessage()));
- $this->container->get('request')->getSession()->getFlashBag()->add('error', "Could not save config correctly. Error: ".$e->getMessage());
- }
-
-
- return $res;
- }
-
- /**
- * handles form for creating empty module
- *
- * @param $key Identifier of connection (connected device ID)
- * @param $configParams
- * @param $postVals
- *
- * @return int
- */
- public function handleCreateEmptyModuleForm($key, $configParams, $postVals) {
- $name = $postVals['name'];
- $namespace = $postVals['namespace'];
- $res = 0;
-
- $xmlTree = new \SimpleXMLElement('<'.$name.'>'.$name.'>');
- $xmlTree->addAttribute('xmlns', $namespace);
- $xmlTree->registerXPathNamespace('xc', 'urn:ietf:params:xml:ns:netconf:base:1.0');
-
- $xmlTree->addAttribute("xc:operation", "create", "urn:ietf:params:xml:ns:netconf:base:1.0");
-
- $createString = "\n".str_replace('', '', $xmlTree->asXML());
-
- try {
- $res = $this->executeEditConfig($key, $createString, $configParams['source']);
-
- if ($res == 0) {
- $this->container->get('request')->getSession()->getFlashBag()->add('success', "New module was created.");
- }
- } catch (\ErrorException $e) {
- $this->logger->warn('Could not create empty module.', array('error' => $e->getMessage(), 'xml' => $createString));
- $this->container->get('request')->getSession()->getFlashBag()->add('error', "Could not create empty module. Error: ".$e->getMessage());
- }
-
- return $res;
- }
-
- /**
- * Handles form for RPC method call
- *
- * @param $key Identifier of connection (connected device ID)
- * @param $configParams
- * @param $postVals
- *
- * @return int
- * @throws \ErrorException
- */
- public function handleRPCMethodForm($key, $configParams, $postVals) {
- $name = $postVals['rootElemName'];
- $namespace = $postVals['rootElemNamespace'];
- $res = 0;
-
- $xmlTree = new \SimpleXMLElement('<'.$name.'>'.$name.'>');
- $xmlTree->registerXPathNamespace('xc', 'urn:ietf:params:xml:ns:netconf:base:1.0');
-
- if ($namespace !== 'false' && $namespace !== '') {
- $xmlTree->registerXPathNamespace('rpcMod', $namespace);
- $xmlTree->addAttribute('xmlns', $namespace);
- }
-
- // we will go through all post values
- $skipArray = array('rootElemName', 'rootElemNamespace');
- foreach ( $postVals as $labelKey => $labelVal ) {
- if (in_array($labelKey, $skipArray)) continue;
- $label = $this->divideInputName($labelKey);
- // values[0] - label
- // values[1] - encoded xPath
-
- if ( count($label) != 2 ) {
- $this->logger->err('RPCMethodForm must contain exactly 2 params, example container_-*-*?1!-*?2!-*?1!', array('values' => $label, 'postKey' => $labelKey));
- throw new \ErrorException("Could not proccess all form fields.");
-
- } else {
- $xpath = $this->decodeXPath($label[1]);
- $xpath = substr($xpath, 1);
-
- $node = $this->insertNewElemIntoXMLTree($xmlTree, $xpath, $label[0], $labelVal, '', $addCreateNS = false);
-
- array_push($skipArray, $labelKey);
- }
- }
-
- $createString = "\n".str_replace('', '', $xmlTree->asXML());
-
- try {
- $res = $this->dataModel->handle("userrpc", array(
- 'key' => $key,
- 'content' => $createString,
- ), false, $result);
- /* RPC can return output data in $result */
-
- if ($res == 0) {
- $this->container->get('request')->getSession()->getFlashBag()->add('success', "RPC method invocation was successful.");
- }
- } catch (\ErrorException $e) {
- $this->logger->warn('Could not invocate RPC method.', array('error' => $e->getMessage(), 'xml' => $createString));
- $this->container->get('request')->getSession()->getFlashBag()->add('error', "Could not invocate RPC method. Error: ".$e->getMessage());
- }
-
- return $res;
- }
-
- /**
- * duplicates node in config - values of duplicated nodes (elements)
- *
- * could be changed by user
- *
- * @param int $key session key of current connection
- * @param array $configParams array of config params
- * @throws \ErrorException
- * @return int result code
- */
- public function handleDuplicateNodeForm(&$key, $configParams) {
- $post_vals = $this->container->get('request')->get('duplicatedNodeForm');
- $res = 0;
-
- try {
- // load original (not modified) getconfig
- if ( ($originalXml = $this->dataModel->handle('getconfig', $configParams, false)) != 1 ) {
- $tmpConfigXml = simplexml_load_string($originalXml);
-
- // save to temp file - for debugging
- if ($this->container->getParameter('kernel.environment') == 'dev') {
- @file_put_contents($this->container->get('kernel')->getRootDir().'/logs/tmp-files/original.yin', $tmpConfigXml->asXml());
- }
-
- // we will get namespaces from original getconfig and set them to simpleXml object, 'cause we need it for XPath queries
- $xmlNameSpaces = $tmpConfigXml->getNamespaces();
- if ( isset($xmlNameSpaces[""]) ) {
- $tmpConfigXml->registerXPathNamespace("xmlns", $xmlNameSpaces[""]);
- }
- }
-
- // if we have XML configuration
- if (isset($tmpConfigXml)) {
-
- // we will go through all posted values
- $newLeafs = array();
-
-// $tmpConfigXml = $this->completeRequestTree($tmpConfigXml, $tmpConfigXml->asXml());
-
- /* fill values */
- $i = 0;
- $createString = "";
-
- foreach ( $post_vals as $postKey => $val ) {
- $values = $this->divideInputName($postKey);
- // values[0] - label
- // values[1] - encoded xPath
-
- if ($postKey == "parent") {
- $xpath = $this->decodeXPath($val);
- // get node according to xPath query
- $parentNode = $tmpConfigXml->xpath($xpath);
- } else if ( count($values) != 2 ) {
- $this->logger->err('newNodeForm must contain exactly 2 params, example container_-*-*?1!-*?2!-*?1!', array('values' => $values, 'postKey' => $postKey));
- throw new \ErrorException("newNodeForm must contain exactly 2 params, example container_-*-*?1!-*?2!-*?1! ". var_export(array('values' => $values, 'postKey' => $postKey), true));
- } else {
- $xpath = $this->decodeXPath($values[1]);
- $xpath = substr($xpath, 1, strripos($xpath, "/") - 1);
-
- $node = $this->elementValReplace($tmpConfigXml, $values[0], $xpath, $val);
- try {
- if ( is_object($node) ) {
- @$node->addAttribute("xc:operation", "create", "urn:ietf:params:xml:ns:netconf:base:1.0");
- }
- } catch (\ContextErrorException $e) {
- // nothing happened - attribute is already there
- }
- }
- }
-
- $createString = "\n".str_replace('', '', $parentNode[0]->asXml());
- $createTree = $this->completeRequestTree($parentNode[0], $createString);
-
- // for debugging, edited configXml will be saved into temp file
- if ($this->container->getParameter('kernel.environment') == 'dev') {
- @file_put_contents($this->container->get('kernel')->getRootDir().'/logs/tmp-files/newElem.yin', $createTree->asXml());
- }
- $res = $this->executeEditConfig($key, $createTree->asXml(), $configParams['source']);
-
- if ($res == 0) {
- $this->container->get('request')->getSession()->getFlashBag()->add('success', "Record has been added.");
- }
- } else {
- throw new \ErrorException("Could not load config.");
- }
-
- } catch (\ErrorException $e) {
- $this->logger->warn('Could not save new node correctly.', array('error' => $e->getMessage()));
- $this->container->get('request')->getSession()->getFlashBag()->add('error', "Could not save new node correctly. Error: ".$e->getMessage());
- }
-
- return $res;
- }
-
- /**
- * create new node
- *
- * @param int $key session key of current connection
- * @param array $configParams array of config params
- * @return int result code
- */
- public function handleNewNodeForm(&$key, $configParams) {
- $post_vals = $this->container->get('request')->get('newNodeForm');
- $res = 0;
-
- try {
- // load original (not modified) getconfig
- if ( ($originalXml = $this->dataModel->handle('getconfig', $configParams, true)) != 1 ) {
- /** @var \SimpleXMLElement $configXml */
- $configXml = simplexml_load_string($originalXml);
-
- // we will get namespaces from original getconfig and set them to simpleXml object, 'cause we need it for XPath queries
- $xmlNameSpaces = $configXml->getNamespaces();
- if ( isset($xmlNameSpaces[""]) ) {
- $namespace = $xmlNameSpaces[""];
- $configXml->registerXPathNamespace("xmlns", $xmlNameSpaces[""]);
- } elseif (sizeof($xmlNameSpaces) == 0) {
- $namespace = 'urn:ietf:params:xml:ns:yang:yin:1';
- $configXml->registerXPathNamespace("xmlns", 'urn:ietf:params:xml:ns:yang:yin:1');
- }
- }
-
- // if we have XML configuration
- if (isset($configXml)) {
- $createTreeXML = $this->processNewNodeForm($configXml, $post_vals);
-
- $res = $this->executeEditConfig($key, $createTreeXML, $configParams['source']);
-
- if ($res == 0) {
- $this->container->get('request')->getSession()->getFlashBag()->add('success', "Record has been added.");
- }
- } else {
- throw new \ErrorException("Could not load config.");
- }
-
- } catch (\ErrorException $e) {
- $this->logger->warn('Could not save new node correctly.', array('error' => $e->getMessage()));
- $this->container->get('request')->getSession()->getFlashBag()->add('error', "Could not save new node correctly. Error: ".$e->getMessage());
- }
-
- return $res;
- }
-
- /**
- * @param \SimpleXMLElement $configXml
- * @param array $post_vals
- *
- * @return mixed|string
- * @throws \ErrorException
- */
- private function processNewNodeForm(&$configXml, $post_vals) {
- $keyElemsCnt = 0;
- $dom = new \DOMDocument();
- $skipArray = array();
-
- // load parent value
- if (array_key_exists('parent', $post_vals)) {
- $parentPath = $post_vals['parent'];
-
- $xpath = $this->decodeXPath($parentPath);
- // get node according to xPath query
- /** @var \SimpleXMLElement $tmpParentNode */
- $parentNode = $configXml->xpath($xpath);
-
- array_push($skipArray, 'parent');
-
- // we have to delete all children from parent node (because of xpath selector for new nodes), except from key nodes
- $domNode = dom_import_simplexml($parentNode[0]);
- $keyElemsCnt = $this->removeChildrenExceptOfKeyElements($domNode, $domNode->childNodes);
-
- } else {
- throw new \ErrorException("Could not set parent node for new elements.");
- }
-
- // we will go through all post values
- $speciallyAddedNodes = array();
- foreach ( $post_vals as $labelKey => $labelVal ) {
- if (in_array($labelKey, $skipArray)) continue;
- $label = $this->divideInputName($labelKey);
- // values[0] - label
- // values[1] - encoded xPath
-
- // load parent node
-
-
- if ( count($label) != 2 ) {
- $this->logger->err('newNodeForm must contain exactly 2 params, example container_-*-*?1!-*?2!-*?1!', array('values' => $label, 'postKey' => $labelKey));
- throw new \ErrorException("Could not proccess all form fields.");
-
- } else {
- $valueKey = str_replace('label', 'value', $labelKey);
- $value = $post_vals[$valueKey];
-
- array_push($skipArray, $labelKey);
- array_push($skipArray, $valueKey);
-
- $xpath = $this->decodeXPath($label[1]);
- $xpath = substr($xpath, 1, strripos($xpath, "/") - 1);
-
- $addedNodes = $this->insertNewElemIntoXMLTree($configXml, $xpath, $labelVal, $value);
- // we have created some other element
- if (sizeof($addedNodes) >= 2) {
- for ($i = 1; $i < sizeof($addedNodes); $i++) {
- array_push($speciallyAddedNodes, $addedNodes[$i]);
- }
- }
- }
- }
-
- if ($keyElemsCnt > 0 && isset($domNode)) {
- $dom->importNode($domNode, true);
- $this->moveCustomKeyAttributesIntoElements($dom, $domNode, $keyElemsCnt);
- }
-
- $createString = "\n".str_replace('', '', $parentNode[0]->asXml());
- $createTree = $this->completeRequestTree($parentNode[0], $createString);
- $createTreeXML = $createTree->asXML();
-
- // add all "specially added nodes" - mainly leafrefs and so
- if (sizeof($speciallyAddedNodes)) {
- // append special nodes into empty root element
- foreach ($speciallyAddedNodes as $node) {
- $nodeCreateString = "\n".str_replace('', '', $node[0]->asXml());
- $nodeCreateTree = $this->completeRequestTree($node[0], $nodeCreateString);
-
- // finally merge the request
- if (($out = $this->mergeXml($createTreeXML, $nodeCreateTree->asXML())) !== false) {
- $createTree = simplexml_load_string($out->saveXML());
- }
- }
-
- $createTreeXML = $createTree->asXML();
- }
-
- return $createTreeXML;
- }
-
- /**
- * @param \DOMDocument $dom
- * @param \DOMElement $domNode
- * @param $keyElementsCnt
- *
- * @return int number of moved items
- */
- public function moveCustomKeyAttributesIntoElements($dom, $domNode, $keyElementsCnt) {
- $attributesArr = array();
- $totalMoved = 0;
-
- if ($domNode->hasAttributes()) {
- foreach ($domNode->attributes as $attr) {
- if (strpos($attr->nodeName, "GUIcustom_") === 0) {
- $elemName = str_replace("GUIcustom_", "", $attr->nodeName);
- $elemValue = $attr->nodeValue;
-
- if ($domNode->hasChildNodes()) {
- $domNode->insertBefore(new \DOMElement($elemName, $elemValue), $domNode->childNodes->item(0));
- } else {
- $domNode->appendChild(new \DOMElement($elemName, $elemValue));
- }
-
- $attributesArr[] = $attr->nodeName;
- $totalMoved++;
- }
- }
- // remove must be in new foreach, previous deletes only first one
- foreach ($attributesArr as $attrName) {
- $domNode->removeAttribute($attrName);
- }
- }
-
- if ($totalMoved < $keyElementsCnt && $domNode->hasChildNodes()) {
- foreach($domNode->childNodes as $child) {
- $totalMoved += $this->moveCustomKeyAttributesIntoElements($dom, $child, $keyElementsCnt);
- }
- }
-
- return $totalMoved;
- }
-
- /**
- * Sorts given XML file by attribute model-level-number recursively
- *
- * @param $xml
- * @param bool $removeIndexAttr
- *
- * @return string
- */
- public function sortXMLByModelLevelIndex($xml, $removeIndexAttr = true) {
- $xslt = '
-
-
-
-
-
-
-
-
-
- ';
-
- $xsldoc = new \DOMDocument();
- $xsldoc->loadXML($xslt);
-
- $xmldoc = new \DOMDocument();
- $xmldoc->loadXML($xml);
-
- $xsl = new \XSLTProcessor();
- $xsl->importStyleSheet($xsldoc);
-
- $res = $xsl->transformToXML($xmldoc);
-
- // remove attribute model-level-index
- if ($removeIndexAttr) {
- $res = preg_replace('/ model-level-index="\d+"/', '', $res);
- }
-
- return $res;
- }
-
- /**
- * removes all children of element except of key elements, which has to remain
- *
- * @param \DOMElement $domNode
- * @param \DOMNodeList $domNodeChildren
- * @param bool $leaveKey
- * @param bool $recursive
- *
- * @return int number of key elements, that remains
- */
- public function removeChildrenExceptOfKeyElements($domNode, $domNodeChildren, $leaveKey = false, $recursive = false)
- {
- $keyElemIndex = $keyElemsCnt = 0;
-
- while ($domNodeChildren->length > $keyElemIndex) {
- $isKey = $isCreated = false;
- $child = $domNodeChildren->item($keyElemIndex);
-
- if ($child->hasAttributes()) {
- foreach ($child->attributes as $attr) {
- if ($attr->nodeName == "iskey" && $attr->nodeValue == "true") {
- if ($child->hasAttributes()) {
- foreach ($child->attributes as $attr) {
- if ($attr->nodeName !== 'xc:operation') {
- $attributesArr[] = $attr->nodeName;
- }
- }
- // remove must be in new foreach, previous deletes only first one
- foreach ($attributesArr as $attrName) {
- $child->removeAttribute($attrName);
- }
- }
- if ($leaveKey == true) {
- $keyElemIndex++;
- $isKey = true;
- } else if (isset($child)) {
- $nodeName = $child->nodeName;
- $nodeValue = $child->nodeValue;
- $domNode->setAttribute("GUIcustom_".$nodeName, $nodeValue);
- }
- $keyElemsCnt++;
- } elseif ($attr->nodeName == "xc:operation" && $attr->nodeValue == "create") {
- $keyElemIndex++;
- $isCreated = true;
- }
- }
- }
-
- if ((!$isKey && !$isCreated) || $leaveKey == false) {
- try {
- $childrenRemains = 0;
-
- // recursively check all children for their key elements
- if (sizeof($child->childNodes) && $recursive) {
- foreach ($child->childNodes as $chnode) {
- if (sizeof($chnode->childNodes)) {
- $childrenRemains += $this->removeChildrenExceptOfKeyElements($chnode, $chnode->childNodes, $leaveKey, $recursive);
- }
- }
- }
-
- if ($childrenRemains == 0) {
- $domNode->removeChild($child);
- } else {
- $keyElemIndex++;
- }
-
- } catch (\DOMException $e) {
-
- }
- }
- }
-
- if ($domNode->hasAttributes()) {
- foreach ($domNode->attributes as $attr) {
- if (strpos($attr->nodeName, "GUIcustom_") !== 0) {
- $attributesArr[] = $attr->nodeName;
- }
- }
- // remove must be in new foreach, previous deletes only first one
- foreach ($attributesArr as $attrName) {
- $domNode->removeAttribute($attrName);
- }
- }
- return $keyElemsCnt;
- }
-
- /**
- * inserts new element into given XML tree
- *
- * @param \SimpleXMLElement $configXml xml file
- * @param string $xpath XPath to the element (without initial /)
- * @param string $label label value
- * @param string $value new value
- * @param string $xPathPrefix
- * @param bool $addCreateNS
- *
- * @return array array of \SimpleXMLElement modified node, which is always first response
- */
- public function insertNewElemIntoXMLTree(&$configXml, $xpath, $label, $value, $xPathPrefix = "xmlns:", $addCreateNS = true)
- {
- /**
- * get node according to xPath query
- * @var \SimpleXMLElement $node
- * @var \SimpleXMLElement $elem
- * @var \SimpleXMLElement $elemModel
- */
- $node = $configXml->xpath('/'.$xPathPrefix.$xpath);
- $retArr = array();
-
- if ($value === "" || $value === false) {
- $elem = $node[0]->addChild($label);
- } else {
- $elem = $node[0]->addChild($label, $value);
- }
- $elemIndex = sizeof($node[0]->children());
-
- if ($addCreateNS) {
- $elem->addAttribute("xc:operation", "create", "urn:ietf:params:xml:ns:netconf:base:1.0");
- }
-
- array_push($retArr, $elem);
-
- // we have to check new insterted element model (load model to XML)
- $xml = $configXml->asXML();
- $xml = $this->mergeXMLWithModel($xml);
- $tmpXml = simplexml_load_string($xml);
- if (isset($configXml->getNamespaces()[""])) {
- $tmpXml->registerXPathNamespace(str_replace(":", "", $xPathPrefix), $configXml->getNamespaces()[""]);
- }
- $elemWithModel = $tmpXml->xpath('/'.$xPathPrefix.$xpath.'/*['.$elemIndex.']');
-
- /* We don't want to auto generate leaf-ref now
- if ($elemWithModel[0]) {
- $elemModel = $elemWithModel[0];
- $leafRefPath = "";
- $isLeafRef = false;
- foreach ($elemModel->attributes() as $key => $val) {
- if ($key == 'type' && $val[0] == 'leafref') {
- $isLeafRef = true;
- } elseif ($key == 'leafref-path') {
- $leafRefPath = $val[0];
- }
-
- if ($isLeafRef && $leafRefPath != "") {
- $refElem = $this->addElementRefOnXPath($configXml, (string)$elem[0], $leafRefPath, $xPathPrefix);
- if ($refElem instanceof \SimpleXMLElement) {
- array_push($retArr, $refElem);
- }
- break;
- }
- }
- }
- */
-
- return $retArr;
- }
-
- /**
- * @param \SimpleXMLElement $configXml
- * @param $refValue value to add
- * @param $leafRefPath xpath to target ref
- * @param string $xPathPrefix
- * @param bool $addCreateNS
- *
- * @return \SimpleXMLElement|bool first added element (root of possible subtree)
- */
- public function addElementRefOnXPath(&$configXml, $refValue, $leafRefPath, $xPathPrefix = "xmlns:", $addCreateNS = true) {
-
- // check if target leaf ref does not exists already (we don't have to add add)
- $xpath = str_replace("/", "/xmlns:", $leafRefPath);
- $targets = $configXml->xpath($xpath);
- if (sizeof($targets)) {
- foreach ($targets as $target) {
- $val = (string)$target;
- if ($val == $refValue) {
- return true;
- }
- }
- }
-
- // start with first part of xpath
- $pathLevels = explode('/', $leafRefPath);
- $xpath = "";
-
- $currentRoot = $configXml->xpath("/xmlns:*");
-
- // go throug all xpath parts and check, if element already exists
- for ($i = 0; $i < sizeof($pathLevels); $i++) {
- $path = $pathLevels[$i];
- if ($path == '') continue;
-
- $xpath .= "/".$xPathPrefix.$path;
- $elem = $configXml->xpath($xpath);
-
- // remove all children from root element
- $isLastElement = ($i == sizeof($pathLevels) - 1);
- if (sizeof($elem) && ($i == sizeof($pathLevels) - 2)) {
- $domNode = dom_import_simplexml($elem[0]);
- $newdoc = new \DOMDocument;
- $node = $newdoc->importNode($domNode, true);
- $newdoc->appendChild($node);
- $this->removeChildrenExceptOfKeyElements($node, $node->childNodes, $leaveKey = false);
-
- $newConfigXml = simplexml_import_dom($node);
- $newConfigXml->registerXPathNamespace(str_replace(":", "", $xPathPrefix), $configXml->getNamespaces()[""]);
- $configXml = $newConfigXml;
- $elem = $configXml->xpath($xpath);
- }
-
- // if element does not exists, create one
- if (!sizeof($elem)) {
-
- // last elem does not exists, create new one
- $elem = $currentRoot[0]->addChild($path);
-
- if ($addCreateNS) {
- $elem->addAttribute("xc:operation", "create", "urn:ietf:params:xml:ns:netconf:base:1.0");
- }
-
- if (!isset($firstAddedElement)) {
- $firstAddedElement = $elem;
- }
-
- $currentRoot = $elem;
- }
-
- // set correct ref value to last element
- if ($isLastElement) {
- $elem[0] = $refValue;
- }
-
- $currentRoot = $elem;
-
- }
-
- if (!isset($firstAddedElement)) {
- $firstAddedElement = $currentRoot;
- }
-
- return ($firstAddedElement[0] instanceof \SimpleXMLElement) ? $firstAddedElement[0] : $firstAddedElement;
- }
-
- /**
- * removes node from config XML tree
- *
- * @param int $key session key of current connection
- * @param array $configParams array of config params
- * @throws \ErrorException when get-config could not be loaded
- * @return int result code
- */
- public function handleRemoveNodeForm(&$key, $configParams) {
- $post_vals = $this->container->get('request')->get('removeNodeForm');
- $res = 0;
-
- try {
- if ( ($originalXml = $this->dataModel->handle('getconfig', $configParams, true)) != 1 ) {
- $tmpConfigXml = simplexml_load_string($originalXml);
-
- // save to temp file - for debugging
- if ($this->container->getParameter('kernel.environment') == 'dev') {
- @file_put_contents($this->container->get('kernel')->getRootDir().'/logs/tmp-files/original.yin', $tmpConfigXml->asXml());
- }
-
- // we will get namespaces from original getconfig and set them to simpleXml object, 'cause we need it for XPath queries
- $xmlNameSpaces = $tmpConfigXml->getNamespaces();
- if ( isset($xmlNameSpaces[""]) ) {
- $tmpConfigXml->registerXPathNamespace("xmlns", $xmlNameSpaces[""]);
- }
-
- $xpath = $this->decodeXPath($post_vals["parent"]);
- $toDelete = $tmpConfigXml->xpath($xpath);
- $deletestring = "";
-
- foreach ($toDelete as $td) {
- //$td->registerXPathNamespace("xc", "urn:ietf:params:xml:ns:netconf:base:1.0");
- $td->addAttribute("xc:operation", "remove", "urn:ietf:params:xml:ns:netconf:base:1.0");
- $deletestring .= "\n".str_replace('', '', $td->asXml());
- }
-
- $deleteTree = $this->completeRequestTree($toDelete[0], $deletestring);
-
- // for debugging, edited configXml will be saved into temp file
- if ($this->container->getParameter('kernel.environment') == 'dev') {
- @file_put_contents($this->container->get('kernel')->getRootDir().'/logs/tmp-files/removeNode.yin', $tmpConfigXml->asXml());
- }
- $res = $this->executeEditConfig($key, $deleteTree->asXml(), $configParams['source']);
- if ($res == 0) {
- $this->container->get('request')->getSession()->getFlashBag()->add('success', "Record has been removed.");
- }
- } else {
- throw new \ErrorException("Could not load config.");
- }
- } catch (\ErrorException $e) {
- $this->logger->warn('Could not remove node correctly.', array('error' => $e->getMessage()));
- $this->container->get('request')->getSession()->getFlashBag()->add('error', "Could not remove node correctly. ".$e->getMessage());
- }
-
- return $res;
-
- }
-
- /**
- * sends modified XML to server
- *
- * @param int $key session key of current connection
- * @param string $config XML document which will be send
- * @param string $target = "running" target source
- *
- * @param array $additionalParams
- *
- * @return int return 0 on success, 1 on error
- */
- private function executeEditConfig($key, $config, $target = "running", $additionalParams = array()) {
- $res = 0;
- $editConfigParams = array(
- 'key' => $key,
- 'target' => $target,
- 'config' => str_replace('', '', $config)
- );
- $editConfigParams = array_merge($editConfigParams, $additionalParams);
-
- // edit-cofig
- if ( ($merged = $this->dataModel->handle('editconfig', $editConfigParams)) != 1 ) {
- // for debugging purposes, we will save result into the temp file
- if ($this->container->getParameter('kernel.environment') == 'dev') {
- @file_put_contents($this->container->get('kernel')->getRootDir().'/logs/tmp-files/merged.yin', $merged);
- }
- } else {
- $this->logger->err('Edit-config failed.', array('params', $editConfigParams));
- // throw new \ErrorException('Edit-config failed.');
- $res = 1;
- }
- return $res;
- }
-
- /**
- * Removes header from text.
- *
- * @param string &$text string to remove XML header in
- * @return mixed returns an array if the subject parameter
- * is an array, or a string otherwise. If matches
- * are found, the new subject will be returned,
- * otherwise subject will be returned unchanged
- * or null if an error occurred.
- */
- public function removeXmlHeader(&$text) {
- return preg_replace("/<\?xml .*\?".">/i", "", $text);
- }
-
- /**
- * @return \SimpleXMLElement|false
- */
- public function loadModel() {
- $notEditedPath = $this->dataModel->getModelsDir();
- $path = $this->dataModel->getPathToModels();
- $modelFile = $path . 'wrapped.wyin';
- $res = false;
-
- $this->logger->info("Trying to find model in ", array('pathToFile' => $modelFile));
- if ( file_exists($modelFile) ) {
- $this->logger->info("Model found in ", array('pathToFile' => $modelFile));
- if ( $path != $notEditedPath ) {
- try {
- $res = simplexml_load_file($modelFile);
- } catch (\ErrorException $e) {
- $this->logger->err("Could not load model");
- }
- }
- } else {
- // TODO: if is not set module direcotory, we have to set model to merge with, maybe custom model?
- $this->logger->warn("Could not find model in ", array('pathToFile' => $modelFile));
- }
- return $res;
- }
-
- /**
- * Merge given XML with data model
- *
- * @param string $xml XML string
- * @return array|false false on error, merged array on success
- * @param array $params modification parameters for merge
- */
- public function mergeXMLWithModel(&$xml, $params = array()) {
- // load model
- $model = $this->loadModel();
- $res = false;
-
- if ($model !== false) {
- try {
- $res = $this->mergeWithModel($model, $xml, $params);
- } catch (\ErrorException $e) {
- // TODO
- $this->logger->err("Could not merge with model:", array('error' => $e->getMessage()));
- }
- }
- return $res;
- }
-
-
-/**
- * Check, if XML response is valid.
- *
- * @param string &$xmlString xml response
- * @return bool
- */
-public function isResponseValidXML(&$xmlString) {
- $e = false;
- try {
- @$simpleXMLRes = simplexml_load_string($xmlString);
- } catch (\ErrorException $e) {
- // Exception will be handled bellow
- }
- if ( (isset($simpleXMLRes) && $simpleXMLRes === false) || $e !== false) {
- // sometimes is exactly one root node missing
- // we will check, if is not XML valid with root node
- $xmlString = "<".self::$customRootElement.">".$xmlString."".self::$customRootElement.">";
- try {
- @$simpleXMLRes = simplexml_load_string($xmlString);
- if (!($simpleXMLRes instanceof \SimpleXMLElement)) {
- return false;
- }
- } catch (\ErrorException $e) {
- return false;
- }
- }
- return true;
-}
-
-/**
- * Get parent for element.
- *
- * @param $element
- * @return bool|\SimpleXMLElement
- */
-public function getElementParent($element) {
-
- $parentsChoice = $element->xpath("parent::*[@eltype='case']/parent::*[@eltype='choice']/parent::*");
- if (sizeof($parentsChoice)) {
- return $parentsChoice[0];
- }
-
- $parents = $element->xpath("parent::*");
- if ($parents) {
- return $parents[0];
- }
- return false;
-}
-
-/**
- * Check if two elements match.
- *
- * @param $model_el element from model
- * @param $possible_el element to match the model
- * @return bool
- */
-public function checkElemMatch($model_el, $possible_el) {
- $mel = $this->getElementParent($model_el);
- $pel = $this->getElementParent($possible_el);
-
- if ($mel instanceof \SimpleXMLElement && $pel instanceof \SimpleXMLElement) {
- while ($pel && $mel) {
- if ($pel->getName() !== $mel->getName()) {
- return false;
- }
- $pel = $this->getElementParent($pel);
- $mel = $this->getElementParent($mel);
- }
- return true;
- } else {
- return false;
- }
-}
-
- /**
- * Completes tree structure for target element.
- *
- * $params['attributesWhiteList'] = set array of white listed attributes to add
- * default empty array() - add all
- *
- * @param \SimpleXMLElement $source
- * @param \SimpleXMLElement $target
- * @param array $params modification parameters for merge
- */
-public function completeAttributes(&$source, &$target, $params = array()) {
- if (isset($params['attributesWhiteList']) && sizeof($params['attributesWhiteList'])) {
- $filterAttributes = $params['attributesWhiteList'];
- }
- if ($source->attributes()) {
- $attrs = $source->attributes();
-// var_dump($source->getName());
- if (in_array($attrs["eltype"], array("leaf","list","leaf-list", "container", "choice", "case"))) {
- foreach ($source->attributes() as $key => $val) {
-
- // skip attributes which are not in whitelist
- if (isset($filterAttributes) && !in_array($key, $filterAttributes)) continue;
-
- try {
- @$target->addAttribute($key, $val);
- } catch (\ErrorException $e) {
-// $this->logger->addWarning('Error in adding attributes: ', array('error' => $e->getMessage()));
- }
-
- }
- }
- }
-}
-
-/**
- * Find corresponding $el in configuration model $model and complete attributes from $model.
- *
- * @param \SimpleXMLElement &$model with data model
- * @param \SimpleXMLElement $el with element of response
- * @param array $params modification parameters for merge
- */
-public function findAndComplete(&$model, $el, $params = array()) {
- $modelns = $model->getNamespaces();
- $model->registerXPathNamespace("c", $modelns[""]);
- $found = $model->xpath("//c:". $el->getName());
-
- if (sizeof($found) == 1) {
- $this->completeAttributes($found[0], $el, $params);
- } else {
-// echo "Not found unique
";
- foreach ($found as $found_el) {
- if ($this->checkElemMatch($found_el, $el)) {
- $this->completeAttributes($found_el, $el, $params);
- break;
- }
- }
- }
-}
-
-/**
- * Go through $root_el tree that represents the response from Netconf server.
- *
- * @param \SimpleXMLElement &$model with data model
- * @param \SimpleXMLElement $root_el with element of response
- * @param array $params modification parameters for merge
- */
-public function mergeRecursive(&$model, $root_el, $params = array()) {
- if ($root_el->count() == 0) {
- $this->findAndComplete($model, $root_el, $params);
- // TODO: repair merge with root element (no parents)
- }
-
- foreach ($root_el as $ch) {
- $this->findAndComplete($model, $ch, $params);
- $this->mergeRecursive($model, $ch, $params);
- }
-
- foreach ($root_el->children as $ch) {
- $this->findAndComplete($model, $ch, $params);
- $this->mergeRecursive($model, $ch, $params);
- }
- }
-
- /**
- * Add attributes from configuration model to response such as config, mandatory, type.
- *
- * @param \SimpleXMLElement $model data configuration model
- * @param string $result data from netconf server
- * @return string the result of merge
- * @param array $params modification parameters for merge
- */
- public function mergeWithModel($model, $result, $params = array()) {
- if ($result) {
- $resxml = simplexml_load_string($result);
-
- $this->mergeRecursive($model, $resxml, $params);
-
- return $resxml->asXML();
- } else {
- return $result;
- }
- }
-
- /**
- * Validates input string against validation files saved in models directory.
- * For now, only two validation step are set up - RelaxNG (*.rng) and Schema (*.xsd)
- *
- * @param string $xml xml string to validate with RelaxNG and Schema, if available
- * @return bool
- */
- public function validateXml($xml) {
- $finder = new Finder();
- $domDoc = new \DOMDocument();
- $xml = "".$xml."";
- $domDoc->loadXML($xml);
-
- $iterator = $finder
- ->files()
- ->name("/.*data\.(rng|xsd)$/")
- ->in($this->dataModel->getPathToModels());
-
- try {
- foreach ($iterator as $file) {
- $path = $file->getRealPath();
- if (strpos($path, "rng")) {
- try {
- if (!@$domDoc->relaxNGValidate($path)) {
- return false;
- }
- } catch (\ContextErrorException $e) {
- $this->logger->addWarning($e->getMessage());
- return false;
- }
- } else if (strpos($path, "xsd")) {
- try {
- if (!@$domDoc->schemaValidate($path)) {
- return false;
- }
- } catch (\ContextErrorException $e) {
- $this->logger->addWarning($e->getMessage());
- return false;
- }
- }
- }
- } catch (\ErrorException $e) {
- $this->logger->addWarning("XML is not valid.", array('error' => $e->getMessage(), 'xml' => $xml, 'RNGfile' => $path));
- return false;
- }
-
- return true;
-
- }
-
- /**
- * loads available values for element from model
- *
- * @param $formId unique form identifier (for caching response)
- * @param $xPath
- *
- * @return array
- */
- public function getAvailableLabelValuesForXPath($formId, $xPath) {
-
- /**
- * @var \winzou\CacheBundle\Cache\LifetimeFileCache $cache
- */
- $cache = $this->container->get('winzou_cache');
-
- if ($cache->contains('getResponseForFormId_'.$formId)) {
- $xml = $cache->fetch('getResponseForFormId_'.$formId);
- } else {
- $xml = $this->loadModel()->asXML();
- $cache->save('getResponseForFormId_'.$formId, $xml, 1000);
- }
-
- $labelsArr = array();
- $attributesArr = array();
- $elemsArr= array();
- if ($xml !== false) {
- $dom = new \DOMDocument();
- $dom->loadXML($xml);
-
- $decodedXPath = str_replace("/", "/xmlns:", $this->decodeXPath($xPath))."/*";
- if (strpos($xPath, '----') !== false) {
- // we have to correct xpath selector if xpath start with '//'
- $decodedXPath = str_replace('xmlns:/', '/', $decodedXPath);
- } else {
- // we have to remove all array selectors [D]
- $decodedXPath = preg_replace('/\[[0-9]+\]/', '', $decodedXPath);
- // we have to add one level for "module" (root) element, which in model in addition to getconfig response
- $decodedXPath = '/xmlns:*'.$decodedXPath;
- }
- $domXpath = new \DOMXPath($dom);
-
- $context = $dom->documentElement;
- foreach( $domXpath->query('namespace::*', $context) as $node ) {
- $domXpath->registerNamespace($node->nodeName, $node->nodeValue);
- }
-
- $elements = $domXpath->query($decodedXPath);
-
- if (!is_null($elements)) {
- foreach ($elements as $element) {
- $isChoice = $isConfig = false;
- $elemsArr[$element->nodeName] = simplexml_import_dom($element, 'SimpleXMLIterator');
- if ($element->hasAttributes()) {
- foreach ($element->attributes as $attr) {
- // if element is choice, we should load case statements bellow
- if ($attr->nodeName == "eltype" && $attr->nodeValue == "choice") {
- $isChoice = true;
- } else if ($attr->nodeName == "config" && $attr->nodeValue == "true") {
- $isConfig = true;
- }
- $attributesArr[$element->nodeName][$attr->nodeName] = $attr->nodeValue;
- }
- }
-
- if (!$isConfig) {
- continue;
- }
-
- // load case statement (children of element choice)
- if ($isChoice) {
- if ($element->hasChildNodes()) {
- foreach ($element->childNodes as $child) {
- $isAllowedEltype = $isConfig = false;
-
- if ($child->hasAttributes()) {
- foreach ($child->attributes as $attr) {
- $isSubCase = false;
-
- // check if is confing
- if ($attr->nodeName == "config" && $attr->nodeValue == "true") {
- $isConfig = true;
- }
-
- // load only available elementtypes
- if ($attr->nodeName == "eltype" && in_array($attr->nodeValue, array('case', 'container', 'leaf', 'leaf-list', 'list'))) {
- $isAllowedEltype = true;
-
- // if its case statement, try to load child with same name and complete its attributes
- if ($attr->nodeValue == "case" && $child->hasChildNodes()) {
- foreach ($child->childNodes as $subchild) {
- if ($subchild->nodeName == $child->nodeName && $subchild->hasAttributes()) {
- $isSubCase = true;
- foreach ($subchild->attributes as $attr) {
- $attributesArr[$child->nodeName][$attr->nodeName] = $attr->nodeValue;
- }
- }
- }
- }
- }
- if (!$isSubCase) {
- $attributesArr[$child->nodeName][$attr->nodeName] = $attr->nodeValue;
- }
- if ($isAllowedEltype && $isConfig) {
- array_push($labelsArr, $child->nodeName);
- break;
- }
- }
- }
- }
- }
- } else {
- array_push($labelsArr, $element->nodeName);
- }
-
- }
- }
- }
- $labelsArr = array_values(array_unique($labelsArr));
-
- $retArr['labels'] = $labelsArr;
- $retArr['labelsAttributes'] = $attributesArr;
- $retArr['elems'] = $elemsArr;
- return $retArr;
- }
-
- /**
- * @param \SimpleXMLIterator $element
- * @param \Twig_Template $template
- *
- * @param string $formId
- * @param string $xPath
- * @param string $requiredChildren
- * @param array $identityRefs
- *
- * @return array|bool
- */
- public function getChildrenValues($element, $template, $formId, $xPath = "", $requiredChildren = "", $identityRefs = array()) {
- $retArr = array();
- $targetAttributes = array('key', 'iskey', 'mandatory');
-
- foreach ($element as $label => $el) {
- $attributesArr = array_fill_keys($targetAttributes, false);
-
- foreach ($element->attributes() as $name => $attr) {
- if ($name == "key") {
- $attributesArr[$name] = (string)$attr[0];
- }
- }
-
- foreach ($el->attributes() as $name => $attr) {
- if (in_array($name, array('iskey', 'mandatory'))) {
- $attributesArr[$name] = (string)$attr[0];
- }
- }
-
- if ( (($attributesArr['iskey'] !== "true" && $attributesArr['key'] == false)
- ||
- ($requiredChildren !== "" && $label != $requiredChildren))
- && $attributesArr['mandatory'] == false
- ) {
- continue;
- }
-
- if ($attributesArr['key'] !== false) {
- $requiredChildren = $attributesArr['key'];
- } else {
- $requiredChildren = "";
- }
-
- $twigArr = array();
- $twigArr['key'] = "";
- $twigArr['xpath'] = "";
- $twigArr['element'] = $el;
- $twigArr['useHiddenInput'] = true;
- $twigArr['moduleIdentityRefs'] = $identityRefs;
-
- $newXPath = $xPath . "/*";
- $res = $this->getAvailableLabelValuesForXPath($formId, $newXPath);
-
- $retArr[$label] = array();
- if (isset($res['labelsAttributes'][$label])) {
- $retArr[$label]['labelAttributes'] = $res['labelsAttributes'][$label];
- }
- $retArr[$label]['valueElem'] = $this->removeMultipleWhitespaces($template->renderBlock('configInputElem', $twigArr));
- $retArr[$label]['children'] = $this->getChildrenValues($el, $template, $formId, $newXPath, $requiredChildren);
- }
-
- return sizeof($retArr) ? $retArr : false;
- }
-
- public function removeMultipleWhitespaces($str) {
- return preg_replace( "/\s+/", " ", $str );
- }
-}
diff --git a/src/FIT/NetopeerBundle/Resources/config/functionality.yml b/src/FIT/NetopeerBundle/Resources/config/functionality.yml
new file mode 100644
index 00000000..eb24e86f
--- /dev/null
+++ b/src/FIT/NetopeerBundle/Resources/config/functionality.yml
@@ -0,0 +1,51 @@
+# @author David Alexa
+#
+# Copyright (C) 2012-2015 CESNET
+#
+# LICENSE TERMS
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name of the Company nor the names of its contributors
+# may be used to endorse or promote products derived from this
+# software without specific prior written permission.
+#
+# ALTERNATIVELY, provided that this notice is retained in full, this
+# product may be distributed under the terms of the GNU General Public
+# License (GPL) version 2 or later, in which case the provisions
+# of the GPL apply INSTEAD OF those given above.
+#
+# This software is provided ``as is'', and any express or implied
+# warranties, including, but not limited to, the implied warranties of
+# merchantability and fitness for a particular purpose are disclaimed.
+# In no event shall the company or contributors be liable for any
+# direct, indirect, incidental, special, exemplary, or consequential
+# damages (including, but not limited to, procurement of substitute
+# goods or services; loss of use, data, or profits; or business
+# interruption) however caused and on any theory of liability, whether
+# in contract, strict liability, or tort (including negligence or
+# otherwise) arising in any way out of the use of this software, even
+# if advised of the possibility of such damage.
+
+services:
+ fitnetopeerbundle.service.connection.functionality:
+ class: FIT\NetopeerBundle\Services\Functionality\ConnectionFunctionality
+ calls:
+ - [setLogger, [@data_logger]]
+ - [setCache, [@winzou_cache]]
+ - [setSession, [@session]]
+ - [setContainer, [@service_container]]
+ - [setEntityManager, [@doctrine.orm.entity_manager]]
+ fitnetopeerbundle.service.netconf.functionality:
+ class: %netopeer.netconf.functionality%
+ calls:
+ - [setLogger, [@data_logger]]
+ - [setSession, [@session]]
+ - [setConnectionFunctionality, [@fitnetopeerbundle.service.connection.functionality]]
\ No newline at end of file
diff --git a/src/FIT/NetopeerBundle/Resources/config/services.yml b/src/FIT/NetopeerBundle/Resources/config/services.yml
index ebdf66f8..8217b37f 100644
--- a/src/FIT/NetopeerBundle/Resources/config/services.yml
+++ b/src/FIT/NetopeerBundle/Resources/config/services.yml
@@ -33,7 +33,10 @@
# in contract, strict liability, or tort (including negligence or
# otherwise) arising in any way out of the use of this software, even
# if advised of the possibility of such damage.
-
+
+imports:
+ - { resource: "functionality.yml" }
+
services:
data_logger:
class: Symfony\Bridge\Monolog\Logger
@@ -42,27 +45,23 @@ services:
- [pushHandler, [@data_handler]]
data_handler:
- class: Monolog\Handler\StreamHandler
+ class: Monolog\Handler\StreamHandler
arguments: [%kernel.logs_dir%/%kernel.environment%.data.log]
authentication_handler:
class: FIT\NetopeerBundle\Handler\AuthenticationHandler
- arguments: [@service_container, @data_logger, @DataModel]
-
- DataModel:
- class: %netopeer.data.class%
- arguments: [@service_container, @data_logger]
+ arguments: [@service_container]
- XMLoperations:
- class: FIT\NetopeerBundle\Models\XMLoperations
- arguments: [@service_container, @data_logger, @DataModel]
+# XMLoperations:
+# class: FIT\NetopeerBundle\Models\XMLoperations
+# arguments: [@service_container, @data_logger, @fitnetopeerbundle.service.netconf.functionality]
BaseConnection:
class: FIT\NetopeerBundle\Entity\BaseConnection
arguments: [@doctrine.orm.entity_manager, @security.context, @data_logger]
SamlToState:
- class: FIT\NetopeerBundle\Models\SamlToState
+ class: FIT\NetopeerBundle\Services\Managers\SamlToState
arguments: [@service_container, @data_logger]
netopeer.twig.netopeer_twig_extension:
@@ -72,7 +71,7 @@ services:
moduleListener:
class: FIT\NetopeerBundle\EventListener\ModuleListener
- arguments: [@DataModel, @doctrine.orm.entity_manager, @data_logger]
+ arguments: [@fitnetopeerbundle.service.connection.functionality, @doctrine.orm.entity_manager, @data_logger]
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelController }
@@ -82,14 +81,4 @@ services:
class: %winzou_cache.driver.abstract%
arguments:
- file # just modify this value to use another cache
- #- {'cache_dir': /tmp/cache } # you can omit this if you don't use FileCache or if the default value is ok for you
-
- ajaxController:
- class: FIT\NetopeerBundle\Controller\AjaxController
- arguments:
- container: "@service_container"
-
- securityController:
- class: FIT\NetopeerBundle\Controller\SecurityController
- arguments:
- container: "@service_container"
+ #- {'cache_dir': /tmp/cache } # you can omit this if you don't use FileCache or if the default value is ok for you
\ No newline at end of file
diff --git a/src/FIT/NetopeerBundle/Resources/public/js/jquery.netopeergui.js b/src/FIT/NetopeerBundle/Resources/public/js/jquery.netopeergui.js
index 0b063c4a..c5ae9a9f 100644
--- a/src/FIT/NetopeerBundle/Resources/public/js/jquery.netopeergui.js
+++ b/src/FIT/NetopeerBundle/Resources/public/js/jquery.netopeergui.js
@@ -81,9 +81,25 @@ jQuery.extend({
// browsers change the syntax of inserted
- {% endif %}