feat(xen-api/getRecords): fetch multiple records

This commit is contained in:
Julien Fontanet 2019-02-22 17:44:35 +01:00
parent 29b4cf414a
commit 04b31db41b

View File

@ -552,6 +552,10 @@ export class Xapi extends EventEmitter {
) )
} }
getRecords(type, refs) {
return Promise.all(refs.map(ref => this.getRecord(type, ref)))
}
async getAllRecords(type) { async getAllRecords(type) {
return map( return map(
await this._sessionCall(`${type}.get_all_records`), await this._sessionCall(`${type}.get_all_records`),