feat(xen-api/getRecord): add $id, $type and $ref props
This commit is contained in:
parent
32d7ccfea5
commit
41506e785e
@ -496,8 +496,17 @@ export class Xapi extends EventEmitter {
|
|||||||
throw new Error('no object with UUID: ' + uuid)
|
throw new Error('no object with UUID: ' + uuid)
|
||||||
}
|
}
|
||||||
|
|
||||||
getRecord (type, ref) {
|
async getRecord (type, ref) {
|
||||||
return this._sessionCall(`${type}.get_record`, [ref])
|
const record = await this._sessionCall(`${type}.get_record`, [ref])
|
||||||
|
|
||||||
|
// All custom properties are read-only and non enumerable.
|
||||||
|
defineProperties(record, {
|
||||||
|
$id: { value: record.uuid || ref },
|
||||||
|
$ref: { value: ref },
|
||||||
|
$type: { value: type },
|
||||||
|
})
|
||||||
|
|
||||||
|
return record
|
||||||
}
|
}
|
||||||
|
|
||||||
@cancelable
|
@cancelable
|
||||||
|
Loading…
Reference in New Issue
Block a user