From 8f8a81d1e47167097611fe0347cba1dc2cc566c1 Mon Sep 17 00:00:00 2001 From: Jorge Villalobos Date: Mon, 9 Jan 2017 16:24:09 -0600 Subject: [PATCH 1/3] Update README.md Update readme file to include instructions on building ciao-webui with the provided Makefile. Remove instructions regarding install.sh script, as it is outdated. Signed-off-by: Jorge Villalobos --- README.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a8099652..a0b7be16 100644 --- a/README.md +++ b/README.md @@ -72,12 +72,21 @@ The following fields will determine how the Ciao Web UI will beconfigured. #### Building application -In order to build application the 'install.sh' must be executed. This script will intsall dependencies using the npm package manager and also build minified JS scripts used with browser compatibility. -Note: this process is only necessary for development as minified scripts and dependencies are already provided by the application. +In order to build the application a Makefile is provided. Use make 'TARGET' to build Ciao-Webui. When running either 'install' or 'install-dev' targets. Note that if not set, the environment variable 'NODE_ENV' will be set to 'production' by default. + +###### make install +Use 'make' or 'make install' in order to build ciao-webui application with latest 'production' ready code. + +###### make install-dev +Use 'make install-dev' to install development dependencies and fully build and update dependencies for the Ciao-Webui project. Use this target for development environments. + +###### make uninstall +Remove Ciao-Webui from the system and cleans build files. + +###### make clean +Clean build generated files from working directory. +**Note:** Use this target to clean the working directory after runnin 'make install-dev' target. - # install while setting a "development" environment - $ ./install.sh development - # In this case NODE_ENV will be set to "development" #### Running application: From 734eec70ce294797a78625f3c8a70dc3dbec719a Mon Sep 17 00:00:00 2001 From: Jorge Villalobos Date: Tue, 10 Jan 2017 16:08:41 -0600 Subject: [PATCH 2/3] Add poolService functions definition The poolService.js file will enable connection to pool resources from new controller API implementaiton. TODO: Implement each method to complete pool management functionality Signed-off-by: Jorge Villalobos --- core/poolService.js | 94 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 core/poolService.js diff --git a/core/poolService.js b/core/poolService.js new file mode 100644 index 00000000..9e40802f --- /dev/null +++ b/core/poolService.js @@ -0,0 +1,94 @@ +/*Pool service component + This is a client implementation to handle Ciao's Pool API. +*/ + +var poolService = function (adapter, tokenManager) { + this.adapter = adapter; + this.tokenManager = tokenManager; +}; + +// Begins section for IP Pools + +// listPools: +// Method: GET +// Returns a list of pools +poolService.prototype.listPools = function () { + var adapter = this.adapter; + var tokenManager = this.tokenManager; + return function (req, res, next) { + + }; +}; + +// addPool +// Method: POST +// Delivers a new pool request. +// On success: Expects http statusNoContent +poolService.prototype.addPool = function () { + var adapter = this.adapter; + var tokenManager = this.tokenManager; + return function (req, res, next) { + + }; +}; + +// addToPool +// Method: POST +// Delivers a new pool request. +// On success: Expects http statusNoContent +poolService.prototype.addToPool = function () { + var adapter = this.adapter; + var tokenManager = this.tokenManager; + return function (req, res, next) { + + }; +}; + +// deletePool +// Method: DELETE +// Delivers request to delete pool +// On success: Expects http statusNoContent +poolService.prototype.deletePool = function () { + var adapter = this.adapter; + var tokenManager = this.tokenManager; + return function (req, res, next) { + + }; +}; + +// deleteSubnet +// Method: DELETE +// Delivers request to delete subnet from +// On success: Expects http statusNoContent +poolService.prototype.deleteSubnet = function () { + var adapter = this.adapter; + var tokenManager = this.tokenManager; + return function (req, res, next) { + + }; +}; + +// deleteExternalIP +// Method: DELETE +// Delivers request to delete external IP from pool +// On success: Expects http statusNoContent +poolService.prototype.deleteExternalIP = function () { + var adapter = this.adapter; + var tokenManager = this.tokenManager; + return function (req, res, next) { + + }; +}; + +// listPools: +// Method: GET +// Returns a single pool object +poolService.prototype.showPool = function () { + var adapter = this.adapter; + var tokenManager = this.tokenManager; + return function (req, res, next) { + + }; +}; + +module.exports = poolService; From 4138505873084b975c2ca4a6f4a67ee501f7d48c Mon Sep 17 00:00:00 2001 From: Jorge Villalobos Date: Tue, 10 Jan 2017 16:21:01 -0600 Subject: [PATCH 3/3] Add external IP service definition Add externalIPService.js file, and define methods to consume external IP API through ciao-controller. TODO: Method implementation to consume API. Signed-off-by: Jorge Villalobos --- core/externalIPService.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 core/externalIPService.js diff --git a/core/externalIPService.js b/core/externalIPService.js new file mode 100644 index 00000000..d4e88c7c --- /dev/null +++ b/core/externalIPService.js @@ -0,0 +1,35 @@ +/*Pool service component + This is a client implementation to handle Ciao's external-ip API. +*/ + +var externalIPService = function (adapter, tokenManager) { +}; + +// listMappedIPs +// Method: GET +externalIPService.prototype.listMappedIPs = function () { + var adapter = this.adapter; + var tokenManager = this.tokenManager; + return function (req, res, next) { + }; +}; + +// mapExternalIP +// Method: POST +externalIPService.prototype.mapExternalIP = function () { + var adapter = this.adapter; + var tokenManager = this.tokenManager; + return function (req, res, next) { + }; +}; + +// unmapExternalIP +// Method: DELETE +externalIPService.prototype.unmapExternalIP = function () { + var adapter = this.adapter; + var tokenManager = this.tokenManager; + return function (req, res, next) { + }; +}; + +module.exports = externalIPService;