]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/aviator/feature/aviator/openstack/compute/v2/admin/list_hosts.rb
Revert "add stackforge/keystone to 3rdparty"
[dsa-puppet.git] / 3rdparty / modules / aviator / feature / aviator / openstack / compute / v2 / admin / list_hosts.rb
1 module Aviator
2
3   define_request :list_hosts, :inherit => [:openstack, :common, :v2, :admin, :base] do
4
5     meta :service, :compute
6
7     link 'documentation',
8          'http://api.openstack.org/api-ref.html#ext-os-hosts'
9
10     link 'documentation bug',
11          'https://bugs.launchpad.net/nova/+bug/1224763'
12
13     param :service, :required => false
14     param :zone,    :required => false
15
16
17     def headers
18       super
19     end
20
21
22     def http_method
23       :get
24     end
25
26
27     def url
28       url = "#{ base_url }/os-hosts"
29
30       filters = []
31
32       optional_params.each do |param_name|
33         filters << "#{ param_name }=#{ params[param_name] }" if params[param_name]
34       end
35
36       url += "?#{ filters.join('&') }" unless filters.empty?
37
38       url
39     end
40
41   end
42
43 end
44