Index: db/default.sql
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
<+>PRAGMA foreign_keys=OFF;\nBEGIN TRANSACTION;\nCREATE TABLE routing (`ID` INTEGER PRIMARY KEY AUTOINCREMENT, `publishing_instance_id` TEXT, `publishing_element_id` TEXT, `destination_instance_id` TEXT, `destination_element_id` TEXT, `is_network_connection` TINYINT(1));\nCREATE TABLE config (`ID` INTEGER PRIMARY KEY AUTOINCREMENT, `key` TEXT, `value` TEXT);\nCREATE TABLE satellite (`ID` INTEGER PRIMARY KEY AUTOINCREMENT, `name` TEXT, `domain` TEXT, `public_ip` TEXT, `created_at` DATETIME NOT NULL, `updated_at` DATETIME NOT NULL);\nINSERT INTO satellite VALUES(2,'ComSat4','comsat4.iotracks.com','104.130.135.213','2016-09-21 15:21:31.898 +00:00','2016-09-21 15:21:31.898 +00:00');\nCREATE TABLE data_tracks (`ID` INTEGER PRIMARY KEY AUTOINCREMENT, `name` TEXT, `instance_id` TEXT, `updated_by` BIGINT, `description` TEXT, `is_selected` INTEGER, `is_activated` INTEGER, `created_at` DATETIME NOT NULL, `updated_at` DATETIME NOT NULL, `user_id` INTEGER REFERENCES `users` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE);\nCREATE TABLE element_instance_port (\n\t`ID`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`port_internal`\tBIGINT,\n\t`port_external`\tBIGINT,\n\t`updated_by`\tBIGINT,\n\t`created_at`\tDATETIME NOT NULL,\n\t`updated_at`\tDATETIME NOT NULL,\n\t`elementId`\tTEXT\n);\nCREATE TABLE iofog_console (ID INTEGER PRIMARY KEY AUTOINCREMENT, org_id BIGINT, version BIGINT, api_base_url TEXT, element_id TEXT, access_token TEXT, iofog_uuid TEXT REFERENCES iofogs (UUID) ON DELETE SET NULL ON UPDATE CASCADE);\nCREATE TABLE stream_viewer (ID INTEGER PRIMARY KEY AUTOINCREMENT, orgId BIGINT, version BIGINT, api_base_url TEXT, element_id TEXT, access_token TEXT, iofog_uuid TEXT REFERENCES iofogs (UUID) ON DELETE SET NULL ON UPDATE CASCADE);\nCREATE TABLE instance_track (ID INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, description TEXT, last_updated DATETIME, is_selected TINYINT (1), is_activated TINYINT (1), updated_by BIGINT, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, element_instance_id INTEGER REFERENCES element_instance (ID) ON DELETE SET NULL ON UPDATE CASCADE);\nCREATE TABLE element_advertised_port (ID INTEGER PRIMARY KEY AUTOINCREMENT, port_number BIGINT, name TEXT, description TEXT, element_id INTEGER REFERENCES element (ID) ON DELETE SET NULL ON UPDATE CASCADE);\nCREATE TABLE iofog_users (ID INTEGER PRIMARY KEY AUTOINCREMENT, user_id INTEGER REFERENCES users (ID) ON DELETE CASCADE ON UPDATE CASCADE, fog_id TEXT REFERENCES iofogs (UUID) ON DELETE CASCADE ON UPDATE CASCADE, UNIQUE (user_id, fog_id));\nINSERT INTO iofog_users VALUES(193,43,'fVmnRpHgdNnDw7XJLJw7GV4NVRhjk4V3');\nCREATE TABLE element_fog_types (ID INTEGER PRIMARY KEY AUTOINCREMENT, element_id INTEGER REFERENCES element (ID) ON DELETE CASCADE ON UPDATE CASCADE, iofog_type_id INTEGER REFERENCES iofog_type (ID) ON DELETE SET NULL ON UPDATE CASCADE);\nINSERT INTO element_fog_types VALUES(1,1,1);\nINSERT INTO element_fog_types VALUES(2,2,1);\nINSERT INTO element_fog_types VALUES(3,3,1);\nINSERT INTO element_fog_types VALUES(4,4,1);\nINSERT INTO element_fog_types VALUES(5,5,1);\nINSERT INTO element_fog_types VALUES(6,8,1);\nINSERT INTO element_fog_types VALUES(7,49,1);\nINSERT INTO element_fog_types VALUES(8,58,1);\nCREATE TABLE network_pairing (ID INTEGER PRIMARY KEY AUTOINCREMENT, IsPublicPort TINYINT (1), instanceId1 TEXT REFERENCES iofogs (UUID) ON DELETE SET NULL ON UPDATE CASCADE, instanceId2 TEXT REFERENCES iofogs (UUID) ON DELETE SET NULL ON UPDATE CASCADE, elementId1 TEXT REFERENCES element_instance (UUID) ON DELETE SET NULL ON UPDATE CASCADE, elementId2 TEXT REFERENCES element_instance (UUID) ON DELETE SET NULL ON UPDATE CASCADE, networkElementId1 TEXT REFERENCES element_instance (UUID) ON DELETE SET NULL ON UPDATE CASCADE, networkElementId2 TEXT REFERENCES element_instance (UUID) ON DELETE SET NULL ON UPDATE CASCADE, elemen1PortId INTEGER REFERENCES element_instance_port (ID) ON DELETE SET NULL ON UPDATE CASCADE, satellitePortId INTEGER REFERENCES satellite_port (ID) ON DELETE SET NULL ON UPDATE CASCADE);\nCREATE TABLE element_instance_connections (ID INTEGER PRIMARY KEY AUTOINCREMENT, source_element_instance TEXT, destination_element_instance TEXT);\nCREATE TABLE element (ID INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, description TEXT, category TEXT, container_image TEXT, publisher TEXT, diskRequired BIGINT, ram_required BIGINT, picture BIGINT, config TEXT, is_public TINYINT (1), org_id BIGINT, registry_id INTEGER REFERENCES registry (ID) ON DELETE SET NULL ON UPDATE CASCADE);\nINSERT INTO element VALUES(1,'Stream Viewer','The built-in stream viewer for ioIntegrator Linux edition','Utilities','iotracks/catalog:stream-viewer-1.0','SYSTEM',0,0,'none.png',NULL,1,0,1);\nINSERT INTO element VALUES(2,'Debug Console','The built-in debug console for ioIntegrator Linux edition','Utilities','iotracks/catalog:debug','SYSTEM',0,0,'none.png',NULL,1,0,1);\nINSERT INTO element VALUES(3,'Networking Tool','The built-in networking tool for ioIntegrator Linux edition','Utilities','iotracks/catalog:core-networking-1-12','SYSTEM',0,0,'none.png',NULL,1,0,1);\nINSERT INTO element VALUES(4,'Hello Web Demo','A simple web server for you to test your ioFog','Demos','iotracks/catalog:hello-web-1','iotracks',0,0,'images/build/4.png',NULL,1,0,1);\nINSERT INTO element VALUES(5,'RESTBlue','Bluetooth RESTful API','Utilities','iotracks/catalog:bluetooth-rest-api-v0.5','SYSTEM',0,0,'none.png',NULL,1,0,1);\nINSERT INTO element VALUES(8,'Open Weather Map Data','A stream of data from the Open Weather Map API in JSON format','Sensors','iotracks/catalog:open-weather-map-v1.06','iotracks',0,0,'images/build/8.png',NULL,1,0,1);\nINSERT INTO element VALUES(49,'JSON REST API','A configurable REST API that gives JSON output','Utilities','iotracks/catalog:json-rest-api-v1.04','iotracks',0,0,'images/build/49.png',NULL,1,0,1);\nINSERT INTO element VALUES(58,'Temperature Converter','A simple temperature format converter','Utilities','iotracks/catalog:temperature-conversion-v1.03','iotracks',0,0,'images/build/58.png',NULL,1,0,1);\nCREATE TABLE element_input_type (ID INTEGER PRIMARY KEY AUTOINCREMENT, element_key BIGINT REFERENCES element (ID) ON DELETE CASCADE ON UPDATE CASCADE, info_type TEXT, info_format TEXT);\nCREATE TABLE element_output_type (ID INTEGER PRIMARY KEY AUTOINCREMENT, element_key BIGINT REFERENCES element (ID) ON DELETE CASCADE ON UPDATE CASCADE, info_type TEXT, info_format TEXT);\nCREATE TABLE satellite_port (ID INTEGER PRIMARY KEY AUTOINCREMENT, port1 BIGINT, port2 BIGINT, max_connections_port1 BIGINT, max_connection_port2 BIGINT, passcode_port1 TEXT, passcode_port2 TEXT, heartbeat_absence_threshold_port1 BIGINT, heartbeat_absence_threshold_port2 BIGINT, updated_by BIGINT, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, satellite_id INTEGER REFERENCES satellite (ID) ON DELETE CASCADE ON UPDATE CASCADE, mapping_id TEXT);\nCREATE TABLE iofog_provision_keys (ID INTEGER PRIMARY KEY AUTOINCREMENT, provisioning_string VARCHAR (100), expiration_time BIGINT, iofog_uuid TEXT REFERENCES iofogs (UUID) ON DELETE SET NULL ON UPDATE CASCADE);\nINSERT INTO iofog_provision_keys VALUES(79,'jX3QfQvQ',1517402261932,'fVmnRpHgdNnDw7XJLJw7GV4NVRhjk4V3');\nCREATE TABLE iofogs (UUID TEXT PRIMARY KEY, Name TEXT DEFAULT ('Unnamed ioFog 1'), Location TEXT, Latitude TEXT, Longitude TEXT, OrgID BIGINT, Description TEXT, created_at DATETIME, updated_at DATETIME, LastActive BIGINT, Token TEXT, DaemonStatus TEXT DEFAULT 'UNKNOWN', DaemonOperatingDuration BIGINT DEFAULT 0, DaemonLastStart BIGINT, MemoryUsage FLOAT DEFAULT 0, DiskUsage FLOAT DEFAULT 0, CPUUsage FLOAT DEFAULT 0, MemoryViolation TEXT, DiskViolation TEXT, CPUViolation TEXT, ElementStatus TEXT, RepositoryCount BIGINT, RepositoryStatus TEXT, SystemTime BIGINT, LastStatusTime BIGINT, IPAddress TEXT DEFAULT '0.0.0.0', ProcessedMessages BIGINT DEFAULT 0, ElementMessageCounts TEXT, MessageSpeed BIGINT, LastCommandTime BIGINT, NetworkInterface TEXT DEFAULT 'eth0', DockerURL TEXT DEFAULT 'unix:///var/run/docker.sock', DiskLimit FLOAT DEFAULT 50, DiskDirectory TEXT DEFAULT ('/var/lib/iofog/'), MemoryLimit FLOAT DEFAULT 4096, CPULimit FLOAT DEFAULT 80, LogLimit FLOAT DEFAULT 10, LogDirectory TEXT DEFAULT ('/var/log/iofog/'), Debug INTEGER, Viewer INTEGER, Bluetooth INTEGER, IsolatedDockerContainer INTEGER, LogFileCount BIGINT DEFAULT 10, Version TEXT, StatusFrequency INTEGER DEFAULT (10), ChangeFrequency INTEGER DEFAULT (20), typeKey INTEGER REFERENCES iofog_type (ID) ON DELETE SET NULL ON UPDATE CASCADE);\nCREATE TABLE iofog_type (ID INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT, Image TEXT, Description TEXT, StreamViewerElementKey BIGINT, consoleElementKey BIGINT, NetworkElementKey BIGINT, BluetoothElementKey BIGINT);\nINSERT INTO iofog_type VALUES(1,'Standard Linux (x86)','iointegrator1.png','A standard Linux server of at least moderate processing power and capacity. Compatible with common Linux types such as Ubuntu, Red Hat, and CentOS.',1,2,3,5);\nINSERT INTO iofog_type VALUES(2,'ARM Linux','iointegrator2.png','A version of ioFog meant to run on Linux systems with ARM processors. Microservices for this ioFog type will be tailored to ARM systems.',1,2,3,5);\nCREATE TABLE element_instance (ID INTEGER PRIMARY KEY AUTOINCREMENT, UUID TEXT UNIQUE, track_id BIGINT, element_key BIGINT, config BIGINT, name TEXT, updated_by BIGINT, config_last_updated BIGINT, is_stream_viewer TINYINT (1), is_debug_console TINYINT (1), is_manager TINYINT (1), is_network TINYINT (1), registry_id BIGINT, rebuild TINYINT (1), root_host_access TINYINT (1), log_size TINYINT (1), created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, volume_mappings TEXT, element_id INTEGER REFERENCES element (ID) ON DELETE SET NULL ON UPDATE CASCADE, iofog_uuid TEXT REFERENCES iofogs (UUID) ON DELETE SET NULL ON UPDATE CASCADE);\nCREATE TABLE iofog_access_tokens (ID INTEGER PRIMARY KEY AUTOINCREMENT, user_id INTEGER, expiration_time BIGINT, token TEXT, iofog_uuid TEXT REFERENCES iofogs (UUID) ON DELETE CASCADE ON UPDATE CASCADE);\nCREATE TABLE users (ID INTEGER PRIMARY KEY AUTOINCREMENT, first_name VARCHAR (100), last_name VARCHAR (100), email VARCHAR (100), password VARCHAR (100), temp_password TEXT, email_activated INTEGER, user_access_token TEXT);\nINSERT INTO users VALUES(43,'Admin','Admin','admin@admin.admin','admin',NULL,1000,'6eb5117a227868387324017f64dc7e2b2ab299b10b5fc5927ba516fd4a6794b6');\nCREATE TABLE email_activation_code (ID INTEGER PRIMARY KEY AUTOINCREMENT, user_id INTEGER REFERENCES users (ID) ON DELETE CASCADE ON UPDATE CASCADE, activation_code TEXT, expiration_time BIGINT);\nINSERT INTO email_activation_code VALUES(35,43,'XPMDjGP6fbQdB4py',1517495034248);\nCREATE TABLE registry (ID INTEGER PRIMARY KEY AUTOINCREMENT, url TEXT, is_public INTEGER, secure INTEGER, certificate TEXT, requires_cert INTEGER, user_name TEXT, password TEXT, user_email BIGINT, iofog_uuid TEXT REFERENCES iofogs (UUID));\nINSERT INTO registry VALUES(1,'registry.hub.docker.com',1,1,'',0,'','','',NULL);\nCREATE TABLE iofog_change_tracking (\n\t`ID`\tINTEGER PRIMARY KEY AUTOINCREMENT,\n\t`container_config`\tBIGINT,\n\t`container_list`\tBIGINT,\n\t`config`\tBIGINT,\n\t`routing`\tBIGINT,\n\t`registries`\tBIGINT,\n\t`iofog_uuid`\tTEXT,\n\tFOREIGN KEY(`iofog_uuid`) REFERENCES iofogs ( UUID ) ON DELETE SET NULL ON UPDATE CASCADE\n);\nINSERT INTO iofog_change_tracking VALUES(1,1517401049283,1517472938429,1517472938429,1517401049283,1517401049283,'fVmnRpHgdNnDw7XJLJw7GV4NVRhjk4V3');\nDELETE FROM sqlite_sequence;\nINSERT INTO sqlite_sequence VALUES('config',52);\nINSERT INTO sqlite_sequence VALUES('satellite',9);\nINSERT INTO sqlite_sequence VALUES('data_tracks',90);\nINSERT INTO sqlite_sequence VALUES('routing',196);\nINSERT INTO sqlite_sequence VALUES('element_instance_port',650);\nINSERT INTO sqlite_sequence VALUES('iofog_console',256);\nINSERT INTO sqlite_sequence VALUES('stream_viewer',257);\nINSERT INTO sqlite_sequence VALUES('instance_track',0);\nINSERT INTO sqlite_sequence VALUES('element_advertised_port',0);\nINSERT INTO sqlite_sequence VALUES('iofog_users',193);\nINSERT INTO sqlite_sequence VALUES('element_fog_types',181);\nINSERT INTO sqlite_sequence VALUES('network_pairing',644);\nINSERT INTO sqlite_sequence VALUES('element_instance_connections',68);\nINSERT INTO sqlite_sequence VALUES('element',226);\nINSERT INTO sqlite_sequence VALUES('element_input_type',100);\nINSERT INTO sqlite_sequence VALUES('element_output_type',92);\nINSERT INTO sqlite_sequence VALUES('satellite_port',639);\nINSERT INTO sqlite_sequence VALUES('iofog_provision_keys',79);\nINSERT INTO sqlite_sequence VALUES('iofog_type',2);\nINSERT INTO sqlite_sequence VALUES('element_instance',1048);\nINSERT INTO sqlite_sequence VALUES('iofog_access_tokens',21);\nINSERT INTO sqlite_sequence VALUES('users',43);\nINSERT INTO sqlite_sequence VALUES('email_activation_code',35);\nINSERT INTO sqlite_sequence VALUES('registry',1);\nINSERT INTO sqlite_sequence VALUES('iofog_change_tracking',1);\nCOMMIT;\n
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- db/default.sql	(revision b36c16160e760507b90134cdc320524aea5124e2)
+++ db/default.sql	(date 1518695598000)
@@ -67,6 +67,22 @@
 	`iofog_uuid`	TEXT,
 	FOREIGN KEY(`iofog_uuid`) REFERENCES iofogs ( UUID ) ON DELETE SET NULL ON UPDATE CASCADE
 );
