function* fetchVmsByPageVLower (action) {
  const { shallowFetch, page } = action.payload

  // TODO: paging: split this call to a loop per up to 25 vms
  const allVms = yield callExternalAction('getVmsByPage', Api.getVmsByPage, action)
  if (allVms && allVms['vm']) { // array
    const internalVms = allVms.vm.map(vm => Api.vmToInternal({ vm }))

    yield put(updateVms({ vms: internalVms, copySubResources: true, page: page }))
    yield fetchUnknownIcons({ vms: internalVms })

    if (!shallowFetch) {
      yield fetchConsoleMetadatas({ vms: internalVms })
      yield fetchDisks({ vms: internalVms })
      yield fetchVmsCdRom({ vms: internalVms, current: false })
      yield fetchVmsNics({ vms: internalVms })
      yield fetchVmsSessions({ vms: internalVms })
      yield fetchVmsSnapshots({ vms: internalVms })
      // TODO: Support <4.2 for statistics?
    } else {
      console.log('getVmsByPage() shallow fetch requested - skipping other resources')
    }
  }
}
/**
 * Fetch VMs and individually fetch nested data as requested (on ovirt 4.1 and earlier)
 */
Fetch VMs and individually fetch nested data as requested (on ovirt 4.1 and earlier)
Fetch VMs and individually fetch nested data as requested ( on ovirt 4 . 1 and earlier )
function* fetchVmsByPageVLower (action) {
  const { shallowFetch, page } = action.payload
  const allVms = yield callExternalAction('getVmsByPage', Api.getVmsByPage, action)
  if (allVms && allVms['vm']) { 
    const internalVms = allVms.vm.map(vm => Api.vmToInternal({ vm }))
    yield put(updateVms({ vms: internalVms, copySubResources: true, page: page }))
    yield fetchUnknownIcons({ vms: internalVms })
    if (!shallowFetch) {
      yield fetchConsoleMetadatas({ vms: internalVms })
      yield fetchDisks({ vms: internalVms })
      yield fetchVmsCdRom({ vms: internalVms, current: false })
      yield fetchVmsNics({ vms: internalVms })
      yield fetchVmsSessions({ vms: internalVms })
      yield fetchVmsSnapshots({ vms: internalVms })
    } else {
      console.log('getVmsByPage() shallow fetch requested - skipping other resources')
    }
  }
}
function * fetchVmsByPageVLower ( action ) { const { shallowFetch , page } = action . payload const allVms = yield callExternalAction ( 'getVmsByPage' , Api . getVmsByPage , action ) if ( allVms && allVms [ 'vm' ] ) { const internalVms = allVms . vm . map ( vm => Api . vmToInternal ( { vm } ) ) yield put ( updateVms ( { vms : internalVms , copySubResources : true , page : page } ) ) yield fetchUnknownIcons ( { vms : internalVms } ) if ( ! shallowFetch ) { yield fetchConsoleMetadatas ( { vms : internalVms } ) yield fetchDisks ( { vms : internalVms } ) yield fetchVmsCdRom ( { vms : internalVms , current : false } ) yield fetchVmsNics ( { vms : internalVms } ) yield fetchVmsSessions ( { vms : internalVms } ) yield fetchVmsSnapshots ( { vms : internalVms } ) } else { console . log ( 'getVmsByPage() shallow fetch requested - skipping other resources' ) } } }
Fetch VMs and individually fetch nested data as requested (on ovirt 4.1 and earlier)
Fetch VMs and individually fetch nested data as requested ( on ovirt 4 . 1 and earlier )
// TODO: paging: split this call to a loop per up to 25 vms // array // TODO: Support <4.2 for statistics?