ManageIQ / manageiq-api-client

Ruby client library to the ManageIQ REST API
MIT License
11 stars 26 forks source link

bulk operations on relations #45

Open Fryguy opened 7 years ago

Fryguy commented 7 years ago

So something like miq.vms.where(:power_state => "off").stop would internally call miq.vms.stop(miq.vms.where(:power_state => "off").pluck(:id))

This way you can do bulk operations, but not have to that dance manually.

abellotti commented 7 years ago

Nice Request !! Wouldn't be hard to do.

miq.vms.stop([id1, id2, id3])

would internally be handled equivalently to

miq.vms.stop([{ "id" : id1 }, { "id" : id2 }, { "id" : id3 }])

this would work great for any actions not requiring parameters.

Thanks