Skip to content

Commit e599a7f

Browse files
committed
Host endpoints
1 parent a4a58c9 commit e599a7f

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ one.createVM('GRAPHICS=[TYPE="vnc",LISTEN="0.0.0.0"]\nMEMORY="1024"\n FROM_APP="
128128
* vm.resize(template, enforce, callback)
129129
* vm.update(template, replace, callback)
130130
* vm.recover(recover, callback)
131+
* vm.migrate(host, live, enforce, datastore, callback)
132+
* vm.saveAsDisk(disk, imagename, imagetype, snapshot, callback)
133+
* vm.createDiskSnapshot(disk, snapshot, callback)
134+
* vm.updateConf(template, callback)
135+
* vm.revertDiskSnapshot(disk, snapshot, callback)
136+
* vm.deleteDiskSnapshot(disk, snapshot, callback)
131137

132138
### Datastore
133139

@@ -192,6 +198,9 @@ one.createVM('GRAPHICS=[TYPE="vnc",LISTEN="0.0.0.0"]\nMEMORY="1024"\n FROM_APP="
192198
* host.update(template, merge, callback)
193199
* host.delete(callback)
194200
* host.rename(name, callback)
201+
* monitoring(callback)
202+
* allocate(hostname, manager, vm, cluster, callback)
203+
* setStatus(status, callback)
195204

196205
### Image
197206

lib/host.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ Host.prototype.enable = function(callback) {
1717
});
1818
};
1919

20+
Host.prototype.monitoring = function(callback) {
21+
this.modem.call('host.monitoring', [this.id], function(err, data) {
22+
if(err) return callback(err);
23+
callback(null, data);
24+
});
25+
};
26+
2027
Host.prototype.disable = function(callback) {
2128
this.modem.call('host.enable', [this.id, false], function(err, data) {
2229
if(err) return callback(err);
@@ -31,13 +38,27 @@ Host.prototype.update = function(template, merge, callback) {
3138
});
3239
};
3340

41+
Host.prototype.allocate = function(hostname, manager, vm, cluster, callback) {
42+
this.modem.call('host.allocate', [this.id, hostname, manager, vm, cluster], function(err, data) {
43+
if(err) return callback(err);
44+
callback(null, data);
45+
});
46+
};
47+
3448
Host.prototype.delete = function(callback) {
3549
this.modem.call('host.delete', [this.id], function(err, data) {
3650
if(err) return callback(err);
3751
callback(null, data);
3852
});
3953
};
4054

55+
Host.prototype.setStatus = function(status, callback) {
56+
this.modem.call('host.status', [this.id, status], function(err, data) {
57+
if(err) return callback(err);
58+
callback(null, data);
59+
});
60+
};
61+
4162
Host.prototype.rename = function(name, callback) {
4263
this.modem.call('host.rename', [this.id, name], function(err, data) {
4364
if(err) return callback(err);

0 commit comments

Comments
 (0)