Read only mode can be altered after initial construction.

This commit is contained in:
Julien Fontanet
2015-12-16 13:58:33 +01:00
parent 720b9ef999
commit b45a169a2f
+8
View File
@@ -199,6 +199,14 @@ export class Xapi extends EventEmitter {
this._readOnly = Boolean(opts.readOnly)
}
get readOnly () {
return this._readOnly
}
set readOnly (ro) {
this._readOnly = Boolean(ro)
}
get sessionId () {
if (this.status !== 'connected') {
throw new Error('sessionId is only available when connected')