fog 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,21 @@
|
|
1
|
+
Shindo.tests("Fog::Network[:openstack] | networks", ['openstack']) do
|
2
|
+
@network = Fog::Network[:openstack].networks.create(:name => 'net_name',
|
3
|
+
:shared => false,
|
4
|
+
:admin_state_up => true,
|
5
|
+
:tenant_id => 'tenant_id')
|
6
|
+
@networks = Fog::Network[:openstack].networks
|
7
|
+
|
8
|
+
tests('success') do
|
9
|
+
|
10
|
+
tests('#all').succeeds do
|
11
|
+
@networks.all
|
12
|
+
end
|
13
|
+
|
14
|
+
tests('#get').succeeds do
|
15
|
+
@networks.get @network.id
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
@network.destroy
|
21
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
Shindo.tests("Fog::Network[:openstack] | port", ['openstack']) do
|
2
|
+
|
3
|
+
tests('success') do
|
4
|
+
|
5
|
+
tests('#create').succeeds do
|
6
|
+
@instance = Fog::Network[:openstack].ports.create(:name => 'port_name',
|
7
|
+
:network_id => 'net_id',
|
8
|
+
:fixed_ips => [],
|
9
|
+
:mac_address => 'fa:16:3e:62:91:7f',
|
10
|
+
:admin_state_up => true,
|
11
|
+
:device_owner => 'device_owner',
|
12
|
+
:device_id => 'device_id',
|
13
|
+
:tenant_id => 'tenant_id')
|
14
|
+
!@instance.id.nil?
|
15
|
+
end
|
16
|
+
|
17
|
+
tests('#update').succeeds do
|
18
|
+
@instance.name = 'new_port_name'
|
19
|
+
@instance.update
|
20
|
+
end
|
21
|
+
|
22
|
+
tests('#destroy').succeeds do
|
23
|
+
@instance.destroy == true
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Shindo.tests("Fog::Network[:openstack] | ports", ['openstack']) do
|
2
|
+
@port = Fog::Network[:openstack].ports.create(:name => 'port_name',
|
3
|
+
:network_id => 'net_id',
|
4
|
+
:fixed_ips => [],
|
5
|
+
:mac_address => 'fa:16:3e:62:91:7f',
|
6
|
+
:admin_state_up => true,
|
7
|
+
:device_owner => 'device_owner',
|
8
|
+
:device_id => 'device_id',
|
9
|
+
:tenant_id => 'tenant_id')
|
10
|
+
@ports = Fog::Network[:openstack].ports
|
11
|
+
|
12
|
+
tests('success') do
|
13
|
+
|
14
|
+
tests('#all').succeeds do
|
15
|
+
@ports.all
|
16
|
+
end
|
17
|
+
|
18
|
+
tests('#get').succeeds do
|
19
|
+
@ports.get @port.id
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
@port.destroy
|
25
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
Shindo.tests("Fog::Network[:openstack] | subnet", ['openstack']) do
|
2
|
+
|
3
|
+
tests('success') do
|
4
|
+
|
5
|
+
tests('#create').succeeds do
|
6
|
+
@instance = Fog::Network[:openstack].subnets.create(:name => 'subnet_name',
|
7
|
+
:network_id => 'net_id',
|
8
|
+
:cidr => '10.2.2.0/24',
|
9
|
+
:ip_version => 4,
|
10
|
+
:gateway_ip => '10.2.2.1',
|
11
|
+
:allocation_pools => [],
|
12
|
+
:dns_nameservers => [],
|
13
|
+
:host_routes => [],
|
14
|
+
:enable_dhcp => true,
|
15
|
+
:tenant_id => 'tenant_id')
|
16
|
+
!@instance.id.nil?
|
17
|
+
end
|
18
|
+
|
19
|
+
tests('#update').succeeds do
|
20
|
+
@instance.name = 'new_subnet_name'
|
21
|
+
@instance.update
|
22
|
+
end
|
23
|
+
|
24
|
+
tests('#destroy').succeeds do
|
25
|
+
@instance.destroy == true
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
Shindo.tests("Fog::Network[:openstack] | subnets", ['openstack']) do
|
2
|
+
@subnet = Fog::Network[:openstack].subnets.create(:name => 'subnet_name',
|
3
|
+
:network_id => 'net_id',
|
4
|
+
:cidr => '10.2.2.0/24',
|
5
|
+
:ip_version => 4,
|
6
|
+
:gateway_ip => '10.2.2.1',
|
7
|
+
:allocation_pools => [],
|
8
|
+
:dns_nameservers => [],
|
9
|
+
:host_routes => [],
|
10
|
+
:enable_dhcp => true,
|
11
|
+
:tenant_id => 'tenant_id')
|
12
|
+
@subnets = Fog::Network[:openstack].subnets
|
13
|
+
|
14
|
+
tests('success') do
|
15
|
+
|
16
|
+
tests('#all').succeeds do
|
17
|
+
@subnets.all
|
18
|
+
end
|
19
|
+
|
20
|
+
tests('#get').succeeds do
|
21
|
+
@subnets.get @subnet.id
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
@subnet.destroy
|
27
|
+
end
|
@@ -17,12 +17,12 @@ Shindo.tests('Fog::Compute[:openstack] | image requests', ['openstack']) do
|
|
17
17
|
}
|
18
18
|
|
19
19
|
tests('success') do
|
20
|
-
|
20
|
+
# Setup
|
21
21
|
@image_id = Fog::Compute[:openstack].images[0].id
|
22
|
-
|
23
22
|
unless Fog.mocking?
|
24
23
|
Fog::Compute[:openstack].images.get(@image_id).wait_for { ready? }
|
25
24
|
end
|
25
|
+
|
26
26
|
tests("#get_image_details(#{@image_id})").formats(@image_format) do
|
27
27
|
pending if Fog.mocking?
|
28
28
|
Fog::Compute[:openstack].get_image_details(@image_id).body['image']
|
@@ -36,14 +36,13 @@ Shindo.tests('Fog::Compute[:openstack] | image requests', ['openstack']) do
|
|
36
36
|
Fog::Compute[:openstack].list_images_detail.body
|
37
37
|
end
|
38
38
|
|
39
|
+
# Teardown
|
39
40
|
unless Fog.mocking?
|
40
41
|
Fog::Compute[:openstack].images.get(@image_id).wait_for { ready? }
|
41
42
|
end
|
42
|
-
|
43
43
|
end
|
44
44
|
|
45
45
|
tests('failure') do
|
46
|
-
|
47
46
|
tests('#delete_image(0)').raises(Fog::Compute::OpenStack::NotFound) do
|
48
47
|
pending if Fog.mocking?
|
49
48
|
Fog::Compute[:openstack].delete_image(0)
|
@@ -11,6 +11,8 @@ Shindo.tests('Fog::Compute[:openstack] | quota requests', ['openstack']) do
|
|
11
11
|
'instances' => Fixnum,
|
12
12
|
'volumes' => Fixnum,
|
13
13
|
'cores' => Fixnum,
|
14
|
+
'security_groups' => Fog::Nullable::Integer,
|
15
|
+
'security_group_rules' => Fog::Nullable::Integer,
|
14
16
|
'id' => String
|
15
17
|
}
|
16
18
|
|
@@ -2,21 +2,21 @@ Shindo.tests('Fog::Compute[:openstack] | security group requests', ['openstack']
|
|
2
2
|
@security_group = Hash.new
|
3
3
|
@security_group_rule = Hash.new
|
4
4
|
@security_group_format = {
|
5
|
-
"
|
6
|
-
"
|
7
|
-
"
|
8
|
-
"name"
|
5
|
+
"id" => Integer,
|
6
|
+
"rules" => Array,
|
7
|
+
"tenant_id" => String,
|
8
|
+
"name" => String,
|
9
9
|
"description" => String
|
10
10
|
}
|
11
11
|
|
12
12
|
@security_group_rule_format = {
|
13
|
-
"
|
14
|
-
"
|
13
|
+
"id" => Integer,
|
14
|
+
"from_port" => Integer,
|
15
|
+
"to_port" => Integer,
|
15
16
|
"ip_protocol" => String,
|
16
|
-
"
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"id" => Integer
|
17
|
+
"group" => Hash,
|
18
|
+
"ip_range" => Hash,
|
19
|
+
"parent_group_id" => Integer
|
20
20
|
}
|
21
21
|
|
22
22
|
tests('success') do
|
@@ -12,7 +12,9 @@ Shindo.tests('Fog::Compute[:openstack] | server requests', ['openstack']) do
|
|
12
12
|
'status' => String,
|
13
13
|
'accessIPv4' => Fog::Nullable::String,
|
14
14
|
'accessIPv6' => Fog::Nullable::String,
|
15
|
-
'links'
|
15
|
+
'links' => Array,
|
16
|
+
'created' => String,
|
17
|
+
'updated' => String
|
16
18
|
}
|
17
19
|
|
18
20
|
@image_format = {
|
@@ -3,19 +3,18 @@ require 'fog/openstack'
|
|
3
3
|
Shindo.tests('Fog::Compute[:openstack] | volume requests', ['openstack']) do
|
4
4
|
|
5
5
|
@volume_format = {
|
6
|
-
'id'
|
7
|
-
'
|
8
|
-
'size'
|
9
|
-
'
|
10
|
-
'status'
|
11
|
-
'
|
12
|
-
'
|
13
|
-
'attachments'
|
14
|
-
'
|
15
|
-
'
|
6
|
+
'id' => String,
|
7
|
+
'display_name' => String,
|
8
|
+
'size' => Integer,
|
9
|
+
'display_description' => String,
|
10
|
+
'status' => String,
|
11
|
+
'snapshot_id' => Fog::Nullable::String,
|
12
|
+
'availability_zone' => String,
|
13
|
+
'attachments' => Array,
|
14
|
+
'volume_type' => Fog::Nullable::String,
|
15
|
+
'created_at' => Time
|
16
16
|
}
|
17
17
|
|
18
|
-
|
19
18
|
tests('success') do
|
20
19
|
tests('#list_volumes').formats({'volumes' => [@volume_format]}) do
|
21
20
|
Fog::Compute[:openstack].list_volumes.body
|
@@ -23,7 +22,7 @@ Shindo.tests('Fog::Compute[:openstack] | volume requests', ['openstack']) do
|
|
23
22
|
|
24
23
|
tests('#get_volume_detail').formats({'volume' => @volume_format}) do
|
25
24
|
pending unless Fog.mocking?
|
26
|
-
Fog::Compute[:openstack].get_volume_details(
|
25
|
+
Fog::Compute[:openstack].get_volume_details(1).body
|
27
26
|
end
|
28
27
|
|
29
28
|
tests('#create_volume').formats({'volume' => @volume_format}) do
|
@@ -20,10 +20,11 @@ Shindo.tests('Fog::Identity[:openstack] | tenant requests', ['openstack']) do
|
|
20
20
|
|
21
21
|
tests('#list_roles_for_user_on_tenant(0,1)').
|
22
22
|
formats({'roles' => [@role_format]}) do
|
23
|
+
user = Fog::Identity[:openstack].create_user("testuser", "passw", "e@mail.co", "us3r1d").body['user']
|
23
24
|
|
24
25
|
openstack = Fog::Identity[:openstack]
|
25
26
|
openstack.list_roles_for_user_on_tenant(
|
26
|
-
openstack.
|
27
|
+
openstack.current_tenant['id'], user['id']).body
|
27
28
|
end
|
28
29
|
|
29
30
|
tests('#create_tenant').formats({'tenant' => @tenant_format}) do
|
@@ -1,75 +1,96 @@
|
|
1
1
|
Shindo.tests('Fog::Image[:openstack] | image requests', ['openstack']) do
|
2
|
+
openstack = Fog::Identity[:openstack]
|
3
|
+
@image_attributes = {
|
4
|
+
'name' => 'new image',
|
5
|
+
'owner' => openstack.current_tenant['id'],
|
6
|
+
'is_public' => 'true',
|
7
|
+
'copy_from' => 'http://website.com/image.iso',
|
8
|
+
'disk_format' => 'iso',
|
9
|
+
'properties' =>
|
10
|
+
{'user_id' => openstack.current_user['id'],
|
11
|
+
'owner_id' => openstack.current_tenant['id']},
|
12
|
+
'container_format'=> 'bare' }
|
2
13
|
|
3
14
|
@image_format = {
|
15
|
+
'name' => String,
|
16
|
+
'container_format' => String,
|
17
|
+
'disk_format' => String,
|
18
|
+
'checksum' => String,
|
19
|
+
'id' => String,
|
20
|
+
'size' => Integer
|
21
|
+
}
|
22
|
+
|
23
|
+
@detailed_image_format = {
|
4
24
|
'id' => String,
|
5
25
|
'name' => String,
|
6
|
-
'size' =>
|
7
|
-
'disk_format' =>
|
8
|
-
'container_format' =>
|
9
|
-
'checksum' =>
|
10
|
-
'min_disk' =>
|
11
|
-
'created_at' =>
|
26
|
+
'size' => Integer,
|
27
|
+
'disk_format' => String,
|
28
|
+
'container_format' => String,
|
29
|
+
'checksum' => String,
|
30
|
+
'min_disk' => Integer,
|
31
|
+
'created_at' => String,
|
12
32
|
'deleted_at' => Fog::Nullable::String,
|
13
|
-
'updated_at' =>
|
14
|
-
'deleted' => Fog::
|
15
|
-
'protected' => Fog::
|
16
|
-
'is_public' => Fog::
|
17
|
-
'status' =>
|
18
|
-
'min_ram' =>
|
33
|
+
'updated_at' => String,
|
34
|
+
'deleted' => Fog::Boolean,
|
35
|
+
'protected' => Fog::Boolean,
|
36
|
+
'is_public' => Fog::Boolean,
|
37
|
+
'status' => String,
|
38
|
+
'min_ram' => Integer,
|
19
39
|
'owner' => Fog::Nullable::String,
|
20
|
-
'properties' =>
|
40
|
+
'properties' => Hash
|
21
41
|
}
|
22
42
|
|
23
43
|
@image_meta_format ={
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
44
|
+
'X-Image-Meta-Is_public'=>String,
|
45
|
+
'X-Image-Meta-Min_disk'=>Fog::Nullable::String,
|
46
|
+
'X-Image-Meta-Property-Ramdisk_id'=>Fog::Nullable::String,
|
47
|
+
'X-Image-Meta-Disk_format'=>Fog::Nullable::String,
|
48
|
+
'X-Image-Meta-Created_at'=>String,
|
49
|
+
'X-Image-Meta-Container_format'=>Fog::Nullable::String,
|
50
|
+
'Etag'=>String,
|
51
|
+
'Location'=>String,
|
52
|
+
'X-Image-Meta-Protected'=>String,
|
53
|
+
'Date'=>String,
|
54
|
+
'X-Image-Meta-Name'=>String,
|
55
|
+
'X-Image-Meta-Min_ram'=>String,
|
56
|
+
'Content-Type'=>String,
|
57
|
+
'X-Image-Meta-Updated_at'=>String,
|
58
|
+
'X-Image-Meta-Property-Kernel_id'=>Fog::Nullable::String,
|
59
|
+
'X-Image-Meta-Size'=>String,
|
60
|
+
'X-Image-Meta-Checksum'=>Fog::Nullable::String,
|
61
|
+
'X-Image-Meta-Deleted'=>String,
|
62
|
+
'Content-Length'=>String,
|
63
|
+
'X-Image-Meta-Status'=>String,
|
64
|
+
'X-Image-Meta-Owner'=>String,
|
65
|
+
'X-Image-Meta-Id'=>String
|
66
|
+
}
|
46
67
|
|
47
68
|
@image_members_format =[
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
69
|
+
{'can_share'=>Fog::Nullable::Boolean,
|
70
|
+
'member_id'=>String
|
71
|
+
}
|
72
|
+
]
|
52
73
|
|
53
74
|
tests('success') do
|
54
75
|
tests('#list_public_images').formats({'images' => [@image_format]}) do
|
55
76
|
Fog::Image[:openstack].list_public_images.body
|
56
77
|
end
|
57
78
|
|
58
|
-
tests('#list_public_images_detailed').formats({'images' => [@
|
59
|
-
Fog::Image[:openstack].
|
79
|
+
tests('#list_public_images_detailed').formats({'images' => [@detailed_image_format]}) do
|
80
|
+
Fog::Image[:openstack].list_public_images_detailed.body
|
60
81
|
end
|
61
82
|
|
62
|
-
tests('#create_image').formats({'image' => @
|
63
|
-
@instance = Fog::Image[:openstack].create_image(
|
83
|
+
tests('#create_image').formats({'image' => @detailed_image_format}) do
|
84
|
+
@instance = Fog::Image[:openstack].create_image(@image_attributes).body
|
64
85
|
end
|
65
86
|
|
66
87
|
tests('#get_image').formats(@image_meta_format) do
|
67
88
|
Fog::Image[:openstack].get_image(@instance['image']['id']).headers
|
68
89
|
end
|
69
90
|
|
70
|
-
tests('#update_image').formats(@
|
91
|
+
tests('#update_image').formats(@detailed_image_format) do
|
71
92
|
Fog::Image[:openstack].update_image({:id => @instance['image']['id'],
|
72
|
-
:name =>
|
93
|
+
:name => 'edit image'}).body['image']
|
73
94
|
end
|
74
95
|
|
75
96
|
tests('#add_member_to_image').succeeds do
|
@@ -0,0 +1,56 @@
|
|
1
|
+
Shindo.tests('Fog::Network[:openstack] | network requests', ['openstack']) do
|
2
|
+
|
3
|
+
@network_format = {
|
4
|
+
'id' => String,
|
5
|
+
'name' => String,
|
6
|
+
'subnets' => Array,
|
7
|
+
'shared' => Fog::Boolean,
|
8
|
+
'status' => String,
|
9
|
+
'admin_state_up' => Fog::Boolean,
|
10
|
+
'tenant_id' => String,
|
11
|
+
}
|
12
|
+
|
13
|
+
tests('success') do
|
14
|
+
tests('#create_network').formats({'network' => @network_format}) do
|
15
|
+
attributes = {:name => 'net_name', :shared => false,
|
16
|
+
:admin_state_up => true, :tenant_id => 'tenant_id'}
|
17
|
+
Fog::Network[:openstack].create_network(attributes).body
|
18
|
+
end
|
19
|
+
|
20
|
+
tests('#list_networks').formats({'networks' => [@network_format]}) do
|
21
|
+
Fog::Network[:openstack].list_networks.body
|
22
|
+
end
|
23
|
+
|
24
|
+
tests('#get_network').formats({'network' => @network_format}) do
|
25
|
+
network_id = Fog::Network[:openstack].networks.all.first.id
|
26
|
+
Fog::Network[:openstack].get_network(network_id).body
|
27
|
+
end
|
28
|
+
|
29
|
+
tests('#update_network').formats({'network' => @network_format}) do
|
30
|
+
network_id = Fog::Network[:openstack].networks.all.first.id
|
31
|
+
attributes = {:name => 'net_name', :shared => false,
|
32
|
+
:admin_state_up => true}
|
33
|
+
Fog::Network[:openstack].update_network(network_id, attributes).body
|
34
|
+
end
|
35
|
+
|
36
|
+
tests('#delete_network').succeeds do
|
37
|
+
network_id = Fog::Network[:openstack].networks.all.first.id
|
38
|
+
Fog::Network[:openstack].delete_network(network_id)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
tests('failure') do
|
43
|
+
tests('#get_network').raises(Fog::Network::OpenStack::NotFound) do
|
44
|
+
Fog::Network[:openstack].get_network(0)
|
45
|
+
end
|
46
|
+
|
47
|
+
tests('#update_network').raises(Fog::Network::OpenStack::NotFound) do
|
48
|
+
Fog::Network[:openstack].update_network(0, {})
|
49
|
+
end
|
50
|
+
|
51
|
+
tests('#delete_network').raises(Fog::Network::OpenStack::NotFound) do
|
52
|
+
Fog::Network[:openstack].delete_network(0)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|