+CREATE TABLE hw_info (
+	`ID` INTEGER PRIMARY KEY AUTOINCREMENT,
+	`info` TEXT,
+	`iofog_uuid`	TEXT,
+	`created_at`	DATETIME NOT NULL,
+	`updated_at`	DATETIME NOT NULL,
+	FOREIGN KEY(`iofog_uuid`) REFERENCES iofogs ( UUID ) ON DELETE SET NULL ON UPDATE CASCADE
+);
+CREATE TABLE usb_info (
+	`ID` INTEGER PRIMARY KEY AUTOINCREMENT,
+	`info` TEXT,
+	`iofog_uuid`	TEXT,
+	`created_at`	DATETIME NOT NULL,
+	`updated_at`	DATETIME NOT NULL,
+	FOREIGN KEY(`iofog_uuid`) REFERENCES iofogs ( UUID ) ON DELETE SET NULL ON UPDATE CASCADE
+);
 INSERT INTO iofog_change_tracking VALUES(1,1517401049283,1517472938429,1517472938429,1517401049283,1517401049283,'fVmnRpHgdNnDw7XJLJw7GV4NVRhjk4V3');
 DELETE FROM sqlite_sequence;
 INSERT INTO sqlite_sequence VALUES('config',52);
Index: src/server/controllers/api/instanceResourcesController.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/server/controllers/api/instanceResourcesController.js	(date 1518619989000)
+++ src/server/controllers/api/instanceResourcesController.js	(date 1518619989000)
@@ -0,0 +1,76 @@
+/**
+ * @file fogController.js
+ * @author elukashick
+ * @description This file includes the implementation of the status end-point
+ */
+
+import async from 'async';
+import express from 'express';
+const router = express.Router();
+
+import AppUtils from '../../utils/appUtils';
+import logger from '../../utils/winstonLogs';
+import instanceResourcesService from "../../services/instanceResourcesService";
+
+
+/********************************************* EndPoints ******************************************************/
+
+/******************** Fog Instance HWInfo (Post: /api/v2/instance/hw_info/id/:ID/token/:Token) ******************/
+const fogInstanceHWInfo = function (req, res) {
+    logger.info("Endpoint hit: " + req.originalUrl);
+
+    var params = {},
+        fogHWInfo = {
+            fogInfo: 'body.info',
+            uuid: 'params.ID',
+            setProperty: 'fogHWInfo'
+        };
+
+    params.body = req.body;
+    params.params = req.params;
+    logger.info("Parameters:" + JSON.stringify(params.bodyParams));
+
+    async.waterfall([
+            async.apply(instanceResourcesService.saveHWInfo, fogHWInfo, params),
+        ],
+        function (err, result) {
+            var output;
+            if (!err) {
+                output = params.params.ID;
+            }
+            AppUtils.sendResponse(res, err, 'uuid', output, result);
+        });
+};
+/******************** Fog Instance USBInfo (Post: /api/v2/instance/usb_info/id/:ID/token/:Token) ******************/
+const fogInstanceUSBInfo = function (req, res) {
+    logger.info("Endpoint hit: " + req.originalUrl);
+
+    var params = {},
+        fogUSBInfo = {
+            fogInfo: 'body.info',
+            uuid: 'params.ID',
+            setProperty: 'fogHWInfo'
+        };
+
+    params.body = req.body;
+    params.params = req.params;
+    logger.info("Parameters:" + JSON.stringify(params.bodyParams));
+
+    async.waterfall([
+            async.apply(instanceResourcesService.saveUSBInfo, fogUSBInfo, params),
+        ],
+        function (err, result) {
+            var output;
+            if (!err) {
+                output = params.params.ID;
+            }
+            AppUtils.sendResponse(res, err, 'uuid', output, result);
+        });
+};
+
+
+
+export default {
+    fogInstanceHWInfo: fogInstanceHWInfo,
+    fogInstanceUSBInfo: fogInstanceUSBInfo,
+};
\ No newline at end of file
Index: src/server/managers/HWInfoManager.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/server/managers/HWInfoManager.js	(date 1518619989000)
+++ src/server/managers/HWInfoManager.js	(date 1518619989000)
@@ -0,0 +1,63 @@
+/**
+ * @file HWInfoManager.js
+ * @author elukashick
+ * @description
+ */
+
+import HWInfo from './../models/hwInfo';
+import BaseManager from './../managers/baseManager';
+import sequelize from './../utils/sequelize';
+
+class HWInfoManager extends BaseManager {
+  getEntity() {
+      return HWInfoManager;
+    }
+    /**
+     * @desc - finds info based on the instanceId
+     * @param Integer - instanceId
+     * @return JSON - returns a JSON object of hwInfo
+     */
+  findByInstanceId(instanceId) {
+      return HWInfo.find({
+        where: {
+          uuid: instanceId
+        }
+      });
+    }
+    /**
+     * @desc - updates
+     * @param Integer, JSON object - instanceId, info
+     * @return Integer - returns the number of rows updated
+     */
+  updateInfo(instanceId, info) {
+      return HWInfo.update(info, {
+        where: {
+          uuid: instanceId
+        }
+      });
+    }
+
+    /**
+     * @desc - saves info
+     * @param JSON object - info
+     * @return Integer - returns the number of rows created
+     */
+  saveInfo(info) {
+      return HWInfo.create(info);
+    }
+    /**
+     * @desc - deletes the info based on the instanceId
+     * @param String - instanceId
+     * @return  Integer - returns the number of rows deleted
+     */
+  deleteByInstanceId(instanceId) {
+    return HWInfo.destroy({
+      where: {
+        uuid: instanceId
+      }
+    });
+  }
+}
+
+const instance = new HWInfoManager();
+export default instance;
\ No newline at end of file
Index: src/server/managers/usbInfoManager.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/server/managers/usbInfoManager.js	(date 1518619989000)
+++ src/server/managers/usbInfoManager.js	(date 1518619989000)
@@ -0,0 +1,103 @@
+/**
+ * @file usbInfoManager.js
+ * @author elukashick
+ */
+
+import USBInfo from './../models/usbInfo';
+import BaseManager from './../managers/baseManager';
+import sequelize from './../utils/sequelize';
+import sequelizeUtils from "../utils/sequelizeUtils";
+
+class USBInfoManager extends BaseManager {
+    getEntity() {
+        return USBInfoManager;
+    }
+
+    /**
+     * @desc - finds info based on the instanceId
+     * @param Integer - instanceId
+     * @return JSON - returns a JSON object of usbInfo
+     */
+    findByInstanceId(instanceId) {
+        return USBInfo.find({
+            where: {
+                iofog_uuid: instanceId
+            }
+        });
+    }
+
+    //todo: FK to iofog_uuid!
+    // upsert(infoObject) {
+    //     this.findByInstanceId(infoObject.iofog_uuid)
+    //         .then(this.updateInfo(infoObject.iofog_uuid, infoObject));
+    // }
+    // upsert(uui, infoObject) {
+    //     this.findByInstanceId(uui)
+    //         .then((data) => {
+    //             if (data != null) {
+    //                 return this.updateInfo(uui, data)
+    //             } else {
+    //                 return this.saveInfo(infoObject)
+    //             }
+    //         });
+    //
+    // upsert(uui, infoObject) {
+    //     return this.findByInstanceId(uui)
+    //         .then((data) => {
+    //             return this.updateInfo(uui, data)
+    //         })
+    //         .catch(() => this.saveInfo(infoObject));
+    // }
+
+
+    upsert(uui, object) {
+        //find the new content by id
+        return this.findByInstanceId(uui) //todo: uui change to id
+            .then((dbObject) => {
+                //if obj is invalid create new obj
+                if (null == dbObject) {
+                    return this.saveInfo(object)
+                } else {
+                    return this.updateInfo(uui, object)
+                }
+            });
+    }
+
+    /**
+     * @desc - updates
+     * @param Integer, JSON object - instanceId, info
+     * @return Integer - returns the number of rows updated
+     */
+    updateInfo(instanceId, info) {
+        return USBInfo.update(info, {
+            where: {
+                iofog_uuid: instanceId
+            }
+        });
+    }
+
+    /**
+     * @desc - saves info
+     * @param JSON object - info
+     * @return Integer - returns the number of rows created
+     */
+    saveInfo(infoObject) {
+        return USBInfo.create(infoObject);
+    }
+
+    /**
+     * @desc - deletes the info based on the instanceId
+     * @param String - instanceId
+     * @return  Integer - returns the number of rows deleted
+     */
+    deleteByInstanceId(instanceId) {
+        return USBInfo.destroy({
+            where: {
+                iofog_uuid: instanceId
+            }
+        });
+    }
+}
+
+const instance = new USBInfoManager();
+export default instance;
\ No newline at end of file
Index: src/server/models/hwInfo.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/server/models/hwInfo.js	(date 1518619989000)
+++ src/server/models/hwInfo.js	(date 1518619989000)
@@ -0,0 +1,41 @@
+/**
+ * @author elukashick
+ * @description This file includes a hw_info model used by sequalize for ORM;
+ */
+
+import Sequelize from 'sequelize';
+import sequelize from './../utils/sequelize';
+import Fog from './fog'
+
+const HWInfo = sequelize.define('hw_info', {
+
+    id: {
+        type: Sequelize.INTEGER,
+        primaryKey: true,
+        autoIncrement: true,
+        field: 'ID'
+    },
+    iofog_uuid: {
+        type: Sequelize.TEXT,
+        field: 'iofog_uuid'
+    },
+    info: {
+        type: Sequelize.TEXT,
+        defaultValue: " ",
+        field: 'info'
+    }
+}, {
+    // add the timestamp attributes (updatedAt, createdAt)
+    timestamps: true,
+    // disable the modification of table names
+    freezeTableName: true,
+    // don't use camelcase for automatically added attributes but underscore style
+    // so updatedAt will be updated_at
+    underscored: true
+});
+
+HWInfo.belongsTo(Fog, {
+    foreignKey: 'iofog_uuid'
+});
+
+export default HWInfo;
\ No newline at end of file
Index: src/server/models/usbInfo.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/server/models/usbInfo.js	(date 1518619989000)
+++ src/server/models/usbInfo.js	(date 1518619989000)
@@ -0,0 +1,41 @@
+/**
+ * @author elukashick
+ * @description This file includes a usb_info model used by sequalize for ORM;
+ */
+
+import Sequelize from 'sequelize';
+import sequelize from './../utils/sequelize';
+import Fog from './fog'
+
+const USBInfo = sequelize.define('usb_info', {
+
+    id: {
+        type: Sequelize.INTEGER,
+        primaryKey: true,
+        autoIncrement: true,
+        field: 'ID'
+    },
+    iofog_uuid: {
+        type: Sequelize.TEXT,
+        field: 'iofog_uuid'
+    },
+    info: {
+        type: Sequelize.TEXT,
+        defaultValue: " ",
+        field: 'info'
+    }
+}, {
+    // add the timestamp attributes (updatedAt, createdAt)
+    timestamps: true,
+    // disable the modification of table names
+    freezeTableName: true,
+    // don't use camelcase for automatically added attributes but underscore style
+    // so updatedAt will be updated_at
+    underscored: true
+});
+
+USBInfo.belongsTo(Fog, {
+    foreignKey: 'iofog_uuid'
+});
+
+export default USBInfo;
\ No newline at end of file
Index: src/server/services/instanceResourcesService.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/server/services/instanceResourcesService.js	(date 1518628359000)
+++ src/server/services/instanceResourcesService.js	(date 1518628359000)
@@ -0,0 +1,43 @@
+/**
+ * @author elukashick
+ */
+
+import HWInfoManager from '../managers/HWInfoManager';
+import USBInfoManager from '../managers/usbInfoManager';
+import AppUtils from "../utils/appUtils";
+
+const saveHWInfo = function(props, params, callback) {
+
+    var info = AppUtils.getProperty(params, props.fogInfo),
+        uuid = AppUtils.getProperty(params, props.uuid);
+
+    var config = {
+        info: info//,
+        // iofog_uuid: uuid
+    };
+
+    HWInfoManager
+        .saveInfo(config)
+        .then(AppUtils.onCreate.bind(null, params, props.setProperty, 'Unable to save HW Info.', callback));
+}
+
+const saveUSBInfo = function(props, params, callback) {
+
+    var info = AppUtils.getProperty(params, props.fogInfo),
+        uuid = AppUtils.getProperty(params, props.uuid);
+
+    var config = {
+        info: info,
+        iofog_uuid: uuid
+    };
+
+    USBInfoManager
+        .upsert(uuid, config)
+        //.updateInfo(uuid, config)
+        .then(AppUtils.onCreate.bind(null, params, props.setProperty, 'Unable to save USB Info.', callback));
+}
+
+export default {
+    saveHWInfo: saveHWInfo,
+    saveUSBInfo: saveUSBInfo,
+};
\ No newline at end of file
Index: src/server.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
<+>import bodyParser from 'body-parser';\nimport cookieParser from 'cookie-parser';\nconst express = require('express');\nimport expressSession from 'express-session';\nimport fs from 'fs';\nimport https from 'https';\nconst path = require('path');\nimport session from 'express-session';\n\nimport appConfig from './config.json';\nimport appUtils from './server/utils/appUtils';\nimport configUtil from './server/utils/configUtil';\nimport constants from './server/constants.js';\n\nimport baseController from './server/controllers/baseController';\nimport elementInstanceController from './server/controllers/api/elementInstanceController';\nimport elementController from './server/controllers/api/elementController';\nimport fogController from './server/controllers/api/fogController';\nimport instanceStatusController from './server/controllers/api/instanceStatusController';\nimport instanceConfigController from './server/controllers/api/instanceConfigController';\nimport instanceContainerListController from './server/controllers/api/instanceContainerListController';\nimport instanceChangesController from './server/controllers/api/instanceChangesController';\nimport instanceRegistriesController from './server/controllers/api/instanceRegistriesController';\nimport instanceRoutingController from './server/controllers/api/instanceRoutingController';\nimport instanceContainerConfigController from './server/controllers/api/instanceContainerConfigController';\nimport integratorController from './server/controllers/api/integratorController';\nimport provisionKeyController from './server/controllers/api/provisionKeyController';\nimport streamViewerController from './server/controllers/api/streamViewerController';\nimport trackController from './server/controllers/api/trackController';\nimport userController from './server/controllers/api/userController';\n\nimport logger from './server/utils/winstonLogs';\n\nconst startServer = function (port) {\n  let app,\n    dbPort,\n    sslKey,\n    sslCert,\n    intermedKey;\n\n  app = initApp();\n\n  configUtil.getAllConfigs()\n    .then(() => {\n      if (!port) {\n        dbPort = configUtil.getConfigParam(constants.CONFIG.port);\n        if (dbPort) {\n          port = dbPort;\n        } else {\n          port = appConfig.port;\n        }\n      }\n      sslKey = configUtil.getConfigParam(constants.CONFIG.ssl_key);\n      sslCert = configUtil.getConfigParam(constants.CONFIG.ssl_cert);\n      intermedKey = configUtil.getConfigParam(constants.CONFIG.intermediate_cert);\n\n      if (sslKey && sslCert && intermedKey) {\n        startHttpsServer(app, port, sslKey, sslCert, intermedKey);\n      } else {\n        startHttpServer(app, port);\n      }\n    });\n}\n\nconst initApp = function () {\n  const app = express();\n\n  // parse application/x-www-form-urlencoded\n  app.use(bodyParser.urlencoded({\n    extended: true\n  }))\n  // parse application/json\n  app.use(bodyParser.json())\n  app.engine('ejs', require('ejs').renderFile);\n  app.set('view engine', 'ejs');\n  app.use(cookieParser());\n\n  // CORS Enabled\n  app.use(function (req, res, next) {\n    res.header(\"Access-Control-Allow-Origin\", \"*\");\n    res.header(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept\");\n    next();\n  });\n\n  app.set('views', path.join(__dirname, 'views'));\n\n  app.get('/', baseController.mainPageEndPoint);\n  app.post('/api/v1/user/login', userController.validateUserEndPoint);\n  app.post('/api/v1/user/logout', userController.logoutUserEndPoint);\n\n  app.get('/api/v2/status', fogController.getFogControllerStatusEndPoint);\n  app.post('/api/v2/status', fogController.getFogControllerStatusEndPoint);\n  app.get('/api/v2/instance/create/type/:type', fogController.fogInstanceCreateEndPoint);\n  // app.get('/api/v2/instance/getfabriclist', fogController.getFogListEndPoint);\n  app.get('/api/v2/authoring/element/get', elementController.getElementsForPublishingEndPoint);\n  app.post('/api/v2/authoring/organization/element/create', elementController.createElementEndPoint);\n  app.post('/api/v2/authoring/organization/element/update', elementController.updateElementEndPoint);\n  app.post('/api/v2/authoring/organization/element/delete', elementController.deleteElementEndPoint);\n  app.get('/api/v2/authoring/element/catalog/get', elementController.getCatalogOfElements);\n  app.post('/api/v2/authoring/element/instance/create', elementInstanceController.detailedElementInstanceCreateEndPoint);\n  app.post('/api/v2/authoring/build/element/instance/create', elementInstanceController.elementInstanceCreateEndPoint);\n  app.post('/api/v2/authoring/integrator/instance/create', integratorController.integratorInstanceCreateEndPoint);\n  app.post('/api/v2/authoring/fabric/instance/create', integratorController.integratorInstanceCreateEndPoint);\n  app.post('/api/v2/authoring/integrator/instance/update', integratorController.integratorInstanceUpdateEndPoint);\n  app.post('/api/v2/authoring/element/instance/update', elementInstanceController.elementInstanceUpdateEndPoint);\n  app.post(['/api/v2/authoring/element/instance/config/update', '/api/v2/authoring/element/instance/name/update',],\n    elementInstanceController.elementInstanceConfigUpdateEndPoint);\n  app.post('/api/v2/authoring/element/instance/delete', elementInstanceController.elementInstanceDeleteEndPoint);\n  app.get('/api/v2/authoring/fabric/viewer/access', streamViewerController.fogViewerAccessEndPoint);\n  app.get('/api/v2/instance/config/id/:ID/token/:Token', instanceConfigController.instanceConfigEndPoint);\n  app.post('/api/v2/instance/config/id/:ID/token/:Token', instanceConfigController.instanceConfigEndPoint);\n  app.post('/api/v2/instance/config/changes/id/:ID/token/:Token', instanceConfigController.instanceConfigChangesEndPoint);\n  app.post('/api/v2/instance/status/id/:ID/token/:Token', instanceStatusController.instanceStatusEndPoint);\n  app.post('/api/v2/authoring/element/instance/comsat/pipe/create', elementInstanceController.elementInstanceComsatPipeCreateEndPoint);\n  app.post('/api/v2/authoring/element/instance/comsat/pipe/delete', elementInstanceController.elementInstanceComsatPipeDeleteEndPoint);\n  app.post('/api/v2/authoring/element/instance/port/create', elementInstanceController.elementInstancePortCreateEndPoint);\n  app.post('/api/v2/authoring/element/instance/port/delete', elementInstanceController.elementInstancePortDeleteEndPoint);\n  app.get('/api/v2/authoring/integrator/instances/list/:t', fogController.fogInstancesListEndPoint); //\n  app.post('/api/v2/authoring/fabric/instances/list', fogController.fogInstancesListEndPoint);\n  app.post('/api/v2/authoring/integrator/instance/delete', fogController.integratorInstanceDeleteEndPoint);\n  app.get('/api/v2/instance/changes/id/:ID/token/:Token/timestamp/:TimeStamp', instanceChangesController.getChangeTrackingChangesEndPoint);\n  app.post('/api/v2/instance/changes/id/:ID/token/:Token/timestamp/:TimeStamp', instanceChangesController.getChangeTrackingChangesEndPoint);\n  app.get('/api/v2/instance/containerconfig/id/:ID/token/:Token', instanceContainerConfigController.containerConfigEndPoint);\n  app.post('/api/v2/instance/containerconfig/id/:ID/token/:Token', instanceContainerConfigController.containerConfigEndPoint);\n  app.get('/api/v2/instance/containerlist/id/:ID/token/:Token', instanceContainerListController.containerListEndPoint);\n  app.post('/api/v2/instance/containerlist/id/:ID/token/:Token', instanceContainerListController.containerListEndPoint);\n  app.post('/api/v2/authoring/user/track/update', trackController.userTrackUpdateEndPoint);\n  app.get('/api/v2/instance/registries/id/:ID/token/:Token', instanceRegistriesController.instanceRegistriesEndPoint);\n  app.post('/api/v2/instance/registries/id/:ID/token/:Token', instanceRegistriesController.instanceRegistriesEndPoint);\n  app.get('/api/v2/instance/routing/id/:ID/token/:Token', instanceRoutingController.instanceRoutingEndPoint);\n  app.post('/api/v2/instance/routing/id/:ID/token/:Token', instanceRoutingController.instanceRoutingEndPoint);\n  app.post('/api/v2/authoring/element/instance/route/create', instanceRoutingController.instanceRouteCreateEndPoint);\n  app.post('/api/v2/authoring/element/instance/route/delete', instanceRoutingController.instanceRouteDeleteEndPoint);\n  app.get('/api/v2/authoring/fabric/provisioningkey/instanceid/:instanceId', provisionKeyController.getProvisionKeyEndPoint);\n  app.get('/api/v2/instance/provision/key/:provisionKey/fabrictype/:fabricType', provisionKeyController.fogProvisionKeyEndPoint);\n  app.post('/api/v2/instance/provision/key/:provisionKey/fabrictype/:fabricType', provisionKeyController.fogProvisionKeyEndPoint);\n  app.post('/api/v2/authoring/fabric/provisioningkey/list/delete', provisionKeyController.deleteProvisionKeyEndPoint);\n  app.get('/api/v2/authoring/fabric/track/list/:instanceId', trackController.fogTrackListEndPoint);\n  app.post('/api/v2/authoring/element/connection/create', elementInstanceController.createElementInstanceConnectionEndPoint);\n  app.post('/api/v2/authoring/element/connection/delete', elementInstanceController.deleteElementInstanceConnectionEndPoint);\n  app.post('/api/v2/authoring/element/instance/rebuild', elementInstanceController.elementInstanceRebuildUpdateEndPoint);\n  app.get('/api/v2/authoring/element/instance/rebuild/status/elementid/:elementId', elementInstanceController.elementInstanceRebuildStatusEndPoint);\n  app.get('/api/v2/authoring/user/track/list/:t', trackController.getTracksForUser);\n  app.get('/api/v2/authoring/fabric/types/list', fogController.getFogTypesEndPoint);\n  app.get('/api/v2/authoring/element/instance/details/trackid/:trackId', elementInstanceController.getElementInstanceDetailsEndPoint);\n  app.post('/api/v2/authoring/element/instance/details/trackid/:trackId', elementInstanceController.getElementInstanceDetailsEndPoint);\n  app.post('/api/v2/authoring/build/properties/panel/get', elementInstanceController.getElementInstancePropertiesEndPoint);\n  app.post('/api/v2/authoring/user/track/create', trackController.userTrackCreateEndPoint);\n  app.post('/api/v2/authoring/user/track/delete', trackController.userTrackDeleteEndPoint);\n  app.get('/api/v2/authoring/fabric/track/element/list/:trackId', elementInstanceController.trackElementListEndPoint);\n  app.post('/api/v2/authoring/fabric/instance/delete', fogController.fogInstanceDeleteEndPoint);\n  app.post('/api/v2/authoring/fabric/instances/settings/update', fogController.updateFogSettingsEndpoint);\n  app.post('/api/v2/authoring/fabric/track/update', trackController.fogTrackUpdateEndPoint);\n  app.post('/api/v2/authoring/fabric/track/delete', trackController.fogTrackDeleteEndPoint);\n  app.post('/api/v2/authoring/fabric/details', fogController.getFogDetailsEndpoint);\n  app.post('/api/v2/authoring/element/module/create', elementController.createElementForUserEndPoint);\n  app.post('/api/v2/authoring/element/module/update', elementController.updateElementForUserEndPoint);\n  app.get('/api/v2/authoring/element/module/delete/moduleid/:moduleId', elementController.deleteElementForUserEndPoint);\n  app.get('/api/v2/authoring/element/module/details/moduleid/:moduleId', elementController.getElementDetailsEndPoint);\n  // app.post('/api/v2/authoring/fabric/instance/bluebox/add', fogController.addBlueboxEndpoint);\n\n  app.get('/api/v2/get/user/data/:t', userController.getUserDetailsEndPoint);\n  app.post('/api/v1/user/profile/update', userController.updateUserDetailsEndPoint);\n  app.post('/api/v1/user/password/change', userController.updateUserPasswordEndPoint);\n  app.post('/api/v1/user/account/delete', userController.deleteUserAccountEndPoint);\n  app.post('/api/v1/user/signup', userController.userSignupEndPoint);\n  app.post('/api/v1/user/password/reset', userController.resetUserPasswordEndPoint);\n  app.post('/api/v1/user/account/activate/resend', userController.resendEmailActivationEndPoint);\n  app.get('/account/activate/code/:code', userController.activateUserAccountEndPoint);\n  app.get('/api/v2/user/authenticate/:t', userController.authenticateUserEndPoint)\n\n  //generic error handler\n  app.use((err, req, res, next) => {\n    logger.error('App crashed with error: ' + err);\n    logger.error('App crashed with stack: ' + err.stack);\n    console.log('App crashed with error: ' + err);\n    console.log('App crashed with stack: ' + err.stack);\n    res.status(500).send('Hmm, what you have encountered is unexpected. If problem persists, contact app provider.');\n  });\n  return app;\n}\n\nconst startHttpServer = function (app, port) {\n  logger.warn(\"| SSL not configured, starting HTTP server.|\");\n\n  console.log(\"------------------------------------------\");\n  console.log(\"| SSL not configured, starting HTTP server.|\");\n  console.log(\"------------------------------------------\");\n\n  app.listen(port, function onStart(err) {\n    if (err) {\n      console.log(err);\n    }\n    logger.info('==> \uD83C\uDF0E Listening on port %s. Open up http://localhost:%s/ in your browser.', port, port);\n    console.log('==> \uD83C\uDF0E Listening on port %s. Open up http://localhost:%s/ in your browser.', port, port);\n  });\n}\n\nconst startHttpsServer = function (app, port, sslKey, sslCert, intermedKey) {\n  try {\n    let sslOptions = {\n      key: fs.readFileSync(sslKey),\n      cert: fs.readFileSync(sslCert),\n      ca: fs.readFileSync(intermedKey),\n      requestCert: true,\n      rejectUnauthorized: false\n    };\n\n    https.createServer(sslOptions, app).listen(port, function onStart(err) {\n      if (err) {\n        logger.error(err);\n        console.log(err);\n      }\n      logger.info('==> \uD83C\uDF0E HTTPS server listening on port %s. Open up https://localhost:%s/ in your browser.', port, port);\n      console.log('==> \uD83C\uDF0E HTTPS server listening on port %s. Open up https://localhost:%s/ in your browser.', port, port);\n    });\n  } catch (e) {\n    logger.error('ssl_key or ssl_cert or intermediate_cert is either missing or invalid. Provide valid SSL configurations.');\n    console.log('ssl_key or ssl_cert or intermediate_cert is either missing or invalid. Provide valid SSL configurations.');\n  }\n}\n\nexport default {\n  startServer: startServer\n};
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/server.js	(revision b36c16160e760507b90134cdc320524aea5124e2)
+++ src/server.js	(date 1518695377000)
@@ -16,6 +16,7 @@
 import elementInstanceController from './server/controllers/api/elementInstanceController';
 import elementController from './server/controllers/api/elementController';
 import fogController from './server/controllers/api/fogController';
+import instanceResourcesController from './server/controllers/api/instanceResourcesController';
 import instanceStatusController from './server/controllers/api/instanceStatusController';
 import instanceConfigController from './server/controllers/api/instanceConfigController';
 import instanceContainerListController from './server/controllers/api/instanceContainerListController';
@@ -90,7 +91,11 @@
 
   app.get('/api/v2/status', fogController.getFogControllerStatusEndPoint);
   app.post('/api/v2/status', fogController.getFogControllerStatusEndPoint);
-  app.get('/api/v2/instance/create/type/:type', fogController.fogInstanceCreateEndPoint);
+  app.post('/api/v2/instance/create/type/:type', fogController.fogInstanceCreateEndPoint);
+
+  app.post('/api/v2/instance/hw_info/id/:ID/token/:Token', instanceResourcesController.fogInstanceHWInfo);
+  app.post('/api/v2/instance/usb_info/id/:ID/token/:Token', instanceResourcesController.fogInstanceUSBInfo);
+
   // app.get('/api/v2/instance/getfabriclist', fogController.getFogListEndPoint);
   app.get('/api/v2/authoring/element/get', elementController.getElementsForPublishingEndPoint);
   app.post('/api/v2/authoring/organization/element/create', elementController.createElementEndPoint);
