fog 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/README.md +1 -0
- data/Rakefile +2 -1
- data/changelog.txt +184 -0
- data/docs/cdn/index.markdown +69 -3
- data/fog.gemspec +2 -2
- data/lib/fog.rb +2 -1
- data/lib/fog/atmos/models/storage/file.rb +16 -14
- data/lib/fog/aws/auto_scaling.rb +55 -13
- data/lib/fog/aws/cdn.rb +69 -9
- data/lib/fog/aws/cloud_watch.rb +15 -1
- data/lib/fog/aws/compute.rb +2 -0
- data/lib/fog/aws/models/auto_scaling/group.rb +10 -4
- data/lib/fog/aws/models/cdn/distribution.rb +93 -0
- data/lib/fog/aws/models/cdn/distribution_helper.rb +64 -0
- data/lib/fog/aws/models/cdn/distributions.rb +32 -0
- data/lib/fog/aws/models/cdn/distributions_helper.rb +47 -0
- data/lib/fog/aws/models/cdn/invalidation.rb +64 -0
- data/lib/fog/aws/models/cdn/invalidations.rb +54 -0
- data/lib/fog/aws/models/cdn/streaming_distribution.rb +77 -0
- data/lib/fog/aws/models/cdn/streaming_distributions.rb +32 -0
- data/lib/fog/aws/models/compute/server.rb +0 -23
- data/lib/fog/aws/models/compute/spot_request.rb +2 -24
- data/lib/fog/aws/models/rds/server.rb +18 -0
- data/lib/fog/aws/models/rds/subnet_group.rb +20 -0
- data/lib/fog/aws/models/rds/subnet_groups.rb +27 -0
- data/lib/fog/aws/models/storage/file.rb +1 -1
- data/lib/fog/aws/parsers/auto_scaling/describe_adjustment_types.rb +15 -2
- data/lib/fog/aws/parsers/auto_scaling/describe_auto_scaling_groups.rb +39 -13
- data/lib/fog/aws/parsers/auto_scaling/describe_auto_scaling_notification_types.rb +43 -0
- data/lib/fog/aws/parsers/auto_scaling/describe_metric_collection_types.rb +3 -3
- data/lib/fog/aws/parsers/auto_scaling/describe_notification_configurations.rb +42 -0
- data/lib/fog/aws/parsers/auto_scaling/describe_scaling_process_types.rb +15 -2
- data/lib/fog/aws/parsers/auto_scaling/describe_tags.rb +46 -0
- data/lib/fog/aws/parsers/auto_scaling/describe_termination_policy_types.rb +44 -0
- data/lib/fog/aws/parsers/cdn/get_invalidation.rb +32 -0
- data/lib/fog/aws/parsers/cloud_formation/describe_stacks.rb +1 -1
- data/lib/fog/aws/parsers/cloud_watch/list_metrics.rb +1 -1
- data/lib/fog/aws/parsers/compute/describe_availability_zones.rb +13 -2
- data/lib/fog/aws/parsers/compute/describe_reserved_instances.rb +1 -1
- data/lib/fog/aws/parsers/elasticache/base.rb +0 -2
- data/lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb +1 -1
- data/lib/fog/aws/parsers/elasticache/event_list.rb +2 -0
- data/lib/fog/aws/parsers/rds/base.rb +32 -0
- data/lib/fog/aws/parsers/rds/create_db_subnet_group.rb +38 -0
- data/lib/fog/aws/parsers/rds/describe_db_subnet_groups.rb +38 -0
- data/lib/fog/aws/parsers/rds/event_list.rb +40 -0
- data/lib/fog/aws/parsers/rds/subnet_group_parser.rb +38 -0
- data/lib/fog/aws/parsers/rds/tag_list_parser.rb +35 -0
- data/lib/fog/aws/rds.rb +24 -7
- data/lib/fog/aws/requests/auto_scaling/create_auto_scaling_group.rb +36 -16
- data/lib/fog/aws/requests/auto_scaling/create_launch_configuration.rb +19 -12
- data/lib/fog/aws/requests/auto_scaling/create_or_update_tags.rb +63 -0
- data/lib/fog/aws/requests/auto_scaling/delete_auto_scaling_group.rb +10 -3
- data/lib/fog/aws/requests/auto_scaling/delete_notification_configuration.rb +21 -5
- data/lib/fog/aws/requests/auto_scaling/delete_policy.rb +2 -2
- data/lib/fog/aws/requests/auto_scaling/delete_tags.rb +63 -0
- data/lib/fog/aws/requests/auto_scaling/describe_adjustment_types.rb +4 -3
- data/lib/fog/aws/requests/auto_scaling/describe_auto_scaling_groups.rb +17 -13
- data/lib/fog/aws/requests/auto_scaling/describe_auto_scaling_instances.rb +1 -1
- data/lib/fog/aws/requests/auto_scaling/describe_auto_scaling_notification_types.rb +55 -0
- data/lib/fog/aws/requests/auto_scaling/describe_metric_collection_types.rb +6 -5
- data/lib/fog/aws/requests/auto_scaling/describe_notification_configurations.rb +79 -0
- data/lib/fog/aws/requests/auto_scaling/describe_policies.rb +1 -1
- data/lib/fog/aws/requests/auto_scaling/describe_scaling_process_types.rb +4 -3
- data/lib/fog/aws/requests/auto_scaling/describe_tags.rb +74 -0
- data/lib/fog/aws/requests/auto_scaling/describe_termination_policy_types.rb +53 -0
- data/lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb +1 -1
- data/lib/fog/aws/requests/auto_scaling/enable_metrics_collection.rb +2 -2
- data/lib/fog/aws/requests/auto_scaling/put_notification_configuration.rb +30 -11
- data/lib/fog/aws/requests/auto_scaling/put_scaling_policy.rb +4 -4
- data/lib/fog/aws/requests/auto_scaling/put_scheduled_update_group_action.rb +8 -5
- data/lib/fog/aws/requests/auto_scaling/set_desired_capacity.rb +2 -2
- data/lib/fog/aws/requests/auto_scaling/set_instance_health.rb +2 -2
- data/lib/fog/aws/requests/auto_scaling/suspend_processes.rb +1 -1
- data/lib/fog/aws/requests/auto_scaling/update_auto_scaling_group.rb +30 -18
- data/lib/fog/aws/requests/cdn/delete_distribution.rb +31 -0
- data/lib/fog/aws/requests/cdn/delete_streaming_distribution.rb +30 -0
- data/lib/fog/aws/requests/cdn/get_distribution.rb +28 -0
- data/lib/fog/aws/requests/cdn/get_distribution_list.rb +29 -0
- data/lib/fog/aws/requests/cdn/get_invalidation.rb +60 -0
- data/lib/fog/aws/requests/cdn/get_invalidation_list.rb +41 -0
- data/lib/fog/aws/requests/cdn/get_streaming_distribution.rb +26 -0
- data/lib/fog/aws/requests/cdn/get_streaming_distribution_list.rb +30 -0
- data/lib/fog/aws/requests/cdn/post_distribution.rb +44 -0
- data/lib/fog/aws/requests/cdn/post_invalidation.rb +33 -0
- data/lib/fog/aws/requests/cdn/post_streaming_distribution.rb +44 -0
- data/lib/fog/aws/requests/cdn/put_distribution_config.rb +28 -0
- data/lib/fog/aws/requests/cdn/put_streaming_distribution_config.rb +28 -0
- data/lib/fog/aws/requests/compute/create_image.rb +32 -5
- data/lib/fog/aws/requests/compute/create_subnet.rb +3 -3
- data/lib/fog/aws/requests/compute/create_volume.rb +2 -2
- data/lib/fog/aws/requests/compute/register_image.rb +1 -1
- data/lib/fog/aws/requests/elasticache/describe_events.rb +7 -4
- data/lib/fog/aws/requests/glacier/create_archive.rb +1 -1
- data/lib/fog/aws/requests/glacier/initiate_multipart_upload.rb +1 -1
- data/lib/fog/aws/requests/rds/add_tags_to_resource.rb +46 -0
- data/lib/fog/aws/requests/rds/create_db_instance.rb +2 -0
- data/lib/fog/aws/requests/rds/create_db_subnet_group.rb +58 -0
- data/lib/fog/aws/requests/rds/describe_db_subnet_groups.rb +63 -0
- data/lib/fog/aws/requests/rds/describe_events.rb +52 -0
- data/lib/fog/aws/requests/rds/list_tags_for_resource.rb +44 -0
- data/lib/fog/aws/requests/rds/remove_tags_from_resource.rb +44 -0
- data/lib/fog/aws/sqs.rb +1 -1
- data/lib/fog/aws/storage.rb +1 -1
- data/lib/fog/bin/openstack.rb +5 -0
- data/lib/fog/bluebox/models/compute/server.rb +0 -19
- data/lib/fog/bluebox/requests/compute/create_block.rb +8 -8
- data/lib/fog/brightbox/compute.rb +56 -7
- data/lib/fog/brightbox/models/compute/accounts.rb +29 -0
- data/lib/fog/brightbox/models/compute/api_client.rb +37 -0
- data/lib/fog/brightbox/models/compute/api_clients.rb +24 -0
- data/lib/fog/brightbox/models/compute/application.rb +27 -0
- data/lib/fog/brightbox/models/compute/applications.rb +28 -0
- data/lib/fog/brightbox/models/compute/server.rb +3 -1
- data/lib/fog/brightbox/models/compute/users.rb +1 -3
- data/lib/fog/brightbox/requests/compute/create_application.rb +13 -0
- data/lib/fog/brightbox/requests/compute/create_cloud_ip.rb +2 -2
- data/lib/fog/brightbox/requests/compute/destroy_application.rb +14 -0
- data/lib/fog/brightbox/requests/compute/get_account.rb +28 -4
- data/lib/fog/brightbox/requests/compute/get_application.rb +14 -0
- data/lib/fog/brightbox/requests/compute/get_authenticated_user.rb +19 -0
- data/lib/fog/brightbox/requests/compute/get_scoped_account.rb +19 -0
- data/lib/fog/brightbox/requests/compute/get_user.rb +28 -5
- data/lib/fog/brightbox/requests/compute/list_accounts.rb +13 -0
- data/lib/fog/brightbox/requests/compute/list_applications.rb +13 -0
- data/lib/fog/brightbox/requests/compute/reset_secret_application.rb +14 -0
- data/lib/fog/brightbox/requests/compute/update_account.rb +51 -3
- data/lib/fog/brightbox/requests/compute/update_application.rb +15 -0
- data/lib/fog/brightbox/requests/compute/update_firewall_rule.rb +4 -2
- data/lib/fog/brightbox/requests/compute/update_scoped_account.rb +37 -0
- data/lib/fog/clodo/models/compute/server.rb +7 -44
- data/lib/fog/compute/models/server.rb +23 -2
- data/lib/fog/core/time.rb +2 -0
- data/lib/fog/core/wait_for.rb +0 -2
- data/lib/fog/ecloud/models/compute/servers.rb +3 -1
- data/lib/fog/ecloud/requests/compute/get_servers.rb +1 -1
- data/lib/fog/ecloud/requests/compute/get_tasks.rb +1 -1
- data/lib/fog/go_grid/models/compute/server.rb +0 -4
- data/lib/fog/google/storage.rb +1 -1
- data/lib/fog/hp/models/compute/server.rb +1 -23
- data/lib/fog/hp/storage.rb +0 -1
- data/lib/fog/joyent/models/compute/server.rb +4 -0
- data/lib/fog/joyent/models/compute/servers.rb +4 -3
- data/lib/fog/libvirt/models/compute/server.rb +1 -27
- data/lib/fog/linode/models/compute/server.rb +0 -1
- data/lib/fog/local/models/storage/directory.rb +1 -1
- data/lib/fog/network.rb +26 -0
- data/lib/fog/ninefold/compute.rb +8 -0
- data/lib/fog/ninefold/requests/compute/assign_to_load_balancer_rule.rb +13 -0
- data/lib/fog/ninefold/requests/compute/create_load_balancer_rule.rb +11 -0
- data/lib/fog/ninefold/requests/compute/delete_load_balancer_rule.rb +11 -0
- data/lib/fog/ninefold/requests/compute/list_load_balancer_rule_instances.rb +15 -0
- data/lib/fog/ninefold/requests/compute/list_load_balancer_rules.rb +14 -0
- data/lib/fog/ninefold/requests/compute/remove_from_load_balancer_rule.rb +12 -0
- data/lib/fog/ninefold/requests/compute/update_load_balancer_rule.rb +15 -0
- data/lib/fog/ninefold/storage.rb +14 -112
- data/lib/fog/openstack.rb +4 -1
- data/lib/fog/openstack/compute.rb +20 -1
- data/lib/fog/openstack/identity.rb +67 -18
- data/lib/fog/openstack/image.rb +12 -4
- data/lib/fog/openstack/models/compute/security_group.rb +1 -1
- data/lib/fog/openstack/models/compute/server.rb +5 -23
- data/lib/fog/openstack/models/identity/tenants.rb +5 -3
- data/lib/fog/openstack/models/identity/users.rb +4 -1
- data/lib/fog/openstack/models/image/image.rb +6 -1
- data/lib/fog/openstack/models/network/network.rb +46 -0
- data/lib/fog/openstack/models/network/networks.rb +34 -0
- data/lib/fog/openstack/models/network/port.rb +52 -0
- data/lib/fog/openstack/models/network/ports.rb +34 -0
- data/lib/fog/openstack/models/network/subnet.rb +55 -0
- data/lib/fog/openstack/models/network/subnets.rb +34 -0
- data/lib/fog/openstack/network.rb +234 -0
- data/lib/fog/openstack/requests/compute/attach_volume.rb +10 -0
- data/lib/fog/openstack/requests/compute/create_security_group.rb +15 -11
- data/lib/fog/openstack/requests/compute/create_security_group_rule.rb +17 -15
- data/lib/fog/openstack/requests/compute/create_server.rb +7 -1
- data/lib/fog/openstack/requests/compute/create_volume.rb +10 -10
- data/lib/fog/openstack/requests/compute/create_volume_snapshot.rb +16 -1
- data/lib/fog/openstack/requests/compute/detach_volume.rb +5 -0
- data/lib/fog/openstack/requests/compute/get_snapshot_details.rb +4 -4
- data/lib/fog/openstack/requests/compute/get_volume_details.rb +9 -9
- data/lib/fog/openstack/requests/compute/list_security_groups.rb +3 -3
- data/lib/fog/openstack/requests/compute/list_volumes.rb +14 -14
- data/lib/fog/openstack/requests/identity/create_tenant.rb +3 -3
- data/lib/fog/openstack/requests/identity/create_user.rb +1 -1
- data/lib/fog/openstack/requests/identity/delete_role.rb +1 -1
- data/lib/fog/openstack/requests/identity/get_tenant.rb +1 -1
- data/lib/fog/openstack/requests/identity/list_roles.rb +7 -0
- data/lib/fog/openstack/requests/image/create_image.rb +36 -38
- data/lib/fog/openstack/requests/image/delete_image.rb +0 -2
- data/lib/fog/openstack/requests/image/list_public_images.rb +7 -25
- data/lib/fog/openstack/requests/image/list_public_images_detailed.rb +2 -41
- data/lib/fog/openstack/requests/image/update_image.rb +26 -21
- data/lib/fog/openstack/requests/image/update_image_members.rb +37 -0
- data/lib/fog/openstack/requests/network/create_network.rb +44 -0
- data/lib/fog/openstack/requests/network/create_port.rb +52 -0
- data/lib/fog/openstack/requests/network/create_subnet.rb +56 -0
- data/lib/fog/openstack/requests/network/delete_network.rb +30 -0
- data/lib/fog/openstack/requests/network/delete_port.rb +30 -0
- data/lib/fog/openstack/requests/network/delete_subnet.rb +30 -0
- data/lib/fog/openstack/requests/network/get_network.rb +42 -0
- data/lib/fog/openstack/requests/network/get_port.rb +48 -0
- data/lib/fog/openstack/requests/network/get_subnet.rb +49 -0
- data/lib/fog/openstack/requests/network/list_networks.rb +27 -0
- data/lib/fog/openstack/requests/network/list_ports.rb +27 -0
- data/lib/fog/openstack/requests/network/list_subnets.rb +27 -0
- data/lib/fog/openstack/requests/network/set_tenant.rb +21 -0
- data/lib/fog/openstack/requests/network/update_network.rb +41 -0
- data/lib/fog/openstack/requests/network/update_port.rb +44 -0
- data/lib/fog/openstack/requests/network/update_subnet.rb +44 -0
- data/lib/fog/openstack/requests/volume/create_volume.rb +10 -10
- data/lib/fog/openstack/requests/volume/create_volume_snapshot.rb +16 -1
- data/lib/fog/openstack/requests/volume/get_snapshot_details.rb +6 -6
- data/lib/fog/openstack/requests/volume/get_volume_details.rb +10 -10
- data/lib/fog/openstack/requests/volume/list_volumes.rb +14 -14
- data/lib/fog/openstack/volume.rb +10 -0
- data/lib/fog/rackspace/models/compute/server.rb +1 -24
- data/lib/fog/rackspace/models/compute_v2/server.rb +4 -2
- data/lib/fog/rackspace/requests/compute_v2/create_server.rb +1 -1
- data/lib/fog/rackspace/requests/compute_v2/list_servers.rb +1 -1
- data/lib/fog/storm_on_demand/models/compute/server.rb +1 -5
- data/lib/fog/virtual_box/models/compute/server.rb +2 -44
- data/lib/fog/vmfusion/models/compute/server.rb +3 -36
- data/lib/fog/vsphere/models/compute/server.rb +1 -1
- data/lib/fog/vsphere/requests/compute/list_virtual_machines.rb +2 -31
- data/lib/fog/vsphere/requests/compute/vm_clone.rb +35 -7
- data/tests/aws/models/cdn/distribution_tests.rb +15 -0
- data/tests/aws/models/cdn/distributions_tests.rb +15 -0
- data/tests/aws/models/cdn/invalidation_tests.rb +32 -0
- data/tests/aws/models/cdn/invalidations_tests.rb +15 -0
- data/tests/aws/models/cdn/streaming_distribution_tests.rb +15 -0
- data/tests/aws/models/cdn/streaming_distributions_tests.rb +15 -0
- data/tests/aws/models/rds/tagging_tests.rb +20 -0
- data/tests/aws/requests/auto_scaling/auto_scaling_tests.rb +1 -11
- data/tests/aws/requests/auto_scaling/describe_types_tests.rb +102 -0
- data/tests/aws/requests/auto_scaling/helper.rb +47 -3
- data/tests/aws/requests/auto_scaling/notification_configuration_tests.rb +123 -0
- data/tests/aws/requests/auto_scaling/tag_tests.rb +62 -0
- data/tests/aws/requests/cdn/cdn_tests.rb +252 -0
- data/tests/aws/requests/compute/image_tests.rb +32 -1
- data/tests/aws/requests/compute/volume_tests.rb +3 -3
- data/tests/aws/requests/rds/describe_events.rb +16 -0
- data/tests/aws/requests/rds/helper.rb +26 -0
- data/tests/aws/requests/rds/subnet_groups_test.rb +48 -0
- data/tests/aws/requests/rds/tagging_tests.rb +78 -0
- data/tests/brightbox/requests/compute/account_tests.rb +24 -4
- data/tests/brightbox/requests/compute/application_test.rb +63 -0
- data/tests/brightbox/requests/compute/helper.rb +49 -1
- data/tests/helper.rb +4 -1
- data/tests/local/models/directory_tests.rb +16 -0
- data/tests/ninefold/requests/compute/helper.rb +53 -0
- data/tests/ninefold/requests/compute/load_balancer_tests.rb +66 -0
- data/tests/openstack/models/image/image_tests.rb +1 -0
- data/tests/openstack/models/network/network_tests.rb +24 -0
- data/tests/openstack/models/network/networks_tests.rb +21 -0
- data/tests/openstack/models/network/port_tests.rb +28 -0
- data/tests/openstack/models/network/ports_tests.rb +25 -0
- data/tests/openstack/models/network/subnet_tests.rb +30 -0
- data/tests/openstack/models/network/subnets_tests.rb +27 -0
- data/tests/openstack/requests/compute/image_tests.rb +3 -4
- data/tests/openstack/requests/compute/quota_tests.rb +2 -0
- data/tests/openstack/requests/compute/security_group_tests.rb +10 -10
- data/tests/openstack/requests/compute/server_tests.rb +3 -1
- data/tests/openstack/requests/compute/volume_tests.rb +11 -12
- data/tests/openstack/requests/identity/tenant_tests.rb +2 -1
- data/tests/openstack/requests/image/image_tests.rb +66 -45
- data/tests/openstack/requests/network/network_tests.rb +56 -0
- data/tests/openstack/requests/network/port_tests.rb +63 -0
- data/tests/openstack/requests/network/subnet_tests.rb +66 -0
- data/tests/rackspace/models/identity/user_tests.rb +1 -1
- data/tests/rackspace/models/identity/users_tests.rb +1 -1
- metadata +137 -13
- data/lib/fog/ninefold/models/storage/directories.rb +0 -48
- data/lib/fog/ninefold/models/storage/directory.rb +0 -53
- data/lib/fog/ninefold/models/storage/file.rb +0 -108
- data/lib/fog/ninefold/models/storage/files.rb +0 -73
- data/lib/fog/ninefold/requests/storage/delete_namespace.rb +0 -19
- data/lib/fog/ninefold/requests/storage/get_namespace.rb +0 -20
- data/lib/fog/ninefold/requests/storage/head_namespace.rb +0 -20
- data/lib/fog/ninefold/requests/storage/post_namespace.rb +0 -20
- data/lib/fog/ninefold/requests/storage/put_namespace.rb +0 -20
@@ -0,0 +1,78 @@
|
|
1
|
+
Shindo.tests('AWS::RDS | tagging requests', ['aws', 'rds']) do
|
2
|
+
@rds = Fog::AWS[:rds]
|
3
|
+
@db_instance_id = "fog-test-#{rand(65536).to_s(16)}"
|
4
|
+
Formatador.display_line "Creating RDS instance #{@db_instance_id}"
|
5
|
+
@rds.create_db_instance(@db_instance_id, 'AllocatedStorage' => 5,
|
6
|
+
'DBInstanceClass' => 'db.t1.micro', 'Engine' => 'mysql',
|
7
|
+
'MasterUsername' => 'foguser', 'MasterUserPassword' => 'fogpassword')
|
8
|
+
Formatador.display_line "Waiting for instance #{@db_instance_id} to be ready"
|
9
|
+
@db = @rds.servers.get(@db_instance_id)
|
10
|
+
@db.wait_for { ready? }
|
11
|
+
|
12
|
+
tests('success') do
|
13
|
+
|
14
|
+
single_tag = {'key1' => 'value1'}
|
15
|
+
two_tags = {'key2' => 'value2', 'key3' => 'value3'}
|
16
|
+
|
17
|
+
tests("#add_tags_to_resource with a single tag").
|
18
|
+
formats(AWS::RDS::Formats::BASIC) do
|
19
|
+
result = @rds.add_tags_to_resource(@db_instance_id, single_tag).body
|
20
|
+
returns(single_tag) do
|
21
|
+
@rds.list_tags_for_resource(@db_instance_id).
|
22
|
+
body['ListTagsForResourceResult']['TagList']
|
23
|
+
end
|
24
|
+
result
|
25
|
+
end
|
26
|
+
|
27
|
+
tests("#add_tags_to_resource with a multiple tags").
|
28
|
+
formats(AWS::RDS::Formats::BASIC) do
|
29
|
+
result = @rds.add_tags_to_resource(@db_instance_id, two_tags).body
|
30
|
+
returns(single_tag.merge(two_tags)) do
|
31
|
+
@rds.list_tags_for_resource(@db_instance_id).
|
32
|
+
body['ListTagsForResourceResult']['TagList']
|
33
|
+
end
|
34
|
+
result
|
35
|
+
end
|
36
|
+
|
37
|
+
tests("#remove_tags_from_resource").formats(AWS::RDS::Formats::BASIC) do
|
38
|
+
result = @rds.remove_tags_from_resource(
|
39
|
+
@db_instance_id, single_tag.keys).body
|
40
|
+
returns(two_tags) do
|
41
|
+
@rds.list_tags_for_resource(@db_instance_id).
|
42
|
+
body['ListTagsForResourceResult']['TagList']
|
43
|
+
end
|
44
|
+
result
|
45
|
+
end
|
46
|
+
|
47
|
+
tests("#list_tags_for_resource").
|
48
|
+
formats(AWS::RDS::Formats::LIST_TAGS_FOR_RESOURCE) do
|
49
|
+
result = @rds.list_tags_for_resource(@db_instance_id).body
|
50
|
+
returns(two_tags) do
|
51
|
+
result['ListTagsForResourceResult']['TagList']
|
52
|
+
end
|
53
|
+
result
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
tests('failure') do
|
59
|
+
tests "tagging a nonexisting instance" do
|
60
|
+
raises(Fog::AWS::RDS::NotFound) do
|
61
|
+
@rds.add_tags_to_resource('doesnexist', {'key1' => 'value1'})
|
62
|
+
end
|
63
|
+
end
|
64
|
+
tests "listing tags for a nonexisting instance" do
|
65
|
+
raises(Fog::AWS::RDS::NotFound) do
|
66
|
+
@rds.list_tags_for_resource('doesnexist')
|
67
|
+
end
|
68
|
+
end
|
69
|
+
tests "removing tags for a nonexisting instance" do
|
70
|
+
raises(Fog::AWS::RDS::NotFound) do
|
71
|
+
@rds.remove_tags_from_resource('doesnexist', ['key1'])
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
Formatador.display_line "Destroying DB instance #{@db_instance_id}"
|
77
|
+
@db.destroy
|
78
|
+
end
|
@@ -2,17 +2,37 @@ Shindo.tests('Fog::Compute[:brightbox] | account requests', ['brightbox']) do
|
|
2
2
|
|
3
3
|
tests('success') do
|
4
4
|
|
5
|
-
tests("#
|
5
|
+
tests("#list_accounts") do
|
6
6
|
pending if Fog.mocking?
|
7
|
-
result = Fog::Compute[:brightbox].
|
7
|
+
result = Fog::Compute[:brightbox].list_accounts
|
8
|
+
formats(Brightbox::Compute::Formats::Collection::ACCOUNTS, false) { result }
|
9
|
+
end
|
10
|
+
|
11
|
+
tests("#get_scoped_account") do
|
12
|
+
pending if Fog.mocking?
|
13
|
+
result = Fog::Compute[:brightbox].get_scoped_account
|
14
|
+
@scoped_account_identifier = result["id"]
|
15
|
+
formats(Brightbox::Compute::Formats::Full::ACCOUNT, false) { result }
|
16
|
+
test("ftp password is blanked") { result["library_ftp_password"].nil? }
|
17
|
+
end
|
18
|
+
|
19
|
+
tests("#get_account(#{@scoped_account_identifier}") do
|
20
|
+
pending if Fog.mocking?
|
21
|
+
result = Fog::Compute[:brightbox].get_account(@scoped_account_identifier)
|
8
22
|
formats(Brightbox::Compute::Formats::Full::ACCOUNT, false) { result }
|
9
23
|
test("ftp password is blanked") { result["library_ftp_password"].nil? }
|
10
24
|
end
|
11
25
|
|
12
26
|
update_options = {:name => "Fog@#{Time.now.iso8601}"}
|
13
|
-
tests("#
|
27
|
+
tests("#update_scoped_account(#{update_options.inspect})") do
|
28
|
+
pending if Fog.mocking?
|
29
|
+
result = Fog::Compute[:brightbox].update_scoped_account(update_options)
|
30
|
+
formats(Brightbox::Compute::Formats::Full::ACCOUNT, false) { result }
|
31
|
+
end
|
32
|
+
|
33
|
+
tests("#update_account(#{@scoped_account_identifier}, #{update_options.inspect})") do
|
14
34
|
pending if Fog.mocking?
|
15
|
-
result = Fog::Compute[:brightbox].update_account(update_options)
|
35
|
+
result = Fog::Compute[:brightbox].update_account(@scoped_account_identifier, update_options)
|
16
36
|
formats(Brightbox::Compute::Formats::Full::ACCOUNT, false) { result }
|
17
37
|
end
|
18
38
|
|
@@ -0,0 +1,63 @@
|
|
1
|
+
Shindo.tests('Fog::Compute[:brightbox] | api client requests', ['brightbox']) do
|
2
|
+
|
3
|
+
tests('success') do
|
4
|
+
|
5
|
+
create_options = {
|
6
|
+
:name => "Fog@#{Time.now.iso8601}"
|
7
|
+
}
|
8
|
+
|
9
|
+
tests("#create_application(#{create_options.inspect})") do
|
10
|
+
pending if Fog.mocking?
|
11
|
+
result = Fog::Compute[:brightbox].create_application(create_options)
|
12
|
+
@application_id = result["id"]
|
13
|
+
formats(Brightbox::Compute::Formats::Full::APPLICATION, false) { result }
|
14
|
+
end
|
15
|
+
|
16
|
+
tests("#list_applications") do
|
17
|
+
pending if Fog.mocking?
|
18
|
+
result = Fog::Compute[:brightbox].list_applications
|
19
|
+
formats(Brightbox::Compute::Formats::Collection::APPLICATION, false) { result }
|
20
|
+
end
|
21
|
+
|
22
|
+
tests("#get_application('#{@application_id}')") do
|
23
|
+
pending if Fog.mocking?
|
24
|
+
result = Fog::Compute[:brightbox].get_application(@application_id)
|
25
|
+
formats(Brightbox::Compute::Formats::Full::APPLICATION, false) { result }
|
26
|
+
end
|
27
|
+
|
28
|
+
update_options = {:name => "Fog@#{Time.now.iso8601}"}
|
29
|
+
tests("#update_application('#{@application_id}', #{update_options.inspect})") do
|
30
|
+
pending if Fog.mocking?
|
31
|
+
result = Fog::Compute[:brightbox].update_application(@application_id, update_options)
|
32
|
+
formats(Brightbox::Compute::Formats::Full::APPLICATION, false) { result }
|
33
|
+
end
|
34
|
+
|
35
|
+
tests("#reset_secret_application('#{@application_id}')") do
|
36
|
+
pending if Fog.mocking?
|
37
|
+
result = Fog::Compute[:brightbox].reset_secret_application(@application_id)
|
38
|
+
formats(Brightbox::Compute::Formats::Full::APPLICATION, false) { result }
|
39
|
+
test("new secret is visible") { ! result["secret"].nil? }
|
40
|
+
end
|
41
|
+
|
42
|
+
tests("#destroy_application('#{@application_id}')") do
|
43
|
+
pending if Fog.mocking?
|
44
|
+
result = Fog::Compute[:brightbox].destroy_application(@application_id)
|
45
|
+
formats(Brightbox::Compute::Formats::Full::APPLICATION, false) { result }
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
tests('failure') do
|
51
|
+
|
52
|
+
tests("#get_api_client('app-00000')").raises(Excon::Errors::NotFound) do
|
53
|
+
pending if Fog.mocking?
|
54
|
+
Fog::Compute[:brightbox].get_application('app-00000')
|
55
|
+
end
|
56
|
+
|
57
|
+
tests("#get_api_client").raises(ArgumentError) do
|
58
|
+
pending if Fog.mocking?
|
59
|
+
Fog::Compute[:brightbox].get_application
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
@@ -73,7 +73,7 @@ class Brightbox
|
|
73
73
|
def self.select_testing_image_from_api
|
74
74
|
images = Fog::Compute[:brightbox].list_images
|
75
75
|
raise "No available images!" if images.empty?
|
76
|
-
images.select {|img| img
|
76
|
+
images.select { |img| img["official"] && img["virtual_size"] != 0 }.sort_by { |img| img["disk_size"] }.first || images.first
|
77
77
|
end
|
78
78
|
|
79
79
|
end
|
@@ -239,6 +239,37 @@ class Brightbox
|
|
239
239
|
end
|
240
240
|
|
241
241
|
module Collected
|
242
|
+
ACCOUNT = {
|
243
|
+
"id" => String,
|
244
|
+
"resource_type" => String,
|
245
|
+
"url" => String,
|
246
|
+
"name" => String,
|
247
|
+
"status" => String,
|
248
|
+
"vat_registration_number" => Fog::Nullable::String,
|
249
|
+
"telephone_number" => Fog::Nullable::String,
|
250
|
+
"telephone_verified" => Fog::Nullable::Boolean,
|
251
|
+
"ram_limit" => Integer,
|
252
|
+
"ram_used" => Integer,
|
253
|
+
"cloud_ips_limit" => Integer,
|
254
|
+
"cloud_ips_used" => Integer,
|
255
|
+
"load_balancers_limit" => Integer,
|
256
|
+
"load_balancers_used" => Integer,
|
257
|
+
"library_ftp_password" => Fog::Nullable::String,
|
258
|
+
"verified_telephone" => Fog::Nullable::String,
|
259
|
+
"verified_at" => Fog::Nullable::String,
|
260
|
+
"verified_ip" => Fog::Nullable::String,
|
261
|
+
"owner" => Brightbox::Compute::Formats::Nested::USER,
|
262
|
+
"users" => [Brightbox::Compute::Formats::Nested::USER],
|
263
|
+
"clients" => [Brightbox::Compute::Formats::Nested::API_CLIENT],
|
264
|
+
"servers" => [Brightbox::Compute::Formats::Nested::SERVER],
|
265
|
+
"load_balancers" => [Brightbox::Compute::Formats::Nested::LOAD_BALANCER],
|
266
|
+
"cloud_ips" => [Brightbox::Compute::Formats::Nested::CLOUD_IP],
|
267
|
+
"server_groups" => [Brightbox::Compute::Formats::Nested::SERVER_GROUP],
|
268
|
+
"firewall_policies" => [Brightbox::Compute::Formats::Nested::FIREWALL_POLICY],
|
269
|
+
"images" => [Brightbox::Compute::Formats::Nested::IMAGE],
|
270
|
+
"zones" => [Brightbox::Compute::Formats::Nested::ZONE]
|
271
|
+
}
|
272
|
+
|
242
273
|
API_CLIENT = {
|
243
274
|
"id" => String,
|
244
275
|
"resource_type" => String,
|
@@ -249,6 +280,13 @@ class Brightbox
|
|
249
280
|
"account" => Brightbox::Compute::Formats::Nested::ACCOUNT
|
250
281
|
}
|
251
282
|
|
283
|
+
APPLICATION = {
|
284
|
+
"id" => String,
|
285
|
+
"resource_type" => String,
|
286
|
+
"url" => String,
|
287
|
+
"name" => Fog::Nullable::String
|
288
|
+
}
|
289
|
+
|
252
290
|
CLOUD_IP = {
|
253
291
|
"id" => String,
|
254
292
|
"resource_type" => String,
|
@@ -448,6 +486,14 @@ class Brightbox
|
|
448
486
|
"account" => Brightbox::Compute::Formats::Nested::ACCOUNT
|
449
487
|
}
|
450
488
|
|
489
|
+
APPLICATION = {
|
490
|
+
"id" => String,
|
491
|
+
"resource_type" => String,
|
492
|
+
"url" => String,
|
493
|
+
"name" => Fog::Nullable::String,
|
494
|
+
"secret" => Fog::Nullable::String
|
495
|
+
}
|
496
|
+
|
451
497
|
CLOUD_IP = {
|
452
498
|
"id" => String,
|
453
499
|
"resource_type" => String,
|
@@ -614,7 +660,9 @@ class Brightbox
|
|
614
660
|
end
|
615
661
|
|
616
662
|
module Collection
|
663
|
+
ACCOUNTS = [Brightbox::Compute::Formats::Collected::ACCOUNT]
|
617
664
|
API_CLIENTS = [Brightbox::Compute::Formats::Collected::API_CLIENT]
|
665
|
+
APPLICATION = [Brightbox::Compute::Formats::Collected::APPLICATION]
|
618
666
|
CLOUD_IPS = [Brightbox::Compute::Formats::Collected::CLOUD_IP]
|
619
667
|
IMAGES = [Brightbox::Compute::Formats::Collected::IMAGE]
|
620
668
|
FIREWALL_POLICIES = [Brightbox::Compute::Formats::Collected::FIREWALL_POLICY]
|
data/tests/helper.rb
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
ENV['FOG_RC'] = ENV['FOG_RC'] || File.expand_path('../.fog', __FILE__)
|
2
|
+
ENV['FOG_CREDENTIAL'] = ENV['FOG_CREDENTIAL'] || 'default'
|
3
|
+
|
1
4
|
require 'fog'
|
2
5
|
require 'fog/bin' # for available_providers and registered_providers
|
3
6
|
|
@@ -22,7 +25,7 @@ available_providers = Fog.available_providers.map {|provider| provider.downcase}
|
|
22
25
|
unavailable_providers = all_providers - available_providers
|
23
26
|
|
24
27
|
for provider in unavailable_providers
|
25
|
-
Formatador.display_line("[yellow]Skipping tests for [bold]#{provider}[/] [yellow]due to lacking credentials (add some to '
|
28
|
+
Formatador.display_line("[yellow]Skipping tests for [bold]#{provider}[/] [yellow]due to lacking credentials (add some to '#{Fog.credentials_path}' to run them)[/]")
|
26
29
|
Thread.current[:tags] << ('-' << provider)
|
27
30
|
end
|
28
31
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Shindo.tests('Storage[:local] | directory', ["local"]) do
|
2
|
+
|
3
|
+
pending if Fog.mocking?
|
4
|
+
|
5
|
+
before do
|
6
|
+
@options = { :local_root => '~/.fog' }
|
7
|
+
end
|
8
|
+
|
9
|
+
tests('save') do
|
10
|
+
returns(true) do
|
11
|
+
connection = Fog::Storage::Local.new(@options)
|
12
|
+
connection.directories.create(:key => 'directory')
|
13
|
+
connection.directories.create(:key => 'directory')
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -312,6 +312,59 @@ class Ninefold
|
|
312
312
|
}
|
313
313
|
FORWARDING_RULES = [FORWARDING_RULE]
|
314
314
|
end
|
315
|
+
module LoadBalancers
|
316
|
+
CREATE_LOAD_BALANCER_RULE_RESPONSE = {
|
317
|
+
"id"=>Integer,
|
318
|
+
"account"=>String,
|
319
|
+
"algorithm"=>String,
|
320
|
+
"cidrlist"=>String,
|
321
|
+
"domain"=>String,
|
322
|
+
"domainid"=>Integer,
|
323
|
+
"name"=>String,
|
324
|
+
"privateport"=>String,
|
325
|
+
"publicip"=>String,
|
326
|
+
"publicipid"=>Integer,
|
327
|
+
"publicport"=>String,
|
328
|
+
"state"=>String,
|
329
|
+
"zoneid"=>Integer
|
330
|
+
}
|
331
|
+
ASSIGN_LOAD_BALANCER_RULE_RESPONSE = {
|
332
|
+
"success"=>Fog::Boolean
|
333
|
+
}
|
334
|
+
LIST_LOAD_BALANCER_RULES_RESPONSE = {
|
335
|
+
"id"=>Integer,
|
336
|
+
"name"=>String,
|
337
|
+
"publicipid"=>Integer,
|
338
|
+
"publicip"=>String,
|
339
|
+
"publicport"=>String,
|
340
|
+
"privateport"=>String,
|
341
|
+
"algorithm"=>String,
|
342
|
+
"cidrlist"=>String,
|
343
|
+
"account"=>String,
|
344
|
+
"domainid"=>Integer,
|
345
|
+
"domain"=>String,
|
346
|
+
"state"=>String,
|
347
|
+
"zoneid"=>Integer
|
348
|
+
}
|
349
|
+
UPDATE_LOAD_BALANCER_RULE_RESPONSE = {
|
350
|
+
"id"=>Integer,
|
351
|
+
"name"=>String,
|
352
|
+
"publicipid"=>Integer,
|
353
|
+
"publicip"=>String,
|
354
|
+
"publicport"=>String,
|
355
|
+
"privateport"=>String,
|
356
|
+
"algorithm"=>String,
|
357
|
+
"cidrlist"=>String,
|
358
|
+
"account"=>String,
|
359
|
+
"domainid"=>Integer,
|
360
|
+
"domain"=>String,
|
361
|
+
"state"=>String,
|
362
|
+
"zoneid"=>Integer
|
363
|
+
}
|
364
|
+
REMOVE_FROM_LOAD_BALANCER_RULE_RESPONSE = {
|
365
|
+
"success"=>Fog::Boolean
|
366
|
+
}
|
367
|
+
end
|
315
368
|
end
|
316
369
|
end
|
317
370
|
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
Shindo.tests('Fog::Compute[:ninefold] | load balancers', ['ninefold']) do
|
2
|
+
|
3
|
+
# NOTE: all of these tests require you to have a vm built with a public IP address.
|
4
|
+
tests('success') do
|
5
|
+
|
6
|
+
before do
|
7
|
+
@compute = Fog::Compute[:ninefold]
|
8
|
+
unless Fog.mocking?
|
9
|
+
@public_ip_id = @compute.list_public_ip_addresses.first['id']
|
10
|
+
@server_id = @compute.servers.all.first.id
|
11
|
+
@create_load_balancer = @compute.create_load_balancer_rule(:algorithm => 'roundrobin', :name => 'test',
|
12
|
+
:privateport => 1000, :publicport => 2000,
|
13
|
+
:publicipid => @public_ip_id)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
after do
|
18
|
+
unless Fog.mocking?
|
19
|
+
delete = @compute.delete_load_balancer_ruler(:id => @create_load_balancer['id'])
|
20
|
+
Ninefold::Compute::TestSupport.wait_for_job(delete['jobid'])
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
tests("#create_load_balancer_rule()").formats(Ninefold::Compute::Formats::LoadBalancers::CREATE_LOAD_BALANCER_RULE_RESPONSE) do
|
25
|
+
pending if Fog.mocking?
|
26
|
+
result = Ninefold::Compute::TestSupport.wait_for_job(@create_load_balancer['jobid'])
|
27
|
+
result['jobresult']['loadbalancer']
|
28
|
+
end
|
29
|
+
|
30
|
+
tests("#assign_to_load_balancer_rule()").formats(Ninefold::Compute::Formats::LoadBalancers::ASSIGN_LOAD_BALANCER_RULE_RESPONSE) do
|
31
|
+
pending if Fog.mocking?
|
32
|
+
assign_load_balancer = @compute.assign_to_load_balancer_rule(:id => @create_load_balancer['id'], :virtualmachineids => @server_id)
|
33
|
+
result = Ninefold::Compute::TestSupport.wait_for_job(assign_load_balancer['jobid'])
|
34
|
+
result['jobresult']
|
35
|
+
end
|
36
|
+
|
37
|
+
tests("#list_to_load_balancer_rules()").formats(Ninefold::Compute::Formats::LoadBalancers::LIST_LOAD_BALANCER_RULES_RESPONSE) do
|
38
|
+
pending if Fog.mocking?
|
39
|
+
list_load_balancer_rules = @compute.list_load_balancer_rules
|
40
|
+
list_load_balancer_rules['loadbalancerrule'].first
|
41
|
+
end
|
42
|
+
|
43
|
+
tests("#update_to_load_balancer_rule()").formats(Ninefold::Compute::Formats::LoadBalancers::UPDATE_LOAD_BALANCER_RULE_RESPONSE) do
|
44
|
+
pending if Fog.mocking?
|
45
|
+
update_load_balancer = @compute.update_load_balancer_rule(:id => @create_load_balancer['id'], :algorithm => 'source')
|
46
|
+
result = Ninefold::Compute::TestSupport.wait_for_job(update_load_balancer['jobid'])
|
47
|
+
result['jobresult']['loadbalancer']
|
48
|
+
end
|
49
|
+
|
50
|
+
tests('with assigned to load balancer rule') do
|
51
|
+
before do
|
52
|
+
unless Fog.mocking?
|
53
|
+
assign_load_balancer = @compute.assign_to_load_balancer_rule(:id => @create_load_balancer['id'], :virtualmachineids => @server_id)
|
54
|
+
result = Ninefold::Compute::TestSupport.wait_for_job(assign_load_balancer['jobid'])
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
tests("#remove_from_load_balancer_rule()").formats(Ninefold::Compute::Formats::LoadBalancers::REMOVE_FROM_LOAD_BALANCER_RULE_RESPONSE) do
|
59
|
+
pending if Fog.mocking?
|
60
|
+
remove = @compute.remove_from_load_balancer_rule(:id => @create_load_balancer['id'], :virtualmachineids => @server_id)
|
61
|
+
result = Ninefold::Compute::TestSupport.wait_for_job(remove['jobid'])
|
62
|
+
result['jobresult']
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
Shindo.tests("Fog::Network[:openstack] | network", ['openstack']) do
|
2
|
+
|
3
|
+
tests('success') do
|
4
|
+
|
5
|
+
tests('#create').succeeds do
|
6
|
+
@instance = Fog::Network[:openstack].networks.create(:name => 'net_name',
|
7
|
+
:shared => false,
|
8
|
+
:admin_state_up => true,
|
9
|
+
:tenant_id => 'tenant_id')
|
10
|
+
!@instance.id.nil?
|
11
|
+
end
|
12
|
+
|
13
|
+
tests('#update').succeeds do
|
14
|
+
@instance.name = 'new_net_name'
|
15
|
+
@instance.update
|
16
|
+
end
|
17
|
+
|
18
|
+
tests('#destroy').succeeds do
|
19
|
+
@instance.destroy == true
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|