Moved ngViews and ngLib to gui folder
diff --git a/gui/ngXosViews/.gitignore b/gui/ngXosViews/.gitignore
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gui/ngXosViews/.gitignore
diff --git a/gui/ngXosViews/ceilometerDashboard/.bowerrc b/gui/ngXosViews/ceilometerDashboard/.bowerrc
new file mode 100644
index 0000000..e491038
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/.bowerrc
@@ -0,0 +1,3 @@
+{
+ "directory": "src/vendor/"
+}
\ No newline at end of file
diff --git a/gui/ngXosViews/ceilometerDashboard/.eslintrc b/gui/ngXosViews/ceilometerDashboard/.eslintrc
new file mode 100644
index 0000000..868fd4b
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/.eslintrc
@@ -0,0 +1,44 @@
+{
+ "ecmaFeatures": {
+ "blockBindings": true,
+ "forOf": true,
+ "destructuring": true,
+ "arrowFunctions": true,
+ "templateStrings": true
+ },
+ "env": {
+ "browser": true,
+ "node": true,
+ "es6": true
+ },
+ "plugins": [
+ //"angular"
+ ],
+ "rules": {
+ "quotes": [2, "single"],
+ "camelcase": [0, {"properties": "always"}],
+ "no-underscore-dangle": 1,
+ "eqeqeq": [2, "smart"],
+ "no-alert": 1,
+ "key-spacing": [1, { "beforeColon": false, "afterColon": true }],
+ "indent": [2, 2],
+ "no-irregular-whitespace": 1,
+ "eol-last": 0,
+ "max-nested-callbacks": [2, 4],
+ "comma-spacing": [1, {"before": false, "after": true}],
+ "no-trailing-spaces": [1, { skipBlankLines: true }],
+ "no-unused-vars": [1, {"vars": "all", "args": "after-used"}],
+ "new-cap": 0,
+ "no-undef": 2,
+
+ //"angular/ng_module_name": [2, '/^xos\.*[a-z]*$/'],
+ //"angular/ng_controller_name": [2, '/^[a-z].*Ctrl$/'],
+ //"angular/ng_service_name": [2, '/^[A-Z].*Service$/'],
+ //"angular/ng_directive_name": [2, '/^[a-z]+[[A-Z].*]*$/'],
+ //"angular/ng_di": [0, "function or array"]
+ },
+ "globals" :{
+ "angular": true,
+ "Chart": true
+ }
+}
\ No newline at end of file
diff --git a/gui/ngXosViews/ceilometerDashboard/.gitignore b/gui/ngXosViews/ceilometerDashboard/.gitignore
new file mode 100644
index 0000000..567aee4
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/.gitignore
@@ -0,0 +1,6 @@
+dist/
+src/vendor
+.tmp
+node_modules
+npm-debug.log
+dist/
\ No newline at end of file
diff --git a/gui/ngXosViews/ceilometerDashboard/bower.json b/gui/ngXosViews/ceilometerDashboard/bower.json
new file mode 100644
index 0000000..363d59d
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/bower.json
@@ -0,0 +1,37 @@
+{
+ "name": "xos-ceilometerDashboard",
+ "version": "0.0.0",
+ "authors": [
+ "Matteo Scandolo <teo@onlab.us>"
+ ],
+ "description": "The ceilometerDashboard view",
+ "license": "MIT",
+ "ignore": [
+ "**/.*",
+ "node_modules",
+ "bower_components",
+ "static/js/vendor/",
+ "test",
+ "tests"
+ ],
+ "dependencies": {
+ "angular-chart.js": "~0.8.7",
+ "angular-animate": "~1.4.8",
+ "ui.bootstrap": "~0.14.3"
+ },
+ "devDependencies": {
+ "jquery": "~2.1.4",
+ "angular-mocks": "~1.4.7",
+ "angular": "~1.4.7",
+ "angular-ui-router": "~0.2.15",
+ "angular-cookies": "~1.4.7",
+ "angular-resource": "~1.4.7",
+ "ng-lodash": "~0.3.0",
+ "bootstrap-css": "3.3.4"
+ },
+ "overrides": {
+ "ui.bootstrap": {
+ "main": ["src/accordion/accordion.js", "src/collapse/collapse.js"]
+ }
+ }
+}
diff --git a/gui/ngXosViews/ceilometerDashboard/env/default.js b/gui/ngXosViews/ceilometerDashboard/env/default.js
new file mode 100644
index 0000000..778faac
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/env/default.js
@@ -0,0 +1,13 @@
+// This is a default configuration for your development environment.
+// You can duplicate this configuration for any of your Backend Environments.
+// Different configurations are loaded setting a NODE_ENV variable that contain the config file name.
+// `NODE_ENV=local npm start`
+//
+// If xoscsrftoken or xossessionid are not specified the browser value are used
+// (works only for local environment as both application are served on the same domain)
+
+module.exports = {
+ host: 'http://clnode015.clemson.cloudlab.us:9999/',
+ xoscsrftoken: 'gvAeNnr2DoQMorphFSxs4nXDSIDAT61Q',
+ xossessionid: 'qu69xzr4u5755w9hhuqa0djxacvi9k9i'
+};
diff --git a/gui/ngXosViews/ceilometerDashboard/env/srikanth.js b/gui/ngXosViews/ceilometerDashboard/env/srikanth.js
new file mode 100644
index 0000000..8d76a20
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/env/srikanth.js
@@ -0,0 +1,13 @@
+// This is a default configuration for your development environment.
+// You can duplicate this configuration for any of your Backend Environments.
+// Different configurations are loaded setting a NODE_ENV variable that contain the config file name.
+// `NODE_ENV=local npm start`
+//
+// If xoscsrftoken or xossessionid are not specified the browser value are used
+// (works only for local environment as both application are served on the same domain)
+
+module.exports = {
+ host: 'http://130.127.133.87:9999',
+ xoscsrftoken: 'Ed51juEvODfN01dtXO7iqRkXDdBIL0sr',
+ xossessionid: 'b3vg7a2qtm7roclcwlqkf7f5xca645jx'
+};
diff --git a/gui/ngXosViews/ceilometerDashboard/gulp/build.js b/gui/ngXosViews/ceilometerDashboard/gulp/build.js
new file mode 100644
index 0000000..9f9bfb8
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/gulp/build.js
@@ -0,0 +1,149 @@
+'use strict';
+
+// BUILD
+//
+// The only purpose of this gulpfile is to build a XOS view and copy the correct files into
+// .html => dashboards
+// .js (minified and concat) => static/js
+//
+// The template are parsed and added to js with angular $templateCache
+
+var gulp = require('gulp');
+var ngAnnotate = require('gulp-ng-annotate');
+var uglify = require('gulp-uglify');
+var templateCache = require('gulp-angular-templatecache');
+var runSequence = require('run-sequence');
+var concat = require('gulp-concat');
+var del = require('del');
+var wiredep = require('wiredep');
+var angularFilesort = require('gulp-angular-filesort');
+var _ = require('lodash');
+var eslint = require('gulp-eslint');
+var inject = require('gulp-inject');
+var rename = require('gulp-rename');
+var replace = require('gulp-replace');
+var postcss = require('gulp-postcss');
+var autoprefixer = require('autoprefixer');
+var mqpacker = require('css-mqpacker');
+var csswring = require('csswring');
+
+var TEMPLATE_FOOTER = `}]);
+angular.module('xos.ceilometerDashboard').run(function($location){$location.path('/')});
+angular.bootstrap(angular.element('#xosCeilometerDashboard'), ['xos.ceilometerDashboard']);`;
+
+module.exports = function(options){
+
+ // delete previous builded file
+ gulp.task('clean', function(){
+ return del(
+ [options.dashboards + 'xosCeilometerDashboard.html'],
+ {force: true}
+ );
+ });
+
+ // minify css
+ gulp.task('css', function () {
+ var processors = [
+ autoprefixer({browsers: ['last 1 version']}),
+ mqpacker,
+ csswring
+ ];
+
+ gulp.src([
+ `${options.css}**/*.css`,
+ `!${options.css}dev.css`
+ ])
+ .pipe(postcss(processors))
+ .pipe(gulp.dest(options.tmp + '/css/'));
+ });
+
+ gulp.task('copyCss', ['css'], function(){
+ return gulp.src([`${options.tmp}/css/*.css`])
+ .pipe(concat('xosCeilometerDashboard.css'))
+ .pipe(gulp.dest(options.static + 'css/'))
+ });
+
+ // compile and minify scripts
+ gulp.task('scripts', function() {
+ return gulp.src([
+ options.tmp + '**/*.js'
+ ])
+ .pipe(ngAnnotate())
+ .pipe(angularFilesort())
+ .pipe(concat('xosCeilometerDashboard.js'))
+ .pipe(uglify())
+ .pipe(gulp.dest(options.static + 'js/'));
+ });
+
+ // set templates in cache
+ gulp.task('templates', function(){
+ return gulp.src('./src/templates/*.html')
+ .pipe(templateCache({
+ module: 'xos.ceilometerDashboard',
+ root: 'templates/',
+ templateFooter: TEMPLATE_FOOTER
+ }))
+ .pipe(gulp.dest(options.tmp));
+ });
+
+ // copy html index to Django Folder
+ gulp.task('copyHtml', ['clean'], function(){
+ return gulp.src(options.src + 'index.html')
+ // remove dev dependencies from html
+ .pipe(replace(/<!-- bower:css -->(\n.*)*\n<!-- endbower --><!-- endcss -->/, ''))
+ .pipe(replace(/<!-- bower:js -->(\n.*)*\n<!-- endbower --><!-- endjs -->/, ''))
+ .pipe(replace(/ng-app=".*"\s/, ''))
+ //rewriting css path
+ // .pipe(replace(/(<link.*">)/, ''))
+ // injecting minified files
+ .pipe(
+ inject(
+ gulp.src([
+ options.static + 'js/vendor/xosCeilometerDashboardVendor.js',
+ options.static + 'js/xosCeilometerDashboard.js',
+ options.static + 'css/xosCeilometerDashboard.css'
+ ])
+ )
+ )
+ .pipe(rename('xosCeilometerDashboard.html'))
+ .pipe(gulp.dest(options.dashboards));
+ });
+
+ // minify vendor js files
+ gulp.task('wiredep', function(){
+ var bowerDeps = wiredep().js;
+ if(!bowerDeps){
+ return;
+ }
+
+ // remove angular (it's already loaded)
+ _.remove(bowerDeps, function(dep){
+ return dep.indexOf('angular/angular.js') !== -1;
+ });
+
+ return gulp.src(bowerDeps)
+ .pipe(concat('xosCeilometerDashboardVendor.js'))
+ .pipe(uglify())
+ .pipe(gulp.dest(options.static + 'js/vendor/'));
+ });
+
+ gulp.task('lint', function () {
+ return gulp.src(['src/js/**/*.js'])
+ .pipe(eslint())
+ .pipe(eslint.format())
+ .pipe(eslint.failAfterError());
+ });
+
+ gulp.task('build', function() {
+ runSequence(
+ 'lint',
+ 'templates',
+ 'babel',
+ 'scripts',
+ 'wiredep',
+ 'copyHtml',
+ 'copyCss',
+ 'cleanTmp'
+ );
+ });
+};
\ No newline at end of file
diff --git a/gui/ngXosViews/ceilometerDashboard/gulp/server.js b/gui/ngXosViews/ceilometerDashboard/gulp/server.js
new file mode 100644
index 0000000..7268b13
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/gulp/server.js
@@ -0,0 +1,159 @@
+'use strict';
+
+var gulp = require('gulp');
+var browserSync = require('browser-sync').create();
+var inject = require('gulp-inject');
+var runSequence = require('run-sequence');
+var angularFilesort = require('gulp-angular-filesort');
+var babel = require('gulp-babel');
+var wiredep = require('wiredep').stream;
+var httpProxy = require('http-proxy');
+var del = require('del');
+var debug = require('gulp-debug');
+
+const environment = process.env.NODE_ENV;
+
+if (environment){
+ var conf = require(`../env/${environment}.js`);
+}
+else{
+ var conf = require('../env/default.js')
+}
+
+console.log(conf);
+
+var proxy = httpProxy.createProxyServer({
+ target: conf.host || 'http://0.0.0.0:9999'
+});
+
+
+proxy.on('error', function(error, req, res) {
+ res.writeHead(500, {
+ 'Content-Type': 'text/plain'
+ });
+
+ console.error('[Proxy]', error);
+});
+
+module.exports = function(options){
+
+ // open in browser with sync and proxy to 0.0.0.0
+ gulp.task('browser', function() {
+ browserSync.init({
+ // reloadDelay: 500,
+ // logLevel: 'debug',
+ // logConnections: true,
+ startPath: '#/',
+ snippetOptions: {
+ rule: {
+ match: /<!-- browserSync -->/i
+ }
+ },
+ server: {
+ baseDir: options.src,
+ routes: {
+ '/api': options.api,
+ '/xosHelpers/src': options.helpers
+ },
+ middleware: function(req, res, next){
+ if(
+ req.url.indexOf('/xos/') !== -1 ||
+ req.url.indexOf('/xoslib/') !== -1 ||
+ req.url.indexOf('/hpcapi/') !== -1
+ ){
+ if(conf.xoscsrftoken && conf.xossessionid){
+ req.headers.cookie = `xoscsrftoken=${conf.xoscsrftoken}; xossessionid=${conf.xossessionid}`;
+ req.headers['x-csrftoken'] = conf.xoscsrftoken;
+ }
+ proxy.web(req, res);
+ }
+ else{
+ next();
+ }
+ }
+ }
+ });
+
+ gulp.watch(options.src + 'js/**/*.js', ['js-watch']);
+
+ gulp.watch(options.src + 'vendor/**/*.js', ['bower'], function(){
+ console.log('Bower Package added!');
+ browserSync.reload();
+ });
+ gulp.watch(options.src + '**/*.html', function(){
+ browserSync.reload();
+ });
+ });
+
+ // transpile js with sourceMaps
+ gulp.task('babel', function(){
+ return gulp.src([options.scripts + '**/*.js'])
+ .pipe(babel({sourceMaps: true}))
+ .pipe(gulp.dest(options.tmp));
+ });
+
+ // inject scripts
+ gulp.task('injectScript', function(){
+ console.log(options.tmp);
+ runSequence(
+ 'cleanTmp',
+ 'babel',
+ function() {
+ return gulp.src(options.src + 'index.html')
+ .pipe(
+ inject(
+ gulp.src([
+ options.tmp + '**/*.js',
+ options.api + '*.js',
+ options.helpers + '**/*.js'
+ ])
+ // .pipe(debug({title: 'unicorn:'}))
+ .pipe(angularFilesort()),
+ {
+ ignorePath: [options.src, '/../../ngXosLib']
+ }
+ )
+ )
+ .pipe(gulp.dest(options.src));
+ }
+ );
+ });
+
+ // inject CSS
+ gulp.task('injectCss', function(){
+ return gulp.src(options.src + 'index.html')
+ .pipe(
+ inject(
+ gulp.src(options.src + 'css/*.css'),
+ {
+ ignorePath: [options.src]
+ }
+ )
+ )
+ .pipe(gulp.dest(options.src));
+ });
+
+ // inject bower dependencies with wiredep
+ gulp.task('bower', function () {
+ return gulp.src(options.src + 'index.html')
+ .pipe(wiredep({devDependencies: true}))
+ .pipe(gulp.dest(options.src));
+ });
+
+ gulp.task('js-watch', ['injectScript'], function(){
+ browserSync.reload();
+ });
+
+ gulp.task('cleanTmp', function(){
+ return del([options.tmp + '**/*']);
+ });
+
+ gulp.task('serve', function() {
+ runSequence(
+ 'bower',
+ 'injectScript',
+ 'injectCss',
+ ['browser']
+ );
+ });
+};
diff --git a/gui/ngXosViews/ceilometerDashboard/gulpfile.js b/gui/ngXosViews/ceilometerDashboard/gulpfile.js
new file mode 100644
index 0000000..a3523ee
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/gulpfile.js
@@ -0,0 +1,25 @@
+'use strict';
+
+var gulp = require('gulp');
+var wrench = require('wrench');
+
+var options = {
+ src: 'src/',
+ css: 'src/css/',
+ scripts: 'src/js/',
+ tmp: 'src/.tmp',
+ dist: 'dist/',
+ api: '../../ngXosLib/api/',
+ helpers: '../../ngXosLib/xosHelpers/src/',
+ static: '../../../xos/core/xoslib/static/', // this is the django static folder
+ dashboards: '../../../xos/core/xoslib/dashboards/' // this is the django html folder
+};
+
+wrench.readdirSyncRecursive('./gulp')
+.map(function(file) {
+ require('./gulp/' + file)(options);
+});
+
+gulp.task('default', function () {
+ gulp.start('build');
+});
diff --git a/gui/ngXosViews/ceilometerDashboard/karma.conf.js b/gui/ngXosViews/ceilometerDashboard/karma.conf.js
new file mode 100644
index 0000000..12d0697
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/karma.conf.js
@@ -0,0 +1,95 @@
+// Karma configuration
+// Generated on Tue Oct 06 2015 09:27:10 GMT+0000 (UTC)
+
+/* eslint indent: [2,2], quotes: [2, "single"]*/
+
+/*eslint-disable*/
+var wiredep = require('wiredep');
+var path = require('path');
+
+var bowerComponents = wiredep( {devDependencies: true} )[ 'js' ].map(function( file ){
+ return path.relative(process.cwd(), file);
+});
+/*eslint-enable*/
+module.exports = function(config) {
+ config.set({
+
+ // base path that will be used to resolve all patterns (eg. files, exclude)
+ basePath: '',
+
+
+ // frameworks to use
+ // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+ frameworks: ['jasmine'],
+
+
+ // list of files / patterns to load in the browser
+ files: bowerComponents.concat([
+ 'src/css/**/*.css',
+ '../../static/js/xosApi.js',
+ '../../static/js/vendor/ngXosHelpers.js',
+ 'src/js/**/*.js',
+ 'spec/**/*.mock.js',
+ 'spec/**/*.test.js',
+ 'src/**/*.html'
+ ]),
+
+
+ // list of files to exclude
+ exclude: [
+ ],
+
+
+ // preprocess matching files before serving them to the browser
+ // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
+ preprocessors: {
+ 'src/js/**/*.js': ['babel'],
+ 'spec/**/*.js': ['babel'],
+ 'src/**/*.html': ['ng-html2js']
+ },
+
+ babelPreprocessor: {
+ options: {
+ presets: ['es2015'],
+ sourceMap: 'inline'
+ }
+ },
+
+ ngHtml2JsPreprocessor: {
+ stripPrefix: 'src/', //strip the src path from template url (http://stackoverflow.com/questions/22869668/karma-unexpected-request-when-testing-angular-directive-even-with-ng-html2js)
+ moduleName: 'templates' // define the template module name
+ },
+
+ // test results reporter to use
+ // possible values: 'dots', 'progress'
+ // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+ reporters: ['mocha'],
+
+
+ // web server port
+ port: 9876,
+
+
+ // enable / disable colors in the output (reporters and logs)
+ colors: true,
+
+
+ // level of logging
+ // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+ logLevel: config.LOG_INFO,
+
+
+ // enable / disable watching file and executing tests whenever any file changes
+ autoWatch: true,
+
+
+ // start these browsers
+ // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
+ browsers: ['PhantomJS'],
+
+
+ // Continuous Integration mode
+ // if true, Karma captures browsers, runs the tests and exits
+ singleRun: false
+ });
+};
diff --git a/gui/ngXosViews/ceilometerDashboard/package.json b/gui/ngXosViews/ceilometerDashboard/package.json
new file mode 100644
index 0000000..0a9ccae
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/package.json
@@ -0,0 +1,62 @@
+{
+ "name": "xos-ceilometerDashboard",
+ "version": "1.0.0",
+ "description": "Angular Application for XOS, created with generator-xos",
+ "scripts": {
+ "prestart": "npm install && bower install",
+ "start": "gulp serve",
+ "prebuild": "npm install && bower install",
+ "build": "gulp",
+ "pretest": "npm install",
+ "test": "karma start",
+ "lint": "eslint src/js/"
+ },
+ "keywords": [
+ "XOS",
+ "Angular",
+ "XOSlib"
+ ],
+ "author": "Matteo Scandolo",
+ "license": "MIT",
+ "dependencies": {},
+ "devDependencies": {
+ "autoprefixer": "^6.1.2",
+ "babel": "^6.3.13",
+ "babel-preset-es2015": "^6.3.13",
+ "browser-sync": "^2.9.11",
+ "css-mqpacker": "^4.0.0",
+ "csswring": "^4.1.1",
+ "del": "^2.0.2",
+ "eslint": "^1.8.0",
+ "eslint-plugin-angular": "linkmesrl/eslint-plugin-angular",
+ "gulp": "^3.9.0",
+ "gulp-angular-filesort": "^1.1.1",
+ "gulp-angular-templatecache": "^1.8.0",
+ "gulp-babel": "^5.3.0",
+ "gulp-concat": "^2.6.0",
+ "gulp-debug": "^2.1.2",
+ "gulp-eslint": "^1.0.0",
+ "gulp-inject": "^3.0.0",
+ "gulp-minify-html": "^1.0.4",
+ "gulp-ng-annotate": "^1.1.0",
+ "gulp-postcss": "^6.0.1",
+ "gulp-rename": "^1.2.2",
+ "gulp-replace": "^0.5.4",
+ "gulp-uglify": "^1.4.2",
+ "http-proxy": "^1.12.0",
+ "jasmine-core": "^2.4.1",
+ "karma": "^0.13.15",
+ "karma-babel-preprocessor": "^6.0.1",
+ "karma-jasmine": "^0.3.6",
+ "karma-mocha-reporter": "^1.1.3",
+ "karma-ng-html2js-preprocessor": "^0.2.0",
+ "karma-phantomjs-launcher": "^0.2.1",
+ "lodash": "^3.10.1",
+ "mocha": "^2.3.4",
+ "phantomjs": "^1.9.19",
+ "proxy-middleware": "^0.15.0",
+ "run-sequence": "^1.1.4",
+ "wiredep": "^3.0.0-beta",
+ "wrench": "^1.5.8"
+ }
+}
diff --git a/gui/ngXosViews/ceilometerDashboard/spec/.eslintrc b/gui/ngXosViews/ceilometerDashboard/spec/.eslintrc
new file mode 100644
index 0000000..ad4bc2d
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/spec/.eslintrc
@@ -0,0 +1,9 @@
+{
+ "globals" :{
+ "describe": true,
+ "beforeEach": true,
+ "it": true,
+ "inject": true,
+ "expect": true
+ }
+}
diff --git a/gui/ngXosViews/ceilometerDashboard/spec/backend.mock.js b/gui/ngXosViews/ceilometerDashboard/spec/backend.mock.js
new file mode 100644
index 0000000..c7642bb
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/spec/backend.mock.js
@@ -0,0 +1,98 @@
+'use strict';
+(function () {
+
+ const meters = [
+ // service_1
+ // - slice_1
+ // - resource_1
+ // service_2
+ // - slice_2
+ // - resource_2
+ // - resource_3
+ // - slice_3
+ // - resource_4
+ {
+ service: 'service_1',
+ slice: 'slice_1',
+ resource_name: 'resource_1',
+ resource_id: 'resource_id_1',
+ name: 'instance_1',
+ unit: 'instance'
+ },
+ {
+ service: 'service_2',
+ slice: 'slice_2',
+ resource_name: 'resource_2',
+ resource_id: 'resource_id_2',
+ name: 'instance_2',
+ unit: 'instance'
+ },
+ {
+ service: 'service_2',
+ slice: 'slice_2',
+ resource_name: 'resource_3',
+ resource_id: 'resource_id_3',
+ name: 'instance_2',
+ unit: 'instance'
+ },
+ {
+ service: 'service_2',
+ slice: 'slice_3',
+ resource_name: 'resource_4',
+ resource_id: 'resource_id_4',
+ name: 'instance_3',
+ unit: 'instance'
+ }
+ ];
+
+ const samples = [
+ {
+ meter: 'cpu',
+ resource_name: 'fakeName',
+ project_id: 'fakeTenant',
+ timestamp: '2015-12-15T00:34:08',
+ volume: 110
+ },
+ {
+ meter: 'cpu',
+ resource_name: 'fakeName',
+ project_id: 'fakeTenant',
+ timestamp: '2015-12-15T00:44:08',
+ volume: 120
+ },
+ {
+ meter: 'cpu',
+ resource_name: 'anotherName',
+ project_id: 'anotherTenant',
+ timestamp: '2015-12-15T00:24:08',
+ volume: 210
+ },
+ {
+ meter: 'cpu',
+ resource_name: 'anotherName',
+ project_id: 'anotherTenant',
+ timestamp: '2015-12-15T00:34:08',
+ volume: 220
+ },
+ {
+ meter: 'cpu',
+ resource_name: 'anotherName',
+ project_id: 'anotherTenant',
+ timestamp: '2015-12-15T00:44:08',
+ volume: 230
+ },
+ {
+ meter: 'cpu',
+ resource_name: 'thirdName',
+ project_id: 'thirdTenant',
+ timestamp: '2015-12-15T00:44:08',
+ volume: 310
+ }
+ ];
+
+ angular.module('xos.ceilometerDashboard')
+ .run(($httpBackend) => {
+ $httpBackend.whenGET(/metersamples/).respond(samples);
+ $httpBackend.whenGET(/meters/).respond(meters);
+ });
+})();
diff --git a/gui/ngXosViews/ceilometerDashboard/spec/ceilometer.test.js b/gui/ngXosViews/ceilometerDashboard/spec/ceilometer.test.js
new file mode 100644
index 0000000..c5bb850
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/spec/ceilometer.test.js
@@ -0,0 +1,137 @@
+'use strict';
+
+describe('In Ceilometer View', () => {
+
+ var scope, element, vm, httpBackend;
+
+ beforeEach(module('xos.ceilometerDashboard'));
+ beforeEach(module('templates'));
+
+ beforeEach(inject(($httpBackend, $rootScope) => {
+ httpBackend = $httpBackend;
+ scope = $rootScope.$new();
+ }))
+
+ describe('The dashboard', () => {
+ beforeEach(inject(function($httpBackend, $compile){
+ element = angular.element('<ceilometer-dashboard></ceilometer-dashboard>');
+ $compile(element)(scope);
+ scope.$digest();
+ vm = element.isolateScope().vm;
+ httpBackend.flush();
+ }));
+
+ describe('when loading meters', () => {
+ it('should group meters by services', () => {
+ expect(Object.keys(vm.projects).length).toBe(2);
+ });
+
+ it('should group services by slices', () => {
+ expect(Object.keys(vm.projects.service_2).length).toBe(2);
+ });
+
+ it('should group slices by resources', () => {
+ expect(Object.keys(vm.projects.service_2.slice_2).length).toBe(2);
+ });
+ });
+ });
+
+ describe('the sample view', () => {
+ beforeEach(inject(function($httpBackend, $compile, $stateParams){
+
+ $stateParams.name = 'fakeName';
+ $stateParams.tenant = 'fakeTenant';
+
+ element = angular.element('<ceilometer-samples></ceilometer-samples>');
+ $compile(element)(scope);
+ scope.$digest();
+ vm = element.isolateScope().vm;
+ httpBackend.flush();
+ }));
+
+ it('should group samples by resource_id', () => {
+ expect(Object.keys(vm.samplesList.fakeTenant).length).toBe(2)
+ expect(Object.keys(vm.samplesList.anotherTenant).length).toBe(3)
+ expect(Object.keys(vm.samplesList.thirdTenant).length).toBe(1)
+ });
+
+ it('should add the comparable samples to the dropdown list', () => {
+ expect(vm.sampleLabels[0].id).toEqual('anotherTenant')
+ expect(vm.sampleLabels[1].id).toEqual('thirdTenant')
+ });
+
+ it('should add the selected meter to the chart', () => {
+ expect(vm.chart.labels.length).toBe(2);
+ expect(vm.chart.series[0]).toBe('fakeTenant');
+ expect(vm.chart.data[0].length).toBe(2);
+ expect(vm.chart.data[0][0]).toBe(110);
+ expect(vm.chart.data[0][1]).toBe(120);
+ expect(vm.chartMeters[0].project_id).toBe('fakeTenant')
+ expect(vm.chartMeters[0].resource_name).toBe('fakeName')
+ });
+
+ it('should add a sample to the chart', () => {
+ vm.addMeterToChart('anotherTenant');
+ expect(vm.chart.labels.length).toBe(3);
+ expect(vm.chart.data[1].length).toBe(3);
+ expect(vm.chart.data[1][0]).toBe(210);
+ expect(vm.chart.data[1][1]).toBe(220);
+ expect(vm.chart.data[1][2]).toBe(230);
+ expect(vm.chartMeters[1].project_id).toBe('anotherTenant')
+ expect(vm.chartMeters[1].resource_name).toBe('anotherName')
+ });
+
+ it('should remove a sample from the chart', () => {
+ // for simplyvity add a tenant (it's tested)
+ vm.addMeterToChart('anotherTenant');
+ vm.removeFromChart(vm.chartMeters[0]);
+ expect(vm.chart.data[0].length).toBe(3);
+ expect(vm.chart.data[0][0]).toBe(210);
+ expect(vm.chart.data[0][1]).toBe(220);
+ expect(vm.chart.data[0][2]).toBe(230);
+ expect(vm.chartMeters[0].project_id).toBe('anotherTenant')
+ expect(vm.chartMeters[0].resource_name).toBe('anotherName')
+ });
+
+ describe('The format sample labels method', () => {
+ it('should create an array of unique labels', () => {
+ // unique because every resource has multiple samples (time-series)
+ const samples = [
+ {project_id: 1, resource_name: 'fakeName'},
+ {project_id: 1, resource_name: 'fakeName'},
+ {project_id: 2, resource_name: 'anotherName'},
+ {project_id: 2, resource_name: 'anotherName'}
+ ];
+
+ const result = vm.formatSamplesLabels(samples);
+
+ expect(result.length).toBe(2);
+ expect(result[0]).toEqual({id: 1, name: 'fakeName'});
+ expect(result[1]).toEqual({id: 2, name: 'anotherName'});
+ });
+ });
+ });
+});
+
+describe('The orderObjectByKey filter', () => {
+ var $filter;
+
+ beforeEach(function () {
+ module('xos.ceilometerDashboard');
+
+ inject(function (_$filter_) {
+ $filter = _$filter_;
+ });
+ });
+
+ it('should order an object by the key value', function () {
+ // Arrange.
+ const list = {c: 3, b: 2, a: 1};
+
+ // call the filter function
+ const result = $filter('orderObjectByKey')(list);
+
+ // Assert.
+ expect(result).toEqual({a: 1, b: 2, c: 3});
+ });
+});
\ No newline at end of file
diff --git a/gui/ngXosViews/ceilometerDashboard/src/css/ceilometerDashboard.css b/gui/ngXosViews/ceilometerDashboard/src/css/ceilometerDashboard.css
new file mode 100644
index 0000000..4e6fa88
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/src/css/ceilometerDashboard.css
@@ -0,0 +1,265 @@
+#xosCeilometerDashboard{
+ position: relative;
+}
+
+/* Panel Layout */
+.panel {
+ margin-top: 10px;
+}
+
+.panel-body:not(:first-child) {
+ border-top: 1px solid #e3e3e3;
+}
+
+.panel-body .row {
+ margin-top: 10px;
+}
+
+/* Chart details */
+.chart {
+ width: 100%;
+ height: 300px;
+}
+
+.btn-chart, .btn-chart:hover {
+ color: #fff;
+}
+
+.side-container {
+ position: relative;
+}
+
+.service-list {
+ margin-top: -10px;
+}
+
+.service-list h3 {
+ margin-top: 0px;
+ margin-bottom: 0px;
+}
+
+.service-list a {
+ text-decoration: none;
+ color: #333;
+}
+
+.meters, .stats {
+ margin-top: 25px;
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ margin-bottom: 50px;
+}
+
+/* LOADER */
+.loader {
+ font-size: 10px;
+ margin: 150px auto;
+ text-indent: -9999em;
+ width: 11em;
+ height: 11em;
+ border-radius: 50%;
+ background: #ffffff;
+ background: -moz-linear-gradient(left, #ffffff 10%, rgba(255, 255, 255, 0) 42%);
+ background: -webkit-linear-gradient(left, #ffffff 10%, rgba(255, 255, 255, 0) 42%);
+ background: -o-linear-gradient(left, #ffffff 10%, rgba(255, 255, 255, 0) 42%);
+ background: -ms-linear-gradient(left, #ffffff 10%, rgba(255, 255, 255, 0) 42%);
+ background: linear-gradient(to right, #ffffff 10%, rgba(255, 255, 255, 0) 42%);
+ position: relative;
+ -webkit-animation: load3 1.4s infinite linear;
+ animation: load3 1.4s infinite linear;
+ -webkit-transform: translateZ(0);
+ -ms-transform: translateZ(0);
+ transform: translateZ(0);
+}
+.loader:before {
+ width: 50%;
+ height: 50%;
+ background: #105E9E;
+ border-radius: 100% 0 0 0;
+ position: absolute;
+ top: 0;
+ left: 0;
+ content: '';
+}
+.loader:after {
+ background: #fff;
+ width: 75%;
+ height: 75%;
+ border-radius: 50%;
+ content: '';
+ margin: auto;
+ position: absolute;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+}
+@-webkit-keyframes load3 {
+ 0% {
+ -webkit-transform: rotate(0deg);
+ transform: rotate(0deg);
+ }
+ 100% {
+ -webkit-transform: rotate(360deg);
+ transform: rotate(360deg);
+ }
+}
+@keyframes load3 {
+ 0% {
+ -webkit-transform: rotate(0deg);
+ transform: rotate(0deg);
+ }
+ 100% {
+ -webkit-transform: rotate(360deg);
+ transform: rotate(360deg);
+ }
+}
+
+/* VIEW ANIMATION */
+
+[ui-view] {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ margin-bottom: 100px;
+}
+
+/* FROM DASHBOARD TO DETAIL */
+
+/* dash out */
+[ui-view].ceilometerDashboard.ng-leave {
+ animation:1s bounceOutLeft ease;
+}
+/* samples in */
+[ui-view].samples.ng-enter {
+ animation:1s bounceInRight ease;
+}
+
+/* FROM DETAIL TO DASHBOARD */
+
+/* samples out */
+[ui-view].samples.ng-leave {
+ animation:1s bounceOutRight ease;
+}
+/* dash in */
+[ui-view].ceilometerDashboard.ng-enter {
+ animation:1s bounceInLeft ease;
+}
+
+/* COLUMS ANIMATION */
+/* when showing the thing */
+.animate .animate-slide-left.ng-hide-remove {
+ animation:0.5s bounceInRight ease;
+}
+
+/* when hiding the picture */
+.animate .animate-slide-left.ng-hide-add {
+ animation:0.5s bounceOutRight ease;
+}
+
+/* ANIMATIONS */
+
+@keyframes bounceInRight {
+ from, 60%, 75%, 90%, to {
+ animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
+ }
+
+ from {
+ opacity: 0;
+ transform: translate3d(3000px, 0, 0);
+ }
+
+ 60% {
+ opacity: 1;
+ transform: translate3d(-25px, 0, 0);
+ }
+
+ 75% {
+ transform: translate3d(10px, 0, 0);
+ }
+
+ 90% {
+ transform: translate3d(-5px, 0, 0);
+ }
+
+ to {
+ transform: none;
+ }
+}
+
+@keyframes bounceInLeft {
+ from, 60%, 75%, 90%, to {
+ animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
+ }
+
+ 0% {
+ opacity: 0;
+ transform: translate3d(-3000px, 0, 0);
+ }
+
+ 60% {
+ opacity: 1;
+ transform: translate3d(25px, 0, 0);
+ }
+
+ 75% {
+ transform: translate3d(-10px, 0, 0);
+ }
+
+ 90% {
+ transform: translate3d(5px, 0, 0);
+ }
+
+ to {
+ transform: none;
+ }
+}
+
+@keyframes slideInUp {
+ from {
+ transform: translate3d(0, 100%, 0);
+ visibility: visible;
+ }
+
+ to {
+ transform: translate3d(0, 0, 0);
+ }
+}
+
+@keyframes bounceOutRight {
+ 20% {
+ opacity: 1;
+ transform: translate3d(-20px, 0, 0);
+ }
+
+ to {
+ opacity: 0;
+ transform: translate3d(2000px, 0, 0);
+ }
+}
+
+@keyframes bounceOutLeft {
+ 20% {
+ opacity: 1;
+ transform: translate3d(20px, 0, 0);
+ }
+
+ to {
+ opacity: 0;
+ transform: translate3d(-2000px, 0, 0);
+ }
+}
+
+@keyframes slideOutDown {
+ from {
+ transform: translate3d(0, 0, 0);
+ }
+
+ to {
+ visibility: hidden;
+ transform: translate3d(0, 100%, 0);
+ }
+}
\ No newline at end of file
diff --git a/gui/ngXosViews/ceilometerDashboard/src/css/dev.css b/gui/ngXosViews/ceilometerDashboard/src/css/dev.css
new file mode 100644
index 0000000..228d394
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/src/css/dev.css
@@ -0,0 +1,14 @@
+@media (min-width: 768px) {
+ #xosCeilometerDashboard {
+ position: absolute;
+ top: 100px;
+ left: 20%;
+ width: 80%;
+ }
+}
+
+@media (min-width: 768px) {
+ #xosCeilometerDashboard {
+ margin: 10px
+ }
+}
\ No newline at end of file
diff --git a/gui/ngXosViews/ceilometerDashboard/src/index.html b/gui/ngXosViews/ceilometerDashboard/src/index.html
new file mode 100644
index 0000000..6363764
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/src/index.html
@@ -0,0 +1,41 @@
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
+<meta name="viewport" content="width=device-width, initial-scale=1, max-scale=1">
+<!-- browserSync -->
+<!-- bower:css -->
+<link rel="stylesheet" href="vendor/angular-chart.js/dist/angular-chart.css" />
+<link rel="stylesheet" href="vendor/bootstrap-css/css/bootstrap.min.css" />
+<!-- endbower --><!-- endcss -->
+<!-- inject:css -->
+<link rel="stylesheet" href="/css/ceilometerDashboard.css">
+<link rel="stylesheet" href="/css/dev.css">
+<!-- endinject -->
+<div ng-app="xos.ceilometerDashboard" id="xosCeilometerDashboard">
+ <div ui-view ng-class="stateName"></div>
+</div>
+
+<!-- bower:js -->
+<script src="vendor/angular/angular.js"></script>
+<script src="vendor/Chart.js/Chart.js"></script>
+<script src="vendor/angular-chart.js/dist/angular-chart.js"></script>
+<script src="vendor/angular-animate/angular-animate.js"></script>
+<script src="vendor/ui.bootstrap/src/accordion/accordion.js"></script>
+<script src="vendor/ui.bootstrap/src/collapse/collapse.js"></script>
+<script src="vendor/jquery/dist/jquery.js"></script>
+<script src="vendor/angular-mocks/angular-mocks.js"></script>
+<script src="vendor/angular-ui-router/release/angular-ui-router.js"></script>
+<script src="vendor/angular-cookies/angular-cookies.js"></script>
+<script src="vendor/angular-resource/angular-resource.js"></script>
+<script src="vendor/ng-lodash/build/ng-lodash.js"></script>
+<script src="vendor/bootstrap-css/js/bootstrap.min.js"></script>
+<!-- endbower --><!-- endjs -->
+
+<!-- inject:js -->
+<script src="/xosHelpers/src/xosHelpers.module.js"></script>
+<script src="/xosHelpers/src/services/noHyperlinks.interceptor.js"></script>
+<script src="/xosHelpers/src/services/csrfToken.interceptor.js"></script>
+<script src="/xosHelpers/src/services/api.services.js"></script>
+<script src="/api/ng-xoslib.js"></script>
+<script src="/api/ng-xos.js"></script>
+<script src="/api/ng-hpcapi.js"></script>
+<script src="/.tmp/main.js"></script>
+<!-- endinject -->
diff --git a/gui/ngXosViews/ceilometerDashboard/src/js/main.js b/gui/ngXosViews/ceilometerDashboard/src/js/main.js
new file mode 100644
index 0000000..a20d563
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/src/js/main.js
@@ -0,0 +1,375 @@
+'use strict';
+
+angular.module('xos.ceilometerDashboard', [
+ 'ngResource',
+ 'ngCookies',
+ 'ngLodash',
+ 'ui.router',
+ 'xos.helpers',
+ 'ngAnimate',
+ 'chart.js',
+ 'ui.bootstrap.accordion'
+])
+.config(($stateProvider, $urlRouterProvider) => {
+ $stateProvider
+ .state('ceilometerDashboard', {
+ url: '/',
+ template: '<ceilometer-dashboard></ceilometer-dashboard>'
+ })
+ .state('samples', {
+ url: '/:name/:tenant/samples',
+ template: '<ceilometer-samples></ceilometer-samples>'
+ });
+ $urlRouterProvider.otherwise('/');
+})
+.config(function($httpProvider){
+ $httpProvider.interceptors.push('NoHyperlinks');
+})
+.run(function($rootScope){
+ $rootScope.stateName = 'ceilometerDashboard';
+ $rootScope.$on('$stateChangeStart', (event, toState) => {
+ $rootScope.stateName = toState.name;
+ })
+})
+.service('Ceilometer', function($http, $q, lodash){
+
+ this.getMeters = () => {
+ let deferred = $q.defer();
+
+ $http.get('/xoslib/meters/', {cache: true})
+ // $http.get('../meters_mock.json', {cache: true})
+ .then((res) => {
+ deferred.resolve(res.data)
+ })
+ .catch((e) => {
+ deferred.reject(e);
+ });
+
+ return deferred.promise;
+ }
+
+ this.getSamples = (name, tenant) => {
+ let deferred = $q.defer();
+
+ $http.get(`/xoslib/metersamples/`, {params: {meter: name, tenant: tenant}})
+ .then((res) => {
+ deferred.resolve(res.data)
+ })
+ .catch((e) => {
+ deferred.reject(e);
+ });
+
+ return deferred.promise;
+ }
+
+ this.getStats = (sliceName) => {
+ let deferred = $q.defer();
+
+ $http.get('/xoslib/meterstatistics/', {cache: true})
+ // $http.get('../stats_mock.son', {cache: true})
+ .then((res) => {
+ deferred.resolve(lodash.filter(res.data, {slice: sliceName}))
+ })
+ .catch((e) => {
+ deferred.reject(e);
+ });
+
+ return deferred.promise;
+ };
+
+ // hold dashboard status (opened service, slice, resource)
+ this.selectedService = null;
+ this.selectedSlice = null;
+ this.selectedResource = null;
+})
+.directive('ceilometerDashboard', function(lodash){
+ return {
+ restrict: 'E',
+ scope: {},
+ bindToController: true,
+ controllerAs: 'vm',
+ templateUrl: 'templates/ceilometer-dashboard.tpl.html',
+ controller: function(Ceilometer){
+
+ console.log(Ceilometer.selectedService, Ceilometer.selectedSlice, Ceilometer.selectedResource);
+
+ // this open the accordion
+ this.accordion = {
+ open: {}
+ }
+
+ /**
+ * Open the active panel base on the service stored values
+ */
+ this.openPanels = () => {
+ if(Ceilometer.selectedService){
+ this.accordion.open[Ceilometer.selectedService] = true;
+ if(Ceilometer.selectedSlice){
+ this.selectedSlice = Ceilometer.selectedSlice;
+ this.selectedResources = this.projects[Ceilometer.selectedService][Ceilometer.selectedSlice]
+ if(Ceilometer.selectedResource){
+ this.selectedResource = Ceilometer.selectedResource;
+ this.selectedMeters = this.selectedResources[Ceilometer.selectedResource];
+ }
+ }
+ }
+ }
+
+ this.loadMeters = () => {
+ this.loader = true;
+
+ // TODO rename projects in meters
+ Ceilometer.getMeters()
+ .then(meters => {
+ //group project by service
+ this.projects = lodash.groupBy(meters, 'service');
+ lodash.forEach(Object.keys(this.projects), (project) => {
+ // inside each service group by slice
+ this.projects[project] = lodash.groupBy(this.projects[project], 'slice');
+ lodash.forEach(Object.keys(this.projects[project]), (slice) => {
+ // inside each service => slice group by resource
+ this.projects[project][slice] = lodash.groupBy(this.projects[project][slice], 'resource_name');
+ });
+ });
+
+ // open selected panels
+ this.openPanels();
+ })
+ .catch(err => {
+ this.error = err.data.detail;
+ })
+ .finally(() => {
+ this.loader = false;
+ });
+ }
+
+ this.loadMeters();
+
+ /**
+ * Select Resources for a slice
+ *
+ * @param Array resources The list of selected resources
+ * @returns void
+ */
+ this.selectedResources = null;
+ this.selectResources = (resources, slice, service) => {
+ //cleaning
+ this.selectedResources = null;
+ this.selectedResource = null;
+ this.selectedMeters = null;
+
+ // hold the resource list for the current slice
+ this.selectedResources = resources;
+ this.selectedSlice = slice;
+ this.selectedService = service;
+
+ // store the status
+ Ceilometer.selectedSlice = slice;
+ Ceilometer.selectedService = service;
+ }
+
+ /**
+ * Select Meters for a resource
+ *
+ * @param Array meters The list of selected resources
+ * @returns void
+ */
+ this.selectedMeters = null;
+ this.selectMeters = (meters, resource) => {
+ this.selectedMeters = meters;
+
+ Ceilometer.selectedResource = resource;
+ this.selectedResource = resource;
+ }
+
+ }
+ };
+})
+.directive('ceilometerSamples', function(lodash, $stateParams){
+ return {
+ restrict: 'E',
+ scope: {
+ name: '=name',
+ tenant: '=tenant'
+ },
+ bindToController: true,
+ controllerAs: 'vm',
+ templateUrl: 'templates/ceilometer-samples.tpl.html',
+ controller: function(Ceilometer) {
+
+ // console.log(Ceilometer.selectResource);
+
+ this.chartColors = [
+ '#286090',
+ '#F7464A',
+ '#46BFBD',
+ '#FDB45C',
+ '#97BBCD',
+ '#4D5360',
+ '#8c4f9f'
+ ];
+
+ this.chart = {
+ series: [],
+ labels: [],
+ data: []
+ }
+
+ Chart.defaults.global.colours = this.chartColors;
+
+ this.chartType = 'line';
+
+ if($stateParams.name && $stateParams.tenant){
+ this.name = $stateParams.name;
+ this.tenant = $stateParams.tenant;
+ // TODO rename tenant in project_id
+ }
+ else{
+ throw new Error('Missing Name and Tenant Params!');
+ }
+
+ /**
+ * Goes trough the array and format date to be used as labels
+ *
+ * @param Array data
+ * @returns Array a list of labels
+ */
+
+ this.getLabels = (data) => {
+ return data.reduce((list, item) => {
+ let date = new Date(item.timestamp);
+ list.push(`${date.getHours()}:${(date.getMinutes()<10?'0':'') + date.getMinutes()}:${date.getSeconds()}`);
+ return list;
+ }, []);
+ };
+
+ /**
+ * Goes trough the array and return a flat array of values
+ *
+ * @param Array data
+ * @returns Array a list of values
+ */
+
+ this.getData = (data) => {
+ return data.reduce((list, item) => {
+ list.push(item.volume);
+ return list;
+ }, []);
+ }
+
+ /**
+ * Add a samples to the chart
+ *
+ * @param string resource_id
+ */
+ this.chartMeters = [];
+ this.addMeterToChart = (project_id) => {
+ this.chart['labels'] = this.getLabels(lodash.sortBy(this.samplesList[project_id], 'timestamp'));
+ this.chart['series'].push(project_id);
+ this.chart['data'].push(this.getData(lodash.sortBy(this.samplesList[project_id], 'timestamp')));
+ this.chartMeters.push(this.samplesList[project_id][0]); //use the 0 as are all samples for the same resource and I need the name
+ lodash.remove(this.sampleLabels, {id: project_id});
+ }
+
+ this.removeFromChart = (meter) => {
+ this.chart.data.splice(this.chart.series.indexOf(meter.project_id), 1);
+ this.chart.series.splice(this.chart.series.indexOf(meter.project_id), 1);
+ this.chartMeters.splice(lodash.findIndex(this.chartMeters, {project_id: meter.project_id}), 1);
+ this.sampleLabels.push({
+ id: meter.project_id,
+ name: meter.resource_name || meter.project_id
+ })
+ };
+
+ /**
+ * Format samples to create a list of labels and ids
+ */
+
+ this.formatSamplesLabels = (samples) => {
+
+ return lodash.uniq(samples, 'project_id')
+ .reduce((labels, item) => {
+ labels.push({
+ id: item.project_id,
+ name: item.resource_name || item.project_id
+ });
+ return labels;
+ }, []);
+ }
+
+
+ /**
+ * Load the samples and format data
+ */
+
+ this.showSamples = () => {
+ this.loader = true;
+ // Ceilometer.getSamples(this.name, this.tenant) //fetch one
+ Ceilometer.getSamples(this.name) //fetch all
+ .then(res => {
+
+ // setup data for visualization
+ this.samplesList = lodash.groupBy(res, 'project_id');
+ this.sampleLabels = this.formatSamplesLabels(res);
+
+ // add current meter to chart
+ this.addMeterToChart(this.tenant);
+
+ })
+ .catch(err => {
+ this.error = err.data.detail;
+ })
+ .finally(() => {
+ this.loader = false;
+ });
+ };
+
+ this.showSamples();
+ }
+ }
+})
+.directive('ceilometerStats', function(){
+ return {
+ restrict: 'E',
+ scope: {
+ name: '=name',
+ },
+ bindToController: true,
+ controllerAs: 'vm',
+ templateUrl: 'templates/ceilometer-stats.tpl.html',
+ controller: function($scope, Ceilometer) {
+ this.getStats = () => {
+ this.loader = true;
+ Ceilometer.getStats(this.name)
+ .then(res => {
+ this.stats = res;
+ })
+ .catch(err => {
+ this.error = err.data;
+ })
+ .finally(() => {
+ this.loader = false;
+ });
+ };
+
+ this.getStats();
+
+ $scope.$watch(() => this.name, () => {this.getStats();});
+ }
+ }
+})
+.filter('orderObjectByKey', function(lodash) {
+ return function(items) {
+
+ if(!items){
+ return;
+ }
+
+ return lodash.reduce(Object.keys(items).reverse(), (list, key) => {
+ list[key] = items[key];
+ return list;
+ }, {});
+
+ };
+});
+;
\ No newline at end of file
diff --git a/gui/ngXosViews/ceilometerDashboard/src/meters_mock.json b/gui/ngXosViews/ceilometerDashboard/src/meters_mock.json
new file mode 100644
index 0000000..7ff0c68
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/src/meters_mock.json
@@ -0,0 +1,1266 @@
+[
+ {
+ "category": "Nova",
+ "slice": "mysite_onos_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "instance",
+ "service": "service_ONOS_vOLT",
+ "resource_id": "197bc772-ff13-4b68-96e6-d4a4b1730fe7",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_onos_volt-4",
+ "meter_id": "MTk3YmM3NzItZmYxMy00YjY4LTk2ZTYtZDRhNGIxNzMwZmU3K2luc3RhbmNl\n",
+ "project_id": "bfef8341327245d682c7bada50aceecb",
+ "type": "gauge",
+ "unit": "instance",
+ "description": "Existence of instance"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_onos_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "instance",
+ "service": "service_ONOS_vBNG",
+ "resource_id": "bde67a22-7579-4097-9406-c15eb2b9ae27",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_onos_vbng-2",
+ "meter_id": "YmRlNjdhMjItNzU3OS00MDk3LTk0MDYtYzE1ZWIyYjlhZTI3K2luc3RhbmNl\n",
+ "project_id": "7c918e6765c24ee281f3ee8692fd102c",
+ "type": "gauge",
+ "unit": "instance",
+ "description": "Existence of instance"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "instance",
+ "service": "Other",
+ "resource_id": "0a802169-5918-4c28-9014-635ae6602cdb",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_volt-5",
+ "meter_id": "MGE4MDIxNjktNTkxOC00YzI4LTkwMTQtNjM1YWU2NjAyY2RiK2luc3RhbmNl\n",
+ "project_id": "f506380a49a24389ae0d8469274e3279",
+ "type": "gauge",
+ "unit": "instance",
+ "description": "Existence of instance"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vcpe",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "instance",
+ "service": "service_vcpe",
+ "resource_id": "f71e7c55-2435-45a4-aa9a-073f97ceccbc",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_vcpe-7",
+ "meter_id": "ZjcxZTdjNTUtMjQzNS00NWE0LWFhOWEtMDczZjk3Y2VjY2JjK2luc3RhbmNl\n",
+ "project_id": "61a5d4b37b5d43718854916079760c0d",
+ "type": "gauge",
+ "unit": "instance",
+ "description": "Existence of instance"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "instance",
+ "service": "Other",
+ "resource_id": "98535996-e184-4996-a28e-61647e5d31d0",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_vbng-6",
+ "meter_id": "OTg1MzU5OTYtZTE4NC00OTk2LWEyOGUtNjE2NDdlNWQzMWQwK2luc3RhbmNl\n",
+ "project_id": "c92cf450df4640d6952c0276730e5048",
+ "type": "gauge",
+ "unit": "instance",
+ "description": "Existence of instance"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_clients",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "instance",
+ "service": "Other",
+ "resource_id": "f5c71396-9092-42da-91ec-434259bde2ef",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_clients-3",
+ "meter_id": "ZjVjNzEzOTYtOTA5Mi00MmRhLTkxZWMtNDM0MjU5YmRlMmVmK2luc3RhbmNl\n",
+ "project_id": "f884c440474b40808a8adcdece5f45ef",
+ "type": "gauge",
+ "unit": "instance",
+ "description": "Existence of instance"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_ceilometer",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "instance",
+ "service": "service_ceilometer",
+ "resource_id": "bdb0ff14-e848-446c-acb4-63e232487dc0",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_ceilometer-8",
+ "meter_id": "YmRiMGZmMTQtZTg0OC00NDZjLWFjYjQtNjNlMjMyNDg3ZGMwK2luc3RhbmNl\n",
+ "project_id": "920d70bc63574552bbb3c3fb262ee1bc",
+ "type": "gauge",
+ "unit": "instance",
+ "description": "Existence of instance"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_onos_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "memory",
+ "service": "service_ONOS_vOLT",
+ "resource_id": "197bc772-ff13-4b68-96e6-d4a4b1730fe7",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_onos_volt-4",
+ "meter_id": "MTk3YmM3NzItZmYxMy00YjY4LTk2ZTYtZDRhNGIxNzMwZmU3K21lbW9yeQ==\n",
+ "project_id": "bfef8341327245d682c7bada50aceecb",
+ "type": "gauge",
+ "unit": "MB",
+ "description": "Volume of RAM"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_onos_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "memory",
+ "service": "service_ONOS_vBNG",
+ "resource_id": "bde67a22-7579-4097-9406-c15eb2b9ae27",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_onos_vbng-2",
+ "meter_id": "YmRlNjdhMjItNzU3OS00MDk3LTk0MDYtYzE1ZWIyYjlhZTI3K21lbW9yeQ==\n",
+ "project_id": "7c918e6765c24ee281f3ee8692fd102c",
+ "type": "gauge",
+ "unit": "MB",
+ "description": "Volume of RAM"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "memory",
+ "service": "Other",
+ "resource_id": "0a802169-5918-4c28-9014-635ae6602cdb",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_volt-5",
+ "meter_id": "MGE4MDIxNjktNTkxOC00YzI4LTkwMTQtNjM1YWU2NjAyY2RiK21lbW9yeQ==\n",
+ "project_id": "f506380a49a24389ae0d8469274e3279",
+ "type": "gauge",
+ "unit": "MB",
+ "description": "Volume of RAM"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vcpe",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "memory",
+ "service": "service_vcpe",
+ "resource_id": "f71e7c55-2435-45a4-aa9a-073f97ceccbc",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_vcpe-7",
+ "meter_id": "ZjcxZTdjNTUtMjQzNS00NWE0LWFhOWEtMDczZjk3Y2VjY2JjK21lbW9yeQ==\n",
+ "project_id": "61a5d4b37b5d43718854916079760c0d",
+ "type": "gauge",
+ "unit": "MB",
+ "description": "Volume of RAM"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "memory",
+ "service": "Other",
+ "resource_id": "98535996-e184-4996-a28e-61647e5d31d0",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_vbng-6",
+ "meter_id": "OTg1MzU5OTYtZTE4NC00OTk2LWEyOGUtNjE2NDdlNWQzMWQwK21lbW9yeQ==\n",
+ "project_id": "c92cf450df4640d6952c0276730e5048",
+ "type": "gauge",
+ "unit": "MB",
+ "description": "Volume of RAM"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_clients",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "memory",
+ "service": "Other",
+ "resource_id": "f5c71396-9092-42da-91ec-434259bde2ef",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_clients-3",
+ "meter_id": "ZjVjNzEzOTYtOTA5Mi00MmRhLTkxZWMtNDM0MjU5YmRlMmVmK21lbW9yeQ==\n",
+ "project_id": "f884c440474b40808a8adcdece5f45ef",
+ "type": "gauge",
+ "unit": "MB",
+ "description": "Volume of RAM"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_ceilometer",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "memory",
+ "service": "service_ceilometer",
+ "resource_id": "bdb0ff14-e848-446c-acb4-63e232487dc0",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_ceilometer-8",
+ "meter_id": "YmRiMGZmMTQtZTg0OC00NDZjLWFjYjQtNjNlMjMyNDg3ZGMwK21lbW9yeQ==\n",
+ "project_id": "920d70bc63574552bbb3c3fb262ee1bc",
+ "type": "gauge",
+ "unit": "MB",
+ "description": "Volume of RAM"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_onos_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "memory.usage",
+ "service": "service_ONOS_vOLT",
+ "resource_id": "197bc772-ff13-4b68-96e6-d4a4b1730fe7",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_onos_volt-4",
+ "meter_id": "MTk3YmM3NzItZmYxMy00YjY4LTk2ZTYtZDRhNGIxNzMwZmU3K21lbW9yeS51c2FnZQ==\n",
+ "project_id": "bfef8341327245d682c7bada50aceecb",
+ "type": "gauge",
+ "unit": "MB",
+ "description": "Volume of RAM used"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_onos_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "memory.usage",
+ "service": "service_ONOS_vBNG",
+ "resource_id": "bde67a22-7579-4097-9406-c15eb2b9ae27",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_onos_vbng-2",
+ "meter_id": "YmRlNjdhMjItNzU3OS00MDk3LTk0MDYtYzE1ZWIyYjlhZTI3K21lbW9yeS51c2FnZQ==\n",
+ "project_id": "7c918e6765c24ee281f3ee8692fd102c",
+ "type": "gauge",
+ "unit": "MB",
+ "description": "Volume of RAM used"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "memory.usage",
+ "service": "Other",
+ "resource_id": "0a802169-5918-4c28-9014-635ae6602cdb",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_volt-5",
+ "meter_id": "MGE4MDIxNjktNTkxOC00YzI4LTkwMTQtNjM1YWU2NjAyY2RiK21lbW9yeS51c2FnZQ==\n",
+ "project_id": "f506380a49a24389ae0d8469274e3279",
+ "type": "gauge",
+ "unit": "MB",
+ "description": "Volume of RAM used"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vcpe",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "memory.usage",
+ "service": "service_vcpe",
+ "resource_id": "f71e7c55-2435-45a4-aa9a-073f97ceccbc",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_vcpe-7",
+ "meter_id": "ZjcxZTdjNTUtMjQzNS00NWE0LWFhOWEtMDczZjk3Y2VjY2JjK21lbW9yeS51c2FnZQ==\n",
+ "project_id": "61a5d4b37b5d43718854916079760c0d",
+ "type": "gauge",
+ "unit": "MB",
+ "description": "Volume of RAM used"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "memory.usage",
+ "service": "Other",
+ "resource_id": "98535996-e184-4996-a28e-61647e5d31d0",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_vbng-6",
+ "meter_id": "OTg1MzU5OTYtZTE4NC00OTk2LWEyOGUtNjE2NDdlNWQzMWQwK21lbW9yeS51c2FnZQ==\n",
+ "project_id": "c92cf450df4640d6952c0276730e5048",
+ "type": "gauge",
+ "unit": "MB",
+ "description": "Volume of RAM used"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_clients",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "memory.usage",
+ "service": "Other",
+ "resource_id": "f5c71396-9092-42da-91ec-434259bde2ef",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_clients-3",
+ "meter_id": "ZjVjNzEzOTYtOTA5Mi00MmRhLTkxZWMtNDM0MjU5YmRlMmVmK21lbW9yeS51c2FnZQ==\n",
+ "project_id": "f884c440474b40808a8adcdece5f45ef",
+ "type": "gauge",
+ "unit": "MB",
+ "description": "Volume of RAM used"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_ceilometer",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "memory.usage",
+ "service": "service_ceilometer",
+ "resource_id": "bdb0ff14-e848-446c-acb4-63e232487dc0",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_ceilometer-8",
+ "meter_id": "YmRiMGZmMTQtZTg0OC00NDZjLWFjYjQtNjNlMjMyNDg3ZGMwK21lbW9yeS51c2FnZQ==\n",
+ "project_id": "920d70bc63574552bbb3c3fb262ee1bc",
+ "type": "gauge",
+ "unit": "MB",
+ "description": "Volume of RAM used"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_onos_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "cpu",
+ "service": "service_ONOS_vOLT",
+ "resource_id": "197bc772-ff13-4b68-96e6-d4a4b1730fe7",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_onos_volt-4",
+ "meter_id": "MTk3YmM3NzItZmYxMy00YjY4LTk2ZTYtZDRhNGIxNzMwZmU3K2NwdQ==\n",
+ "project_id": "bfef8341327245d682c7bada50aceecb",
+ "type": "cumulative",
+ "unit": "ns",
+ "description": "CPU time used"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_onos_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "cpu",
+ "service": "service_ONOS_vBNG",
+ "resource_id": "bde67a22-7579-4097-9406-c15eb2b9ae27",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_onos_vbng-2",
+ "meter_id": "YmRlNjdhMjItNzU3OS00MDk3LTk0MDYtYzE1ZWIyYjlhZTI3K2NwdQ==\n",
+ "project_id": "7c918e6765c24ee281f3ee8692fd102c",
+ "type": "cumulative",
+ "unit": "ns",
+ "description": "CPU time used"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "cpu",
+ "service": "Other",
+ "resource_id": "0a802169-5918-4c28-9014-635ae6602cdb",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_volt-5",
+ "meter_id": "MGE4MDIxNjktNTkxOC00YzI4LTkwMTQtNjM1YWU2NjAyY2RiK2NwdQ==\n",
+ "project_id": "f506380a49a24389ae0d8469274e3279",
+ "type": "cumulative",
+ "unit": "ns",
+ "description": "CPU time used"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vcpe",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "cpu",
+ "service": "service_vcpe",
+ "resource_id": "f71e7c55-2435-45a4-aa9a-073f97ceccbc",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_vcpe-7",
+ "meter_id": "ZjcxZTdjNTUtMjQzNS00NWE0LWFhOWEtMDczZjk3Y2VjY2JjK2NwdQ==\n",
+ "project_id": "61a5d4b37b5d43718854916079760c0d",
+ "type": "cumulative",
+ "unit": "ns",
+ "description": "CPU time used"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "cpu",
+ "service": "Other",
+ "resource_id": "98535996-e184-4996-a28e-61647e5d31d0",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_vbng-6",
+ "meter_id": "OTg1MzU5OTYtZTE4NC00OTk2LWEyOGUtNjE2NDdlNWQzMWQwK2NwdQ==\n",
+ "project_id": "c92cf450df4640d6952c0276730e5048",
+ "type": "cumulative",
+ "unit": "ns",
+ "description": "CPU time used"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_clients",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "cpu",
+ "service": "Other",
+ "resource_id": "f5c71396-9092-42da-91ec-434259bde2ef",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_clients-3",
+ "meter_id": "ZjVjNzEzOTYtOTA5Mi00MmRhLTkxZWMtNDM0MjU5YmRlMmVmK2NwdQ==\n",
+ "project_id": "f884c440474b40808a8adcdece5f45ef",
+ "type": "cumulative",
+ "unit": "ns",
+ "description": "CPU time used"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_ceilometer",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "cpu",
+ "service": "service_ceilometer",
+ "resource_id": "bdb0ff14-e848-446c-acb4-63e232487dc0",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_ceilometer-8",
+ "meter_id": "YmRiMGZmMTQtZTg0OC00NDZjLWFjYjQtNjNlMjMyNDg3ZGMwK2NwdQ==\n",
+ "project_id": "920d70bc63574552bbb3c3fb262ee1bc",
+ "type": "cumulative",
+ "unit": "ns",
+ "description": "CPU time used"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_onos_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "cpu_util",
+ "service": "service_ONOS_vOLT",
+ "resource_id": "197bc772-ff13-4b68-96e6-d4a4b1730fe7",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_onos_volt-4",
+ "meter_id": "MTk3YmM3NzItZmYxMy00YjY4LTk2ZTYtZDRhNGIxNzMwZmU3K2NwdV91dGls\n",
+ "project_id": "bfef8341327245d682c7bada50aceecb",
+ "type": "gauge",
+ "unit": "%",
+ "description": "Average CPU utilization"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_onos_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "cpu_util",
+ "service": "service_ONOS_vBNG",
+ "resource_id": "bde67a22-7579-4097-9406-c15eb2b9ae27",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_onos_vbng-2",
+ "meter_id": "YmRlNjdhMjItNzU3OS00MDk3LTk0MDYtYzE1ZWIyYjlhZTI3K2NwdV91dGls\n",
+ "project_id": "7c918e6765c24ee281f3ee8692fd102c",
+ "type": "gauge",
+ "unit": "%",
+ "description": "Average CPU utilization"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "cpu_util",
+ "service": "Other",
+ "resource_id": "0a802169-5918-4c28-9014-635ae6602cdb",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_volt-5",
+ "meter_id": "MGE4MDIxNjktNTkxOC00YzI4LTkwMTQtNjM1YWU2NjAyY2RiK2NwdV91dGls\n",
+ "project_id": "f506380a49a24389ae0d8469274e3279",
+ "type": "gauge",
+ "unit": "%",
+ "description": "Average CPU utilization"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vcpe",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "cpu_util",
+ "service": "service_vcpe",
+ "resource_id": "f71e7c55-2435-45a4-aa9a-073f97ceccbc",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_vcpe-7",
+ "meter_id": "ZjcxZTdjNTUtMjQzNS00NWE0LWFhOWEtMDczZjk3Y2VjY2JjK2NwdV91dGls\n",
+ "project_id": "61a5d4b37b5d43718854916079760c0d",
+ "type": "gauge",
+ "unit": "%",
+ "description": "Average CPU utilization"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "cpu_util",
+ "service": "Other",
+ "resource_id": "98535996-e184-4996-a28e-61647e5d31d0",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_vbng-6",
+ "meter_id": "OTg1MzU5OTYtZTE4NC00OTk2LWEyOGUtNjE2NDdlNWQzMWQwK2NwdV91dGls\n",
+ "project_id": "c92cf450df4640d6952c0276730e5048",
+ "type": "gauge",
+ "unit": "%",
+ "description": "Average CPU utilization"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_clients",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "cpu_util",
+ "service": "Other",
+ "resource_id": "f5c71396-9092-42da-91ec-434259bde2ef",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_clients-3",
+ "meter_id": "ZjVjNzEzOTYtOTA5Mi00MmRhLTkxZWMtNDM0MjU5YmRlMmVmK2NwdV91dGls\n",
+ "project_id": "f884c440474b40808a8adcdece5f45ef",
+ "type": "gauge",
+ "unit": "%",
+ "description": "Average CPU utilization"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_ceilometer",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "cpu_util",
+ "service": "service_ceilometer",
+ "resource_id": "bdb0ff14-e848-446c-acb4-63e232487dc0",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "mysite_ceilometer-8",
+ "meter_id": "YmRiMGZmMTQtZTg0OC00NDZjLWFjYjQtNjNlMjMyNDg3ZGMwK2NwdV91dGls\n",
+ "project_id": "920d70bc63574552bbb3c3fb262ee1bc",
+ "type": "gauge",
+ "unit": "%",
+ "description": "Average CPU utilization"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_onos_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "service_ONOS_vOLT",
+ "resource_id": "instance-00000002-197bc772-ff13-4b68-96e6-d4a4b1730fe7-tap27815de2-07",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap27815de2-07",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDItMTk3YmM3NzItZmYxMy00YjY4LTk2ZTYtZDRhNGIxNzMwZmU3LXRh\ncDI3ODE1ZGUyLTA3K25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "bfef8341327245d682c7bada50aceecb",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_onos_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "service_ONOS_vOLT",
+ "resource_id": "instance-00000002-197bc772-ff13-4b68-96e6-d4a4b1730fe7-tap8f02bde6-e4",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap8f02bde6-e4",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDItMTk3YmM3NzItZmYxMy00YjY4LTk2ZTYtZDRhNGIxNzMwZmU3LXRh\ncDhmMDJiZGU2LWU0K25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "bfef8341327245d682c7bada50aceecb",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_onos_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "service_ONOS_vBNG",
+ "resource_id": "instance-00000004-bde67a22-7579-4097-9406-c15eb2b9ae27-tap265bab7b-93",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap265bab7b-93",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDQtYmRlNjdhMjItNzU3OS00MDk3LTk0MDYtYzE1ZWIyYjlhZTI3LXRh\ncDI2NWJhYjdiLTkzK25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "7c918e6765c24ee281f3ee8692fd102c",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_onos_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "service_ONOS_vBNG",
+ "resource_id": "instance-00000004-bde67a22-7579-4097-9406-c15eb2b9ae27-tap6d838c10-05",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap6d838c10-05",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDQtYmRlNjdhMjItNzU3OS00MDk3LTk0MDYtYzE1ZWIyYjlhZTI3LXRh\ncDZkODM4YzEwLTA1K25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "7c918e6765c24ee281f3ee8692fd102c",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000001-0a802169-5918-4c28-9014-635ae6602cdb-tap5ef062b7-1d",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap5ef062b7-1d",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDEtMGE4MDIxNjktNTkxOC00YzI4LTkwMTQtNjM1YWU2NjAyY2RiLXRh\ncDVlZjA2MmI3LTFkK25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "f506380a49a24389ae0d8469274e3279",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000001-0a802169-5918-4c28-9014-635ae6602cdb-tap905990b8-db",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap905990b8-db",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDEtMGE4MDIxNjktNTkxOC00YzI4LTkwMTQtNjM1YWU2NjAyY2RiLXRh\ncDkwNTk5MGI4LWRiK25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "f506380a49a24389ae0d8469274e3279",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000001-0a802169-5918-4c28-9014-635ae6602cdb-tapa216d1f0-3e",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tapa216d1f0-3e",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDEtMGE4MDIxNjktNTkxOC00YzI4LTkwMTQtNjM1YWU2NjAyY2RiLXRh\ncGEyMTZkMWYwLTNlK25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "f506380a49a24389ae0d8469274e3279",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000001-0a802169-5918-4c28-9014-635ae6602cdb-tapd80be99a-b6",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tapd80be99a-b6",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDEtMGE4MDIxNjktNTkxOC00YzI4LTkwMTQtNjM1YWU2NjAyY2RiLXRh\ncGQ4MGJlOTlhLWI2K25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "f506380a49a24389ae0d8469274e3279",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vcpe",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "service_vcpe",
+ "resource_id": "instance-00000006-f71e7c55-2435-45a4-aa9a-073f97ceccbc-tap5afd137f-19",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap5afd137f-19",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDYtZjcxZTdjNTUtMjQzNS00NWE0LWFhOWEtMDczZjk3Y2VjY2JjLXRh\ncDVhZmQxMzdmLTE5K25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "61a5d4b37b5d43718854916079760c0d",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vcpe",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "service_vcpe",
+ "resource_id": "instance-00000006-f71e7c55-2435-45a4-aa9a-073f97ceccbc-tap9a6306b4-7e",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap9a6306b4-7e",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDYtZjcxZTdjNTUtMjQzNS00NWE0LWFhOWEtMDczZjk3Y2VjY2JjLXRh\ncDlhNjMwNmI0LTdlK25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "61a5d4b37b5d43718854916079760c0d",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vcpe",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "service_vcpe",
+ "resource_id": "instance-00000006-f71e7c55-2435-45a4-aa9a-073f97ceccbc-tapc59abc32-a4",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tapc59abc32-a4",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDYtZjcxZTdjNTUtMjQzNS00NWE0LWFhOWEtMDczZjk3Y2VjY2JjLXRh\ncGM1OWFiYzMyLWE0K25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "61a5d4b37b5d43718854916079760c0d",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vcpe",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "service_vcpe",
+ "resource_id": "instance-00000006-f71e7c55-2435-45a4-aa9a-073f97ceccbc-tapf1e00a14-22",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tapf1e00a14-22",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDYtZjcxZTdjNTUtMjQzNS00NWE0LWFhOWEtMDczZjk3Y2VjY2JjLXRh\ncGYxZTAwYTE0LTIyK25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "61a5d4b37b5d43718854916079760c0d",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000007-98535996-e184-4996-a28e-61647e5d31d0-tapabf29bde-bc",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tapabf29bde-bc",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDctOTg1MzU5OTYtZTE4NC00OTk2LWEyOGUtNjE2NDdlNWQzMWQwLXRh\ncGFiZjI5YmRlLWJjK25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "c92cf450df4640d6952c0276730e5048",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000007-98535996-e184-4996-a28e-61647e5d31d0-tapbc16b000-82",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tapbc16b000-82",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDctOTg1MzU5OTYtZTE4NC00OTk2LWEyOGUtNjE2NDdlNWQzMWQwLXRh\ncGJjMTZiMDAwLTgyK25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "c92cf450df4640d6952c0276730e5048",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000007-98535996-e184-4996-a28e-61647e5d31d0-tape44bc1cc-46",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tape44bc1cc-46",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDctOTg1MzU5OTYtZTE4NC00OTk2LWEyOGUtNjE2NDdlNWQzMWQwLXRh\ncGU0NGJjMWNjLTQ2K25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "c92cf450df4640d6952c0276730e5048",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000007-98535996-e184-4996-a28e-61647e5d31d0-tape4f20024-47",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tape4f20024-47",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDctOTg1MzU5OTYtZTE4NC00OTk2LWEyOGUtNjE2NDdlNWQzMWQwLXRh\ncGU0ZjIwMDI0LTQ3K25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "c92cf450df4640d6952c0276730e5048",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_clients",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000003-f5c71396-9092-42da-91ec-434259bde2ef-tap3518d7f8-9f",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap3518d7f8-9f",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDMtZjVjNzEzOTYtOTA5Mi00MmRhLTkxZWMtNDM0MjU5YmRlMmVmLXRh\ncDM1MThkN2Y4LTlmK25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "f884c440474b40808a8adcdece5f45ef",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_clients",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000003-f5c71396-9092-42da-91ec-434259bde2ef-tap7409a9c5-e0",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap7409a9c5-e0",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDMtZjVjNzEzOTYtOTA5Mi00MmRhLTkxZWMtNDM0MjU5YmRlMmVmLXRh\ncDc0MDlhOWM1LWUwK25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "f884c440474b40808a8adcdece5f45ef",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_clients",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000003-f5c71396-9092-42da-91ec-434259bde2ef-tapde69764f-3d",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tapde69764f-3d",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDMtZjVjNzEzOTYtOTA5Mi00MmRhLTkxZWMtNDM0MjU5YmRlMmVmLXRh\ncGRlNjk3NjRmLTNkK25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "f884c440474b40808a8adcdece5f45ef",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_ceilometer",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "service_ceilometer",
+ "resource_id": "instance-00000005-bdb0ff14-e848-446c-acb4-63e232487dc0-tap8d13e0d5-d2",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap8d13e0d5-d2",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDUtYmRiMGZmMTQtZTg0OC00NDZjLWFjYjQtNjNlMjMyNDg3ZGMwLXRh\ncDhkMTNlMGQ1LWQyK25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "920d70bc63574552bbb3c3fb262ee1bc",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_ceilometer",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "service_ceilometer",
+ "resource_id": "instance-00000005-bdb0ff14-e848-446c-acb4-63e232487dc0-tapa5d252a8-ae",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tapa5d252a8-ae",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDUtYmRiMGZmMTQtZTg0OC00NDZjLWFjYjQtNjNlMjMyNDg3ZGMwLXRh\ncGE1ZDI1MmE4LWFlK25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "920d70bc63574552bbb3c3fb262ee1bc",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_ceilometer",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.incoming.bytes.rate",
+ "service": "service_ceilometer",
+ "resource_id": "instance-00000005-bdb0ff14-e848-446c-acb4-63e232487dc0-tapb06a526b-03",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tapb06a526b-03",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDUtYmRiMGZmMTQtZTg0OC00NDZjLWFjYjQtNjNlMjMyNDg3ZGMwLXRh\ncGIwNmE1MjZiLTAzK25ldHdvcmsuaW5jb21pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "920d70bc63574552bbb3c3fb262ee1bc",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_onos_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "service_ONOS_vOLT",
+ "resource_id": "instance-00000002-197bc772-ff13-4b68-96e6-d4a4b1730fe7-tap27815de2-07",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap27815de2-07",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDItMTk3YmM3NzItZmYxMy00YjY4LTk2ZTYtZDRhNGIxNzMwZmU3LXRh\ncDI3ODE1ZGUyLTA3K25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "bfef8341327245d682c7bada50aceecb",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_onos_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "service_ONOS_vOLT",
+ "resource_id": "instance-00000002-197bc772-ff13-4b68-96e6-d4a4b1730fe7-tap8f02bde6-e4",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap8f02bde6-e4",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDItMTk3YmM3NzItZmYxMy00YjY4LTk2ZTYtZDRhNGIxNzMwZmU3LXRh\ncDhmMDJiZGU2LWU0K25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "bfef8341327245d682c7bada50aceecb",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_onos_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "service_ONOS_vBNG",
+ "resource_id": "instance-00000004-bde67a22-7579-4097-9406-c15eb2b9ae27-tap265bab7b-93",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap265bab7b-93",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDQtYmRlNjdhMjItNzU3OS00MDk3LTk0MDYtYzE1ZWIyYjlhZTI3LXRh\ncDI2NWJhYjdiLTkzK25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "7c918e6765c24ee281f3ee8692fd102c",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_onos_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "service_ONOS_vBNG",
+ "resource_id": "instance-00000004-bde67a22-7579-4097-9406-c15eb2b9ae27-tap6d838c10-05",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap6d838c10-05",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDQtYmRlNjdhMjItNzU3OS00MDk3LTk0MDYtYzE1ZWIyYjlhZTI3LXRh\ncDZkODM4YzEwLTA1K25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "7c918e6765c24ee281f3ee8692fd102c",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000001-0a802169-5918-4c28-9014-635ae6602cdb-tap5ef062b7-1d",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap5ef062b7-1d",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDEtMGE4MDIxNjktNTkxOC00YzI4LTkwMTQtNjM1YWU2NjAyY2RiLXRh\ncDVlZjA2MmI3LTFkK25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "f506380a49a24389ae0d8469274e3279",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000001-0a802169-5918-4c28-9014-635ae6602cdb-tap905990b8-db",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap905990b8-db",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDEtMGE4MDIxNjktNTkxOC00YzI4LTkwMTQtNjM1YWU2NjAyY2RiLXRh\ncDkwNTk5MGI4LWRiK25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "f506380a49a24389ae0d8469274e3279",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000001-0a802169-5918-4c28-9014-635ae6602cdb-tapa216d1f0-3e",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tapa216d1f0-3e",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDEtMGE4MDIxNjktNTkxOC00YzI4LTkwMTQtNjM1YWU2NjAyY2RiLXRh\ncGEyMTZkMWYwLTNlK25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "f506380a49a24389ae0d8469274e3279",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_volt",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000001-0a802169-5918-4c28-9014-635ae6602cdb-tapd80be99a-b6",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tapd80be99a-b6",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDEtMGE4MDIxNjktNTkxOC00YzI4LTkwMTQtNjM1YWU2NjAyY2RiLXRh\ncGQ4MGJlOTlhLWI2K25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "f506380a49a24389ae0d8469274e3279",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vcpe",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "service_vcpe",
+ "resource_id": "instance-00000006-f71e7c55-2435-45a4-aa9a-073f97ceccbc-tap5afd137f-19",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap5afd137f-19",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDYtZjcxZTdjNTUtMjQzNS00NWE0LWFhOWEtMDczZjk3Y2VjY2JjLXRh\ncDVhZmQxMzdmLTE5K25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "61a5d4b37b5d43718854916079760c0d",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vcpe",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "service_vcpe",
+ "resource_id": "instance-00000006-f71e7c55-2435-45a4-aa9a-073f97ceccbc-tap9a6306b4-7e",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap9a6306b4-7e",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDYtZjcxZTdjNTUtMjQzNS00NWE0LWFhOWEtMDczZjk3Y2VjY2JjLXRh\ncDlhNjMwNmI0LTdlK25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "61a5d4b37b5d43718854916079760c0d",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vcpe",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "service_vcpe",
+ "resource_id": "instance-00000006-f71e7c55-2435-45a4-aa9a-073f97ceccbc-tapc59abc32-a4",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tapc59abc32-a4",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDYtZjcxZTdjNTUtMjQzNS00NWE0LWFhOWEtMDczZjk3Y2VjY2JjLXRh\ncGM1OWFiYzMyLWE0K25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "61a5d4b37b5d43718854916079760c0d",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vcpe",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "service_vcpe",
+ "resource_id": "instance-00000006-f71e7c55-2435-45a4-aa9a-073f97ceccbc-tapf1e00a14-22",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tapf1e00a14-22",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDYtZjcxZTdjNTUtMjQzNS00NWE0LWFhOWEtMDczZjk3Y2VjY2JjLXRh\ncGYxZTAwYTE0LTIyK25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "61a5d4b37b5d43718854916079760c0d",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000007-98535996-e184-4996-a28e-61647e5d31d0-tapabf29bde-bc",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tapabf29bde-bc",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDctOTg1MzU5OTYtZTE4NC00OTk2LWEyOGUtNjE2NDdlNWQzMWQwLXRh\ncGFiZjI5YmRlLWJjK25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "c92cf450df4640d6952c0276730e5048",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000007-98535996-e184-4996-a28e-61647e5d31d0-tapbc16b000-82",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tapbc16b000-82",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDctOTg1MzU5OTYtZTE4NC00OTk2LWEyOGUtNjE2NDdlNWQzMWQwLXRh\ncGJjMTZiMDAwLTgyK25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "c92cf450df4640d6952c0276730e5048",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000007-98535996-e184-4996-a28e-61647e5d31d0-tape44bc1cc-46",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tape44bc1cc-46",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDctOTg1MzU5OTYtZTE4NC00OTk2LWEyOGUtNjE2NDdlNWQzMWQwLXRh\ncGU0NGJjMWNjLTQ2K25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "c92cf450df4640d6952c0276730e5048",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_vbng",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000007-98535996-e184-4996-a28e-61647e5d31d0-tape4f20024-47",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tape4f20024-47",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDctOTg1MzU5OTYtZTE4NC00OTk2LWEyOGUtNjE2NDdlNWQzMWQwLXRh\ncGU0ZjIwMDI0LTQ3K25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "c92cf450df4640d6952c0276730e5048",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_clients",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000003-f5c71396-9092-42da-91ec-434259bde2ef-tap3518d7f8-9f",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap3518d7f8-9f",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDMtZjVjNzEzOTYtOTA5Mi00MmRhLTkxZWMtNDM0MjU5YmRlMmVmLXRh\ncDM1MThkN2Y4LTlmK25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "f884c440474b40808a8adcdece5f45ef",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_clients",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000003-f5c71396-9092-42da-91ec-434259bde2ef-tap7409a9c5-e0",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap7409a9c5-e0",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDMtZjVjNzEzOTYtOTA5Mi00MmRhLTkxZWMtNDM0MjU5YmRlMmVmLXRh\ncDc0MDlhOWM1LWUwK25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "f884c440474b40808a8adcdece5f45ef",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_clients",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "Other",
+ "resource_id": "instance-00000003-f5c71396-9092-42da-91ec-434259bde2ef-tapde69764f-3d",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tapde69764f-3d",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDMtZjVjNzEzOTYtOTA5Mi00MmRhLTkxZWMtNDM0MjU5YmRlMmVmLXRh\ncGRlNjk3NjRmLTNkK25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "f884c440474b40808a8adcdece5f45ef",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_ceilometer",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "service_ceilometer",
+ "resource_id": "instance-00000005-bdb0ff14-e848-446c-acb4-63e232487dc0-tap8d13e0d5-d2",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tap8d13e0d5-d2",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDUtYmRiMGZmMTQtZTg0OC00NDZjLWFjYjQtNjNlMjMyNDg3ZGMwLXRh\ncDhkMTNlMGQ1LWQyK25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "920d70bc63574552bbb3c3fb262ee1bc",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_ceilometer",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "service_ceilometer",
+ "resource_id": "instance-00000005-bdb0ff14-e848-446c-acb4-63e232487dc0-tapa5d252a8-ae",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tapa5d252a8-ae",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDUtYmRiMGZmMTQtZTg0OC00NDZjLWFjYjQtNjNlMjMyNDg3ZGMwLXRh\ncGE1ZDI1MmE4LWFlK25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "920d70bc63574552bbb3c3fb262ee1bc",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "category": "Nova",
+ "slice": "mysite_ceilometer",
+ "user_id": "36e376b1072443758a0314f62fa8a414",
+ "name": "network.outgoing.bytes.rate",
+ "service": "service_ceilometer",
+ "resource_id": "instance-00000005-bdb0ff14-e848-446c-acb4-63e232487dc0-tapb06a526b-03",
+ "label": "",
+ "source": "openstack",
+ "resource_name": "tapb06a526b-03",
+ "meter_id": "aW5zdGFuY2UtMDAwMDAwMDUtYmRiMGZmMTQtZTg0OC00NDZjLWFjYjQtNjNlMjMyNDg3ZGMwLXRh\ncGIwNmE1MjZiLTAzK25ldHdvcmsub3V0Z29pbmcuYnl0ZXMucmF0ZQ==\n",
+ "project_id": "920d70bc63574552bbb3c3fb262ee1bc",
+ "type": "gauge",
+ "unit": "B/s",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ }
+]
\ No newline at end of file
diff --git a/gui/ngXosViews/ceilometerDashboard/src/stats_mock.json b/gui/ngXosViews/ceilometerDashboard/src/stats_mock.json
new file mode 100644
index 0000000..5dd083a
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/src/stats_mock.json
@@ -0,0 +1,950 @@
+[
+ {
+ "value": 1.0,
+ "unit": "instance",
+ "slice": "mysite_ceilometer",
+ "name": "none",
+ "service": "service_ceilometer",
+ "resource_id": "c7f44959-490b-4d24-8043-66a096c7cae0",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "instance",
+ "description": "Existence of instance"
+ },
+ {
+ "value": 1.0,
+ "unit": "instance",
+ "slice": "mysite_vcpe",
+ "name": "none",
+ "service": "service_vcpe",
+ "resource_id": "afac5cb6-72c7-4c25-b281-7a442835b395",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "instance",
+ "description": "Existence of instance"
+ },
+ {
+ "value": 1.0,
+ "unit": "instance",
+ "slice": "mysite_vbng",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "9ec8c981-feb8-46c1-a1f6-3438702ee170",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "instance",
+ "description": "Existence of instance"
+ },
+ {
+ "value": 1.0,
+ "unit": "instance",
+ "slice": "mysite_onos_volt",
+ "name": "none",
+ "service": "service_ONOS_vOLT",
+ "resource_id": "274134cc-700a-4392-8226-447a2f35cc1e",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "instance",
+ "description": "Existence of instance"
+ },
+ {
+ "value": 1.0,
+ "unit": "instance",
+ "slice": "mysite_onos_vbng",
+ "name": "none",
+ "service": "service_ONOS_vBNG",
+ "resource_id": "e66d524e-9ce1-4ec2-81bb-c95043fb8e4f",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "instance",
+ "description": "Existence of instance"
+ },
+ {
+ "value": 1.0,
+ "unit": "instance",
+ "slice": "mysite_clients",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "a8214ed9-e222-484b-93c2-9245e4712a99",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "instance",
+ "description": "Existence of instance"
+ },
+ {
+ "value": 1.0,
+ "unit": "instance",
+ "slice": "mysite_volt",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "7d483484-a660-4307-b081-af1e4dd07eae",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "instance",
+ "description": "Existence of instance"
+ },
+ {
+ "value": 2048.0,
+ "unit": "MB",
+ "slice": "mysite_ceilometer",
+ "name": "none",
+ "service": "service_ceilometer",
+ "resource_id": "c7f44959-490b-4d24-8043-66a096c7cae0",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "memory",
+ "description": "Volume of RAM"
+ },
+ {
+ "value": 2048.0,
+ "unit": "MB",
+ "slice": "mysite_vcpe",
+ "name": "none",
+ "service": "service_vcpe",
+ "resource_id": "afac5cb6-72c7-4c25-b281-7a442835b395",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "memory",
+ "description": "Volume of RAM"
+ },
+ {
+ "value": 2048.0,
+ "unit": "MB",
+ "slice": "mysite_vbng",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "9ec8c981-feb8-46c1-a1f6-3438702ee170",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "memory",
+ "description": "Volume of RAM"
+ },
+ {
+ "value": 2048.0,
+ "unit": "MB",
+ "slice": "mysite_onos_volt",
+ "name": "none",
+ "service": "service_ONOS_vOLT",
+ "resource_id": "274134cc-700a-4392-8226-447a2f35cc1e",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "memory",
+ "description": "Volume of RAM"
+ },
+ {
+ "value": 2048.0,
+ "unit": "MB",
+ "slice": "mysite_onos_vbng",
+ "name": "none",
+ "service": "service_ONOS_vBNG",
+ "resource_id": "e66d524e-9ce1-4ec2-81bb-c95043fb8e4f",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "memory",
+ "description": "Volume of RAM"
+ },
+ {
+ "value": 2048.0,
+ "unit": "MB",
+ "slice": "mysite_clients",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "a8214ed9-e222-484b-93c2-9245e4712a99",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "memory",
+ "description": "Volume of RAM"
+ },
+ {
+ "value": 2048.0,
+ "unit": "MB",
+ "slice": "mysite_volt",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "7d483484-a660-4307-b081-af1e4dd07eae",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "memory",
+ "description": "Volume of RAM"
+ },
+ {
+ "value": 1507.9379310344827,
+ "unit": "MB",
+ "slice": "mysite_ceilometer",
+ "name": "none",
+ "service": "service_ceilometer",
+ "resource_id": "c7f44959-490b-4d24-8043-66a096c7cae0",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "memory.usage",
+ "description": "Volume of RAM used"
+ },
+ {
+ "value": 374.6965517241379,
+ "unit": "MB",
+ "slice": "mysite_vcpe",
+ "name": "none",
+ "service": "service_vcpe",
+ "resource_id": "afac5cb6-72c7-4c25-b281-7a442835b395",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "memory.usage",
+ "description": "Volume of RAM used"
+ },
+ {
+ "value": 375.1655172413793,
+ "unit": "MB",
+ "slice": "mysite_vbng",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "9ec8c981-feb8-46c1-a1f6-3438702ee170",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "memory.usage",
+ "description": "Volume of RAM used"
+ },
+ {
+ "value": 1786.7310344827586,
+ "unit": "MB",
+ "slice": "mysite_onos_volt",
+ "name": "none",
+ "service": "service_ONOS_vOLT",
+ "resource_id": "274134cc-700a-4392-8226-447a2f35cc1e",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "memory.usage",
+ "description": "Volume of RAM used"
+ },
+ {
+ "value": 1797.2413793103449,
+ "unit": "MB",
+ "slice": "mysite_onos_vbng",
+ "name": "none",
+ "service": "service_ONOS_vBNG",
+ "resource_id": "e66d524e-9ce1-4ec2-81bb-c95043fb8e4f",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "memory.usage",
+ "description": "Volume of RAM used"
+ },
+ {
+ "value": 376.36551724137934,
+ "unit": "MB",
+ "slice": "mysite_clients",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "a8214ed9-e222-484b-93c2-9245e4712a99",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "memory.usage",
+ "description": "Volume of RAM used"
+ },
+ {
+ "value": 373.5448275862069,
+ "unit": "MB",
+ "slice": "mysite_volt",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "7d483484-a660-4307-b081-af1e4dd07eae",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "memory.usage",
+ "description": "Volume of RAM used"
+ },
+ {
+ "value": 194620344827.5862,
+ "unit": "ns",
+ "slice": "mysite_ceilometer",
+ "name": "none",
+ "service": "service_ceilometer",
+ "resource_id": "c7f44959-490b-4d24-8043-66a096c7cae0",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "cpu",
+ "description": "CPU time used"
+ },
+ {
+ "value": 93601310344.82759,
+ "unit": "ns",
+ "slice": "mysite_vcpe",
+ "name": "none",
+ "service": "service_vcpe",
+ "resource_id": "afac5cb6-72c7-4c25-b281-7a442835b395",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "cpu",
+ "description": "CPU time used"
+ },
+ {
+ "value": 93402206896.55173,
+ "unit": "ns",
+ "slice": "mysite_vbng",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "9ec8c981-feb8-46c1-a1f6-3438702ee170",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "cpu",
+ "description": "CPU time used"
+ },
+ {
+ "value": 4394690965517.241,
+ "unit": "ns",
+ "slice": "mysite_onos_volt",
+ "name": "none",
+ "service": "service_ONOS_vOLT",
+ "resource_id": "274134cc-700a-4392-8226-447a2f35cc1e",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "cpu",
+ "description": "CPU time used"
+ },
+ {
+ "value": 4025309517241.3794,
+ "unit": "ns",
+ "slice": "mysite_onos_vbng",
+ "name": "none",
+ "service": "service_ONOS_vBNG",
+ "resource_id": "e66d524e-9ce1-4ec2-81bb-c95043fb8e4f",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "cpu",
+ "description": "CPU time used"
+ },
+ {
+ "value": 90704896551.72414,
+ "unit": "ns",
+ "slice": "mysite_clients",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "a8214ed9-e222-484b-93c2-9245e4712a99",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "cpu",
+ "description": "CPU time used"
+ },
+ {
+ "value": 93930827586.2069,
+ "unit": "ns",
+ "slice": "mysite_volt",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "7d483484-a660-4307-b081-af1e4dd07eae",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "cpu",
+ "description": "CPU time used"
+ },
+ {
+ "value": 0.2539938837459742,
+ "unit": "%",
+ "slice": "mysite_ceilometer",
+ "name": "none",
+ "service": "service_ceilometer",
+ "resource_id": "c7f44959-490b-4d24-8043-66a096c7cae0",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "cpu_util",
+ "description": "Average CPU utilization"
+ },
+ {
+ "value": 0.1430115727449207,
+ "unit": "%",
+ "slice": "mysite_vcpe",
+ "name": "none",
+ "service": "service_vcpe",
+ "resource_id": "afac5cb6-72c7-4c25-b281-7a442835b395",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "cpu_util",
+ "description": "Average CPU utilization"
+ },
+ {
+ "value": 0.14234621932639643,
+ "unit": "%",
+ "slice": "mysite_vbng",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "9ec8c981-feb8-46c1-a1f6-3438702ee170",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "cpu_util",
+ "description": "Average CPU utilization"
+ },
+ {
+ "value": 9.501434897077173,
+ "unit": "%",
+ "slice": "mysite_onos_volt",
+ "name": "none",
+ "service": "service_ONOS_vOLT",
+ "resource_id": "274134cc-700a-4392-8226-447a2f35cc1e",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "cpu_util",
+ "description": "Average CPU utilization"
+ },
+ {
+ "value": 8.59252727701459,
+ "unit": "%",
+ "slice": "mysite_onos_vbng",
+ "name": "none",
+ "service": "service_ONOS_vBNG",
+ "resource_id": "e66d524e-9ce1-4ec2-81bb-c95043fb8e4f",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "cpu_util",
+ "description": "Average CPU utilization"
+ },
+ {
+ "value": 0.13846207922030151,
+ "unit": "%",
+ "slice": "mysite_clients",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "a8214ed9-e222-484b-93c2-9245e4712a99",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "cpu_util",
+ "description": "Average CPU utilization"
+ },
+ {
+ "value": 0.14287395279840676,
+ "unit": "%",
+ "slice": "mysite_volt",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "7d483484-a660-4307-b081-af1e4dd07eae",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "cpu_util",
+ "description": "Average CPU utilization"
+ },
+ {
+ "value": 88.53419771575258,
+ "unit": "B/s",
+ "slice": "mysite_ceilometer",
+ "name": "none",
+ "service": "service_ceilometer",
+ "resource_id": "instance-0000001b-c7f44959-490b-4d24-8043-66a096c7cae0-tapcadfbd73-5b",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 0.009455996028375395,
+ "unit": "B/s",
+ "slice": "mysite_ceilometer",
+ "name": "none",
+ "service": "service_ceilometer",
+ "resource_id": "instance-0000001b-c7f44959-490b-4d24-8043-66a096c7cae0-tap972eb016-96",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 0.009455996028375395,
+ "unit": "B/s",
+ "slice": "mysite_ceilometer",
+ "name": "none",
+ "service": "service_ceilometer",
+ "resource_id": "instance-0000001b-c7f44959-490b-4d24-8043-66a096c7cae0-tapf56382ad-45",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 124.74842906323501,
+ "unit": "B/s",
+ "slice": "mysite_vcpe",
+ "name": "none",
+ "service": "service_vcpe",
+ "resource_id": "instance-0000001a-afac5cb6-72c7-4c25-b281-7a442835b395-tap79d13f74-62",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 0.017425896307365425,
+ "unit": "B/s",
+ "slice": "mysite_vcpe",
+ "name": "none",
+ "service": "service_vcpe",
+ "resource_id": "instance-0000001a-afac5cb6-72c7-4c25-b281-7a442835b395-tap25ae020a-23",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 0.0174337765740103,
+ "unit": "B/s",
+ "slice": "mysite_vcpe",
+ "name": "none",
+ "service": "service_vcpe",
+ "resource_id": "instance-0000001a-afac5cb6-72c7-4c25-b281-7a442835b395-tap8382609c-7c",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 0.009424851354967827,
+ "unit": "B/s",
+ "slice": "mysite_vcpe",
+ "name": "none",
+ "service": "service_vcpe",
+ "resource_id": "instance-0000001a-afac5cb6-72c7-4c25-b281-7a442835b395-tap7bbe02e0-09",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 127.2159155680703,
+ "unit": "B/s",
+ "slice": "mysite_vbng",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-0000001c-9ec8c981-feb8-46c1-a1f6-3438702ee170-tap308ba38c-64",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 1.996809016615307,
+ "unit": "B/s",
+ "slice": "mysite_vbng",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-0000001c-9ec8c981-feb8-46c1-a1f6-3438702ee170-tap2aadc958-57",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 0.00944055944055944,
+ "unit": "B/s",
+ "slice": "mysite_vbng",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-0000001c-9ec8c981-feb8-46c1-a1f6-3438702ee170-tap0b518c8d-01",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 0.017428347945877158,
+ "unit": "B/s",
+ "slice": "mysite_vbng",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-0000001c-9ec8c981-feb8-46c1-a1f6-3438702ee170-tapaf0c7436-e8",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 0.009471769187962845,
+ "unit": "B/s",
+ "slice": "mysite_onos_volt",
+ "name": "none",
+ "service": "service_ONOS_vOLT",
+ "resource_id": "instance-00000017-274134cc-700a-4392-8226-447a2f35cc1e-tap4b98f4d2-7e",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 33.618374055863,
+ "unit": "B/s",
+ "slice": "mysite_onos_volt",
+ "name": "none",
+ "service": "service_ONOS_vOLT",
+ "resource_id": "instance-00000017-274134cc-700a-4392-8226-447a2f35cc1e-tap35a9b09a-29",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 0.009448122592881327,
+ "unit": "B/s",
+ "slice": "mysite_onos_vbng",
+ "name": "none",
+ "service": "service_ONOS_vBNG",
+ "resource_id": "instance-00000019-e66d524e-9ce1-4ec2-81bb-c95043fb8e4f-tap6717e37b-5a",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 33.6291738301644,
+ "unit": "B/s",
+ "slice": "mysite_onos_vbng",
+ "name": "none",
+ "service": "service_ONOS_vBNG",
+ "resource_id": "instance-00000019-e66d524e-9ce1-4ec2-81bb-c95043fb8e4f-tap35b38817-7f",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 0.009463869463869463,
+ "unit": "B/s",
+ "slice": "mysite_clients",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-00000018-a8214ed9-e222-484b-93c2-9245e4712a99-tapaf9418d8-68",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 0.017437164857185466,
+ "unit": "B/s",
+ "slice": "mysite_clients",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-00000018-a8214ed9-e222-484b-93c2-9245e4712a99-tap56d0c6f9-27",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 124.61289583768621,
+ "unit": "B/s",
+ "slice": "mysite_clients",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-00000018-a8214ed9-e222-484b-93c2-9245e4712a99-tap31f27f17-47",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 123.65339047759299,
+ "unit": "B/s",
+ "slice": "mysite_volt",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-0000001d-7d483484-a660-4307-b081-af1e4dd07eae-tap4894ed8a-51",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 0.009440585664408507,
+ "unit": "B/s",
+ "slice": "mysite_volt",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-0000001d-7d483484-a660-4307-b081-af1e4dd07eae-tap31c8ec21-34",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 0.01743467844779237,
+ "unit": "B/s",
+ "slice": "mysite_volt",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-0000001d-7d483484-a660-4307-b081-af1e4dd07eae-tap2605ab77-0a",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 0.013442333959863174,
+ "unit": "B/s",
+ "slice": "mysite_volt",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-0000001d-7d483484-a660-4307-b081-af1e4dd07eae-tapeea51a4b-f3",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.incoming.bytes.rate",
+ "description": "Average rate per sec of incoming bytes on a VM network interface"
+ },
+ {
+ "value": 22.145300578664518,
+ "unit": "B/s",
+ "slice": "mysite_ceilometer",
+ "name": "none",
+ "service": "service_ceilometer",
+ "resource_id": "instance-0000001b-c7f44959-490b-4d24-8043-66a096c7cae0-tapcadfbd73-5b",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 0.008951048951048951,
+ "unit": "B/s",
+ "slice": "mysite_ceilometer",
+ "name": "none",
+ "service": "service_ceilometer",
+ "resource_id": "instance-0000001b-c7f44959-490b-4d24-8043-66a096c7cae0-tap972eb016-96",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 0.008951048951048951,
+ "unit": "B/s",
+ "slice": "mysite_ceilometer",
+ "name": "none",
+ "service": "service_ceilometer",
+ "resource_id": "instance-0000001b-c7f44959-490b-4d24-8043-66a096c7cae0-tapf56382ad-45",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 1.3187296037296037,
+ "unit": "B/s",
+ "slice": "mysite_vcpe",
+ "name": "none",
+ "service": "service_vcpe",
+ "resource_id": "instance-0000001a-afac5cb6-72c7-4c25-b281-7a442835b395-tap79d13f74-62",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 0.008951048951048951,
+ "unit": "B/s",
+ "slice": "mysite_vcpe",
+ "name": "none",
+ "service": "service_vcpe",
+ "resource_id": "instance-0000001a-afac5cb6-72c7-4c25-b281-7a442835b395-tap25ae020a-23",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 0.008951048951048951,
+ "unit": "B/s",
+ "slice": "mysite_vcpe",
+ "name": "none",
+ "service": "service_vcpe",
+ "resource_id": "instance-0000001a-afac5cb6-72c7-4c25-b281-7a442835b395-tap8382609c-7c",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 0.008951048951048951,
+ "unit": "B/s",
+ "slice": "mysite_vcpe",
+ "name": "none",
+ "service": "service_vcpe",
+ "resource_id": "instance-0000001a-afac5cb6-72c7-4c25-b281-7a442835b395-tap7bbe02e0-09",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 3.087960372960373,
+ "unit": "B/s",
+ "slice": "mysite_vbng",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-0000001c-9ec8c981-feb8-46c1-a1f6-3438702ee170-tap308ba38c-64",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 0.008951048951048951,
+ "unit": "B/s",
+ "slice": "mysite_vbng",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-0000001c-9ec8c981-feb8-46c1-a1f6-3438702ee170-tap2aadc958-57",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 0.008951048951048951,
+ "unit": "B/s",
+ "slice": "mysite_vbng",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-0000001c-9ec8c981-feb8-46c1-a1f6-3438702ee170-tap0b518c8d-01",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 0.008951048951048951,
+ "unit": "B/s",
+ "slice": "mysite_vbng",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-0000001c-9ec8c981-feb8-46c1-a1f6-3438702ee170-tapaf0c7436-e8",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 0.008951048951048951,
+ "unit": "B/s",
+ "slice": "mysite_onos_volt",
+ "name": "none",
+ "service": "service_ONOS_vOLT",
+ "resource_id": "instance-00000017-274134cc-700a-4392-8226-447a2f35cc1e-tap4b98f4d2-7e",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 0.68399416060279,
+ "unit": "B/s",
+ "slice": "mysite_onos_volt",
+ "name": "none",
+ "service": "service_ONOS_vOLT",
+ "resource_id": "instance-00000017-274134cc-700a-4392-8226-447a2f35cc1e-tap35a9b09a-29",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 0.008951048951048951,
+ "unit": "B/s",
+ "slice": "mysite_onos_vbng",
+ "name": "none",
+ "service": "service_ONOS_vBNG",
+ "resource_id": "instance-00000019-e66d524e-9ce1-4ec2-81bb-c95043fb8e4f-tap6717e37b-5a",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 0.5502331002331002,
+ "unit": "B/s",
+ "slice": "mysite_onos_vbng",
+ "name": "none",
+ "service": "service_ONOS_vBNG",
+ "resource_id": "instance-00000019-e66d524e-9ce1-4ec2-81bb-c95043fb8e4f-tap35b38817-7f",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 0.008951048951048951,
+ "unit": "B/s",
+ "slice": "mysite_clients",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-00000018-a8214ed9-e222-484b-93c2-9245e4712a99-tapaf9418d8-68",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 0.008951048951048951,
+ "unit": "B/s",
+ "slice": "mysite_clients",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-00000018-a8214ed9-e222-484b-93c2-9245e4712a99-tap56d0c6f9-27",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 1.2715034965034964,
+ "unit": "B/s",
+ "slice": "mysite_clients",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-00000018-a8214ed9-e222-484b-93c2-9245e4712a99-tap31f27f17-47",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 0.441946386946387,
+ "unit": "B/s",
+ "slice": "mysite_volt",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-0000001d-7d483484-a660-4307-b081-af1e4dd07eae-tap4894ed8a-51",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 0.008951048951048951,
+ "unit": "B/s",
+ "slice": "mysite_volt",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-0000001d-7d483484-a660-4307-b081-af1e4dd07eae-tap31c8ec21-34",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 0.008951048951048951,
+ "unit": "B/s",
+ "slice": "mysite_volt",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-0000001d-7d483484-a660-4307-b081-af1e4dd07eae-tap2605ab77-0a",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ },
+ {
+ "value": 0.008951048951048951,
+ "unit": "B/s",
+ "slice": "mysite_volt",
+ "name": "none",
+ "service": "Other",
+ "resource_id": "instance-0000001d-7d483484-a660-4307-b081-af1e4dd07eae-tapeea51a4b-f3",
+ "time": "2015-12-10T00:44:10",
+ "type": "Nova",
+ "meter": "network.outgoing.bytes.rate",
+ "description": "Average rate per sec of outgoing bytes on a VM network interface"
+ }
+]
\ No newline at end of file
diff --git a/gui/ngXosViews/ceilometerDashboard/src/templates/accordion-group.html b/gui/ngXosViews/ceilometerDashboard/src/templates/accordion-group.html
new file mode 100644
index 0000000..069141d
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/src/templates/accordion-group.html
@@ -0,0 +1,10 @@
+<div class="panel {{panelClass || 'panel-default'}}">
+ <div class="panel-heading" ng-keypress="toggleOpen($event)">
+ <h3>
+ <a href tabindex="0" class="accordion-toggle" ng-click="toggleOpen()" uib-accordion-transclude="heading"><span ng-class="{'text-muted': isDisabled}">{{heading}}</span></a>
+ </h3>
+ </div>
+ <div class="panel-collapse collapse" uib-collapse="!isOpen">
+ <div class="panel-body" ng-transclude></div>
+ </div>
+</div>
diff --git a/gui/ngXosViews/ceilometerDashboard/src/templates/accordion.html b/gui/ngXosViews/ceilometerDashboard/src/templates/accordion.html
new file mode 100644
index 0000000..ba428f3
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/src/templates/accordion.html
@@ -0,0 +1 @@
+<div class="panel-group" ng-transclude></div>
\ No newline at end of file
diff --git a/gui/ngXosViews/ceilometerDashboard/src/templates/ceilometer-dashboard.tpl.html b/gui/ngXosViews/ceilometerDashboard/src/templates/ceilometer-dashboard.tpl.html
new file mode 100644
index 0000000..f04a974
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/src/templates/ceilometer-dashboard.tpl.html
@@ -0,0 +1,114 @@
+<div class="row">
+ <div class="col-sm-10">
+ <h1>XOS Monitoring Statistics</h1>
+ </div>
+ <div class="col-xs-2 text-right">
+ <a href="" class="btn btn-default"
+ ng-show="vm.selectedResources && !vm.showStats"
+ ng-click="vm.showStats = true">
+ <i class="glyphicon glyphicon-transfer"></i>
+ </a>
+ <a href="" class="btn btn-default"
+ ng-show="vm.selectedResources && vm.showStats"
+ ng-click="vm.showStats = false">
+ <i class="glyphicon glyphicon-transfer"></i>
+ </a>
+ </div>
+</div>
+
+<div class="row" ng-show="vm.loader">
+ <div class="col-xs-12">
+ <div class="loader">Loading</div>
+ </div>
+</div>
+
+<section ng-hide="vm.loader" ng-class="{animate: !vm.loader}">
+ <div class="row">
+ <div class="col-sm-3 service-list">
+ <h3>XOS Service: </h3>
+ <uib-accordion close-others="true" template-url="templates/accordion.html">
+ <uib-accordion-group
+ ng-repeat="(service, slices) in vm.projects | orderObjectByKey"
+ template-url="templates/accordion-group.html"
+ is-open="vm.accordion.open[service]"
+ heading="{{service}}">
+ <h4>Slices:</h4>
+ <a ng-repeat="(slice, resources) in slices"
+ ng-class="{active: slice === vm.selectedSlice}"
+ ng-click="vm.selectResources(resources, slice, service)"
+ href="#" class="list-group-item" >
+ {{slice}} <i class="glyphicon glyphicon-chevron-right pull-right"></i>
+ </a>
+ </uib-accordion-group>
+ </uib-accordion>
+ </div>
+ <section class="side-container col-sm-9">
+ <div class="row">
+ <article ng-hide="!vm.showStats" class="stats animate-slide-left">
+ <div class="col-xs-12">
+ <div class="list-group">
+ <div class="list-group-item">
+ <h3>Stats</h3>
+ </div>
+ <div class="list-group-item">
+ <ceilometer-stats ng-if="vm.selectedSlice" name="vm.selectedSlice"></ceilometer-stats>
+ </div>
+ </div>
+ </div>
+ </article>
+ <article ng-hide="vm.showStats" class="meters animate-slide-left">
+ <div class="col-sm-4 animate-slide-left" ng-hide="!vm.selectedResources">
+ <div class="list-group">
+ <div class="list-group-item">
+ <h3>Resources</h3>
+ </div>
+ <a href="#"
+ ng-click="vm.selectMeters(meters, resource)"
+ class="list-group-item"
+ ng-repeat="(resource, meters) in vm.selectedResources"
+ ng-class="{active: resource === vm.selectedResource}">
+ {{resource}} <i class="glyphicon glyphicon-chevron-right pull-right"></i>
+ </a>
+ </div>
+ </div>
+ <div class="col-sm-8 animate-slide-left" ng-hide="!vm.selectedMeters">
+ <div class="list-group">
+ <div class="list-group-item">
+ <h3>Meters</h3>
+ </div>
+ <div class="list-group-item">
+ <div class="row">
+ <div class="col-xs-6">
+ <label>Name:</label>
+ </div>
+ <div class="col-xs-3">
+ <label>Unit:</label>
+ </div>
+ <div class="col-xs-3"></div>
+ </div>
+ <div class="row" ng-repeat="meter in vm.selectedMeters" style="margin-bottom: 10px;">
+ <div class="col-xs-6">
+ {{meter.name}}
+ </div>
+ <div class="col-xs-3">
+ {{meter.unit}}
+ </div>
+ <div class="col-xs-3">
+ <a ui-sref="samples({name: meter.name, tenant: meter.project_id})" class="btn btn-primary">
+ <i class="glyphicon glyphicon-search"></i>
+ </a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </article>
+ </div>
+ </section>
+ </div>
+</section>
+<section ng-if="!vm.loader && vm.error">
+ <div class="alert alert-danger">
+ {{vm.error}}
+ </div>
+</section>
diff --git a/gui/ngXosViews/ceilometerDashboard/src/templates/ceilometer-samples.tpl.html b/gui/ngXosViews/ceilometerDashboard/src/templates/ceilometer-samples.tpl.html
new file mode 100644
index 0000000..b279123
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/src/templates/ceilometer-samples.tpl.html
@@ -0,0 +1,54 @@
+<!-- <pre>{{ vm | json}}</pre> -->
+
+<div class="row">
+ <div class="col-xs-10">
+ <h1>{{vm.name | uppercase}}</h1>
+ </div>
+ <div class="col-xs-2">
+ <a ui-sref="ceilometerDashboard" class="btn btn-primary pull-right">
+ <i class="glyphicon glyphicon-arrow-left"></i> Back to list
+ </a>
+ </div>
+</div>
+<div class="row" ng-show="vm.loader">
+ <div class="col-xs-12">
+ <div class="loader">Loading</div>
+ </div>
+</div>
+<section ng-if="!vm.loader && !vm.error">
+ <div class="row">
+ <form class="form-inline col-xs-8" ng-submit="vm.addMeterToChart(vm.addMeterValue)">
+ <select ng-model="vm.addMeterValue" class="form-control" ng-options="resource.id as resource.name for resource in vm.sampleLabels"></select>
+ <button class="btn btn-success">
+ <i class="glyphicon glyphicon-plus"></i> Add
+ </button>
+ </form>
+ <div class="col-xs-4 text-right">
+ <a ng-click="vm.chartType = 'line'" class="btn" ng-class="{'btn-default': vm.chartType != 'bar', 'btn-primary': vm.chartType == 'line'}">Lines</a>
+ <a ng-click="vm.chartType = 'bar'" class="btn" ng-class="{'btn-default': vm.chartType != 'line', 'btn-primary': vm.chartType == 'bar'}">Bars</a>
+ </div>
+ </div>
+ <div class="row" ng-if="!vm.loader">
+ <div class="col-xs-12">
+ <canvas ng-if="vm.chartType === 'line'" id="line" class="chart chart-line" chart-data="vm.chart.data" chart-options="{datasetFill: false}"
+ chart-labels="vm.chart.labels" chart-legend="false" chart-series="vm.chart.series">
+ </canvas>
+ <canvas ng-if="vm.chartType === 'bar'" id="bar" class="chart chart-bar" chart-data="vm.chart.data"
+ chart-labels="vm.chart.labels" chart-legend="false" chart-series="vm.chart.series">
+ </canvas>
+ <!-- <pre>{{vm.chartMeters | json}}</pre> -->
+ </div>
+ </div>
+ <div class="row" ng-if="!vm.loader">
+ <div class="col-xs-12">
+ <a ng-click="vm.removeFromChart(meter)" class="btn btn-chart" ng-style="{'background-color': vm.chartColors[$index]}" ng-repeat="meter in vm.chartMeters">
+ {{meter.resource_name || meter.resource_id}}
+ </a>
+ </div>
+ </div>
+</section>
+<section ng-if="!vm.loader && vm.error">
+ <div class="alert alert-danger">
+ {{vm.error}}
+ </div>
+</section>
\ No newline at end of file
diff --git a/gui/ngXosViews/ceilometerDashboard/src/templates/ceilometer-stats.tpl.html b/gui/ngXosViews/ceilometerDashboard/src/templates/ceilometer-stats.tpl.html
new file mode 100644
index 0000000..531f0cf
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/src/templates/ceilometer-stats.tpl.html
@@ -0,0 +1,58 @@
+<div ng-show="vm.loader" class="loader">Loading</div>
+
+<section ng-if="!vm.loader && !vm.error">
+
+ <div class="alert alert-danger" ng-if="vm.stats.length == 0">
+ No result
+ </div>
+
+ <table class="table" ng-if="vm.stats.length > 0">
+ <tr>
+ <th>
+ <a ng-click="order = 'category'">Type:</a>
+ </th>
+ <th>
+ <a ng-click="order = 'resource_name'">Resource:</a>
+ </th>
+ <th>
+ <a ng-click="order = 'meter'">Meter:</a>
+ </th>
+ <th>
+ Unit:
+ </th>
+ <th>
+ Value:
+ </th>
+ </tr>
+ <!-- <tr>
+ <td>
+ <input type="text" ng-model="query.category">
+ </td>
+ <td>
+ <input type="text" ng-model="query.resource_name">
+ </td>
+ <td>
+ <input type="text" ng-model="query.meter">
+ </td>
+ <td>
+ <input type="text" ng-model="query.unit">
+ </td>
+ <td>
+ <input type="text" ng-model="query.value">
+ </td>
+ </tr> -->
+ <tr ng-repeat="item in vm.stats | orderBy:order">
+ <td>{{item.category}}</td>
+ <td>{{item.resource_name}}</td>
+ <td>{{item.meter}}</td>
+ <td>{{item.unit}}</td>
+ <td>{{item.value}}</td>
+ </tr>
+ </table>
+</section>
+
+<section ng-if="!vm.loader && vm.error">
+ <div class="alert alert-danger">
+ {{vm.error}}
+ </div>
+</section>
diff --git a/gui/ngXosViews/ceilometerDashboard/teone@clnode015.clemson.cloudlab.us b/gui/ngXosViews/ceilometerDashboard/teone@clnode015.clemson.cloudlab.us
new file mode 100644
index 0000000..8e990a2
--- /dev/null
+++ b/gui/ngXosViews/ceilometerDashboard/teone@clnode015.clemson.cloudlab.us
@@ -0,0 +1,20 @@
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
+<meta name="viewport" content="width=device-width, initial-scale=1, max-scale=1">
+<!-- browserSync -->
+
+<!-- inject:css -->
+<link rel="stylesheet" href="/css/ceilometerDashboard.css">
+<link rel="stylesheet" href="/css/dev.css">
+<!-- endinject -->
+<link rel="stylesheet" href="css/ceilometerDashboard.css">
+<div id="xosCeilometerDashboard">
+ <div ui-view ng-class="stateName"></div>
+</div>
+
+
+<script src="vendor/ui.bootstrap/src/collapse/collapse.js"></script>
+<script src="vendor/ui.bootstrap/src/accordion/accordion.js"></script>
+<!-- inject:js -->
+<script src="/../../static/js/vendor/xosCeilometerDashboardVendor.js"></script>
+<script src="/../../static/js/xosCeilometerDashboard.js"></script>
+<!-- endinject -->
diff --git a/gui/ngXosViews/contentProvider/.bowerrc b/gui/ngXosViews/contentProvider/.bowerrc
new file mode 100644
index 0000000..e491038
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/.bowerrc
@@ -0,0 +1,3 @@
+{
+ "directory": "src/vendor/"
+}
\ No newline at end of file
diff --git a/gui/ngXosViews/contentProvider/.eslintrc b/gui/ngXosViews/contentProvider/.eslintrc
new file mode 100644
index 0000000..c852748
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/.eslintrc
@@ -0,0 +1,42 @@
+{
+ "ecmaFeatures": {
+ "blockBindings": true,
+ "forOf": true,
+ "destructuring": true,
+ "arrowFunctions": true,
+ "templateStrings": true
+ },
+ "env": {
+ "browser": true,
+ "node": true,
+ "es6": true
+ },
+ "plugins": [
+ //"angular"
+ ],
+ "rules": {
+ "quotes": [2, "single"],
+ "camelcase": [1, {"properties": "always"}],
+ "no-underscore-dangle": 1,
+ "eqeqeq": [2, "smart"],
+ "no-alert": 1,
+ "key-spacing": [1, { "beforeColon": false, "afterColon": true }],
+ "indent": [2, 2],
+ "no-irregular-whitespace": 1,
+ "eol-last": 0,
+ "max-nested-callbacks": [2, 4],
+ "comma-spacing": [1, {"before": false, "after": true}],
+ "no-trailing-spaces": [1, { skipBlankLines: true }],
+ "no-unused-vars": [1, {"vars": "all", "args": "after-used"}],
+ "new-cap": 0,
+
+ //"angular/ng_module_name": [2, '/^xos\.*[a-z]*$/'],
+ //"angular/ng_controller_name": [2, '/^[a-z].*Ctrl$/'],
+ //"angular/ng_service_name": [2, '/^[A-Z].*Service$/'],
+ //"angular/ng_directive_name": [2, '/^[a-z]+[[A-Z].*]*$/'],
+ //"angular/ng_di": [0, "function or array"]
+ },
+ "globals" :{
+ "angular": true
+ }
+}
\ No newline at end of file
diff --git a/gui/ngXosViews/contentProvider/.gitignore b/gui/ngXosViews/contentProvider/.gitignore
new file mode 100644
index 0000000..567aee4
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/.gitignore
@@ -0,0 +1,6 @@
+dist/
+src/vendor
+.tmp
+node_modules
+npm-debug.log
+dist/
\ No newline at end of file
diff --git a/gui/ngXosViews/contentProvider/bower.json b/gui/ngXosViews/contentProvider/bower.json
new file mode 100644
index 0000000..9c85e88
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/bower.json
@@ -0,0 +1,29 @@
+{
+ "name": "xos-contentProvider",
+ "version": "0.0.0",
+ "authors": [
+ "Matteo Scandolo <matteo.scandolo@link-me.it>"
+ ],
+ "description": "The contentProvider view",
+ "license": "MIT",
+ "ignore": [
+ "**/.*",
+ "node_modules",
+ "bower_components",
+ "static/js/vendor/",
+ "test",
+ "tests"
+ ],
+ "dependencies": {
+ },
+ "devDependencies": {
+ "jquery": "~2.1.4",
+ "angular-mocks": "~1.4.7",
+ "angular": "~1.4.7",
+ "angular-ui-router": "~0.2.15",
+ "angular-cookies": "~1.4.7",
+ "angular-resource": "~1.4.7",
+ "ng-lodash": "~0.3.0",
+ "bootstrap-css": "2.3.2"
+ }
+}
diff --git a/gui/ngXosViews/contentProvider/gulp/build.js b/gui/ngXosViews/contentProvider/gulp/build.js
new file mode 100644
index 0000000..9af8074
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/gulp/build.js
@@ -0,0 +1,118 @@
+'use strict';
+
+// BUILD
+//
+// The only purpose of this gulpfile is to build a XOS view and copy the correct files into
+// .html => dashboards
+// .js (minified and concat) => static/js
+//
+// The template are parsed and added to js with angular $templateCache
+
+var gulp = require('gulp');
+var ngAnnotate = require('gulp-ng-annotate');
+var uglify = require('gulp-uglify');
+var templateCache = require('gulp-angular-templatecache');
+var runSequence = require('run-sequence');
+var concat = require('gulp-concat');
+var del = require('del');
+var wiredep = require('wiredep');
+var angularFilesort = require('gulp-angular-filesort');
+var _ = require('lodash');
+var eslint = require('gulp-eslint');
+var inject = require('gulp-inject');
+var rename = require('gulp-rename');
+var replace = require('gulp-replace');
+
+var TEMPLATE_FOOTER = `}]);
+angular.module('xos.contentProvider').run(function($location){$location.path('/')});
+angular.bootstrap(angular.element('#xosContentProvider'), ['xos.contentProvider']);`;
+
+module.exports = function(options){
+
+ // delete previous builded file
+ gulp.task('clean', function(){
+ return del(
+ [options.dashboards + 'xosContentProvider.html'],
+ {force: true}
+ );
+ });
+
+ // compile and minify scripts
+ gulp.task('scripts', function() {
+ return gulp.src([
+ options.tmp + '**/*.js'
+ ])
+ .pipe(ngAnnotate())
+ .pipe(angularFilesort())
+ .pipe(concat('xosContentProvider.js'))
+ .pipe(uglify())
+ .pipe(gulp.dest(options.static + 'js/'));
+ });
+
+ // set templates in cache
+ gulp.task('templates', function(){
+ return gulp.src('./src/templates/*.html')
+ .pipe(templateCache({
+ module: 'xos.contentProvider',
+ root: 'templates/',
+ templateFooter: TEMPLATE_FOOTER
+ }))
+ .pipe(gulp.dest(options.tmp));
+ });
+
+ // copy html index to Django Folder
+ gulp.task('copyHtml', ['clean'], function(){
+ return gulp.src(options.src + 'index.html')
+ // remove dev dependencies from html
+ .pipe(replace(/<!-- bower:css -->(\n.*)*\n<!-- endbower --><!-- endcss -->/, ''))
+ .pipe(replace(/<!-- bower:js -->(\n.*)*\n<!-- endbower --><!-- endjs -->/, ''))
+ .pipe(replace(/ng-app=".*"\s/, ''))
+ // injecting minified files
+ .pipe(
+ inject(
+ gulp.src([
+ options.static + 'js/vendor/xosContentProviderVendor.js',
+ options.static + 'js/xosContentProvider.js'
+ ])
+ )
+ )
+ .pipe(rename('xosContentProvider.html'))
+ .pipe(gulp.dest(options.dashboards));
+ });
+
+ // minify vendor js files
+ gulp.task('wiredep', function(){
+ var bowerDeps = wiredep().js;
+ if(!bowerDeps){
+ return;
+ }
+
+ // remove angular (it's already loaded)
+ _.remove(bowerDeps, function(dep){
+ return dep.indexOf('angular/angular.js') !== -1;
+ });
+
+ return gulp.src(bowerDeps)
+ .pipe(concat('xosContentProviderVendor.js'))
+ .pipe(uglify())
+ .pipe(gulp.dest(options.static + 'js/vendor/'));
+ });
+
+ gulp.task('lint', function () {
+ return gulp.src(['src/js/**/*.js'])
+ .pipe(eslint())
+ .pipe(eslint.format())
+ .pipe(eslint.failAfterError());
+ });
+
+ gulp.task('build', function() {
+ runSequence(
+ 'templates',
+ 'babel',
+ 'scripts',
+ 'wiredep',
+ 'copyHtml',
+ 'cleanTmp'
+ );
+ });
+};
\ No newline at end of file
diff --git a/gui/ngXosViews/contentProvider/gulp/server.js b/gui/ngXosViews/contentProvider/gulp/server.js
new file mode 100644
index 0000000..8eab1bf
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/gulp/server.js
@@ -0,0 +1,133 @@
+'use strict';
+
+var gulp = require('gulp');
+var browserSync = require('browser-sync').create();
+var inject = require('gulp-inject');
+var runSequence = require('run-sequence');
+var angularFilesort = require('gulp-angular-filesort');
+var babel = require('gulp-babel');
+var wiredep = require('wiredep').stream;
+var httpProxy = require('http-proxy');
+var del = require('del');
+
+var proxy = httpProxy.createProxyServer({
+ target: 'http://0.0.0.0:9999'
+});
+
+
+proxy.on('error', function(error, req, res) {
+ res.writeHead(500, {
+ 'Content-Type': 'text/plain'
+ });
+
+ console.error('[Proxy]', error);
+});
+
+module.exports = function(options){
+
+ // open in browser with sync and proxy to 0.0.0.0
+ gulp.task('browser', function() {
+ browserSync.init({
+ // reloadDelay: 500,
+ // logLevel: 'debug',
+ // logConnections: true,
+ startPath: '#/',
+ snippetOptions: {
+ rule: {
+ match: /<!-- browserSync -->/i
+ }
+ },
+ server: {
+ baseDir: options.src,
+ routes: {
+ '/api': options.api,
+ '/xosHelpers/src': options.helpers
+ },
+ middleware: function(req, res, next){
+ if(
+ req.url.indexOf('/xos/') !== -1 ||
+ req.url.indexOf('/xoslib/') !== -1 ||
+ req.url.indexOf('/hpcapi/') !== -1
+ ){
+ proxy.web(req, res);
+ }
+ else{
+ next();
+ }
+ }
+ }
+ });
+
+ gulp.watch(options.src + 'js/**/*.js', ['js-watch']);
+ gulp.watch(options.src + 'vendor/**/*.js', ['bower'], function(){
+ browserSync.reload();
+ });
+ gulp.watch(options.src + '**/*.html', function(){
+ browserSync.reload();
+ });
+ });
+
+ // transpile js with sourceMaps
+ gulp.task('babel', function(){
+ return gulp.src(options.scripts + '**/*.js')
+ .pipe(babel({sourceMaps: true}))
+ .pipe(gulp.dest(options.tmp));
+ });
+
+ // inject scripts
+ gulp.task('injectScript', ['cleanTmp', 'babel'], function(){
+ return gulp.src(options.src + 'index.html')
+ .pipe(
+ inject(
+ gulp.src([
+ options.tmp + '**/*.js',
+ options.api + '*.js',
+ options.helpers + '**/*.js'
+ ])
+ .pipe(angularFilesort()),
+ {
+ ignorePath: [options.src, '/../../ngXosLib']
+ }
+ )
+ )
+ .pipe(gulp.dest(options.src));
+ });
+
+ // inject CSS
+ gulp.task('injectCss', function(){
+ return gulp.src(options.src + 'index.html')
+ .pipe(
+ inject(
+ gulp.src(options.src + 'css/*.css'),
+ {
+ ignorePath: [options.src]
+ }
+ )
+ )
+ .pipe(gulp.dest(options.src));
+ });
+
+ // inject bower dependencies with wiredep
+ gulp.task('bower', function () {
+ return gulp.src(options.src + 'index.html')
+ .pipe(wiredep({devDependencies: true}))
+ .pipe(gulp.dest(options.src));
+ });
+
+ gulp.task('js-watch', ['injectScript'], function(){
+ browserSync.reload();
+ });
+
+ gulp.task('cleanTmp', function(){
+ return del([options.tmp + '**/*']);
+ });
+
+ gulp.task('serve', function() {
+ runSequence(
+ 'bower',
+ 'injectScript',
+ 'injectCss',
+ ['browser']
+ );
+ });
+};
\ No newline at end of file
diff --git a/gui/ngXosViews/contentProvider/gulpfile.js b/gui/ngXosViews/contentProvider/gulpfile.js
new file mode 100644
index 0000000..b2cdab8
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/gulpfile.js
@@ -0,0 +1,24 @@
+'use strict';
+
+var gulp = require('gulp');
+var wrench = require('wrench');
+
+var options = {
+ src: 'src/',
+ scripts: 'src/js/',
+ tmp: 'src/.tmp',
+ dist: 'dist/',
+ api: '../../ngXosLib/api/',
+ helpers: '../../ngXosLib/xosHelpers/src/',
+ static: '../../../xos/core/xoslib/static/', // this is the django static folder
+ dashboards: '../../../xos/core/xoslib/dashboards/' // this is the django html folder
+};
+
+wrench.readdirSyncRecursive('./gulp')
+.map(function(file) {
+ require('./gulp/' + file)(options);
+});
+
+gulp.task('default', function () {
+ gulp.start('build');
+});
diff --git a/gui/ngXosViews/contentProvider/karma.conf.js b/gui/ngXosViews/contentProvider/karma.conf.js
new file mode 100644
index 0000000..83d3f63
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/karma.conf.js
@@ -0,0 +1,88 @@
+// Karma configuration
+// Generated on Tue Oct 06 2015 09:27:10 GMT+0000 (UTC)
+
+/* eslint indent: [2,2], quotes: [2, "single"]*/
+
+/*eslint-disable*/
+var wiredep = require('wiredep');
+var path = require('path');
+
+var bowerComponents = wiredep( {devDependencies: true} )[ 'js' ].map(function( file ){
+ return path.relative(process.cwd(), file);
+});
+
+module.exports = function(config) {
+/*eslint-enable*/
+ config.set({
+
+ // base path that will be used to resolve all patterns (eg. files, exclude)
+ basePath: '',
+
+
+ // frameworks to use
+ // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+ frameworks: ['jasmine'],
+
+
+ // list of files / patterns to load in the browser
+ files: bowerComponents.concat([
+ '../../static/js/xosApi.js',
+ '../../static/js/vendor/ngXosHelpers.js',
+ 'src/js/**/*.js',
+ 'spec/**/*.mock.js',
+ 'spec/**/*.test.js',
+ 'src/**/*.html'
+ ]),
+
+
+ // list of files to exclude
+ exclude: [
+ ],
+
+
+ // preprocess matching files before serving them to the browser
+ // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
+ preprocessors: {
+ 'src/js/**/*.js': ['babel'],
+ 'spec/**/*.test.js': ['babel'],
+ 'src/**/*.html': ['ng-html2js']
+ },
+
+ ngHtml2JsPreprocessor: {
+ stripPrefix: 'src/', //strip the src path from template url (http://stackoverflow.com/questions/22869668/karma-unexpected-request-when-testing-angular-directive-even-with-ng-html2js)
+ moduleName: 'templates' // define the template module name
+ },
+
+ // test results reporter to use
+ // possible values: 'dots', 'progress'
+ // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+ reporters: ['mocha'],
+
+
+ // web server port
+ port: 9876,
+
+
+ // enable / disable colors in the output (reporters and logs)
+ colors: true,
+
+
+ // level of logging
+ // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+ logLevel: config.LOG_INFO,
+
+
+ // enable / disable watching file and executing tests whenever any file changes
+ autoWatch: true,
+
+
+ // start these browsers
+ // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
+ browsers: ['PhantomJS'],
+
+
+ // Continuous Integration mode
+ // if true, Karma captures browsers, runs the tests and exits
+ singleRun: false
+ });
+};
diff --git a/gui/ngXosViews/contentProvider/package.json b/gui/ngXosViews/contentProvider/package.json
new file mode 100644
index 0000000..80d34f9
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/package.json
@@ -0,0 +1,45 @@
+{
+ "name": "xos-contentProvider",
+ "version": "1.0.0",
+ "description": "Angular Application for XOS, created with generator-xos",
+ "scripts": {
+ "prestart": "npm install && bower install",
+ "start": "gulp serve",
+ "prebuild": "npm install && bower install",
+ "build": "gulp",
+ "test": "karma start",
+ "lint": "eslint src/js/"
+ },
+ "keywords": [
+ "XOS",
+ "Angular",
+ "XOSlib"
+ ],
+ "author": "Matteo Scandolo",
+ "license": "MIT",
+ "dependencies": {},
+ "devDependencies": {
+ "browser-sync": "^2.9.11",
+ "del": "^2.0.2",
+ "gulp": "^3.9.0",
+ "gulp-angular-filesort": "^1.1.1",
+ "gulp-angular-templatecache": "^1.8.0",
+ "gulp-babel": "^5.3.0",
+ "gulp-concat": "^2.6.0",
+ "gulp-inject": "^3.0.0",
+ "gulp-minify-html": "^1.0.4",
+ "gulp-rename": "^1.2.2",
+ "gulp-replace": "^0.5.4",
+ "gulp-uglify": "^1.4.2",
+ "http-proxy": "^1.12.0",
+ "proxy-middleware": "^0.15.0",
+ "run-sequence": "^1.1.4",
+ "wiredep": "^3.0.0-beta",
+ "wrench": "^1.5.8",
+ "gulp-ng-annotate": "^1.1.0",
+ "lodash": "^3.10.1",
+ "eslint": "^1.8.0",
+ "eslint-plugin-angular": "linkmesrl/eslint-plugin-angular",
+ "gulp-eslint": "^1.0.0"
+ }
+}
diff --git a/gui/ngXosViews/contentProvider/spec/contentprovider.test.js b/gui/ngXosViews/contentProvider/spec/contentprovider.test.js
new file mode 100644
index 0000000..b19ce0c
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/spec/contentprovider.test.js
@@ -0,0 +1,247 @@
+'use strict';
+
+describe('The Content Provider SPA', () => {
+
+ var scope, element, isolatedScope, httpBackend, mockLocation, httpProvider;
+
+ var token = 'fakeToken';
+
+ // injecting main module
+ beforeEach(module('xos.contentProvider'));
+
+ beforeEach(module('templates'));
+
+ beforeEach(function(){
+ module(function($provide, $httpProvider){
+
+ httpProvider = $httpProvider;
+
+ // mocking stateParams to pass 1 as id
+ $provide.provider('$stateParams', function(){
+ /* eslint-disable no-invalid-this*/
+ this.$get = function(){
+ return {id: 1};
+ };
+ /* eslint-enable no-invalid-this*/
+ });
+
+ //mock $cookie to return a fake xoscsrftoken
+ $provide.service('$cookies', function(){
+ /* eslint-disable no-invalid-this*/
+ this.get = () => {
+ return token;
+ };
+ /* eslint-enable no-invalid-this*/
+ });
+ });
+ });
+
+ beforeEach(inject(function(_$location_, $httpBackend){
+ spyOn(_$location_, 'url');
+ mockLocation = _$location_;
+ httpBackend = $httpBackend;
+ // Setting up mock request
+ $httpBackend.whenGET('/hpcapi/contentproviders/?no_hyperlinks=1').respond(CPmock.CPlist);
+ $httpBackend.whenGET('/hpcapi/serviceproviders/?no_hyperlinks=1').respond(CPmock.SPlist);
+ $httpBackend.whenDELETE('/hpcapi/contentproviders/1/?no_hyperlinks=1').respond();
+ }));
+
+ it('should set the $http interceptor', () => {
+ expect(httpProvider.interceptors).toContain('SetCSRFToken');
+ });
+
+ it('should add no_hyperlink param', inject(($http, $httpBackend) => {
+ $http.get('www.example.com');
+ $httpBackend.expectGET('www.example.com?no_hyperlinks=1').respond(200);
+ $httpBackend.flush();
+ }));
+
+ it('should set token in the headers', inject(($http, $httpBackend) => {
+ $http.post('http://example.com');
+ $httpBackend.expectPOST('http://example.com?no_hyperlinks=1', undefined, function(headers){
+ // if this condition is false the httpBackend expectation fail
+ return headers['X-CSRFToken'] === token;
+ }).respond(200, {name: 'example'});
+ httpBackend.flush();
+ }));
+
+ describe('the action directive', () => {
+ beforeEach(inject(function($compile, $rootScope){
+ scope = $rootScope.$new();
+
+ element = angular.element('<cp-actions id="\'1\'"></cp-actions>');
+ $compile(element)(scope);
+ scope.$digest();
+ isolatedScope = element.isolateScope().vm;
+ }));
+
+ it('should delete an element and redirect to list', () => {
+ isolatedScope.deleteCp(1);
+ httpBackend.flush();
+ expect(mockLocation.url).toHaveBeenCalled();
+ });
+ });
+
+ describe('the contentProvider list', () => {
+ beforeEach(inject(function($compile, $rootScope){
+ scope = $rootScope.$new();
+
+ element = angular.element('<content-provider-list></content-provider-list>');
+ $compile(element)(scope);
+ scope.$digest();
+ httpBackend.flush();
+ isolatedScope = element.isolateScope().vm;
+ }));
+
+
+ it('should load 2 contentProvider', () => {
+ expect(isolatedScope.contentProviderList.length).toBe(2);
+ });
+
+ it('should delete a contentProvider', () => {
+ isolatedScope.deleteCp(1);
+ httpBackend.flush();
+ expect(isolatedScope.contentProviderList.length).toBe(1);
+ });
+ });
+
+ describe('the contentProviderDetail directive', () => {
+
+ beforeEach(inject(function($compile, $rootScope){
+ scope = $rootScope.$new();
+ element = angular.element('<content-provider-detail></content-provider-detail>');
+ $compile(element)(scope);
+ httpBackend.expectGET('/hpcapi/contentproviders/1/?no_hyperlinks=1').respond(CPmock.CPlist[0]);
+ scope.$digest();
+ httpBackend.flush();
+ isolatedScope = element.isolateScope().vm;
+ }));
+
+ describe('when an id is set in the route', () => {
+
+ beforeEach(() => {
+ // spy the instance update method
+ spyOn(isolatedScope.cp, '$update').and.callThrough();
+ });
+
+ it('should request the correct contentProvider', () => {
+ expect(isolatedScope.cp.name).toEqual(CPmock.CPlist[0].name);
+ });
+
+ it('should update a contentProvider', () => {
+ isolatedScope.cp.name = 'new name';
+ isolatedScope.saveContentProvider(isolatedScope.cp);
+ expect(isolatedScope.cp.$update).toHaveBeenCalled();
+ });
+ });
+ });
+
+ describe('the contentProviderCdn directive', () => {
+ beforeEach(inject(($compile, $rootScope) => {
+ scope = $rootScope.$new();
+ element = angular.element('<content-provider-cdn></content-provider-cdn>');
+ $compile(element)(scope);
+ httpBackend.expectGET('/hpcapi/contentproviders/1/?no_hyperlinks=1').respond(CPmock.CPlist[0]);
+ // httpBackend.expectGET('/hpcapi/cdnprefixs/?no_hyperlinks=1&contentProvider=1').respond([CPmock.CDNlist[0]]);
+ httpBackend.expectGET('/hpcapi/cdnprefixs/?no_hyperlinks=1').respond(CPmock.CDNlist);
+ httpBackend.whenPOST('/hpcapi/cdnprefixs/?no_hyperlinks=1').respond(CPmock.CDNlist[0]);
+ httpBackend.whenDELETE('/hpcapi/cdnprefixs/5/?no_hyperlinks=1').respond();
+ scope.$digest();
+ httpBackend.flush();
+ isolatedScope = element.isolateScope().vm;
+ }));
+
+ it('should load associated CDN prefix', () => {
+ expect(isolatedScope.cp_prf.length).toBe(1);
+ expect(isolatedScope.prf.length).toBe(2);
+ });
+
+ it('should add a CDN Prefix', () => {
+ isolatedScope.addPrefix({prefix: 'test.io', defaultOriginServer: '/hpcapi/originservers/2/'});
+ httpBackend.flush();
+ expect(isolatedScope.cp_prf.length).toBe(2);
+ });
+
+ it('should remove a CDN Prefix', () => {
+ isolatedScope.removePrefix(isolatedScope.cp_prf[0]);
+ httpBackend.flush();
+ expect(isolatedScope.cp_prf.length).toBe(0);
+ });
+ });
+
+ describe('the contentProviderServer directive', () => {
+ beforeEach(inject(($compile, $rootScope) => {
+ scope = $rootScope.$new();
+ element = angular.element('<content-provider-server></content-provider-server>');
+ $compile(element)(scope);
+ httpBackend.expectGET('/hpcapi/contentproviders/1/?no_hyperlinks=1').respond(CPmock.CPlist[0]);
+ httpBackend.expectGET('/hpcapi/originservers/?no_hyperlinks=1&contentProvider=1').respond(CPmock.OSlist);
+ httpBackend.whenPOST('/hpcapi/originservers/?no_hyperlinks=1').respond(CPmock.OSlist[0]);
+ httpBackend.whenDELETE('/hpcapi/originservers/8/?no_hyperlinks=1').respond();
+ scope.$digest();
+ httpBackend.flush();
+ isolatedScope = element.isolateScope().vm;
+ }));
+
+ it('should load associated OriginServer', () => {
+ expect(isolatedScope.cp_os.length).toBe(4);
+ });
+
+ it('should add a OriginServer', () => {
+ isolatedScope.addOrigin({protocol: 'http', url: 'test.io'});
+ httpBackend.flush();
+ expect(isolatedScope.cp_os.length).toBe(5);
+ });
+
+ it('should remove a OriginServer', () => {
+ isolatedScope.removeOrigin(isolatedScope.cp_os[0]);
+ httpBackend.flush();
+ expect(isolatedScope.cp_os.length).toBe(3);
+ });
+ });
+
+ describe('the contentProviderUsers directive', () => {
+ beforeEach(inject(($compile, $rootScope) => {
+ scope = $rootScope.$new();
+ element = angular.element('<content-provider-users></content-provider-users>');
+ $compile(element)(scope);
+ httpBackend.expectGET('/xos/users/?no_hyperlinks=1').respond(CPmock.UserList);
+ httpBackend.expectGET('/hpcapi/contentproviders/1/?no_hyperlinks=1').respond(CPmock.CPlist[0]);
+ httpBackend.whenPUT('/hpcapi/contentproviders/1/?no_hyperlinks=1').respond(CPmock.CPlist[0]);
+ scope.$digest();
+ httpBackend.flush();
+ isolatedScope = element.isolateScope().vm;
+ }));
+
+ it('should render one user', () => {
+ expect(isolatedScope.cp.users.length).toBe(1);
+ expect(typeof isolatedScope.cp.users[0]).toEqual('object');
+ });
+
+ it('should add a user', () => {
+ isolatedScope.addUserToCp({name: 'teo'});
+ expect(isolatedScope.cp.users.length).toBe(2);
+ });
+
+ it('should remove a user', () => {
+ isolatedScope.addUserToCp({name: 'teo'});
+ expect(isolatedScope.cp.users.length).toBe(2);
+ isolatedScope.removeUserFromCp({name: 'teo'});
+ expect(isolatedScope.cp.users.length).toBe(1);
+ });
+
+ it('should save and reformat users', () => {
+ // add a user
+ isolatedScope.cp.users.push(1);
+
+ //trigger save
+ isolatedScope.saveContentProvider(isolatedScope.cp);
+
+ httpBackend.flush();
+
+ // I'll get one as the BE is mocked, the important is to check the conversion
+ expect(isolatedScope.cp.users.length).toBe(1);
+ expect(typeof isolatedScope.cp.users[0]).toEqual('object');
+ });
+ });
+});
diff --git a/gui/ngXosViews/contentProvider/spec/mocks/contentProvider.mock.js b/gui/ngXosViews/contentProvider/spec/mocks/contentProvider.mock.js
new file mode 100644
index 0000000..46a0b0e
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/spec/mocks/contentProvider.mock.js
@@ -0,0 +1,910 @@
+/* eslint-disable key-spacing, no-unused-vars */
+
+var CPmock = {
+ CPlist: [
+ {
+ 'humanReadableName':'on_lab_content',
+ 'validators':{
+ 'updated':[
+
+ ],
+ 'policed':[
+
+ ],
+ 'name':[
+ 'notBlank'
+ ],
+ 'created':[
+
+ ],
+ 'deleted':[
+
+ ],
+ 'serviceProvider':[
+ 'notBlank'
+ ],
+ 'description':[
+
+ ],
+ 'enabled':[
+
+ ],
+ 'lazy_blocked':[
+
+ ],
+ 'backend_register':[
+ 'notBlank'
+ ],
+ 'write_protect':[
+
+ ],
+ 'content_provider_id':[
+
+ ],
+ 'backend_status':[
+ 'notBlank'
+ ],
+ 'id':[
+
+ ],
+ 'no_sync':[
+
+ ],
+ 'enacted':[
+
+ ]
+ },
+ 'id':1,
+ 'created':'2015-10-22T19:33:55.078Z',
+ 'updated':'2015-10-22T19:33:55.078Z',
+ 'enacted':null,
+ 'policed':null,
+ 'backend_register':'{}',
+ 'backend_status':'0 - Provisioning in progress',
+ 'deleted':false,
+ 'write_protect':false,
+ 'lazy_blocked':false,
+ 'no_sync':false,
+ 'content_provider_id':null,
+ 'name':'on_lab_content',
+ 'enabled':true,
+ 'description':null,
+ users: [2],
+ 'serviceProvider':'http://0.0.0.0:9000/hpcapi/serviceproviders/1/'
+ },
+ {
+ 'humanReadableName':'test',
+ 'validators':{
+ 'updated':[
+
+ ],
+ 'policed':[
+
+ ],
+ 'name':[
+ 'notBlank'
+ ],
+ 'created':[
+
+ ],
+ 'deleted':[
+
+ ],
+ 'serviceProvider':[
+ 'notBlank'
+ ],
+ 'description':[
+
+ ],
+ 'enabled':[
+
+ ],
+ 'lazy_blocked':[
+
+ ],
+ 'backend_register':[
+ 'notBlank'
+ ],
+ 'write_protect':[
+
+ ],
+ 'content_provider_id':[
+
+ ],
+ 'backend_status':[
+ 'notBlank'
+ ],
+ 'id':[
+
+ ],
+ 'no_sync':[
+
+ ],
+ 'enacted':[
+
+ ]
+ },
+ 'id':2,
+ 'created':'2015-10-23T10:50:37.482Z',
+ 'updated':'2015-10-23T10:52:56.232Z',
+ 'enacted':null,
+ 'policed':null,
+ 'backend_register':'{}',
+ 'backend_status':'0 - Provisioning in progress',
+ 'deleted':false,
+ 'write_protect':false,
+ 'lazy_blocked':false,
+ 'no_sync':false,
+ 'content_provider_id':null,
+ 'name':'test',
+ 'enabled':true,
+ 'description':'',
+ 'serviceProvider':'http://0.0.0.0:9000/hpcapi/serviceproviders/1/'
+ }
+ ],
+ SPlist: [
+ {
+ 'humanReadableName':'main_service_provider',
+ 'validators':{
+ 'updated':[
+
+ ],
+ 'policed':[
+
+ ],
+ 'name':[
+ 'notBlank'
+ ],
+ 'created':[
+
+ ],
+ 'deleted':[
+
+ ],
+ 'hpcService':[
+ 'notBlank'
+ ],
+ 'description':[
+
+ ],
+ 'enabled':[
+
+ ],
+ 'service_provider_id':[
+
+ ],
+ 'lazy_blocked':[
+
+ ],
+ 'backend_register':[
+ 'notBlank'
+ ],
+ 'write_protect':[
+
+ ],
+ 'backend_status':[
+ 'notBlank'
+ ],
+ 'id':[
+
+ ],
+ 'no_sync':[
+
+ ],
+ 'enacted':[
+
+ ]
+ },
+ 'id':1,
+ 'created':'2015-10-22T19:33:55.048Z',
+ 'updated':'2015-10-22T19:33:55.048Z',
+ 'enacted':null,
+ 'policed':null,
+ 'backend_register':'{}',
+ 'backend_status':'0 - Provisioning in progress',
+ 'deleted':false,
+ 'write_protect':false,
+ 'lazy_blocked':false,
+ 'no_sync':false,
+ 'hpcService':'http://0.0.0.0:9000/hpcapi/hpcservices/1/',
+ 'service_provider_id':null,
+ 'name':'main_service_provider',
+ 'description':null,
+ 'enabled':true
+ }
+ ],
+ CDNlist: [
+ {
+ 'humanReadableName':'onlab.vicci.org',
+ 'validators':{
+ 'updated':[
+
+ ],
+ 'contentProvider':[
+ 'notBlank'
+ ],
+ 'policed':[
+
+ ],
+ 'created':[
+
+ ],
+ 'deleted':[
+
+ ],
+ 'description':[
+
+ ],
+ 'enabled':[
+
+ ],
+ 'cdn_prefix_id':[
+
+ ],
+ 'lazy_blocked':[
+
+ ],
+ 'backend_register':[
+ 'notBlank'
+ ],
+ 'write_protect':[
+
+ ],
+ 'prefix':[
+ 'notBlank'
+ ],
+ 'defaultOriginServer':[
+
+ ],
+ 'backend_status':[
+ 'notBlank'
+ ],
+ 'id':[
+
+ ],
+ 'no_sync':[
+
+ ],
+ 'enacted':[
+
+ ]
+ },
+ 'id':5,
+ 'created':'2015-10-26T13:09:44.343Z',
+ 'updated':'2015-10-26T13:09:44.343Z',
+ 'enacted':null,
+ 'policed':null,
+ 'backend_register':'{}',
+ 'backend_status':'0 - Provisioning in progress',
+ 'deleted':false,
+ 'write_protect':false,
+ 'lazy_blocked':false,
+ 'no_sync':false,
+ 'cdn_prefix_id':null,
+ 'prefix':'onlab.vicci.org',
+ 'contentProvider':1,
+ 'description':null,
+ 'defaultOriginServer':'http://0.0.0.0:9000/hpcapi/originservers/2/',
+ 'enabled':true
+ },
+ {
+ 'humanReadableName':'downloads.onosproject.org',
+ 'validators':{
+ 'updated':[
+
+ ],
+ 'contentProvider':[
+ 'notBlank'
+ ],
+ 'policed':[
+
+ ],
+ 'created':[
+
+ ],
+ 'deleted':[
+
+ ],
+ 'description':[
+
+ ],
+ 'enabled':[
+
+ ],
+ 'cdn_prefix_id':[
+
+ ],
+ 'lazy_blocked':[
+
+ ],
+ 'backend_register':[
+ 'notBlank'
+ ],
+ 'write_protect':[
+
+ ],
+ 'prefix':[
+ 'notBlank'
+ ],
+ 'defaultOriginServer':[
+
+ ],
+ 'backend_status':[
+ 'notBlank'
+ ],
+ 'id':[
+
+ ],
+ 'no_sync':[
+
+ ],
+ 'enacted':[
+
+ ]
+ },
+ 'id':1,
+ 'created':'2015-10-26T13:09:44.196Z',
+ 'updated':'2015-10-26T13:09:44.196Z',
+ 'enacted':null,
+ 'policed':null,
+ 'backend_register':'{}',
+ 'backend_status':'0 - Provisioning in progress',
+ 'deleted':false,
+ 'write_protect':false,
+ 'lazy_blocked':false,
+ 'no_sync':false,
+ 'cdn_prefix_id':null,
+ 'prefix':'downloads.onosproject.org',
+ 'contentProvider':2,
+ 'description':null,
+ 'defaultOriginServer':'http://0.0.0.0:9000/hpcapi/originservers/1/',
+ 'enabled':true
+ }
+ ],
+ OSlist: [
+ {
+ 'humanReadableName':'another.it',
+ 'validators':{
+ 'updated':[
+
+ ],
+ 'contentProvider':[
+ 'notBlank'
+ ],
+ 'origin_server_id':[
+
+ ],
+ 'policed':[
+
+ ],
+ 'created':[
+
+ ],
+ 'deleted':[
+
+ ],
+ 'description':[
+
+ ],
+ 'enabled':[
+
+ ],
+ 'redirects':[
+
+ ],
+ 'protocol':[
+ 'notBlank'
+ ],
+ 'lazy_blocked':[
+
+ ],
+ 'backend_register':[
+ 'notBlank'
+ ],
+ 'write_protect':[
+
+ ],
+ 'url':[
+ 'notBlank'
+ ],
+ 'authenticated':[
+
+ ],
+ 'backend_status':[
+ 'notBlank'
+ ],
+ 'id':[
+
+ ],
+ 'no_sync':[
+
+ ],
+ 'enacted':[
+
+ ]
+ },
+ 'id':8,
+ 'created':'2015-10-26T13:40:36.878Z',
+ 'updated':'2015-10-26T13:40:36.878Z',
+ 'enacted':null,
+ 'policed':null,
+ 'backend_register':'{}',
+ 'backend_status':'0 - Provisioning in progress',
+ 'deleted':false,
+ 'write_protect':false,
+ 'lazy_blocked':false,
+ 'no_sync':false,
+ 'origin_server_id':null,
+ 'url':'another.it',
+ 'contentProvider':'http://0.0.0.0:9000/hpcapi/contentproviders/1/',
+ 'authenticated':false,
+ 'enabled':true,
+ 'protocol':'http',
+ 'redirects':true,
+ 'description':null
+ },
+ {
+ 'humanReadableName':'test.it',
+ 'validators':{
+ 'updated':[
+
+ ],
+ 'contentProvider':[
+ 'notBlank'
+ ],
+ 'origin_server_id':[
+
+ ],
+ 'policed':[
+
+ ],
+ 'created':[
+
+ ],
+ 'deleted':[
+
+ ],
+ 'description':[
+
+ ],
+ 'enabled':[
+
+ ],
+ 'redirects':[
+
+ ],
+ 'protocol':[
+ 'notBlank'
+ ],
+ 'lazy_blocked':[
+
+ ],
+ 'backend_register':[
+ 'notBlank'
+ ],
+ 'write_protect':[
+
+ ],
+ 'url':[
+ 'notBlank'
+ ],
+ 'authenticated':[
+
+ ],
+ 'backend_status':[
+ 'notBlank'
+ ],
+ 'id':[
+
+ ],
+ 'no_sync':[
+
+ ],
+ 'enacted':[
+
+ ]
+ },
+ 'id':7,
+ 'created':'2015-10-26T13:36:42.567Z',
+ 'updated':'2015-10-26T13:36:42.567Z',
+ 'enacted':null,
+ 'policed':null,
+ 'backend_register':'{}',
+ 'backend_status':'0 - Provisioning in progress',
+ 'deleted':false,
+ 'write_protect':false,
+ 'lazy_blocked':false,
+ 'no_sync':false,
+ 'origin_server_id':null,
+ 'url':'test.it',
+ 'contentProvider':'http://0.0.0.0:9000/hpcapi/contentproviders/1/',
+ 'authenticated':false,
+ 'enabled':true,
+ 'protocol':'http',
+ 'redirects':true,
+ 'description':null
+ },
+ {
+ 'humanReadableName':'onlab.vicci.org',
+ 'validators':{
+ 'updated':[
+
+ ],
+ 'contentProvider':[
+ 'notBlank'
+ ],
+ 'origin_server_id':[
+
+ ],
+ 'policed':[
+
+ ],
+ 'created':[
+
+ ],
+ 'deleted':[
+
+ ],
+ 'description':[
+
+ ],
+ 'enabled':[
+
+ ],
+ 'redirects':[
+
+ ],
+ 'protocol':[
+ 'notBlank'
+ ],
+ 'lazy_blocked':[
+
+ ],
+ 'backend_register':[
+ 'notBlank'
+ ],
+ 'write_protect':[
+
+ ],
+ 'url':[
+ 'notBlank'
+ ],
+ 'authenticated':[
+
+ ],
+ 'backend_status':[
+ 'notBlank'
+ ],
+ 'id':[
+
+ ],
+ 'no_sync':[
+
+ ],
+ 'enacted':[
+
+ ]
+ },
+ 'id':2,
+ 'created':'2015-10-26T13:09:44.286Z',
+ 'updated':'2015-10-26T13:09:44.286Z',
+ 'enacted':null,
+ 'policed':null,
+ 'backend_register':'{}',
+ 'backend_status':'0 - Provisioning in progress',
+ 'deleted':false,
+ 'write_protect':false,
+ 'lazy_blocked':false,
+ 'no_sync':false,
+ 'origin_server_id':null,
+ 'url':'onlab.vicci.org',
+ 'contentProvider':'http://0.0.0.0:9000/hpcapi/contentproviders/1/',
+ 'authenticated':false,
+ 'enabled':true,
+ 'protocol':'HTTP',
+ 'redirects':true,
+ 'description':null
+ },
+ {
+ 'humanReadableName':'downloads.onosproject.org',
+ 'validators':{
+ 'updated':[
+
+ ],
+ 'contentProvider':[
+ 'notBlank'
+ ],
+ 'origin_server_id':[
+
+ ],
+ 'policed':[
+
+ ],
+ 'created':[
+
+ ],
+ 'deleted':[
+
+ ],
+ 'description':[
+
+ ],
+ 'enabled':[
+
+ ],
+ 'redirects':[
+
+ ],
+ 'protocol':[
+ 'notBlank'
+ ],
+ 'lazy_blocked':[
+
+ ],
+ 'backend_register':[
+ 'notBlank'
+ ],
+ 'write_protect':[
+
+ ],
+ 'url':[
+ 'notBlank'
+ ],
+ 'authenticated':[
+
+ ],
+ 'backend_status':[
+ 'notBlank'
+ ],
+ 'id':[
+
+ ],
+ 'no_sync':[
+
+ ],
+ 'enacted':[
+
+ ]
+ },
+ 'id':1,
+ 'created':'2015-10-26T13:09:44.182Z',
+ 'updated':'2015-10-26T13:09:44.182Z',
+ 'enacted':null,
+ 'policed':null,
+ 'backend_register':'{}',
+ 'backend_status':'0 - Provisioning in progress',
+ 'deleted':false,
+ 'write_protect':false,
+ 'lazy_blocked':false,
+ 'no_sync':false,
+ 'origin_server_id':null,
+ 'url':'downloads.onosproject.org',
+ 'contentProvider':'http://0.0.0.0:9000/hpcapi/contentproviders/1/',
+ 'authenticated':false,
+ 'enabled':true,
+ 'protocol':'HTTP',
+ 'redirects':true,
+ 'description':null
+ }
+ ],
+ UserList: [
+ {
+ 'humanReadableName':'teo@onlab.us',
+ 'validators':{
+ 'policed':[
+ 'notBlank'
+ ],
+ 'site':[
+ 'notBlank'
+ ],
+ 'is_appuser':[
+
+ ],
+ 'is_staff':[
+
+ ],
+ 'timezone':[
+ 'notBlank'
+ ],
+ 'backend_status':[
+ 'notBlank'
+ ],
+ 'id':[
+
+ ],
+ 'is_registering':[
+
+ ],
+ 'last_login':[
+ 'notBlank'
+ ],
+ 'email':[
+ 'notBlank'
+ ],
+ 'username':[
+ 'notBlank'
+ ],
+ 'updated':[
+
+ ],
+ 'login_page':[
+
+ ],
+ 'firstname':[
+ 'notBlank'
+ ],
+ 'user_url':[
+ 'url'
+ ],
+ 'deleted':[
+
+ ],
+ 'lastname':[
+ 'notBlank'
+ ],
+ 'is_active':[
+
+ ],
+ 'phone':[
+
+ ],
+ 'is_admin':[
+
+ ],
+ 'password':[
+ 'notBlank'
+ ],
+ 'enacted':[
+ 'notBlank'
+ ],
+ 'public_key':[
+
+ ],
+ 'is_readonly':[
+
+ ],
+ 'created':[
+
+ ],
+ 'write_protect':[
+
+ ]
+ },
+ 'id':2,
+ 'password':'pbkdf2_sha256$12000$2Uzp1YCyjEBO$uU2irK//ZpEZYOIgLzanuApFoPnwfG1jNol2jD273wQ=',
+ 'last_login':'2015-10-26T14:11:27.625Z',
+ 'email':'teo@onlab.us',
+ 'username':'teo@onlab.us',
+ 'firstname':'Matteo',
+ 'lastname':'Scandolo',
+ 'phone':'',
+ 'user_url':null,
+ 'site':1,
+ 'public_key':'',
+ 'is_active':true,
+ 'is_admin':false,
+ 'is_staff':true,
+ 'is_readonly':false,
+ 'is_registering':false,
+ 'is_appuser':false,
+ 'login_page':null,
+ 'created':'2015-10-26T14:11:27.699Z',
+ 'updated':'2015-10-26T14:11:27.699Z',
+ 'enacted':null,
+ 'policed':null,
+ 'backend_status':'Provisioning in progress',
+ 'deleted':false,
+ 'write_protect':false,
+ 'timezone':'America/New_York'
+ },
+ {
+ 'humanReadableName':'padmin@vicci.org',
+ 'validators':{
+ 'policed':[
+ 'notBlank'
+ ],
+ 'site':[
+ 'notBlank'
+ ],
+ 'is_appuser':[
+
+ ],
+ 'is_staff':[
+
+ ],
+ 'timezone':[
+ 'notBlank'
+ ],
+ 'backend_status':[
+ 'notBlank'
+ ],
+ 'id':[
+
+ ],
+ 'is_registering':[
+
+ ],
+ 'last_login':[
+ 'notBlank'
+ ],
+ 'email':[
+ 'notBlank'
+ ],
+ 'username':[
+ 'notBlank'
+ ],
+ 'updated':[
+
+ ],
+ 'login_page':[
+
+ ],
+ 'firstname':[
+ 'notBlank'
+ ],
+ 'user_url':[
+ 'url'
+ ],
+ 'deleted':[
+
+ ],
+ 'lastname':[
+ 'notBlank'
+ ],
+ 'is_active':[
+
+ ],
+ 'phone':[
+
+ ],
+ 'is_admin':[
+
+ ],
+ 'password':[
+ 'notBlank'
+ ],
+ 'enacted':[
+ 'notBlank'
+ ],
+ 'public_key':[
+
+ ],
+ 'is_readonly':[
+
+ ],
+ 'created':[
+
+ ],
+ 'write_protect':[
+
+ ]
+ },
+ 'id':1,
+ 'password':'pbkdf2_sha256$12000$Qufx9iqtaYma$xs0YurPOcj9qYQna/Qrb3K+im9Yr2XEVr0J4Kqek7AE=',
+ 'last_login':'2015-10-27T10:07:09.065Z',
+ 'email':'padmin@vicci.org',
+ 'username':'padmin@vicci.org',
+ 'firstname':'XOS',
+ 'lastname':'admin',
+ 'phone':null,
+ 'user_url':null,
+ 'site':1,
+ 'public_key':null,
+ 'is_active':true,
+ 'is_admin':true,
+ 'is_staff':true,
+ 'is_readonly':false,
+ 'is_registering':false,
+ 'is_appuser':false,
+ 'login_page':null,
+ 'created':'2015-02-17T22:06:38.059Z',
+ 'updated':'2015-10-27T09:00:44.672Z',
+ 'enacted':null,
+ 'policed':null,
+ 'backend_status':'Provisioning in progress',
+ 'deleted':false,
+ 'write_protect':false,
+ 'timezone':'America/New_York'
+ }
+ ]
+};
\ No newline at end of file
diff --git a/gui/ngXosViews/contentProvider/spec/sample.test.js b/gui/ngXosViews/contentProvider/spec/sample.test.js
new file mode 100644
index 0000000..177bc7d
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/spec/sample.test.js
@@ -0,0 +1,37 @@
+'use strict';
+
+describe('The User List', () => {
+
+ var scope, element, isolatedScope, httpBackend;
+
+ beforeEach(module('xos.contentProvider'));
+ beforeEach(module('templates'));
+
+ beforeEach(inject(function($httpBackend, $compile, $rootScope){
+
+ httpBackend = $httpBackend;
+ // Setting up mock request
+ $httpBackend.expectGET('/xos/users/?no_hyperlinks=1').respond([
+ {
+ email: 'matteo.scandolo@link-me.it',
+ firstname: 'Matteo',
+ lastname: 'Scandolo'
+ }
+ ]);
+
+ scope = $rootScope.$new();
+ element = angular.element('<users-list></users-list>');
+ $compile(element)(scope);
+ scope.$digest();
+ isolatedScope = element.isolateScope().vm;
+ }));
+
+ it('should load 1 users', () => {
+ httpBackend.flush();
+ expect(isolatedScope.users.length).toBe(1);
+ expect(isolatedScope.users[0].email).toEqual('matteo.scandolo@link-me.it');
+ expect(isolatedScope.users[0].firstname).toEqual('Matteo');
+ expect(isolatedScope.users[0].lastname).toEqual('Scandolo');
+ });
+
+});
\ No newline at end of file
diff --git a/gui/ngXosViews/contentProvider/src/css/dev.css b/gui/ngXosViews/contentProvider/src/css/dev.css
new file mode 100644
index 0000000..1457e38
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/src/css/dev.css
@@ -0,0 +1,5 @@
+#xosContentProvider{
+ position: absolute;
+ top: 100px;
+ left: 200px;
+}
\ No newline at end of file
diff --git a/gui/ngXosViews/contentProvider/src/index.html b/gui/ngXosViews/contentProvider/src/index.html
new file mode 100644
index 0000000..b203c67
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/src/index.html
@@ -0,0 +1,32 @@
+<!-- browserSync -->
+<!-- bower:css -->
+<link rel="stylesheet" href="vendor/bootstrap-css/css/bootstrap.css" />
+<!-- endbower --><!-- endcss -->
+<!-- inject:css -->
+<link rel="stylesheet" href="/css/dev.css">
+<!-- endinject -->
+
+<div ng-app="xos.contentProvider" id="xosContentProvider">
+ <div ui-view></div>
+</div>
+
+<!-- bower:js -->
+<script src="vendor/jquery/dist/jquery.js"></script>
+<script src="vendor/angular/angular.js"></script>
+<script src="vendor/angular-mocks/angular-mocks.js"></script>
+<script src="vendor/angular-ui-router/release/angular-ui-router.js"></script>
+<script src="vendor/angular-cookies/angular-cookies.js"></script>
+<script src="vendor/angular-resource/angular-resource.js"></script>
+<script src="vendor/ng-lodash/build/ng-lodash.js"></script>
+<script src="vendor/bootstrap-css/js/bootstrap.js"></script>
+<!-- endbower --><!-- endjs -->
+<!-- inject:js -->
+<script src="/xosHelpers/src/xosHelpers.module.js"></script>
+<script src="/xosHelpers/src/services/noHyperlinks.interceptor.js"></script>
+<script src="/xosHelpers/src/services/csrfToken.interceptor.js"></script>
+<script src="/xosHelpers/src/services/api.services.js"></script>
+<script src="/api/ng-xoslib.js"></script>
+<script src="/api/ng-xos.js"></script>
+<script src="/api/ng-hpcapi.js"></script>
+<script src="/.tmp/main.js"></script>
+<!-- endinject -->
diff --git a/gui/ngXosViews/contentProvider/src/js/main.js b/gui/ngXosViews/contentProvider/src/js/main.js
new file mode 100644
index 0000000..6f93c0a
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/src/js/main.js
@@ -0,0 +1,369 @@
+'use strict';
+
+angular.module('xos.contentProvider', [
+ 'ngResource',
+ 'ngCookies',
+ 'ngLodash',
+ 'xos.helpers',
+ 'ui.router',
+ 'xos.xos'
+])
+.config(($stateProvider, $urlRouterProvider) => {
+
+ $stateProvider
+ .state('list', {
+ url: '/',
+ template: '<content-provider-list></content-provider-list>',
+ })
+ .state('details', {
+ url: '/contentProvider/:id',
+ template: '<content-provider-detail></content-provider-detail>'
+ })
+ .state('cdn', {
+ url: '/contentProvider/:id/cdn_prefix',
+ template: '<content-provider-cdn></content-provider-cdn>'
+ })
+ .state('server', {
+ url: '/contentProvider/:id/origin_server',
+ template: '<content-provider-server></content-provider-server>'
+ })
+ .state('users', {
+ url: '/contentProvider/:id/users',
+ template: '<content-provider-users></content-provider-users>'
+ });
+})
+.config(function($httpProvider){
+ // add X-CSRFToken header for update, create, delete (!GET)
+ $httpProvider.interceptors.push('SetCSRFToken');
+ $httpProvider.interceptors.push('NoHyperlinks');
+})
+.service('ContentProvider', function($resource){
+ return $resource('/hpcapi/contentproviders/:id/', {id: '@id'}, {
+ 'update': {method: 'PUT'}
+ });
+})
+.service('ServiceProvider', function($resource){
+ return $resource('/hpcapi/serviceproviders/:id/', {id: '@id'});
+})
+.service('CdnPrefix', function($resource){
+ return $resource('/hpcapi/cdnprefixs/:id/', {id: '@id'});
+})
+.service('OriginServer', function($resource){
+ return $resource('/hpcapi/originservers/:id/', {id: '@id'});
+})
+.service('User', function($resource){
+ return $resource('/xos/users/:id/', {id: '@id'});
+})
+.directive('cpActions', function(ContentProvider, $location){
+ return {
+ restrict: 'E',
+ scope: {
+ id: '=id',
+ },
+ bindToController: true,
+ controllerAs: 'vm',
+ templateUrl: 'templates/cp_actions.html',
+ controller: function(){
+ this.deleteCp = function(id){
+ ContentProvider.delete({id: id}).$promise
+ .then(function(){
+ $location.url('/');
+ });
+ };
+ }
+ };
+})
+.directive('contentProviderList', function(ContentProvider, lodash){
+ return {
+ restrict: 'E',
+ controllerAs: 'vm',
+ scope: {},
+ templateUrl: 'templates/cp_list.html',
+ controller: function(){
+ var self = this;
+
+ ContentProvider.query().$promise
+ .then(function(cp){
+ self.contentProviderList = cp;
+ })
+ .catch(function(e){
+ throw new Error(e);
+ });
+
+ this.deleteCp = function(id){
+ ContentProvider.delete({id: id}).$promise
+ .then(function(){
+ lodash.remove(self.contentProviderList, {id: id});
+ });
+ };
+ }
+ };
+})
+.directive('contentProviderDetail', function(ContentProvider, ServiceProvider, $stateParams, $location){
+ return {
+ restrict: 'E',
+ controllerAs: 'vm',
+ scope: {},
+ templateUrl: 'templates/cp_detail.html',
+ controller: function(){
+ this.pageName = 'detail';
+ var self = this;
+
+ if($stateParams.id){
+ ContentProvider.get({id: $stateParams.id}).$promise
+ .then(function(cp){
+ self.cp = cp;
+ }).catch(function(e){
+ self.result = {
+ status: 0,
+ msg: e.data.detail
+ };
+ });
+ }
+ else{
+ self.cp = new ContentProvider();
+ }
+
+ ServiceProvider.query().$promise
+ .then(function(sp){
+ self.sp = sp;
+ });
+
+ this.saveContentProvider = function(cp){
+ var p, isNew = false;
+
+ if(cp.id){
+ p = cp.$update();
+ }
+ else{
+ isNew = true;
+ cp.name = cp.humanReadableName;
+ p = cp.$save();
+ }
+
+ p.then(function(res){
+ self.result = {
+ status: 1,
+ msg: 'Content Provider Saved'
+ };
+ if(isNew){
+ $location.url('contentProvider/' + res.id + '/');
+ }
+ })
+ .catch(function(e){
+ self.result = {
+ status: 0,
+ msg: e.data.detail
+ };
+ });
+ };
+ }
+ };
+})
+.directive('contentProviderCdn', function($stateParams, CdnPrefix, ContentProvider, lodash){
+ return{
+ restrict: 'E',
+ controllerAs: 'vm',
+ scope: {},
+ templateUrl: 'templates/cp_cdn_prefix.html',
+ controller: function(){
+ var self = this;
+
+ this.pageName = 'cdn';
+
+ if($stateParams.id){
+ ContentProvider.get({id: $stateParams.id}).$promise
+ .then(function(cp){
+ self.cp = cp;
+ }).catch(function(e){
+ self.result = {
+ status: 0,
+ msg: e.data.detail
+ };
+ });
+ }
+
+ CdnPrefix.query().$promise
+ .then(function(prf){
+ self.prf = prf;
+ // set the active CdnPrefix for this contentProvider
+ self.cp_prf = lodash.where(prf, {contentProvider: parseInt($stateParams.id)});
+ }).catch(function(e){
+ self.result = {
+ status: 0,
+ msg: e.data.detail
+ };
+ });
+
+ this.addPrefix = function(prf){
+ prf.contentProvider = $stateParams.id;
+
+ var item = new CdnPrefix(prf);
+
+ item.$save()
+ .then(function(res){
+ self.cp_prf.push(res);
+ })
+ .catch(function(e){
+ self.result = {
+ status: 0,
+ msg: e.data.detail
+ };
+ });
+ };
+
+ this.removePrefix = function(item){
+ item.$delete()
+ .then(function(){
+ lodash.remove(self.cp_prf, item);
+ })
+ .catch(function(e){
+ self.result = {
+ status: 0,
+ msg: e.data.detail
+ };
+ });
+ };
+ }
+ };
+})
+.directive('contentProviderServer', function($stateParams, OriginServer, ContentProvider, lodash){
+ return{
+ restrict: 'E',
+ controllerAs: 'vm',
+ scope: {},
+ templateUrl: 'templates/cp_origin_server.html',
+ controller: function(){
+ this.pageName = 'server';
+ this.protocols = {'http': 'HTTP', 'rtmp': 'RTMP', 'rtp': 'RTP', 'shout': 'SHOUTcast'};
+
+ var self = this;
+
+ if($stateParams.id){
+ ContentProvider.get({id: $stateParams.id}).$promise
+ .then(function(cp){
+ self.cp = cp;
+ }).catch(function(e){
+ self.result = {
+ status: 0,
+ msg: e.data.detail
+ };
+ });
+ }
+
+ OriginServer.query({contentProvider: $stateParams.id}).$promise
+ .then(function(cp_os){
+ self.cp_os = cp_os;
+ }).catch(function(e){
+ self.result = {
+ status: 0,
+ msg: e.data.detail
+ };
+ });
+
+ this.addOrigin = function(os){
+ os.contentProvider = $stateParams.id;
+
+ var item = new OriginServer(os);
+
+ item.$save()
+ .then(function(res){
+ self.cp_os.push(res);
+ })
+ .catch(function(e){
+ self.result = {
+ status: 0,
+ msg: e.data.detail
+ };
+ });
+ };
+
+ this.removeOrigin = function(item){
+ item.$delete()
+ .then(function(){
+ lodash.remove(self.cp_os, item);
+ })
+ .catch(function(e){
+ self.result = {
+ status: 0,
+ msg: e.data.detail
+ };
+ });
+ };
+ }
+ };
+})
+.directive('contentProviderUsers', function($stateParams, ContentProvider, User, lodash){
+ return{
+ restrict: 'E',
+ controllerAs: 'vm',
+ scope: {},
+ templateUrl: 'templates/cp_user.html',
+ controller: function(){
+ var self = this;
+
+ this.pageName = 'user';
+
+ this.cp_users = [];
+
+ if($stateParams.id){
+ User.query().$promise
+ .then(function(users){
+ self.users = users;
+ return ContentProvider.get({id: $stateParams.id}).$promise;
+ })
+ .then(function(res){
+ res.users = self.populateUser(res.users, self.users);
+ return res;
+ })
+ .then(function(cp){
+ self.cp = cp;
+ }).catch(function(e){
+ self.result = {
+ status: 0,
+ msg: e.data.detail
+ };
+ });
+ }
+
+ this.populateUser = function(ids, list){
+ for(var i = 0; i < ids.length; i++){
+ ids[i] = lodash.find(list, {id: ids[i]});
+ }
+ return ids;
+ };
+
+ this.addUserToCp = function(user){
+ self.cp.users.push(user);
+ };
+
+ this.removeUserFromCp = function(user){
+ lodash.remove(self.cp.users, user);
+ };
+
+ this.saveContentProvider = function(cp){
+
+ // flatten the user to id of array
+ cp.users = lodash.pluck(cp.users, 'id');
+
+ cp.$update()
+ .then(function(res){
+
+ self.cp.users = self.populateUser(res.users, self.users);
+
+ self.result = {
+ status: 1,
+ msg: 'Content Provider Saved'
+ };
+
+ })
+ .catch(function(e){
+ self.result = {
+ status: 0,
+ msg: e.data.detail
+ };
+ });
+ };
+ }
+ };
+});
\ No newline at end of file
diff --git a/gui/ngXosViews/contentProvider/src/templates/cp_actions.html b/gui/ngXosViews/contentProvider/src/templates/cp_actions.html
new file mode 100644
index 0000000..8c6ae97
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/src/templates/cp_actions.html
@@ -0,0 +1,9 @@
+<a href="#/" class="btn btn-default">
+ <i class="icon icon-arrow-left"></i>Back
+</a>
+<a href="#/contentProvider/" class="btn btn-success">
+ <i class="icon icon-plus"></i>Create
+</a>
+<a ng-click="vm.deleteCp(vm.id)" class="btn btn-danger">
+ <i class="icon icon-remove"></i>Remove
+</a>
\ No newline at end of file
diff --git a/gui/ngXosViews/contentProvider/src/templates/cp_cdn_prefix.html b/gui/ngXosViews/contentProvider/src/templates/cp_cdn_prefix.html
new file mode 100644
index 0000000..8532e6a
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/src/templates/cp_cdn_prefix.html
@@ -0,0 +1,55 @@
+<div class="row-fluid">
+ <div class="span6">
+ <h1>{$ vm.cp.humanReadableName $}</h1>
+ </div>
+ <div class="span6 text-right">
+ <cp-actions id="vm.cp.id"></cp-actions>
+ </div>
+</div>
+<hr>
+<div class="row-fluid">
+ <div class="span2">
+ <div ng-include="'templates/cp_side_nav.html'"></div>
+ </div>
+ <div class="span10">
+ <div ng-repeat="item in vm.cp_prf" class="well">
+ <div class="row-fluid">
+ <div class="span4">
+ {{item.humanReadableName}}
+ </div>
+ <div class="span6">
+ <!-- TODO show the name instead that id -->
+ {{item.defaultOriginServer}}
+ </div>
+ <div class="span2">
+ <a ng-click="vm.removePrefix(item)" class="btn btn-danger pull-right">
+ <i class="icon icon-remove"></i>
+ </a>
+ </div>
+ </div>
+ </div>
+ <hr>
+ <form ng-submit="vm.addPrefix(vm.new_prf)">
+ <div class="row-fluid">
+ <div class="span4">
+ <label>Prefix</label>
+ <input type="text" ng-model="vm.new_prf.prefix" required style="max-width: 90%">
+ </div>
+ <div class="span6">
+ <label>Default Origin Server</label>
+ <select ng-model="vm.new_prf.defaultOriginServer" style="max-width: 100%">
+ <option ng-repeat="prf in vm.prf" ng-value="prf.id">{$ prf.humanReadableName $}</option>
+ </select>
+ </div>
+ <div class="span2 text-right">
+ <button class="btn btn-success margin-wells">
+ <i class="icon icon-plus"></i>
+ </button>
+ </div>
+ </div>
+ </form>
+ <div class="alert" ng-show="vm.result" ng-class="{'alert-success': vm.result.status === 1,'alert-error': vm.result.status === 0}">
+ {$ vm.result.msg $}
+ </div>
+ </div>
+</div>
\ No newline at end of file
diff --git a/gui/ngXosViews/contentProvider/src/templates/cp_detail.html b/gui/ngXosViews/contentProvider/src/templates/cp_detail.html
new file mode 100644
index 0000000..89d8daf
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/src/templates/cp_detail.html
@@ -0,0 +1,55 @@
+<div class="row-fluid">
+ <div class="span6">
+ <h1>{$ vm.cp.humanReadableName $}</h1>
+ </div>
+ <div class="span6 text-right">
+ <cp-actions id="vm.cp.id"></cp-actions>
+ </div>
+</div>
+<hr>
+<div class="row-fluid">
+ <div ng-show="vm.cp.id" class="span2">
+ <div ng-include="'templates/cp_side_nav.html'"></div>
+ </div>
+ <div ng-class="{span10: vm.cp.id, span12: !vm.cp.id}">
+ <!-- TODO hide form on not found -->
+ <form ng-submit="vm.saveContentProvider(vm.cp)">
+ <fieldset>
+ <div class="row-fluid">
+ <div class="span6">
+ <label>Name:</label>
+ <input type="text" ng-model="vm.cp.humanReadableName" required/>
+ </div>
+ <div class="span6">
+ <label class="checkbox">
+ <input type="checkbox" ng-model="vm.cp.enabled" /> Enabled
+ </label>
+ </div>
+ </div>
+ <div class="row-fluid">
+ <div class="span12">
+ <label>Description</label>
+ <textarea style="width: 100%" ng-model="vm.cp.description"></textarea>
+ </div>
+ </div>
+ <div class="row-fluid">
+ <div class="span12">
+ <label>Service provider</label>
+ <select required ng-model="vm.cp.serviceProvider" ng-options="sp.id as sp.humanReadableName for sp in vm.sp"></select>
+ </div>
+ </div>
+ <div class="row-fluid">
+ <div class="span12">
+ <button class="btn btn-success">
+ <span ng-show="vm.cp.id">Save</span>
+ <span ng-show="!vm.cp.id">Create</span>
+ </button>
+ </div>
+ </div>
+ </fieldset>
+ </form>
+ <div class="alert" ng-show="vm.result" ng-class="{'alert-success': vm.result.status === 1,'alert-error': vm.result.status === 0}">
+ {$ vm.result.msg $}
+ </div>
+ </div>
+</div>
\ No newline at end of file
diff --git a/gui/ngXosViews/contentProvider/src/templates/cp_list.html b/gui/ngXosViews/contentProvider/src/templates/cp_list.html
new file mode 100644
index 0000000..e54ebe6
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/src/templates/cp_list.html
@@ -0,0 +1,34 @@
+<table class="table table-striped" ng-show="vm.contentProviderList.length > 0">
+ <thead>
+ <tr>
+ <th>
+ Name
+ </th>
+ <th>Description</th>
+ <th>Status</th>
+ <th></th>
+ </tr>
+ </thead>
+ <tr ng-repeat="item in vm.contentProviderList">
+ <td>
+ <a ui-sref="details({ id: item.id })">{$ item.humanReadableName $}</a>
+ </td>
+ <td>
+ {$ item.description $}
+ </td>
+ <td>
+ {$ item.enabled $}
+ </td>
+ <td class="text-right">
+ <a ng-click="vm.deleteCp(item.id)" class="btn btn-danger"><i class="icon icon-remove"></i></a></td>
+ </tr>
+</table>
+<div class="alert alert-error" ng-show="vm.contentProviderList.length == 0">
+ No Content Provider defined
+</div>
+
+<div class="row">
+ <div class="span12 text-right">
+ <a class="btn btn-success"href="#/contentProvider/">Create</a>
+ </div>
+</div>
\ No newline at end of file
diff --git a/gui/ngXosViews/contentProvider/src/templates/cp_origin_server.html b/gui/ngXosViews/contentProvider/src/templates/cp_origin_server.html
new file mode 100644
index 0000000..49cd175
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/src/templates/cp_origin_server.html
@@ -0,0 +1,53 @@
+<div class="row-fluid">
+ <div class="span6">
+ <h1>{$ vm.cp.humanReadableName $}</h1>
+ </div>
+ <div class="span6 text-right">
+ <cp-actions id="vm.cp.id"></cp-actions>
+ </div>
+</div>
+<hr>
+<div class="row-fluid">
+ <div class="span2">
+ <div ng-include="'templates/cp_side_nav.html'"></div>
+ </div>
+ <div class="span10">
+ <div ng-repeat="item in vm.cp_os" class="well">
+ <div class="row-fluid">
+ <div class="span4">
+ {{item.humanReadableName}}
+ </div>
+ <div class="span6">
+ <!-- TODO shoe the name instead that url -->
+ {{item.defaultOriginServer}}
+ </div>
+ <div class="span2">
+ <a ng-click="vm.removeOrigin(item)" class="btn btn-danger pull-right">
+ <i class="icon icon-remove"></i>
+ </a>
+ </div>
+ </div>
+ </div>
+ <hr>
+ <form ng-submit="vm.addOrigin(vm.new_os)">
+ <div class="row-fluid">
+ <div class="span4">
+ <label>Protocol</label>
+ <select ng-model="vm.new_os.protocol" ng-options="k as v for (k,v) in vm.protocols" style="max-width: 100%;"></select>
+ </div>
+ <div class="span6">
+ <label>Url</label>
+ <input type="text" ng-model="vm.new_os.url" required>
+ </div>
+ <div class="span2 text-right">
+ <button class="btn btn-success margin-wells">
+ <i class="icon icon-plus"></i>
+ </button>
+ </div>
+ </div>
+ </form>
+ <div class="alert" ng-show="vm.result" ng-class="{'alert-success': vm.result.status === 1,'alert-error': vm.result.status === 0}">
+ {$ vm.result.msg $}
+ </div>
+ </div>
+</div>
\ No newline at end of file
diff --git a/gui/ngXosViews/contentProvider/src/templates/cp_side_nav.html b/gui/ngXosViews/contentProvider/src/templates/cp_side_nav.html
new file mode 100644
index 0000000..a2c8633
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/src/templates/cp_side_nav.html
@@ -0,0 +1,14 @@
+<ul class="nav nav-list">
+ <li>
+ <a class="btn" ng-class="{'btn-primary': vm.pageName == 'detail'}" href="#/contentProvider/{$ vm.cp.id $}">Details</a>
+ </li>
+ <li>
+ <a class="btn" ng-class="{'btn-primary': vm.pageName == 'cdn'}" href="#/contentProvider/{$ vm.cp.id $}/cdn_prefix">Cdn Prexix</a>
+ </li>
+ <li>
+ <a class="btn" ng-class="{'btn-primary': vm.pageName == 'server'}" href="#/contentProvider/{$ vm.cp.id $}/origin_server">Origin Server</a>
+ </li>
+ <li>
+ <a class="btn" ng-class="{'btn-primary': vm.pageName == 'user'}" href="#/contentProvider/{$ vm.cp.id $}/users">Users</a>
+ </li>
+</ul>
\ No newline at end of file
diff --git a/gui/ngXosViews/contentProvider/src/templates/cp_user.html b/gui/ngXosViews/contentProvider/src/templates/cp_user.html
new file mode 100644
index 0000000..2b82e1c
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/src/templates/cp_user.html
@@ -0,0 +1,51 @@
+<div class="row-fluid">
+ <div class="span6">
+ <h1>{$ vm.cp.humanReadableName $}</h1>
+ </div>
+ <div class="span6 text-right">
+ <cp-actions id="vm.cp.id"></cp-actions>
+ </div>
+</div>
+<hr>
+<div class="row-fluid">
+ <div class="span2">
+ <div ng-include="'templates/cp_side_nav.html'"></div>
+ </div>
+ <div class="span10">
+ <div ng-repeat="item in vm.cp.users" class="well">
+ <div class="row-fluid">
+ <div class="span3">
+ {{item.firstname}}
+ </div>
+ <div class="span3">
+ {{item.lastname}}
+ </div>
+ <div class="span4">
+ {{item.email}}
+ </div>
+ <div class="span2">
+ <a ng-click="vm.removeUserFromCp(item)" class="btn btn-danger pull-right">
+ <i class="icon icon-remove"></i>
+ </a>
+ </div>
+ </div>
+ </div>
+ <hr>
+ <form ng-submit="vm.saveContentProvider(vm.cp)">
+ <div class="row-fluid">
+ <div class="span8">
+ <label>Select user:</label>
+ <select ng-model="vm.user" ng-options="u as u.username for u in vm.users" ng-change="vm.addUserToCp(vm.user)"></select>
+ </div>
+ <div class="span4 text-right">
+ <button class="btn btn-success margin-wells">
+ Save
+ </button>
+ </div>
+ </div>
+ </form>
+ <div class="alert" ng-show="vm.result" ng-class="{'alert-success': vm.result.status === 1,'alert-error': vm.result.status === 0}">
+ {$ vm.result.msg $}
+ </div>
+ </div>
+</div>
\ No newline at end of file
diff --git a/gui/ngXosViews/contentProvider/src/templates/users-list.tpl.html b/gui/ngXosViews/contentProvider/src/templates/users-list.tpl.html
new file mode 100644
index 0000000..2983ad0
--- /dev/null
+++ b/gui/ngXosViews/contentProvider/src/templates/users-list.tpl.html
@@ -0,0 +1,14 @@
+<div class="row">
+ <h1>Users List</h1>
+ <p>This is only an example view.</p>
+</div>
+<div class="row">
+ <div class="span4">Email</div>
+ <div class="span4">First Name</div>
+ <div class="span4">Last Name</div>
+</div>
+<div class="row" ng-repeat="user in vm.users">
+ <div class="span4">{{user.email}}</div>
+ <div class="span4">{{user.firstname}}</div>
+ <div class="span4">{{user.lastname}}</div>
+</div>
\ No newline at end of file