fog-openstack 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/Rakefile +25 -15
- data/{lib/fog/openstack/docs → docs}/compute.md +0 -0
- data/{lib/fog/openstack/docs → docs}/getting_started.md +0 -0
- data/{lib/fog/openstack/docs → docs}/introspection.md +0 -0
- data/{lib/fog/openstack/docs → docs}/metering.md +0 -0
- data/{lib/fog/openstack/docs → docs}/network.md +0 -0
- data/{lib/fog/openstack/docs → docs}/nfv.md +0 -0
- data/{lib/fog/openstack/docs → docs}/orchestration.md +0 -0
- data/{lib/fog/openstack/docs → docs}/planning.md +0 -0
- data/{lib/fog/openstack/docs → docs}/storage.md +0 -0
- data/{lib/fog/openstack/examples → examples}/compute/basics.rb +0 -0
- data/{lib/fog/openstack/examples → examples}/compute/block_device_mapping_v2.rb +0 -0
- data/{lib/fog/openstack/examples → examples}/identity/basics.rb +0 -0
- data/{lib/fog/openstack/examples → examples}/image/upload-test-image.rb +0 -0
- data/{lib/fog/openstack/examples → examples}/introspection/basics.rb +0 -0
- data/{lib/fog/openstack/examples → examples}/network/network_add_port.rb +0 -0
- data/{lib/fog/openstack/examples → examples}/network/network_rbac.rb +0 -0
- data/{lib/fog/openstack/examples → examples}/network/network_subnets_routers.rb +0 -0
- data/{lib/fog/openstack/examples → examples}/planning/basics.rb +0 -0
- data/{lib/fog/openstack/examples → examples}/storage/set-account-quota.rb +0 -0
- data/fog-openstack.gemspec +1 -1
- data/lib/fog/openstack.rb +6 -0
- data/lib/fog/openstack/models/compute/aggregate.rb +3 -2
- data/lib/fog/openstack/models/monitoring/alarm.rb +48 -0
- data/lib/fog/openstack/models/monitoring/alarm_count.rb +17 -0
- data/lib/fog/openstack/models/monitoring/alarm_counts.rb +16 -0
- data/lib/fog/openstack/models/monitoring/alarm_definition.rb +56 -0
- data/lib/fog/openstack/models/monitoring/alarm_definitions.rb +42 -0
- data/lib/fog/openstack/models/monitoring/alarm_state.rb +32 -0
- data/lib/fog/openstack/models/monitoring/alarm_states.rb +20 -0
- data/lib/fog/openstack/models/monitoring/alarms.rb +30 -0
- data/lib/fog/openstack/models/monitoring/measurement.rb +20 -0
- data/lib/fog/openstack/models/monitoring/measurements.rb +16 -0
- data/lib/fog/openstack/models/monitoring/metric.rb +27 -0
- data/lib/fog/openstack/models/monitoring/metrics.rb +28 -0
- data/lib/fog/openstack/models/monitoring/notification_method.rb +40 -0
- data/lib/fog/openstack/models/monitoring/notification_methods.rb +38 -0
- data/lib/fog/openstack/models/monitoring/statistic.rb +20 -0
- data/lib/fog/openstack/models/monitoring/statistics.rb +16 -0
- data/lib/fog/openstack/monitoring.rb +116 -0
- data/lib/fog/openstack/requests/compute/attach_volume.rb +1 -0
- data/lib/fog/openstack/requests/compute/create_aggregate.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_server.rb +2 -2
- data/lib/fog/openstack/requests/compute/detach_volume.rb +1 -0
- data/lib/fog/openstack/requests/compute/update_aggregate.rb +1 -1
- data/lib/fog/openstack/requests/monitoring/create_alarm_definition.rb +19 -0
- data/lib/fog/openstack/requests/monitoring/create_metric.rb +29 -0
- data/lib/fog/openstack/requests/monitoring/create_metric_array.rb +19 -0
- data/lib/fog/openstack/requests/monitoring/create_notification_method.rb +19 -0
- data/lib/fog/openstack/requests/monitoring/delete_alarm.rb +18 -0
- data/lib/fog/openstack/requests/monitoring/delete_alarm_definition.rb +18 -0
- data/lib/fog/openstack/requests/monitoring/delete_notification_method.rb +18 -0
- data/lib/fog/openstack/requests/monitoring/find_measurements.rb +22 -0
- data/lib/fog/openstack/requests/monitoring/get_alarm.rb +22 -0
- data/lib/fog/openstack/requests/monitoring/get_alarm_counts.rb +22 -0
- data/lib/fog/openstack/requests/monitoring/get_alarm_definition.rb +18 -0
- data/lib/fog/openstack/requests/monitoring/get_notification_method.rb +18 -0
- data/lib/fog/openstack/requests/monitoring/list_alarm_definitions.rb +22 -0
- data/lib/fog/openstack/requests/monitoring/list_alarm_state_history_for_all_alarms.rb +22 -0
- data/lib/fog/openstack/requests/monitoring/list_alarm_state_history_for_specific_alarm.rb +22 -0
- data/lib/fog/openstack/requests/monitoring/list_alarms.rb +22 -0
- data/lib/fog/openstack/requests/monitoring/list_metric_names.rb +22 -0
- data/lib/fog/openstack/requests/monitoring/list_metrics.rb +22 -0
- data/lib/fog/openstack/requests/monitoring/list_notification_methods.rb +22 -0
- data/lib/fog/openstack/requests/monitoring/list_statistics.rb +22 -0
- data/lib/fog/openstack/requests/monitoring/patch_alarm.rb +19 -0
- data/lib/fog/openstack/requests/monitoring/patch_alarm_definition.rb +19 -0
- data/lib/fog/openstack/requests/monitoring/update_alarm.rb +19 -0
- data/lib/fog/openstack/requests/monitoring/update_alarm_definition.rb +19 -0
- data/lib/fog/openstack/requests/monitoring/update_notification_method.rb +19 -0
- data/lib/fog/openstack/version.rb +1 -1
- metadata +65 -42
- data/tests/openstack/models/identity/ec2_credential_tests.rb +0 -41
- data/tests/openstack/models/identity/ec2_credentials_tests.rb +0 -58
- data/tests/openstack/models/identity/role_tests.rb +0 -31
- data/tests/openstack/models/identity/roles_tests.rb +0 -21
- data/tests/openstack/models/identity/tenant_tests.rb +0 -33
- data/tests/openstack/models/identity/tenants_tests.rb +0 -31
- data/tests/openstack/models/identity/user_tests.rb +0 -47
- data/tests/openstack/models/identity/users_tests.rb +0 -46
- data/tests/openstack/requests/baremetal/chassis_tests.rb +0 -48
- data/tests/openstack/requests/baremetal/driver_tests.rb +0 -40
- data/tests/openstack/requests/baremetal/node_tests.rb +0 -83
- data/tests/openstack/requests/baremetal/port_tests.rb +0 -56
- data/tests/openstack/requests/identity/ec2_credentials_tests.rb +0 -41
- data/tests/openstack/requests/identity/helper.rb +0 -21
- data/tests/openstack/requests/identity/role_tests.rb +0 -48
- data/tests/openstack/requests/identity/tenant_tests.rb +0 -57
- data/tests/openstack/requests/identity/user_tests.rb +0 -46
- data/tests/openstack/requests/introspection/introspection_tests.rb +0 -297
- data/tests/openstack/requests/introspection/rules_tests.rb +0 -46
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Monitoring
|
3
|
+
class OpenStack
|
4
|
+
class Real
|
5
|
+
def update_alarm_definition(id, alarm_definition)
|
6
|
+
request(
|
7
|
+
:expects => [200],
|
8
|
+
:method => 'PUT',
|
9
|
+
:path => "alarm-definitions/#{id}",
|
10
|
+
:body => Fog::JSON.encode(alarm_definition)
|
11
|
+
)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Mock
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Monitoring
|
3
|
+
class OpenStack
|
4
|
+
class Real
|
5
|
+
def update_notification_method(id, notification)
|
6
|
+
request(
|
7
|
+
:expects => [200],
|
8
|
+
:method => 'PUT',
|
9
|
+
:path => "notification-methods/#{id}",
|
10
|
+
:body => Fog::JSON.encode(notification)
|
11
|
+
)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Mock
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-openstack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Darby
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.40'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.40'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: fog-json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -214,6 +214,25 @@ files:
|
|
214
214
|
- Rakefile
|
215
215
|
- bin/console
|
216
216
|
- bin/setup
|
217
|
+
- docs/compute.md
|
218
|
+
- docs/getting_started.md
|
219
|
+
- docs/introspection.md
|
220
|
+
- docs/metering.md
|
221
|
+
- docs/network.md
|
222
|
+
- docs/nfv.md
|
223
|
+
- docs/orchestration.md
|
224
|
+
- docs/planning.md
|
225
|
+
- docs/storage.md
|
226
|
+
- examples/compute/basics.rb
|
227
|
+
- examples/compute/block_device_mapping_v2.rb
|
228
|
+
- examples/identity/basics.rb
|
229
|
+
- examples/image/upload-test-image.rb
|
230
|
+
- examples/introspection/basics.rb
|
231
|
+
- examples/network/network_add_port.rb
|
232
|
+
- examples/network/network_rbac.rb
|
233
|
+
- examples/network/network_subnets_routers.rb
|
234
|
+
- examples/planning/basics.rb
|
235
|
+
- examples/storage/set-account-quota.rb
|
217
236
|
- fog-openstack.gemspec
|
218
237
|
- gemfiles/Gemfile-1.9
|
219
238
|
- lib/fog/openstack.rb
|
@@ -221,26 +240,7 @@ files:
|
|
221
240
|
- lib/fog/openstack/common.rb
|
222
241
|
- lib/fog/openstack/compute.rb
|
223
242
|
- lib/fog/openstack/core.rb
|
224
|
-
- lib/fog/openstack/docs/compute.md
|
225
|
-
- lib/fog/openstack/docs/getting_started.md
|
226
|
-
- lib/fog/openstack/docs/introspection.md
|
227
|
-
- lib/fog/openstack/docs/metering.md
|
228
|
-
- lib/fog/openstack/docs/network.md
|
229
|
-
- lib/fog/openstack/docs/nfv.md
|
230
|
-
- lib/fog/openstack/docs/orchestration.md
|
231
|
-
- lib/fog/openstack/docs/planning.md
|
232
|
-
- lib/fog/openstack/docs/storage.md
|
233
243
|
- lib/fog/openstack/errors.rb
|
234
|
-
- lib/fog/openstack/examples/compute/basics.rb
|
235
|
-
- lib/fog/openstack/examples/compute/block_device_mapping_v2.rb
|
236
|
-
- lib/fog/openstack/examples/identity/basics.rb
|
237
|
-
- lib/fog/openstack/examples/image/upload-test-image.rb
|
238
|
-
- lib/fog/openstack/examples/introspection/basics.rb
|
239
|
-
- lib/fog/openstack/examples/network/network_add_port.rb
|
240
|
-
- lib/fog/openstack/examples/network/network_rbac.rb
|
241
|
-
- lib/fog/openstack/examples/network/network_subnets_routers.rb
|
242
|
-
- lib/fog/openstack/examples/planning/basics.rb
|
243
|
-
- lib/fog/openstack/examples/storage/set-account-quota.rb
|
244
244
|
- lib/fog/openstack/identity.rb
|
245
245
|
- lib/fog/openstack/identity_v2.rb
|
246
246
|
- lib/fog/openstack/identity_v3.rb
|
@@ -336,6 +336,22 @@ files:
|
|
336
336
|
- lib/fog/openstack/models/metering/resource.rb
|
337
337
|
- lib/fog/openstack/models/metering/resources.rb
|
338
338
|
- lib/fog/openstack/models/model.rb
|
339
|
+
- lib/fog/openstack/models/monitoring/alarm.rb
|
340
|
+
- lib/fog/openstack/models/monitoring/alarm_count.rb
|
341
|
+
- lib/fog/openstack/models/monitoring/alarm_counts.rb
|
342
|
+
- lib/fog/openstack/models/monitoring/alarm_definition.rb
|
343
|
+
- lib/fog/openstack/models/monitoring/alarm_definitions.rb
|
344
|
+
- lib/fog/openstack/models/monitoring/alarm_state.rb
|
345
|
+
- lib/fog/openstack/models/monitoring/alarm_states.rb
|
346
|
+
- lib/fog/openstack/models/monitoring/alarms.rb
|
347
|
+
- lib/fog/openstack/models/monitoring/measurement.rb
|
348
|
+
- lib/fog/openstack/models/monitoring/measurements.rb
|
349
|
+
- lib/fog/openstack/models/monitoring/metric.rb
|
350
|
+
- lib/fog/openstack/models/monitoring/metrics.rb
|
351
|
+
- lib/fog/openstack/models/monitoring/notification_method.rb
|
352
|
+
- lib/fog/openstack/models/monitoring/notification_methods.rb
|
353
|
+
- lib/fog/openstack/models/monitoring/statistic.rb
|
354
|
+
- lib/fog/openstack/models/monitoring/statistics.rb
|
339
355
|
- lib/fog/openstack/models/network/floating_ip.rb
|
340
356
|
- lib/fog/openstack/models/network/floating_ips.rb
|
341
357
|
- lib/fog/openstack/models/network/ike_policies.rb
|
@@ -419,6 +435,7 @@ files:
|
|
419
435
|
- lib/fog/openstack/models/volume_v2/volume_type.rb
|
420
436
|
- lib/fog/openstack/models/volume_v2/volume_types.rb
|
421
437
|
- lib/fog/openstack/models/volume_v2/volumes.rb
|
438
|
+
- lib/fog/openstack/monitoring.rb
|
422
439
|
- lib/fog/openstack/network.rb
|
423
440
|
- lib/fog/openstack/nfv.rb
|
424
441
|
- lib/fog/openstack/orchestration.rb
|
@@ -724,6 +741,31 @@ files:
|
|
724
741
|
- lib/fog/openstack/requests/metering/list_events.rb
|
725
742
|
- lib/fog/openstack/requests/metering/list_meters.rb
|
726
743
|
- lib/fog/openstack/requests/metering/list_resources.rb
|
744
|
+
- lib/fog/openstack/requests/monitoring/create_alarm_definition.rb
|
745
|
+
- lib/fog/openstack/requests/monitoring/create_metric.rb
|
746
|
+
- lib/fog/openstack/requests/monitoring/create_metric_array.rb
|
747
|
+
- lib/fog/openstack/requests/monitoring/create_notification_method.rb
|
748
|
+
- lib/fog/openstack/requests/monitoring/delete_alarm.rb
|
749
|
+
- lib/fog/openstack/requests/monitoring/delete_alarm_definition.rb
|
750
|
+
- lib/fog/openstack/requests/monitoring/delete_notification_method.rb
|
751
|
+
- lib/fog/openstack/requests/monitoring/find_measurements.rb
|
752
|
+
- lib/fog/openstack/requests/monitoring/get_alarm.rb
|
753
|
+
- lib/fog/openstack/requests/monitoring/get_alarm_counts.rb
|
754
|
+
- lib/fog/openstack/requests/monitoring/get_alarm_definition.rb
|
755
|
+
- lib/fog/openstack/requests/monitoring/get_notification_method.rb
|
756
|
+
- lib/fog/openstack/requests/monitoring/list_alarm_definitions.rb
|
757
|
+
- lib/fog/openstack/requests/monitoring/list_alarm_state_history_for_all_alarms.rb
|
758
|
+
- lib/fog/openstack/requests/monitoring/list_alarm_state_history_for_specific_alarm.rb
|
759
|
+
- lib/fog/openstack/requests/monitoring/list_alarms.rb
|
760
|
+
- lib/fog/openstack/requests/monitoring/list_metric_names.rb
|
761
|
+
- lib/fog/openstack/requests/monitoring/list_metrics.rb
|
762
|
+
- lib/fog/openstack/requests/monitoring/list_notification_methods.rb
|
763
|
+
- lib/fog/openstack/requests/monitoring/list_statistics.rb
|
764
|
+
- lib/fog/openstack/requests/monitoring/patch_alarm.rb
|
765
|
+
- lib/fog/openstack/requests/monitoring/patch_alarm_definition.rb
|
766
|
+
- lib/fog/openstack/requests/monitoring/update_alarm.rb
|
767
|
+
- lib/fog/openstack/requests/monitoring/update_alarm_definition.rb
|
768
|
+
- lib/fog/openstack/requests/monitoring/update_notification_method.rb
|
727
769
|
- lib/fog/openstack/requests/network/add_router_interface.rb
|
728
770
|
- lib/fog/openstack/requests/network/associate_floating_ip.rb
|
729
771
|
- lib/fog/openstack/requests/network/associate_lb_health_monitor.rb
|
@@ -1007,14 +1049,6 @@ files:
|
|
1007
1049
|
- tests/openstack/models/compute/security_group_tests.rb
|
1008
1050
|
- tests/openstack/models/compute/server_tests.rb
|
1009
1051
|
- tests/openstack/models/compute/service_tests.rb
|
1010
|
-
- tests/openstack/models/identity/ec2_credential_tests.rb
|
1011
|
-
- tests/openstack/models/identity/ec2_credentials_tests.rb
|
1012
|
-
- tests/openstack/models/identity/role_tests.rb
|
1013
|
-
- tests/openstack/models/identity/roles_tests.rb
|
1014
|
-
- tests/openstack/models/identity/tenant_tests.rb
|
1015
|
-
- tests/openstack/models/identity/tenants_tests.rb
|
1016
|
-
- tests/openstack/models/identity/user_tests.rb
|
1017
|
-
- tests/openstack/models/identity/users_tests.rb
|
1018
1052
|
- tests/openstack/models/image/image_tests.rb
|
1019
1053
|
- tests/openstack/models/image/images_tests.rb
|
1020
1054
|
- tests/openstack/models/network/floating_ip_tests.rb
|
@@ -1056,10 +1090,6 @@ files:
|
|
1056
1090
|
- tests/openstack/models/planning/plans_tests.rb
|
1057
1091
|
- tests/openstack/models/planning/role_tests.rb
|
1058
1092
|
- tests/openstack/models/storage/file_tests.rb
|
1059
|
-
- tests/openstack/requests/baremetal/chassis_tests.rb
|
1060
|
-
- tests/openstack/requests/baremetal/driver_tests.rb
|
1061
|
-
- tests/openstack/requests/baremetal/node_tests.rb
|
1062
|
-
- tests/openstack/requests/baremetal/port_tests.rb
|
1063
1093
|
- tests/openstack/requests/compute/address_tests.rb
|
1064
1094
|
- tests/openstack/requests/compute/aggregate_tests.rb
|
1065
1095
|
- tests/openstack/requests/compute/availability_zone_tests.rb
|
@@ -1074,14 +1104,7 @@ files:
|
|
1074
1104
|
- tests/openstack/requests/compute/service_tests.rb
|
1075
1105
|
- tests/openstack/requests/compute/tenant_tests.rb
|
1076
1106
|
- tests/openstack/requests/compute/volume_tests.rb
|
1077
|
-
- tests/openstack/requests/identity/ec2_credentials_tests.rb
|
1078
|
-
- tests/openstack/requests/identity/helper.rb
|
1079
|
-
- tests/openstack/requests/identity/role_tests.rb
|
1080
|
-
- tests/openstack/requests/identity/tenant_tests.rb
|
1081
|
-
- tests/openstack/requests/identity/user_tests.rb
|
1082
1107
|
- tests/openstack/requests/image/image_tests.rb
|
1083
|
-
- tests/openstack/requests/introspection/introspection_tests.rb
|
1084
|
-
- tests/openstack/requests/introspection/rules_tests.rb
|
1085
1108
|
- tests/openstack/requests/metering/event_tests.rb
|
1086
1109
|
- tests/openstack/requests/metering/meter_tests.rb
|
1087
1110
|
- tests/openstack/requests/metering/resource_tests.rb
|
@@ -1,41 +0,0 @@
|
|
1
|
-
Shindo.tests("Fog::Identity[:openstack] | ec2_credential", ['openstack']) do
|
2
|
-
before do
|
3
|
-
openstack = Fog::Identity::OpenStack.new(:openstack_auth_url => 'http://openstack:35357/v2.0/tokens')
|
4
|
-
tenant_id = openstack.list_tenants.body['tenants'].first['id']
|
5
|
-
|
6
|
-
@user = openstack.users.find { |user| user.name == 'foobar' }
|
7
|
-
@user ||= openstack.users.create({
|
8
|
-
:name => 'foobar',
|
9
|
-
:email => 'foo@bar.com',
|
10
|
-
:tenant_id => tenant_id,
|
11
|
-
:password => 'spoof',
|
12
|
-
:enabled => true
|
13
|
-
})
|
14
|
-
|
15
|
-
@ec2_credential = openstack.ec2_credentials.create({
|
16
|
-
:user_id => @user.id,
|
17
|
-
:tenant_id => tenant_id,
|
18
|
-
})
|
19
|
-
end
|
20
|
-
|
21
|
-
after do
|
22
|
-
@user.ec2_credentials.each do |ec2_credential|
|
23
|
-
ec2_credential.destroy
|
24
|
-
end
|
25
|
-
|
26
|
-
@user.destroy
|
27
|
-
end
|
28
|
-
|
29
|
-
tests('success') do
|
30
|
-
tests('#destroy').returns(true) do
|
31
|
-
@ec2_credential.destroy
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
tests('failure') do
|
36
|
-
tests('#save').raises(Fog::Errors::Error) do
|
37
|
-
@ec2_credential.save
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|
@@ -1,58 +0,0 @@
|
|
1
|
-
Shindo.tests("Fog::Identity[:openstack] | ec2_credentials", ['openstack']) do
|
2
|
-
before do
|
3
|
-
openstack = Fog::Identity::OpenStack.new(:openstack_auth_url => 'http://openstack:35357/v2.0/tokens')
|
4
|
-
tenant_id = openstack.list_tenants.body['tenants'].first['id']
|
5
|
-
|
6
|
-
@user = openstack.users.find { |user| user.name == 'foobar' }
|
7
|
-
@user ||= openstack.users.create({
|
8
|
-
:name => 'foobar',
|
9
|
-
:email => 'foo@bar.com',
|
10
|
-
:tenant_id => tenant_id,
|
11
|
-
:password => 'spoof',
|
12
|
-
:enabled => true
|
13
|
-
})
|
14
|
-
|
15
|
-
@ec2_credential = openstack.ec2_credentials.create({
|
16
|
-
:user_id => @user.id,
|
17
|
-
:tenant_id => tenant_id,
|
18
|
-
})
|
19
|
-
end
|
20
|
-
|
21
|
-
after do
|
22
|
-
@user.ec2_credentials.each do |ec2_credential|
|
23
|
-
ec2_credential.destroy
|
24
|
-
end
|
25
|
-
|
26
|
-
@user.destroy
|
27
|
-
end
|
28
|
-
|
29
|
-
tests('success') do
|
30
|
-
tests('#find_by_access_key').succeeds do
|
31
|
-
ec2_credential =
|
32
|
-
@user.ec2_credentials.find_by_access_key(@ec2_credential.access)
|
33
|
-
|
34
|
-
ec2_credential.access == @ec2_credential.access
|
35
|
-
end
|
36
|
-
|
37
|
-
tests('#create').succeeds do
|
38
|
-
@user.ec2_credentials.create
|
39
|
-
end
|
40
|
-
|
41
|
-
tests('#destroy').succeeds do
|
42
|
-
@user.ec2_credentials.destroy(@ec2_credential.access)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
tests('fails') do
|
47
|
-
pending if Fog.mocking?
|
48
|
-
|
49
|
-
tests('#find_by_access_key').raises(Fog::Identity::OpenStack::NotFound) do
|
50
|
-
@user.ec2_credentials.find_by_access_key('fake')
|
51
|
-
end
|
52
|
-
|
53
|
-
tests('#destroy').raises(Fog::Identity::OpenStack::NotFound) do
|
54
|
-
@user.ec2_credentials.destroy('fake')
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
Shindo.tests("Fog::Identity[:openstack] | role", ['openstack']) do
|
2
|
-
@identity = Fog::Identity::OpenStack.new(:openstack_auth_url => 'http://openstack:35357/v2.0/tokens')
|
3
|
-
@instance = @identity.roles.new(
|
4
|
-
:name => 'Role Name',
|
5
|
-
:user_id => 1,
|
6
|
-
:role_id => 1
|
7
|
-
)
|
8
|
-
@tenant = @identity.tenants.create(:name => 'test_user')
|
9
|
-
@user = @identity.users.create(:name => 'test_user', :tenant_id => @tenant.id, :password => 'spoof')
|
10
|
-
|
11
|
-
tests('success') do
|
12
|
-
tests('#save').returns(true) do
|
13
|
-
@instance.save
|
14
|
-
end
|
15
|
-
|
16
|
-
tests('#add_to_user(@user.id, @tenant.id)').returns(true) do
|
17
|
-
@instance.add_to_user(@user.id, @tenant.id)
|
18
|
-
end
|
19
|
-
|
20
|
-
tests('#remove_to_user(@user.id, @tenant.id)').returns(true) do
|
21
|
-
@instance.remove_to_user(@user.id, @tenant.id)
|
22
|
-
end
|
23
|
-
|
24
|
-
tests('#destroy').returns(true) do
|
25
|
-
@instance.destroy
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
@user.destroy
|
30
|
-
@tenant.destroy
|
31
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
Shindo.tests("Fog::Identity[:openstack] | roles", ['openstack']) do
|
2
|
-
@identity = Fog::Identity::OpenStack.new(:openstack_auth_url => 'http://openstack:35357/v2.0/tokens')
|
3
|
-
@tenant = @identity.tenants.create(:name => 'test_user')
|
4
|
-
@user = @identity.users.create(:name => 'test_user', :tenant_id => @tenant.id, :password => 'spoof')
|
5
|
-
@role = @identity.roles(:user => @user, :tenant => @tenant).create(:name => 'test_role')
|
6
|
-
@roles = @identity.roles(:user => @user, :tenant => @tenant)
|
7
|
-
|
8
|
-
tests('success') do
|
9
|
-
tests('#all').succeeds do
|
10
|
-
@roles.all
|
11
|
-
end
|
12
|
-
|
13
|
-
tests('#get').succeeds do
|
14
|
-
@roles.get @roles.first.id
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
@role.destroy
|
19
|
-
@user.destroy
|
20
|
-
@tenant.destroy
|
21
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
Shindo.tests("Fog::Identity[:openstack] | tenant", ['openstack']) do
|
2
|
-
tests('success') do
|
3
|
-
@openstack = Fog::Identity::OpenStack.new(:openstack_auth_url => 'http://openstack:35357/v2.0/tokens')
|
4
|
-
|
5
|
-
tests('#roles_for(0)').succeeds do
|
6
|
-
instance = @openstack.tenants.first
|
7
|
-
instance.roles_for(0)
|
8
|
-
end
|
9
|
-
|
10
|
-
tests('#users').succeeds do
|
11
|
-
instance = @openstack.tenants.first
|
12
|
-
openstack = Fog::Identity::OpenStack.new(:openstack_auth_url => 'http://openstack:35357/v2.0/tokens')
|
13
|
-
|
14
|
-
instance.users.count != openstack.users.count
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
tests('CRUD') do
|
19
|
-
tests('#create').succeeds do
|
20
|
-
@instance = @openstack.tenants.create(:name => 'test')
|
21
|
-
!@instance.id.nil?
|
22
|
-
end
|
23
|
-
|
24
|
-
tests('#update').succeeds do
|
25
|
-
@instance.update(:name => 'test2')
|
26
|
-
@instance.name == 'test2'
|
27
|
-
end
|
28
|
-
|
29
|
-
tests('#destroy').succeeds do
|
30
|
-
@instance.destroy == true
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
Shindo.tests("Fog::Compute[:openstack] | tenants", ['openstack']) do
|
2
|
-
openstack = Fog::Identity::OpenStack.new(:openstack_auth_url => 'http://openstack:35357/v2.0/tokens')
|
3
|
-
@instance = openstack.tenants.create(:name => 'test')
|
4
|
-
|
5
|
-
tests('success') do
|
6
|
-
tests('#find_by_id').succeeds do
|
7
|
-
openstack = Fog::Identity::OpenStack.new(:openstack_auth_url => 'http://openstack:35357/v2.0/tokens')
|
8
|
-
tenant = openstack.tenants.find_by_id(@instance.id)
|
9
|
-
tenant.id == @instance.id
|
10
|
-
end
|
11
|
-
|
12
|
-
tests('#destroy').succeeds do
|
13
|
-
openstack = Fog::Identity::OpenStack.new(:openstack_auth_url => 'http://openstack:35357/v2.0/tokens')
|
14
|
-
openstack.tenants.destroy(@instance.id)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
tests('fails') do
|
19
|
-
pending if Fog.mocking?
|
20
|
-
|
21
|
-
tests('#find_by_id').raises(Fog::Identity::OpenStack::NotFound) do
|
22
|
-
openstack = Fog::Identity::OpenStack.new(:openstack_auth_url => 'http://openstack:35357/v2.0/tokens')
|
23
|
-
openstack.tenants.find_by_id('fake')
|
24
|
-
end
|
25
|
-
|
26
|
-
tests('#destroy').raises(Fog::Identity::OpenStack::NotFound) do
|
27
|
-
openstack = Fog::Identity::OpenStack.new(:openstack_auth_url => 'http://openstack:35357/v2.0/tokens')
|
28
|
-
openstack.tenants.destroy('fake')
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|