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

  action.payload.additional = shallowFetch ? ['graphics_consoles'] : vmFetchAdditionalList

  // 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, getSubResources: true }))
    yield put(updateVms({ vms: internalVms, copySubResources: false, page: page }))
    yield fetchUnknownIcons({ vms: internalVms })

    // NOTE: No need to fetch the current=true cdrom info at this point. The cdrom info
    //       is needed on the VM details page and `fetchSingleVm` is called upon entry
    //       to the details page. The `fetchSingleVm` fetch includes loading the
    //       appropriate cdrom info based on the VM's state. See `fetchSingleVm` for more
    //       details.
  }
}
/**
 * Fetch VMs with additional nested data requested (on ovirt 4.2 and later)
 */
Fetch VMs with additional nested data requested (on ovirt 4.2 and later)
Fetch VMs with additional nested data requested ( on ovirt 4 . 2 and later )
function* fetchVmsByPageV42 (action) {
  const { shallowFetch, page } = action.payload
  action.payload.additional = shallowFetch ? ['graphics_consoles'] : vmFetchAdditionalList
  const allVms = yield callExternalAction('getVmsByPage', Api.getVmsByPage, action)
  if (allVms && allVms['vm']) { 
    const internalVms = allVms.vm.map(vm => Api.vmToInternal({ vm, getSubResources: true }))
    yield put(updateVms({ vms: internalVms, copySubResources: false, page: page }))
    yield fetchUnknownIcons({ vms: internalVms })
  }
}
function * fetchVmsByPageV42 ( action ) { const { shallowFetch , page } = action . payload action . payload . additional = shallowFetch ? [ 'graphics_consoles' ] : vmFetchAdditionalList const allVms = yield callExternalAction ( 'getVmsByPage' , Api . getVmsByPage , action ) if ( allVms && allVms [ 'vm' ] ) { const internalVms = allVms . vm . map ( vm => Api . vmToInternal ( { vm , getSubResources : true } ) ) yield put ( updateVms ( { vms : internalVms , copySubResources : false , page : page } ) ) yield fetchUnknownIcons ( { vms : internalVms } ) } }
Fetch VMs with additional nested data requested (on ovirt 4.2 and later)
Fetch VMs with additional nested data requested ( on ovirt 4 . 2 and later )
// TODO: paging: split this call to a loop per up to 25 VMs // array // NOTE: No need to fetch the current=true cdrom info at this point. The cdrom info //       is needed on the VM details page and `fetchSingleVm` is called upon entry //       to the details page. The `fetchSingleVm` fetch includes loading the //       appropriate cdrom info based on the VM's state. See `fetchSingleVm` for more //       details.