fog 1.31.0 → 1.32.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (176) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +53 -0
  3. data/Rakefile +5 -5
  4. data/fog.gemspec +6 -5
  5. data/lib/fog/cloudstack/models/compute/network.rb +1 -0
  6. data/lib/fog/openstack/compute.rb +41 -98
  7. data/lib/fog/openstack/core.rb +257 -118
  8. data/lib/fog/openstack/identity.rb +4 -0
  9. data/lib/fog/openstack/identity_v3.rb +10 -41
  10. data/lib/fog/openstack/models/baremetal/chassis_collection.rb +10 -4
  11. data/lib/fog/openstack/models/baremetal/drivers.rb +4 -2
  12. data/lib/fog/openstack/models/baremetal/nodes.rb +10 -4
  13. data/lib/fog/openstack/models/baremetal/ports.rb +10 -4
  14. data/lib/fog/openstack/models/compute/addresses.rb +4 -2
  15. data/lib/fog/openstack/models/compute/aggregate.rb +64 -0
  16. data/lib/fog/openstack/models/compute/aggregates.rb +28 -0
  17. data/lib/fog/openstack/models/compute/flavors.rb +5 -0
  18. data/lib/fog/openstack/models/compute/hosts.rb +4 -2
  19. data/lib/fog/openstack/models/compute/images.rb +2 -0
  20. data/lib/fog/openstack/models/compute/key_pairs.rb +4 -2
  21. data/lib/fog/openstack/models/compute/security_groups.rb +4 -2
  22. data/lib/fog/openstack/models/compute/servers.rb +2 -0
  23. data/lib/fog/openstack/models/compute/services.rb +7 -4
  24. data/lib/fog/openstack/models/compute/snapshots.rb +15 -2
  25. data/lib/fog/openstack/models/compute/volumes.rb +15 -2
  26. data/lib/fog/openstack/models/identity_v2/ec2_credentials.rb +6 -3
  27. data/lib/fog/openstack/models/identity_v2/roles.rb +5 -3
  28. data/lib/fog/openstack/models/identity_v2/tenants.rb +5 -3
  29. data/lib/fog/openstack/models/identity_v2/users.rb +7 -3
  30. data/lib/fog/openstack/models/identity_v3/domains.rb +7 -6
  31. data/lib/fog/openstack/models/identity_v3/endpoints.rb +5 -4
  32. data/lib/fog/openstack/models/identity_v3/groups.rb +5 -3
  33. data/lib/fog/openstack/models/identity_v3/os_credentials.rb +5 -3
  34. data/lib/fog/openstack/models/identity_v3/policies.rb +5 -3
  35. data/lib/fog/openstack/models/identity_v3/project.rb +1 -0
  36. data/lib/fog/openstack/models/identity_v3/projects.rb +7 -5
  37. data/lib/fog/openstack/models/identity_v3/role_assignments.rb +10 -5
  38. data/lib/fog/openstack/models/identity_v3/roles.rb +11 -5
  39. data/lib/fog/openstack/models/identity_v3/services.rb +5 -3
  40. data/lib/fog/openstack/models/identity_v3/users.rb +4 -2
  41. data/lib/fog/openstack/models/image/images.rb +10 -4
  42. data/lib/fog/openstack/models/network/floating_ips.rb +2 -0
  43. data/lib/fog/openstack/models/network/lb_health_monitors.rb +2 -0
  44. data/lib/fog/openstack/models/network/lb_members.rb +2 -0
  45. data/lib/fog/openstack/models/network/lb_pools.rb +2 -0
  46. data/lib/fog/openstack/models/network/lb_vips.rb +2 -0
  47. data/lib/fog/openstack/models/network/networks.rb +2 -0
  48. data/lib/fog/openstack/models/network/port.rb +1 -0
  49. data/lib/fog/openstack/models/network/ports.rb +2 -0
  50. data/lib/fog/openstack/models/network/routers.rb +2 -0
  51. data/lib/fog/openstack/models/network/security_group_rules.rb +2 -0
  52. data/lib/fog/openstack/models/network/security_groups.rb +2 -0
  53. data/lib/fog/openstack/models/network/subnets.rb +2 -0
  54. data/lib/fog/openstack/models/orchestration/events.rb +10 -6
  55. data/lib/fog/openstack/models/orchestration/resources.rb +4 -2
  56. data/lib/fog/openstack/models/orchestration/stack.rb +1 -1
  57. data/lib/fog/openstack/models/orchestration/stacks.rb +9 -1
  58. data/lib/fog/openstack/models/planning/plans.rb +4 -2
  59. data/lib/fog/openstack/models/planning/roles.rb +5 -2
  60. data/lib/fog/openstack/models/storage/directories.rb +4 -2
  61. data/lib/fog/openstack/models/storage/files.rb +2 -0
  62. data/lib/fog/openstack/models/volume/volume.rb +1 -0
  63. data/lib/fog/openstack/models/volume/volume_types.rb +2 -0
  64. data/lib/fog/openstack/models/volume/volumes.rb +13 -2
  65. data/lib/fog/openstack/network.rb +18 -97
  66. data/lib/fog/openstack/orchestration.rb +2 -0
  67. data/lib/fog/openstack/requests/baremetal/list_chassis.rb +2 -8
  68. data/lib/fog/openstack/requests/baremetal/list_chassis_detailed.rb +3 -9
  69. data/lib/fog/openstack/requests/baremetal/list_drivers.rb +4 -3
  70. data/lib/fog/openstack/requests/baremetal/list_nodes.rb +3 -9
  71. data/lib/fog/openstack/requests/baremetal/list_nodes_detailed.rb +3 -9
  72. data/lib/fog/openstack/requests/baremetal/list_ports.rb +3 -9
  73. data/lib/fog/openstack/requests/baremetal/list_ports_detailed.rb +3 -9
  74. data/lib/fog/openstack/requests/compute/add_aggregate_host.rb +30 -0
  75. data/lib/fog/openstack/requests/compute/create_aggregate.rb +42 -0
  76. data/lib/fog/openstack/requests/compute/delete_aggregate.rb +28 -0
  77. data/lib/fog/openstack/requests/compute/get_aggregate.rb +26 -0
  78. data/lib/fog/openstack/requests/compute/list_aggregates.rb +36 -0
  79. data/lib/fog/openstack/requests/compute/list_all_addresses.rb +4 -3
  80. data/lib/fog/openstack/requests/compute/list_flavors.rb +6 -5
  81. data/lib/fog/openstack/requests/compute/list_hosts.rb +4 -3
  82. data/lib/fog/openstack/requests/compute/list_key_pairs.rb +4 -3
  83. data/lib/fog/openstack/requests/compute/list_security_groups.rb +15 -2
  84. data/lib/fog/openstack/requests/compute/list_snapshots.rb +18 -4
  85. data/lib/fog/openstack/requests/compute/list_snapshots_detail.rb +27 -0
  86. data/lib/fog/openstack/requests/compute/list_volumes.rb +18 -4
  87. data/lib/fog/openstack/requests/compute/list_volumes_detail.rb +25 -0
  88. data/lib/fog/openstack/requests/compute/remove_aggregate_host.rb +30 -0
  89. data/lib/fog/openstack/requests/compute/update_aggregate.rb +37 -0
  90. data/lib/fog/openstack/requests/compute/update_aggregate_metadata.rb +30 -0
  91. data/lib/fog/openstack/requests/identity_v2/list_ec2_credentials.rb +23 -7
  92. data/lib/fog/openstack/requests/identity_v2/list_roles.rb +5 -4
  93. data/lib/fog/openstack/requests/identity_v2/list_tenants.rb +14 -8
  94. data/lib/fog/openstack/requests/identity_v2/list_users.rb +16 -4
  95. data/lib/fog/openstack/requests/identity_v3/auth_domains.rb +2 -7
  96. data/lib/fog/openstack/requests/identity_v3/auth_projects.rb +6 -11
  97. data/lib/fog/openstack/requests/identity_v3/list_domains.rb +7 -14
  98. data/lib/fog/openstack/requests/identity_v3/list_endpoints.rb +7 -14
  99. data/lib/fog/openstack/requests/identity_v3/list_group_users.rb +5 -13
  100. data/lib/fog/openstack/requests/identity_v3/list_groups.rb +14 -24
  101. data/lib/fog/openstack/requests/identity_v3/list_os_credentials.rb +7 -12
  102. data/lib/fog/openstack/requests/identity_v3/list_policies.rb +7 -11
  103. data/lib/fog/openstack/requests/identity_v3/list_projects.rb +14 -25
  104. data/lib/fog/openstack/requests/identity_v3/list_role_assignments.rb +21 -17
  105. data/lib/fog/openstack/requests/identity_v3/list_roles.rb +7 -25
  106. data/lib/fog/openstack/requests/identity_v3/list_services.rb +7 -13
  107. data/lib/fog/openstack/requests/identity_v3/list_users.rb +7 -15
  108. data/lib/fog/openstack/requests/image/list_public_images.rb +4 -3
  109. data/lib/fog/openstack/requests/image/list_public_images_detailed.rb +9 -6
  110. data/lib/fog/openstack/requests/network/create_port.rb +12 -11
  111. data/lib/fog/openstack/requests/network/create_subnet.rb +7 -7
  112. data/lib/fog/openstack/requests/network/get_port.rb +1 -0
  113. data/lib/fog/openstack/requests/network/update_port.rb +7 -6
  114. data/lib/fog/openstack/requests/orchestration/list_events.rb +46 -0
  115. data/lib/fog/openstack/requests/orchestration/list_resource_events.rb +7 -2
  116. data/lib/fog/openstack/requests/orchestration/list_resource_types.rb +3 -2
  117. data/lib/fog/openstack/requests/orchestration/list_resources.rb +27 -4
  118. data/lib/fog/openstack/requests/orchestration/list_stack_data.rb +2 -2
  119. data/lib/fog/openstack/requests/orchestration/list_stack_data_detailed.rb +49 -0
  120. data/lib/fog/openstack/requests/orchestration/list_stack_events.rb +6 -2
  121. data/lib/fog/openstack/requests/planning/list_plans.rb +4 -3
  122. data/lib/fog/openstack/requests/planning/list_roles.rb +3 -9
  123. data/lib/fog/openstack/requests/volume/create_volume.rb +2 -1
  124. data/lib/fog/openstack/requests/volume/list_snapshots.rb +16 -3
  125. data/lib/fog/openstack/requests/volume/list_snapshots_detailed.rb +27 -0
  126. data/lib/fog/openstack/requests/volume/list_volume_types.rb +6 -6
  127. data/lib/fog/openstack/requests/volume/list_volumes.rb +20 -7
  128. data/lib/fog/openstack/requests/volume/list_volumes_detailed.rb +49 -0
  129. data/lib/fog/openstack/volume.rb +1 -0
  130. data/lib/fog/ovirt/models/compute/server.rb +1 -0
  131. data/lib/fog/ovirt/models/compute/template.rb +1 -0
  132. data/lib/fog/rackspace/docs/queues.md +2 -2
  133. data/lib/fog/rackspace/models/block_storage/snapshot.rb +5 -1
  134. data/lib/fog/version.rb +1 -1
  135. data/lib/fog/vsphere/requests/compute/vm_clone.rb +1 -1
  136. data/lib/tasks/changelog_task.rb +1 -0
  137. data/spec/fog/openstack/identity_v3/authv3_a.yml +55 -35
  138. data/spec/fog/openstack/identity_v3/authv3_b.yml +55 -35
  139. data/spec/fog/openstack/identity_v3/authv3_c.yml +159 -33
  140. data/spec/fog/openstack/identity_v3/authv3_project.yml +79 -35
  141. data/spec/fog/openstack/identity_v3/authv3_token.yml +377 -76
  142. data/spec/fog/openstack/identity_v3/authv3_unscoped.yml +298 -155
  143. data/spec/fog/openstack/identity_v3/authv3_unscoped_reauth.yml +371 -0
  144. data/spec/fog/openstack/identity_v3/idv3.yml +456 -41
  145. data/spec/fog/openstack/identity_v3/idv3_credential.yml +36 -30
  146. data/spec/fog/openstack/identity_v3/idv3_credential_crud.yml +223 -190
  147. data/spec/fog/openstack/identity_v3/idv3_domain.yml +64 -58
  148. data/spec/fog/openstack/identity_v3/idv3_domain_crud.yml +176 -393
  149. data/spec/fog/openstack/identity_v3/idv3_domain_group_roles_mutation.yml +277 -379
  150. data/spec/fog/openstack/identity_v3/idv3_domain_roles_mutation.yml +177 -204
  151. data/spec/fog/openstack/identity_v3/idv3_endpoint.yml +492 -174
  152. data/spec/fog/openstack/identity_v3/idv3_endpoints_crud.yml +669 -435
  153. data/spec/fog/openstack/identity_v3/idv3_group_crud_mutation.yml +378 -298
  154. data/spec/fog/openstack/identity_v3/idv3_other_region.yml +187 -0
  155. data/spec/fog/openstack/identity_v3/idv3_policy.yml +54 -46
  156. data/spec/fog/openstack/identity_v3/idv3_policy_crud.yml +137 -117
  157. data/spec/fog/openstack/identity_v3/idv3_project.yml +116 -86
  158. data/spec/fog/openstack/identity_v3/idv3_project_crud.yml +179 -387
  159. data/spec/fog/openstack/identity_v3/idv3_project_group_user_roles_mutation.yml +415 -556
  160. data/spec/fog/openstack/identity_v3/idv3_role.yml +108 -74
  161. data/spec/fog/openstack/identity_v3/idv3_role_crud.yml +160 -368
  162. data/spec/fog/openstack/identity_v3/idv3_service.yml +156 -94
  163. data/spec/fog/openstack/identity_v3/idv3_services_crud.yml +250 -306
  164. data/spec/fog/openstack/identity_v3/idv3_token.yml +195 -101
  165. data/spec/fog/openstack/identity_v3/idv3_user_crud.yml +276 -193
  166. data/spec/fog/openstack/identity_v3/idv3_users.yml +149 -219
  167. data/spec/fog/openstack/identity_v3_spec.rb +502 -474
  168. data/spec/fog/openstack/volume/volume_common_setup.yml +76 -0
  169. data/spec/fog/openstack/volume/volume_crud.yml +561 -0
  170. data/spec/fog/openstack/volume/volume_type_read.yml +120 -0
  171. data/spec/fog/openstack/volume_spec.rb +165 -0
  172. data/tests/openstack/requests/compute/aggregate_tests.rb +59 -0
  173. data/tests/openstack/requests/network/port_tests.rb +12 -11
  174. data/tests/openstack/requests/orchestration/stack_tests.rb +25 -0
  175. metadata +56 -14
  176. data/spec/fog/openstack/identity_v3/idv2_unscoped_token_v3.yml +0 -467
