fog-openstack 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -28
  3. data/docs/workflow.md +129 -0
  4. data/examples/workflow/workflow-examples.rb +387 -0
  5. data/gemfiles/Gemfile-1.9 +1 -0
  6. data/lib/fog/openstack.rb +5 -1
  7. data/lib/fog/openstack/baremetal.rb +14 -38
  8. data/lib/fog/openstack/compute.rb +4 -33
  9. data/lib/fog/openstack/core.rb +104 -50
  10. data/lib/fog/openstack/identity.rb +2 -1
  11. data/lib/fog/openstack/identity_v2.rb +0 -2
  12. data/lib/fog/openstack/identity_v3.rb +0 -2
  13. data/lib/fog/openstack/image_v1.rb +6 -6
  14. data/lib/fog/openstack/image_v2.rb +7 -6
  15. data/lib/fog/openstack/introspection.rb +10 -35
  16. data/lib/fog/openstack/metering.rb +16 -35
  17. data/lib/fog/openstack/monitoring.rb +5 -31
  18. data/lib/fog/openstack/network.rb +5 -34
  19. data/lib/fog/openstack/nfv.rb +10 -35
  20. data/lib/fog/openstack/orchestration.rb +5 -40
  21. data/lib/fog/openstack/planning.rb +11 -36
  22. data/lib/fog/openstack/requests/compute/get_limits.rb +8 -7
  23. data/lib/fog/openstack/requests/network/update_router.rb +1 -1
  24. data/lib/fog/openstack/requests/workflow_v2/create_action.rb +28 -0
  25. data/lib/fog/openstack/requests/workflow_v2/create_action_execution.rb +31 -0
  26. data/lib/fog/openstack/requests/workflow_v2/create_cron_trigger.rb +55 -0
  27. data/lib/fog/openstack/requests/workflow_v2/create_environment.rb +31 -0
  28. data/lib/fog/openstack/requests/workflow_v2/create_execution.rb +30 -0
  29. data/lib/fog/openstack/requests/workflow_v2/create_workbook.rb +28 -0
  30. data/lib/fog/openstack/requests/workflow_v2/create_workflow.rb +28 -0
  31. data/lib/fog/openstack/requests/workflow_v2/delete_action.rb +25 -0
  32. data/lib/fog/openstack/requests/workflow_v2/delete_action_execution.rb +25 -0
  33. data/lib/fog/openstack/requests/workflow_v2/delete_cron_trigger.rb +25 -0
  34. data/lib/fog/openstack/requests/workflow_v2/delete_environment.rb +25 -0
  35. data/lib/fog/openstack/requests/workflow_v2/delete_execution.rb +25 -0
  36. data/lib/fog/openstack/requests/workflow_v2/delete_workbook.rb +25 -0
  37. data/lib/fog/openstack/requests/workflow_v2/delete_workflow.rb +25 -0
  38. data/lib/fog/openstack/requests/workflow_v2/get_action.rb +27 -0
  39. data/lib/fog/openstack/requests/workflow_v2/get_action_execution.rb +26 -0
  40. data/lib/fog/openstack/requests/workflow_v2/get_cron_trigger.rb +28 -0
  41. data/lib/fog/openstack/requests/workflow_v2/get_environment.rb +28 -0
  42. data/lib/fog/openstack/requests/workflow_v2/get_execution.rb +26 -0
  43. data/lib/fog/openstack/requests/workflow_v2/get_task.rb +27 -0
  44. data/lib/fog/openstack/requests/workflow_v2/get_workbook.rb +28 -0
  45. data/lib/fog/openstack/requests/workflow_v2/get_workflow.rb +28 -0
  46. data/lib/fog/openstack/requests/workflow_v2/list_action_executions.rb +28 -0
  47. data/lib/fog/openstack/requests/workflow_v2/list_actions.rb +30 -0
  48. data/lib/fog/openstack/requests/workflow_v2/list_cron_triggers.rb +28 -0
  49. data/lib/fog/openstack/requests/workflow_v2/list_environments.rb +28 -0
  50. data/lib/fog/openstack/requests/workflow_v2/list_executions.rb +28 -0
  51. data/lib/fog/openstack/requests/workflow_v2/list_services.rb +28 -0
  52. data/lib/fog/openstack/requests/workflow_v2/list_tasks.rb +28 -0
  53. data/lib/fog/openstack/requests/workflow_v2/list_workbooks.rb +28 -0
  54. data/lib/fog/openstack/requests/workflow_v2/list_workflows.rb +30 -0
  55. data/lib/fog/openstack/requests/workflow_v2/rerun_task.rb +33 -0
  56. data/lib/fog/openstack/requests/workflow_v2/update_action.rb +28 -0
  57. data/lib/fog/openstack/requests/workflow_v2/update_action_execution.rb +33 -0
  58. data/lib/fog/openstack/requests/workflow_v2/update_environment.rb +31 -0
  59. data/lib/fog/openstack/requests/workflow_v2/update_execution.rb +33 -0
  60. data/lib/fog/openstack/requests/workflow_v2/update_workbook.rb +28 -0
  61. data/lib/fog/openstack/requests/workflow_v2/update_workflow.rb +28 -0
  62. data/lib/fog/openstack/requests/workflow_v2/validate_action.rb +28 -0
  63. data/lib/fog/openstack/requests/workflow_v2/validate_workbook.rb +28 -0
  64. data/lib/fog/openstack/requests/workflow_v2/validate_workflow.rb +28 -0
  65. data/lib/fog/openstack/storage.rb +4 -35
  66. data/lib/fog/openstack/version.rb +1 -1
  67. data/lib/fog/openstack/volume_v1.rb +7 -5
  68. data/lib/fog/openstack/volume_v2.rb +7 -5
  69. data/lib/fog/openstack/workflow.rb +12 -0
  70. data/lib/fog/openstack/workflow_v2.rb +160 -0
  71. metadata +48 -95
  72. data/lib/fog/openstack/common.rb +0 -44
  73. data/tests/openstack/models/compute/images_tests.rb +0 -13
  74. data/tests/openstack/models/compute/security_group_tests.rb +0 -54
  75. data/tests/openstack/models/compute/server_tests.rb +0 -220
  76. data/tests/openstack/models/compute/service_tests.rb +0 -17
  77. data/tests/openstack/models/image/image_tests.rb +0 -36
  78. data/tests/openstack/models/image/images_tests.rb +0 -19
  79. data/tests/openstack/models/network/floating_ip_tests.rb +0 -35
  80. data/tests/openstack/models/network/floating_ips_tests.rb +0 -19
  81. data/tests/openstack/models/network/ike_policies_tests.rb +0 -28
  82. data/tests/openstack/models/network/ike_policy_tests.rb +0 -36
  83. data/tests/openstack/models/network/ipsec_policies_tests.rb +0 -26
  84. data/tests/openstack/models/network/ipsec_policy_tests.rb +0 -36
  85. data/tests/openstack/models/network/ipsec_site_connection_tests.rb +0 -50
  86. data/tests/openstack/models/network/ipsec_site_connections_tests.rb +0 -32
  87. data/tests/openstack/models/network/lb_health_monitor_tests.rb +0 -52
  88. data/tests/openstack/models/network/lb_health_monitors_tests.rb +0 -21
  89. data/tests/openstack/models/network/lb_member_tests.rb +0 -28
  90. data/tests/openstack/models/network/lb_members_tests.rb +0 -21
  91. data/tests/openstack/models/network/lb_pool_tests.rb +0 -53
  92. data/tests/openstack/models/network/lb_pools_tests.rb +0 -20
  93. data/tests/openstack/models/network/lb_vip_tests.rb +0 -39
  94. data/tests/openstack/models/network/lb_vips_tests.rb +0 -21
  95. data/tests/openstack/models/network/network_tests.rb +0 -61
  96. data/tests/openstack/models/network/networks_tests.rb +0 -21
  97. data/tests/openstack/models/network/port_tests.rb +0 -28
  98. data/tests/openstack/models/network/ports_tests.rb +0 -25
  99. data/tests/openstack/models/network/router_tests.rb +0 -39
  100. data/tests/openstack/models/network/routers_tests.rb +0 -21
  101. data/tests/openstack/models/network/security_group_rule_tests.rb +0 -27
  102. data/tests/openstack/models/network/security_group_rules_tests.rb +0 -25
  103. data/tests/openstack/models/network/security_group_tests.rb +0 -17
  104. data/tests/openstack/models/network/security_groups_tests.rb +0 -16
  105. data/tests/openstack/models/network/subnet_tests.rb +0 -30
  106. data/tests/openstack/models/network/subnets_tests.rb +0 -27
  107. data/tests/openstack/models/network/vpn_service_tests.rb +0 -27
  108. data/tests/openstack/models/network/vpn_services_tests.rb +0 -22
  109. data/tests/openstack/models/nfv/vnf_tests.rb +0 -35
  110. data/tests/openstack/models/nfv/vnfd_tests.rb +0 -23
  111. data/tests/openstack/models/nfv/vnfds_tests.rb +0 -31
  112. data/tests/openstack/models/nfv/vnfs_tests.rb +0 -38
  113. data/tests/openstack/models/planning/.gitkeep +0 -0
  114. data/tests/openstack/models/planning/plan_tests.rb +0 -51
  115. data/tests/openstack/models/planning/plans_tests.rb +0 -18
  116. data/tests/openstack/models/planning/role_tests.rb +0 -14
  117. data/tests/openstack/models/storage/file_tests.rb +0 -251
  118. data/tests/openstack/requests/compute/address_tests.rb +0 -58
  119. data/tests/openstack/requests/compute/aggregate_tests.rb +0 -59
  120. data/tests/openstack/requests/compute/availability_zone_tests.rb +0 -18
  121. data/tests/openstack/requests/compute/flavor_tests.rb +0 -95
  122. data/tests/openstack/requests/compute/helper.rb +0 -41
  123. data/tests/openstack/requests/compute/image_tests.rb +0 -58
  124. data/tests/openstack/requests/compute/keypair_tests.rb +0 -30
  125. data/tests/openstack/requests/compute/limit_tests.rb +0 -59
  126. data/tests/openstack/requests/compute/quota_tests.rb +0 -60
  127. data/tests/openstack/requests/compute/security_group_tests.rb +0 -61
  128. data/tests/openstack/requests/compute/server_tests.rb +0 -289
  129. data/tests/openstack/requests/compute/service_tests.rb +0 -33
  130. data/tests/openstack/requests/compute/tenant_tests.rb +0 -19
  131. data/tests/openstack/requests/compute/volume_tests.rb +0 -38
  132. data/tests/openstack/requests/image/image_tests.rb +0 -135
  133. data/tests/openstack/requests/metering/event_tests.rb +0 -17
  134. data/tests/openstack/requests/metering/meter_tests.rb +0 -52
  135. data/tests/openstack/requests/metering/resource_tests.rb +0 -19
  136. data/tests/openstack/requests/network/ike_policy_tests.rb +0 -65
  137. data/tests/openstack/requests/network/ipsec_policy_tests.rb +0 -65
  138. data/tests/openstack/requests/network/ipsec_site_connection_tests.rb +0 -82
  139. data/tests/openstack/requests/network/lb_health_monitor_tests.rb +0 -93
  140. data/tests/openstack/requests/network/lb_member_tests.rb +0 -60
  141. data/tests/openstack/requests/network/lb_pool_tests.rb +0 -80
  142. data/tests/openstack/requests/network/lb_vip_tests.rb +0 -71
  143. data/tests/openstack/requests/network/network_tests.rb +0 -107
  144. data/tests/openstack/requests/network/port_tests.rb +0 -66
  145. data/tests/openstack/requests/network/quota_tests.rb +0 -65
  146. data/tests/openstack/requests/network/router_tests.rb +0 -73
  147. data/tests/openstack/requests/network/security_group_rule_tests.rb +0 -58
  148. data/tests/openstack/requests/network/security_group_tests.rb +0 -43
  149. data/tests/openstack/requests/network/subnet_tests.rb +0 -66
  150. data/tests/openstack/requests/network/vpn_service_tests.rb +0 -61
  151. data/tests/openstack/requests/nfv/vnf_tests.rb +0 -70
  152. data/tests/openstack/requests/nfv/vnfd_tests.rb +0 -44
  153. data/tests/openstack/requests/orchestration/stack_tests.rb +0 -64
  154. data/tests/openstack/requests/planning/.gitkeep +0 -0
  155. data/tests/openstack/requests/planning/plan_tests.rb +0 -65
  156. data/tests/openstack/requests/planning/role_tests.rb +0 -16
  157. data/tests/openstack/requests/storage/container_tests.rb +0 -64
  158. data/tests/openstack/requests/storage/large_object_tests.rb +0 -372
  159. data/tests/openstack/requests/storage/object_tests.rb +0 -208
  160. data/tests/openstack/requests/volume/availability_zone_tests.rb +0 -13
  161. data/tests/openstack/requests/volume/quota_tests.rb +0 -50
  162. data/tests/openstack/requests/volume/volume_type_tests.rb +0 -32
