def export
CSV.open(option_csv_file, 'wb') do |csv|
csv << [NAME, COUNT, ORGANIZATION, LIMIT, DESCRIPTION]
@api.resource(:organizations)\
.call(:index, {
'per_page' => 999999
})['results'].each do |organization|
@api.resource(:host_collections)\
.call(:index, {
'organization_id' => organization['id']
}).each do |hostcollection|
puts hostcollection
csv << [hostcollection['name'], 1, organization['id'],
hostcollection['max_systems'].to_i < 0 ? 'Unlimited' : sytemgroup['max_systems'],
hostcollection['description']]
end
end
end
end