@@ -28,6 +28,10 @@ module Fog
28
28
  options = {
29
29
  :openstack_api_key => @openstack_api_key,
30
30
  :openstack_username => @openstack_username,
31
+ :openstack_userid => @openstack_userid,
32
+ :openstack_domain_name => @openstack_domain_name,
33
+ :openstack_domain_id => @openstack_domain_id,
34
+ :openstack_project_name => @openstack_project_name,
31
35
  :openstack_auth_token => @openstack_must_reauthenticate ? nil : @openstack_auth_token,
32
36
  :openstack_auth_uri => @openstack_auth_uri,
33
37
  :openstack_tenant => @openstack_tenant,
@@ -5,15 +5,16 @@ module Fog
5
5
  module Identity
6
6
  class OpenStack
7
7
  class V3 < Fog::Service
8
-
9
8
  requires :openstack_auth_url
10
9
  recognizes :openstack_auth_token, :openstack_management_url, :persistent,
11
10
  :openstack_service_type, :openstack_service_name, :openstack_tenant,
12
- :openstack_project_name, :openstack_domain_name, :openstack_userid,
13
- :openstack_api_key, :openstack_username, :openstack_current_user_id,
14
- :current_user, :current_tenant,
15
11
  :openstack_endpoint_type, :openstack_region, :openstack_domain_id,
16
- :openstack_domain, :openstack_project, :provider
12
+ :openstack_project_name, :openstack_domain_name,
13
+ :openstack_user_domain, :openstack_project_domain,
14
+ :openstack_user_domain_id, :openstack_project_domain_id,
15
+ :openstack_api_key, :openstack_current_user_id, :openstack_userid, :openstack_username,
16
+ :current_user, :current_tenant,
17
+ :provider
17
18
 
18
19
  model_path 'fog/openstack/models/identity_v3'
19
20
  model :domain
@@ -118,6 +119,7 @@ module Fog
118
119
  request :delete_policy
119
120
 
120
121
  class Mock
122
+ include Fog::OpenStack::Core
121
123
  def initialize(options={})
122
124
 
123
125
  end
@@ -152,30 +154,11 @@ module Fog
152
154
  attr_reader :auth_token
153
155
 
154
156
  include Fog::Identity::OpenStack::Common
157
+ include Fog::OpenStack::Core
155
158
 
156
159
  def initialize(options={})
157
- @openstack_auth_token = options[:openstack_auth_token]
158
-
159
- @openstack_region = options[:openstack_region]
160
-
161
- unless @openstack_auth_token
162
- missing_credentials = Array.new
163
- @openstack_api_key = options[:openstack_api_key]
164
- @openstack_username = options[:openstack_username]
165
- @openstack_userid = options[:openstack_userid]
166
-
167
- missing_credentials << :openstack_api_key unless @openstack_api_key
168
- unless @openstack_username || @openstack_userid
169
- missing_credentials << 'openstack_username or openstack_userid'
170
- end
171
- raise ArgumentError, "Missing required arguments: #{missing_credentials.join(', ')}" unless missing_credentials.empty?
172
- end
173
-
160
+ initialize_identity options
174
161
 
175
- @openstack_tenant = options[:openstack_tenant]
176
- @openstack_auth_uri = URI.parse(options[:openstack_auth_url])
177
- @openstack_management_url = options[:openstack_management_url]
178
- @openstack_must_reauthenticate = false
179
162
  @openstack_service_type = options[:openstack_service_type] || ['identity_v3','identityv3','identity']
180
163
  @openstack_service_name = options[:openstack_service_name]
181
164
 
@@ -185,25 +168,12 @@ module Fog
185
168
 
186
169
  @openstack_endpoint_type = options[:openstack_endpoint_type] || 'adminURL'
187
170
 
188
- @current_user = options[:current_user]
189
- @current_tenant = options[:current_tenant]
190
-
191
171
  authenticate
192
172
 
193
173
  @persistent = options[:persistent] || false
194
174
  @connection = Fog::Core::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
195
175
  end
196
176
 
197
- def credentials
198
- {:provider => 'openstack',
199
- :openstack_auth_url => @openstack_auth_uri.to_s,
200
- :openstack_auth_token => @auth_token,
201
- :openstack_management_url => @openstack_management_url,
202
- :openstack_current_user_id => @openstack_current_user_id,
203
- :current_user => @current_user,
204
- :current_tenant => @current_tenant}
205
- end
206
-
207
177
  def reload
208
178
  @connection.reset
209
179
  end
@@ -240,10 +210,9 @@ module Fog
240
210
  response
241
211
  end
242
212
 
243
-
244
213
  end
245
214
 
246
215
  end
247
216
  end
248
217
  end
249
- end
218
+ end
@@ -7,12 +7,18 @@ module Fog
7
7
  class ChassisCollection < Fog::Collection
8
8
  model Fog::Baremetal::OpenStack::Chassis
9
9
 
10
- def all
11
- load(service.list_chassis.body['chassis'])
10
+ def all(options = {})
11
+ load(service.list_chassis_detailed(options).body['chassis'])
12
12
  end
13
13
 
14
- def details(parameters=nil)
15
- load(service.list_chassis_detailed(parameters).body['chassis'])
14
+ def summary(options = {})
15
+ load(service.list_chassis(options).body['chassis'])
16
+ end
17
+
18
+ def details(options = {})
19
+ Fog::Logger.deprecation("Calling OpenStack[:baremetal].chassis_collection.details will be removed, "\
20
+ " call .chassis_collection.all for detailed list.")
21
+ load(service.list_chassis_detailed(options).body['chassis'])
16
22
  end
17
23
 
18
24
  def find_by_uuid(uuid)
@@ -7,10 +7,12 @@ module Fog
7
7
  class Drivers < Fog::Collection
8
8
  model Fog::Baremetal::OpenStack::Driver
9
9
 
10
- def all
11
- load(service.list_drivers.body['drivers'])
10
+ def all(options = {})
11
+ load(service.list_drivers(options).body['drivers'])
12
12
  end
13
13
 
14
+ alias_method :summary, :all
15
+
14
16
  def find_by_name(name)
15
17
  new(service.get_driver(name).body)
16
18
  end
@@ -7,12 +7,18 @@ module Fog
7
7
  class Nodes < Fog::Collection
8
8
  model Fog::Baremetal::OpenStack::Node
9
9
 
10
- def all
11
- load(service.list_nodes.body['nodes'])
10
+ def all(options = {})
11
+ load(service.list_nodes_detailed(options).body['nodes'])
12
12
  end
13
13
 
14
- def details(parameters=nil)
15
- load(service.list_nodes_detailed(parameters).body['nodes'])
14
+ def summary(options = {})
15
+ load(service.list_nodes(options).body['nodes'])
16
+ end
17
+
18
+ def details(options = {})
19
+ Fog::Logger.deprecation("Calling OpenStack[:baremetal].nodes.details will be removed, "\
20
+ " call .nodes.all for detailed list.")
21
+ load(service.list_nodes_detailed(options).body['nodes'])
16
22
  end
17
23
 
18
24
  def find_by_uuid(uuid)
@@ -7,12 +7,18 @@ module Fog
7
7
  class Ports < Fog::Collection
8
8
  model Fog::Baremetal::OpenStack::Port
9
9
 
10
- def all
11
- load(service.list_ports.body['ports'])
10
+ def all(options = {})
11
+ load(service.list_ports_detailed(options).body['ports'])
12
12
  end
13
13
 
14
- def details(parameters=nil)
15
- load(service.list_ports_detailed(parameters).body['ports'])
14
+ def summary(options = {})
15
+ load(service.list_ports(options).body['ports'])
16
+ end
17
+
18
+ def details(options = {})
19
+ Fog::Logger.deprecation("Calling OpenStack[:baremetal].ports.details will be removed, "\
20
+ " call .ports.all for detailed list.")
21
+ load(service.list_ports_detailed(options).body['ports'])
16
22
  end
17
23
 
18
24
  def find_by_uuid(uuid)
@@ -7,10 +7,12 @@ module Fog
7
7
  class Addresses < Fog::Collection
8
8
  model Fog::Compute::OpenStack::Address
9
9
 
10
- def all
11
- load(service.list_all_addresses.body['floating_ips'])
10
+ def all(options = {})
11
+ load(service.list_all_addresses(options).body['floating_ips'])
12
12
  end
13
13
 
14
+ alias_method :summary, :all
15
+
14
16
  def get(address_id)
15
17
  if address = service.get_address(address_id).body['floating_ip']
16
18
  new(address)
@@ -0,0 +1,64 @@
1
+ require 'fog/core/model'
2
+
3
+ module Fog
4
+ module Compute
5
+ class OpenStack
6
+ class Aggregate < Fog::Model
7
+ identity :id
8
+
9
+ attribute :availability_zone
10
+ attribute :name
11
+ attribute :metadata
12
+ attribute :deleted
13
+ attribute :deleted_at
14
+ attribute :updated_at
15
+ attribute :created_at
16
+
17
+ # Detailed
18
+ attribute :hosts
19
+
20
+ def initialize(attributes)
21
+ # Old 'connection' is renamed as service and should be used instead
22
+ prepare_service_value(attributes)
23
+ super
24
+ end
25
+
26
+ def save
27
+ requires :name
28
+ identity ? update : create
29
+ end
30
+
31
+ def create
32
+ requires :name
33
+ merge_attributes(service.create_aggregate(self.name, self.attributes).body['aggregate'])
34
+ self
35
+ end
36
+
37
+ def update
38
+ merge_attributes(service.update_aggregate(self.id, self.attributes).body['aggregate'])
39
+ self
40
+ end
41
+
42
+ def add_host(host_uuid)
43
+ requires :id,
44
+ service.add_aggregate_host(self.id, host_uuid)
45
+ end
46
+
47
+ def remove_host(host_uuid)
48
+ requires :id,
49
+ service.remove_aggregate_host(self.id, host_uuid)
50
+ end
51
+
52
+ def update_metadata(metadata)
53
+ service.update_aggregate_metadata(self.id, metadata)
54
+ end
55
+
56
+ def destroy
57
+ requires :id
58
+ service.delete_aggregate(self.id)
59
+ true
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,28 @@
1
+ require 'fog/core/collection'
2
+ require 'fog/openstack/models/compute/aggregate'
3
+
4
+ module Fog
5
+ module Compute
6
+ class OpenStack
7
+ class Aggregates < Fog::Collection
8
+ model Fog::Compute::OpenStack::Aggregate
9
+
10
+ def all(options = {})
11
+ load(service.list_aggregates(options).body['aggregates'])
12
+ end
13
+
14
+ alias_method :summary, :all
15
+
16
+ def find_by_id(id)
17
+ new(service.get_aggregate(id).body['aggregate'])
18
+ end
19
+ alias_method :get, :find_by_id
20
+
21
+ def destroy(id)
22
+ aggregate = self.find_by_id(id)
23
+ aggregate.destroy
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -12,6 +12,11 @@ module Fog
12
12
  load(data)
13
13
  end
14
14
 
15
+ def summary(options = {})
16
+ data = service.list_flavors(options).body['flavors']
17
+ load(data)
18
+ end
19
+
15
20
  def get(flavor_id)
16
21
  data = service.get_flavor_details(flavor_id).body['flavor']
17
22
  new(data)
@@ -7,11 +7,13 @@ module Fog
7
7
  class Hosts < Fog::Collection
8
8
  model Fog::Compute::OpenStack::Host
9
9
 
10
- def all
11
- data = service.list_hosts.body['hosts']
10
+ def all(options = {})
11
+ data = service.list_hosts(options).body['hosts']
12
12
  load(data)
13
13
  end
14
14
 
15
+ alias_method :summary, :all
16
+
15
17
  def get(host_name)
16
18
  if host = service.get_host_details(host_name).body['host']
17
19
  new({
@@ -26,6 +26,8 @@ module Fog
26
26
  images
27
27
  end
28
28
 
29
+ alias_method :summary, :all
30
+
29
31
  def get(image_id)
30
32
  data = service.get_image_details(image_id).body['image']
31
33
  new(data)
@@ -7,14 +7,16 @@ module Fog
7
7
  class KeyPairs < Fog::Collection
8
8
  model Fog::Compute::OpenStack::KeyPair
9
9
 
10
- def all
10
+ def all(options = {})
11
11
  items = Array.new
12
- service.list_key_pairs.body['keypairs'].each do |kp|
12
+ service.list_key_pairs(options).body['keypairs'].each do |kp|
13
13
  items = items + kp.values
14
14
  end
15
15
  load(items)
16
16
  end
17
17
 
18
+ alias_method :summary, :all
19
+
18
20
  def get(key_pair_name)
19
21
  if key_pair_name
20
22
  self.all.select {|kp| kp.name == key_pair_name}.first
@@ -7,10 +7,12 @@ module Fog
7
7
  class SecurityGroups < Fog::Collection
8
8
  model Fog::Compute::OpenStack::SecurityGroup
9
9
 
10
- def all
11
- load(service.list_security_groups.body['security_groups'])
10
+ def all(options = {})
11
+ load(service.list_security_groups(options).body['security_groups'])
12
12
  end
13
13
 
14
+ alias_method :summary, :all
15
+
14
16
  def get(security_group_id)
15
17
  if security_group_id
16
18
  new(service.get_security_group(security_group_id).body['security_group'])
@@ -20,6 +20,8 @@ module Fog
20
20
  load(data)
21
21
  end
22
22
 
23
+ alias_method :summary, :all
24
+
23
25
  # Creates a new server and populates ssh keys
24
26
  # @return [Fog::Compute::OpenStack::Server]
25
27
  # @raise [Fog::Compute::OpenStack::NotFound] - HTTP 404
@@ -7,12 +7,15 @@ module Fog
7
7
  class Services < Fog::Collection
8
8
  model Fog::Compute::OpenStack::Service
9
9
 
10
- def all(parameters=nil)
11
- load(service.list_services(parameters).body['services'])
10
+ def all(options = {})
11
+ load(service.list_services(options).body['services'])
12
12
  end
13
13
 
14
- def details(parameters=nil)
15
- load(service.list_services(parameters).body['services'])
14
+ alias_method :summary, :all
15
+
16
+ def details(options = {})
17
+ Fog::Logger.deprecation('Calling OpenStack[:compute].services.details is deprecated, use .services.all')
18
+ load(service.list_services(options).body['services'])
16
19
  end
17
20
  end
18
21
  end
@@ -7,8 +7,21 @@ module Fog
7
7
  class Snapshots < Fog::Collection
8
8
  model Fog::Compute::OpenStack::Snapshot
9
9
 
10
- def all(detailed=true)
11
- load(service.list_snapshots(detailed).body['snapshots'])
10
+ def all(options = {})
11
+ if !options.is_a?(Hash)
12
+ if options
13
+ Fog::Logger.deprecation('Calling OpenStack[:compute].snapshots.all(true) is deprecated, use .snapshots.all')
14
+ else
15
+ Fog::Logger.deprecation('Calling OpenStack[:compute].snapshots.all(false) is deprecated, use .snapshots.summary')
16
+ end
17
+ load(service.list_snapshots(options).body['snapshots'])
18
+ else
19
+ load(service.list_snapshots_detail(options).body['snapshots'])
20
+ end
21
+ end
22
+
23
+ def summary(options = {})
24
+ load(service.list_snapshots(options).body['snapshots'])
12
25
  end
13
26
 
14
27
  def get(snapshot_id)
@@ -7,8 +7,21 @@ module Fog
7
7
  class Volumes < Fog::Collection
8
8
  model Fog::Compute::OpenStack::Volume
9
9
 
10
- def all(detailed=true)
11
- load(service.list_volumes(detailed).body['volumes'])
10
+ def all(options = true)
11
+ if !options.is_a?(Hash)
12
+ if options
13
+ Fog::Logger.deprecation('Calling OpenStack[:compute].volumes.all(true) is deprecated, use .volumes.all')
14
+ else
15
+ Fog::Logger.deprecation('Calling OpenStack[:compute].volumes.all(false) is deprecated, use .volumes.summary')
16
+ end
17
+ load(service.list_volumes(options).body['volumes'])
18
+ else
19
+ load(service.list_volumes_detail(options).body['volumes'])
20
+ end
21
+ end
22
+
23
+ def summary(options = {})
24
+ load(service.list_volumes(options).body['volumes'])
12
25
  end
13
26
 
14
27
  def get(volume_id)