File without changes
@@ -1,51 +0,0 @@
1
- Shindo.tests("Fog::Openstack[:planning] | plan", ['openstack']) do
2
- @instance = Fog::Openstack[:planning].plans.first
3
-
4
- tests('success') do
5
- tests('#add_role').succeeds do
6
- @role = Fog::Openstack[:planning].list_roles.body.first
7
- @instance.add_role(@role['uuid'])
8
- end
9
-
10
- tests('#templates').succeeds do
11
- @instance.templates
12
- end
13
-
14
- tests('#master_template').succeeds do
15
- @instance.master_template
16
- end
17
-
18
- tests('#environment').succeeds do
19
- @instance.environment
20
- end
21
-
22
- tests('#provider_resource_templates').succeeds do
23
- @instance.provider_resource_templates
24
- end
25
-
26
- tests('#patch').succeeds do
27
- parameter = @instance.parameters.first
28
- @instance.patch(:parameters => [{"name" => parameter['name'], "value" => 'new_value'}])
29
- end
30
-
31
- tests('#remove_role').succeeds do
32
- @instance.remove_role(@role['uuid'])
33
- end
34
-
35
- tests('#save').succeeds do
36
- @instance.save
37
- end
38
-
39
- tests('#update').succeeds do
40
- @instance.update
41
- end
42
-
43
- tests('#destroy').succeeds do
44
- @instance.destroy
45
- end
46
-
47
- tests('#create').succeeds do
48
- @instance.create
49
- end
50
- end
51
- end
@@ -1,18 +0,0 @@
1
- Shindo.tests("Fog::Openstack[:planning] | plans", ['openstack']) do
2
- tests('success') do
3
- tests('#all').succeeds do
4
- plans = Fog::Openstack[:planning].plans.all
5
- @instance = plans.first
6
- end
7
-
8
- tests('#get').succeeds do
9
- Fog::Openstack[:planning].plans.get(@instance.uuid)
10
- end
11
-
12
- tests('#find_by_*').succeeds do
13
- plan = Fog::Openstack[:planning].plans.find_by_name(@instance.name)
14
- plan.name == @instance.name
15
- end
16
- end
17
- end
18
-
@@ -1,14 +0,0 @@
1
- Shindo.tests("Fog::Openstack[:planning] | plan", ['openstack']) do
2
- @instance = Fog::Openstack[:planning].roles.first
3
-
4
- tests('success') do
5
- tests('#add_role').succeeds do
6
- @plan = Fog::Openstack[:planning].list_plans.body.first
7
- @instance.add_to_plan(@plan['uuid'])
8
- end
9
-
10
- tests('#remove_role').succeeds do
11
- @instance.remove_from_plan(@plan['uuid'])
12
- end
13
- end
14
- end
@@ -1,251 +0,0 @@
1
- Shindo.tests('Fog::OpenStack::Storage | file', ['openstack']) do
2
-
3
- pending if Fog.mocking?
4
-
5
- def object_attributes(file=@instance)
6
- @instance.service.head_object(@directory.key, file.key).headers
7
- end
8
-
9
- def object_meta_attributes
10
- @instance.service.head_object(@directory.key, @instance.key).headers.reject {|k, v| !(k =~ /X-Object-Meta-/)}
11
- end
12
-
13
- def clear_metadata
14
- @instance.metadata.tap do |metadata|
15
- metadata.each_pair {|k, v| metadata[k] = nil }
16
- end
17
- end
18
-
19
- file_attributes = {
20
- :key => 'fog_file_tests',
21
- :body => lorem_file
22
- }
23
-
24
- directory_attributes = {
25
- # Add a random suffix to prevent collision
26
- :key => "fogfilestests-#{rand(65536)}"
27
- }
28
-
29
- @directory = Fog::Storage[:openstack].
30
- directories.
31
- create(directory_attributes)
32
-
33
- model_tests(@directory.files, file_attributes.merge(:etag => 'foo'), Fog.mocking?) do
34
- tests('#save should not blow up with etag') do
35
- @instance.save
36
- end
37
- end
38
-
39
- model_tests(@directory.files, file_attributes, Fog.mocking?) do
40
-
41
- tests("#metadata should load empty metadata").returns({}) do
42
- @instance.metadata
43
- end
44
-
45
- tests('#save') do
46
-
47
- tests('#metadata') do
48
-
49
- before do
50
- @instance.metadata[:foo] = 'bar'
51
- @instance.save
52
- end
53
-
54
- after do
55
- clear_metadata
56
- @instance.save
57
- end
58
-
59
- tests("should update metadata").returns('bar') do
60
- object_meta_attributes['X-Object-Meta-Foo']
61
- end
62
-
63
- tests('should cache metadata').returns('bar') do
64
- @instance.metadata[:foo]
65
- end
66
-
67
- tests('should remove empty metadata').returns({}) do
68
- @instance.metadata[:foo] = nil
69
- @instance.save
70
- object_meta_attributes
71
- end
72
-
73
- end
74
-
75
- tests('#content_disposition') do
76
- before do
77
- @instance = @directory.files.create :key => 'meta-test', :body => lorem_file, :content_disposition => 'ho-ho-ho'
78
- end
79
-
80
- after do
81
- clear_metadata
82
- @instance.save
83
- end
84
-
85
- tests("sets Content-Disposition on create").returns("ho-ho-ho") do
86
- object_attributes(@instance)["Content-Disposition"]
87
- end
88
- end
89
-
90
- tests('#metadata keys') do
91
-
92
- after do
93
- clear_metadata
94
- @instance.save
95
- end
96
-
97
- @instance.metadata[:foo_bar] = 'baz'
98
- tests("should support compound key names").returns('baz') do
99
- @instance.save
100
- object_meta_attributes['X-Object-Meta-Foo-Bar']
101
- end
102
-
103
- @instance.metadata['foo'] = 'bar'
104
- tests("should support string keys").returns('bar') do
105
- @instance.save
106
- object_meta_attributes['X-Object-Meta-Foo']
107
- end
108
-
109
- @instance.metadata['foo_bar'] = 'baz'
110
- tests("should support compound string key names").returns('baz') do
111
- @instance.save
112
- object_meta_attributes['X-Object-Meta-Foo-Bar']
113
- end
114
-
115
- @instance.metadata['foo-bar'] = 'baz'
116
- tests("should support hyphenated keys").returns('baz') do
117
- @instance.save
118
- object_meta_attributes['X-Object-Meta-Foo-Bar']
119
- end
120
-
121
- @instance.metadata['foo-bar'] = 'baz'
122
- @instance.metadata[:'foo_bar'] = 'bref'
123
- tests("should only support one value per metadata key").returns('bref') do
124
- @instance.save
125
- object_meta_attributes['X-Object-Meta-Foo-Bar']
126
- end
127
-
128
- end
129
-
130
- end
131
-
132
- tests("#access_control_allow_origin") do
133
-
134
- tests("#access_control_allow_origin should default to nil").returns(nil) do
135
- @instance.access_control_allow_origin
136
- end
137
-
138
- @instance.access_control_allow_origin = 'http://example.com'
139
- @instance.save
140
- tests("#access_control_allow_origin should return access control attribute").returns('http://example.com') do
141
- @instance.access_control_allow_origin
142
- end
143
-
144
- @instance.access_control_allow_origin = 'foo'
145
- @instance.save
146
- tests("#access_control_allow_origin= should update access_control_allow_origin").returns('bar') do
147
- @instance.access_control_allow_origin = 'bar'
148
- @instance.save
149
- @instance.access_control_allow_origin
150
- end
151
-
152
- tests("#access_control_allow_origin= should not blow up on nil") do
153
- @instance.access_control_allow_origin = nil
154
- @instance.save
155
- end
156
-
157
- end
158
-
159
- tests("#delete_at") do
160
- @delete_at_time = (Time.now + 300).to_i
161
-
162
- tests("#delete_at should default to nil").returns(nil) do
163
- @instance.delete_at
164
- end
165
-
166
- @instance.delete_at = @delete_at_time
167
- @instance.save
168
- tests("#delete_at should return delete_at attribute").returns(@delete_at_time) do
169
- @instance.delete_at
170
- end
171
-
172
- @instance.delete_at = @delete_at_time
173
- @instance.save
174
- tests("#delete_at= should update delete_at").returns(@delete_at_time + 100) do
175
- @instance.delete_at = @delete_at_time + 100
176
- @instance.save
177
- @instance.delete_at
178
- end
179
-
180
- tests("#delete_at= should not blow up on nil") do
181
- @instance.delete_at = nil
182
- @instance.save
183
- end
184
- end
185
- end
186
-
187
- model_tests(@directory.files, file_attributes, Fog.mocking?) do
188
-
189
- tests("#origin") do
190
-
191
- tests("#origin should default to nil").returns(nil) do
192
- @instance.save
193
- @instance.origin
194
- end
195
-
196
- @instance.origin = 'http://example.com'
197
- @instance.save
198
- tests("#origin should return access control attributes").returns('http://example.com') do
199
- @instance.origin
200
- end
201
- @instance.attributes.delete('Origin')
202
-
203
- @instance.origin = 'foo'
204
- @instance.save
205
- tests("#origin= should update origin").returns('bar') do
206
- @instance.origin = 'bar'
207
- @instance.save
208
- @instance.origin
209
- end
210
-
211
- tests("#origin= should not blow up on nil") do
212
- @instance.origin = nil
213
- @instance.save
214
- end
215
-
216
- end
217
-
218
- tests("#content_encoding") do
219
-
220
- tests("#content_encoding should default to nil").returns(nil) do
221
- @instance.save
222
- @instance.content_encoding
223
- end
224
-
225
- @instance.content_encoding = 'gzip'
226
- @instance.save
227
- tests("#content_encoding should return the content encoding").returns('gzip') do
228
- @instance.content_encoding
229
- end
230
- @instance.attributes.delete('content_encoding')
231
-
232
- @instance.content_encoding = 'foo'
233
- @instance.save
234
- tests("#content_encoding= should update content_encoding").returns('bar') do
235
- @instance.content_encoding = 'bar'
236
- @instance.save
237
- @instance.content_encoding
238
- end
239
-
240
- tests("#content_encoding= should not blow up on nil") do
241
- @instance.content_encoding = nil
242
- @instance.save
243
- end
244
-
245
- end
246
-
247
- end
248
-
249
- @directory.destroy
250
-
251
- end
@@ -1,58 +0,0 @@
1
- Shindo.tests('Fog::Compute[:openstack] | address requests', ['openstack']) do
2
-
3
- compute = Fog::Compute[:openstack]
4
-
5
- @server_id = compute.create_server("shindo_test_server", get_image_ref, get_flavor_ref).body['server']['id']
6
-
7
- @address_format = {
8
- "instance_id" => NilClass,
9
- "ip" => String,
10
- "fixed_ip" => NilClass,
11
- "id" => Integer,
12
- "pool" => String
13
- }
14
-
15
- @address_pools_format = {
16
- "name" => String
17
- }
18
-
19
- tests('success') do
20
-
21
- tests('#allocate_address').formats({"floating_ip" => @address_format}) do
22
- data = compute.allocate_address.body
23
- @address_id = data['floating_ip']['id']
24
- @address_ip = data['floating_ip']['ip']
25
- data
26
- end
27
-
28
- tests('#list_all_addresses').formats({"floating_ips" => [@address_format]}) do
29
- compute.list_all_addresses.body
30
- end
31
-
32
- tests('#get_address(address_id)').formats({"floating_ip" => @address_format}) do
33
- compute.get_address(@address_id).body
34
- end
35
-
36
- tests('#list_address_pools').formats({"floating_ip_pools" => [@address_pools_format]}) do
37
- compute.list_address_pools.body
38
- end
39
-
40
- compute.servers.get(@server_id).wait_for { ready? }
41
-
42
- tests('#associate_address(server_id, ip_address)').succeeds do
43
- compute.associate_address(@server_id, @address_ip).body
44
- end
45
-
46
- tests('#disassociate_address(server_id, ip_address)').succeeds do
47
- compute.disassociate_address(@server_id, @address_ip).body
48
- end
49
-
50
- tests('#release_address(ip_address)').succeeds do
51
- compute.release_address(@address_id)
52
- end
53
-
54
- end
55
-
56
- compute.delete_server(@server_id)
57
-
58
- end
@@ -1,59 +0,0 @@
1
- Shindo.tests('Fog::Compute[:openstack] | Compute aggregate requests', ['openstack']) do
2
- openstack = Fog::Identity[:openstack]
3
-
4
- @aggregate_format = {
5
- "availability_zone" => Fog::Nullable::String,
6
- "created_at" => String,
7
- "deleted" => Fog::Boolean,
8
- "deleted_at" => Fog::Nullable::String,
9
- "id" => Integer,
10
- "name" => String,
11
- "updated_at" => Fog::Nullable::String
12
- }
13
-
14
- @detailed_aggregate_format = @aggregate_format.merge({
15
- 'hosts' => Array,
16
- })
17
-
18
- @metadata_aggregate_format = @aggregate_format.merge({
19
- "metadata" => Hash,
20
- })
21
-
22
- tests('success') do
23
- tests('#create_aggregate').data_matches_schema({'aggregate' => @aggregate_format}) do
24
- aggregate_body = Fog::Compute[:openstack].create_aggregate('test_aggregate').body
25
- @aggregate = aggregate_body['aggregate']
26
- aggregate_body
27
- end
28
-
29
- tests('#list_aggregates').data_matches_schema({'aggregates' => [@metadata_aggregate_format]}) do
30
- Fog::Compute[:openstack].list_aggregates.body
31
- end
32
-
33
- tests('#update_aggregate').data_matches_schema({'aggregate' => @aggregate_format}) do
34
- aggregate_attributes = {'name' => 'test_aggregate2'}
35
- Fog::Compute[:openstack].update_aggregate(@aggregate['id'], aggregate_attributes).body
36
- end
37
-
38
- tests('#get_aggregate').data_matches_schema({'aggregate' => @detailed_aggregate_format}) do
39
- Fog::Compute[:openstack].get_aggregate(@aggregate['id']).body
40
- end
41
-
42
- tests('#add_aggregate_host').succeeds do
43
- @host_name = Fog::Compute[:openstack].hosts.select{ |x| x.service_name == 'compute' }.first.host_name
44
- Fog::Compute[:openstack].add_aggregate_host(@aggregate['id'], @host_name)
45
- end
46
-
47
- tests('#remove_aggregate_host').succeeds do
48
- Fog::Compute[:openstack].remove_aggregate_host(@aggregate['id'], @host_name)
49
- end
50
-
51
- tests('#update_aggregate_metadata').succeeds do
52
- Fog::Compute[:openstack].update_aggregate_metadata(@aggregate['id'], {'test' => 'test', 'test2' => 'test2'})
53
- end
54
-
55
- tests('#delete_aggregate').succeeds do
56
- Fog::Compute[:openstack].delete_aggregate(@aggregate['id'])
57
- end
58
- end
59
- end