Module: CloudstackClient::AffinityGroup
- Defined in:
- lib/cloudstack_client/commands/affinity_group.rb
Instance Method Summary collapse
-
#list_affinity_groups(args = {}) ⇒ Object
List Affinity Groups.
Instance Method Details
#list_affinity_groups(args = {}) ⇒ Object
List Affinity Groups.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/cloudstack_client/commands/affinity_group.rb', line 8 def list_affinity_groups(args = {}) params = { 'command' => 'listAffinityGroups', } if args[:account] account = list_accounts({name: args[:account]}).first unless account puts "Error: Account #{args[:account]} not found." exit 1 end params['domainid'] = account["domainid"] params['account'] = args[:account] end if args['listall'] params['listall'] = true params['isrecursive'] = true end params['name'] = args['name'] if args['name'] params['type'] = args['type'] if args['type'] params['virtualmachineid'] = args['virtualmachine_id'] if args['virtualmachine_id'] params['keyword'] = args['keyword'] if args['keyword'] json = send_request(params) json['affinitygroup'] || [] end |