It looks like cloudstack and gogrid models do something very similar.

lib/fog/go_grid/compute.rb
lib/fog/cloudstack/models/compute/job.rb
lib/fog/cloudstack/models/compute/security_group_rule.rb
lib/fog/cloudstack/models/compute/volume.rb