From 74acb93d8f49b464e7db58a62ea4d7a42fcd26e5 Mon Sep 17 00:00:00 2001 From: Pedro Dias Date: Tue, 30 Jun 2015 18:23:11 +0100 Subject: [PATCH] vm.monitoring, version bump --- lib/vm.js | 7 +++++++ package.json | 2 +- test/vm.js | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/vm.js b/lib/vm.js index 73577b6..b6c8560 100644 --- a/lib/vm.js +++ b/lib/vm.js @@ -10,6 +10,13 @@ VM.prototype.info = function(callback) { }); }; +VM.prototype.monitoring = function(callback) { + this.modem.call('vm.monitoring', [this.id], function(err, data) { + if (err) return callback(err); + callback(null, data); + }); +}; + VM.prototype.action = function(action, callback) { this.modem.call('vm.action', [action, this.id], function(err, data) { if (err) return callback(err); diff --git a/package.json b/package.json index ff9676a..51e27f3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "opennebula", "description": "OpenNebula XML-RPC API client.", - "version": "1.0.6", + "version": "1.0.7", "author": "Pedro Dias ", "maintainers": [ "apocas " diff --git a/test/vm.js b/test/vm.js index 90484df..30963dd 100644 --- a/test/vm.js +++ b/test/vm.js @@ -9,7 +9,7 @@ describe("#vm", function() { it("should create a vm", function(done) { this.timeout(5000); - one.createVM('GRAPHICS=[TYPE="vnc",LISTEN="0.0.0.0"]\nMEMORY="1024"\n FROM_APP="53e767ba8fb81d6a69000001"\nVCPU="1"\nFROM_APP_NAME="CentOS 6.5 - KVM"\nOS=[ARCH="x86_64"]\n NIC=[NETWORK="private"]\nLOGO="images/logos/centos.png"\nCPU="0.5"\n DISK=[IMAGE="CentOS-6.5-one-4.8",IMAGE_UNAME="oneadmin"]\n', false, function(err, vm) { + one.createVM('GRAPHICS=[TYPE="vnc",LISTEN="0.0.0.0"]\nMEMORY="512"\nVCPU="1"\nOS=[ARCH="x86_64"]\n NIC=[NETWORK="cloud"]\nCPU="0.5"\n DISK=[IMAGE="ttylinux",IMAGE_UNAME="oneadmin"]\n', false, function(err, vm) { expect(err).to.be.null; expect(vm).to.be.ok;