Skip to content

Commit

Permalink
Merge pull request #8 from gologo13/master
Browse files Browse the repository at this point in the history
Add /api/wlan/host-list endpoint
  • Loading branch information
ishan-marikar authored Oct 1, 2020
2 parents 00bbb3d + 0d1d2f2 commit 69b9608
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ var API = HuaweiRouter.prototype;
module.exports = HuaweiRouter;
module.exports.create = create;


API.getHostList = function(token, callback) {
var uri = url('http://', this.options.gateway, '/api/wlan/host-list');
utilities.contactRouter(uri, token, null, function(error, response) {
callback(error, response);
});
};

API.getMonthStatistics = function (token, callback) {
var uri = url('http://', this.options.gateway, '/api/monitoring/month_statistics');
utilities.contactRouter(uri, token, null, function (error, response) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"xml2js": "^0.4.16"
},
"devDependencies": {
"chai": "^4.2.0",
"mocha": "^3.2.0",
"should": "^11.1.2"
},
Expand Down
12 changes: 12 additions & 0 deletions tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ describe('getSignal', function() {
});
});

describe('getHostList', function() {
it('should respond with the host-list information on the router ', function(done) {
var router = new Router();
router.getToken(function(error, token) {
router.getHostList(token, function(error, response) {
expect(response).to.have.property('Hosts');
done();
});
});
});
});

describe('getStatus', function() {
it('should respond with the status information on the router ', function(done) {
var router = new Router();
Expand Down

0 comments on commit 69b9608

Please sign in to comment.