Module: CloudstackClient::Capacity

Defined in:
lib/cloudstack_client/commands/capacity.rb

Instance Method Summary collapse

Instance Method Details

#list_capacity(args = {}) ⇒ Object

List capacity.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/cloudstack_client/commands/capacity.rb', line 8

def list_capacity(args = {})
  params = {
    'command' => 'listCapacity',
  }

  if args[:zone]
    zone = get_zone(args[:zone])
    unless zone 
      puts "Error: Zone #{args[:zone]} not found"
      exit 1
    end
    params['zoneid'] = zone['id']  
  end

  params['type'] = args[:type] if args[:type]

  json = send_request(params)
  json['capacity'] || []
end