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
@@ -21,7 +21,7 @@ module Fog
|
|
21
21
|
# * 'subnetId'<~String> - The Subnet's ID
|
22
22
|
# * 'state'<~String> - The current state of the Subnet. ['pending', 'available']
|
23
23
|
# * 'cidrBlock'<~String> - The CIDR block the Subnet covers.
|
24
|
-
# * 'AvailableIpAddressCount'<~Integer> - The number of unused IP addresses in the subnet (the IP addresses for any stopped
|
24
|
+
# * 'AvailableIpAddressCount'<~Integer> - The number of unused IP addresses in the subnet (the IP addresses for any stopped
|
25
25
|
# instances are considered unavailable)
|
26
26
|
# * 'AvailabilityZone'<~String> - The Availability Zone the subnet is in
|
27
27
|
# * 'tagSet'<~Array>: Tags assigned to the resource.
|
@@ -39,7 +39,7 @@ module Fog
|
|
39
39
|
|
40
40
|
end
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
class Mock
|
44
44
|
def create_subnet(vpcId, cidrBlock, options = {})
|
45
45
|
av_zone = options['AvailabilityZone'].nil? ? 'us-east-1c' : options['AvailabilityZone']
|
@@ -49,7 +49,7 @@ module Fog
|
|
49
49
|
self.data[:subnets].push({
|
50
50
|
'subnetId' => Fog::AWS::Mock.request_id,
|
51
51
|
'state' => 'pending',
|
52
|
-
'vpcId' =>
|
52
|
+
'vpcId' => vpcId,
|
53
53
|
'cidrBlock' => cidrBlock,
|
54
54
|
'availableIpAddressCount' => "255",
|
55
55
|
'availabilityZone' => av_zone,
|
@@ -83,8 +83,8 @@ module Fog
|
|
83
83
|
raise Fog::Compute::AWS::Error.new("VolumeIOPSLimit => Volume iops of #{iops} is too low; minimum is 100.")
|
84
84
|
end
|
85
85
|
|
86
|
-
if iops >
|
87
|
-
raise Fog::Compute::AWS::Error.new("VolumeIOPSLimit => Volume iops of #{iops} is too high; maximum is
|
86
|
+
if iops > 2000
|
87
|
+
raise Fog::Compute::AWS::Error.new("VolumeIOPSLimit => Volume iops of #{iops} is too high; maximum is 2000.")
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
@@ -102,7 +102,7 @@ module Fog
|
|
102
102
|
'ebs' => {}
|
103
103
|
}
|
104
104
|
["DeviceName","VirtualName"].each do |n|
|
105
|
-
block_device_mapping = bd[n] if bd[n]
|
105
|
+
block_device_mapping[n] = bd[n] if bd[n]
|
106
106
|
end
|
107
107
|
["SnapshotId","VolumeSize","NoDevice","DeleteOnTermination"].each do |n|
|
108
108
|
block_device_mapping['ebs'][n] = bd[n] if bd[n]
|
@@ -6,16 +6,19 @@ module Fog
|
|
6
6
|
require 'fog/aws/parsers/elasticache/event_list'
|
7
7
|
|
8
8
|
# Returns a list of service events
|
9
|
+
#
|
10
|
+
# For more information see:
|
11
|
+
# http://docs.amazonwebservices.com/AmazonElastiCache/latest/APIReference/API_DescribeEvents.html
|
9
12
|
#
|
10
13
|
# === Parameters (optional)
|
11
14
|
# * options <~Hash> (optional):
|
12
15
|
# * :start_time <~DateTime> - starting time for event records
|
13
16
|
# * :end_time <~DateTime> - ending time for event records
|
14
|
-
# * :duration <~
|
17
|
+
# * :duration <~Integer> - time span for event records
|
15
18
|
# * :marker <~String> - marker provided in the previous request
|
16
19
|
# * :max_records <~Integer> - the maximum number of records to include
|
17
|
-
# * :source_identifier <~
|
18
|
-
# * :source_type <~
|
20
|
+
# * :source_identifier <~String> - identifier of the event source
|
21
|
+
# * :source_type <~String> - event type, one of:
|
19
22
|
# (cache-cluster | cache-parameter-group | cache-security-group)
|
20
23
|
# === Returns
|
21
24
|
# * response <~Excon::Response>:
|
@@ -23,7 +26,7 @@ module Fog
|
|
23
26
|
def describe_events(options = {})
|
24
27
|
request(
|
25
28
|
'Action' => 'DescribeEvents',
|
26
|
-
'StartTime' => options[:
|
29
|
+
'StartTime' => options[:start_time],
|
27
30
|
'EndTime' => options[:end_time],
|
28
31
|
'Duration' => options[:duration],
|
29
32
|
'Marker' => options[:marker],
|
@@ -26,7 +26,7 @@ module Fog
|
|
26
26
|
'x-amz-content-sha256' => Digest::SHA256.hexdigest(body),
|
27
27
|
'x-amz-sha256-tree-hash' => Fog::AWS::Glacier::TreeHash.digest(body)
|
28
28
|
}
|
29
|
-
headers['x-amz-archive-description'] = options['description'] if options['description']
|
29
|
+
headers['x-amz-archive-description'] = Fog::AWS.escape(options['description']) if options['description']
|
30
30
|
|
31
31
|
request(
|
32
32
|
:expects => 201,
|
@@ -23,7 +23,7 @@ module Fog
|
|
23
23
|
path = "/#{account_id}/vaults/#{Fog::AWS.escape(name)}/multipart-uploads"
|
24
24
|
|
25
25
|
headers = {'x-amz-part-size' => part_size.to_s}
|
26
|
-
headers['x-amz-archive-description'] = options['description'] if options['description']
|
26
|
+
headers['x-amz-archive-description'] = Fog::AWS.escape(options['description']) if options['description']
|
27
27
|
request(
|
28
28
|
:expects => 201,
|
29
29
|
:headers => headers,
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class RDS
|
4
|
+
class Real
|
5
|
+
|
6
|
+
# adds tags to a database instance
|
7
|
+
# http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/API_AddTagsToResource.html
|
8
|
+
# ==== Parameters
|
9
|
+
# * rds_id <~String> - name of the RDS instance whose tags are to be retrieved
|
10
|
+
# * tags <~Hash> A Hash of (String) key-value pairs
|
11
|
+
# ==== Returns
|
12
|
+
# * response<~Excon::Response>:
|
13
|
+
# * body<~Hash>:
|
14
|
+
def add_tags_to_resource(rds_id, tags)
|
15
|
+
keys = tags.keys.sort
|
16
|
+
values = keys.map {|key| tags[key]}
|
17
|
+
request({
|
18
|
+
'Action' => 'AddTagsToResource',
|
19
|
+
'ResourceName' => "arn:aws:rds:#{@region}:#{owner_id}:db:#{rds_id}",
|
20
|
+
:parser => Fog::Parsers::AWS::RDS::Base.new,
|
21
|
+
}.merge(Fog::AWS.indexed_param('Tags.member.%d.Key', keys)).
|
22
|
+
merge(Fog::AWS.indexed_param('Tags.member.%d.Value', values)))
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
class Mock
|
28
|
+
|
29
|
+
def add_tags_to_resource(rds_id, tags)
|
30
|
+
response = Excon::Response.new
|
31
|
+
if server = self.data[:servers][rds_id]
|
32
|
+
self.data[:tags][rds_id].merge! tags
|
33
|
+
response.status = 200
|
34
|
+
response.body = {
|
35
|
+
"ResponseMetadata"=>{ "RequestId"=> Fog::AWS::Mock.request_id }
|
36
|
+
}
|
37
|
+
response
|
38
|
+
else
|
39
|
+
raise Fog::AWS::RDS::NotFound.new("DBInstance #{rds_id} not found")
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -115,6 +115,8 @@ module Fog
|
|
115
115
|
response.status = 200
|
116
116
|
# This values aren't showed at creating time but at available time
|
117
117
|
self.data[:servers][db_name]["InstanceCreateTime"] = Time.now
|
118
|
+
self.data[:tags] ||= {}
|
119
|
+
self.data[:tags][db_name] = {}
|
118
120
|
response
|
119
121
|
end
|
120
122
|
|
@@ -0,0 +1,58 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class RDS
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/aws/parsers/rds/create_db_subnet_group'
|
7
|
+
|
8
|
+
# Creates a db subnet group
|
9
|
+
# http://docs.amazonwebservices.com/AmazonRDS/2012-01-15/APIReference/API_CreateDBSubnetGroup.html
|
10
|
+
# ==== Parameters
|
11
|
+
# * DBSubnetGroupName <~String> - The name for the DB Subnet Group. This value is stored as a lowercase string. Must contain no more than 255 alphanumeric characters or hyphens. Must not be "Default".
|
12
|
+
# * SubnetIds <~Array> - The EC2 Subnet IDs for the DB Subnet Group.
|
13
|
+
# * DBSubnetGroupDescription <~String> - The description for the DB Subnet Group
|
14
|
+
# ==== Returns
|
15
|
+
# * response<~Excon::Response>:
|
16
|
+
# * body<~Hash>:
|
17
|
+
def create_db_subnet_group(name, subnet_ids, description = name)
|
18
|
+
params = { 'Action' => 'CreateDBSubnetGroup',
|
19
|
+
'DBSubnetGroupName' => name,
|
20
|
+
'DBSubnetGroupDescription' => description,
|
21
|
+
:parser => Fog::Parsers::AWS::RDS::CreateDBSubnetGroup.new }
|
22
|
+
params.merge!(Fog::AWS.indexed_param("SubnetIds.member", Array(subnet_ids)))
|
23
|
+
request(params)
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
class Mock
|
29
|
+
|
30
|
+
def create_db_subnet_group(name, subnet_ids, description = name)
|
31
|
+
response = Excon::Response.new
|
32
|
+
if self.data[:subnet_groups] && self.data[:subnet_groups][name]
|
33
|
+
raise Fog::AWS::RDS::IdentifierTaken.new("DBSubnetGroupAlreadyExists => The subnet group '#{name}' already exists")
|
34
|
+
end
|
35
|
+
|
36
|
+
subnets = subnet_ids.map { |snid| Fog::Compute[:aws].subnets.get(snid) }
|
37
|
+
vpc_id = subnets.first.vpc_id
|
38
|
+
|
39
|
+
data = {
|
40
|
+
'DBSubnetGroupName' => name,
|
41
|
+
'DBSubnetGroupDescription' => description,
|
42
|
+
'SubnetGroupStatus' => 'Complete',
|
43
|
+
'Subnets' => subnet_ids,
|
44
|
+
'VpcId' => vpc_id
|
45
|
+
}
|
46
|
+
self.data[:subnet_groups][name] = data
|
47
|
+
response.body = {
|
48
|
+
"ResponseMetadata"=>{ "RequestId"=> Fog::AWS::Mock.request_id },
|
49
|
+
'CreateDBSubnetGroupResult' => { 'DBSubnetGroup' => data }
|
50
|
+
}
|
51
|
+
response
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class RDS
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/aws/parsers/rds/describe_db_subnet_groups'
|
7
|
+
|
8
|
+
# This API returns a list of DBSubnetGroup descriptions. If a DBSubnetGroupName is specified, the list will contain only
|
9
|
+
# the descriptions of the specified DBSubnetGroup
|
10
|
+
# http://docs.amazonwebservices.com/AmazonRDS/2012-01-15/APIReference/API_DescribeDBSubnetGroups.html
|
11
|
+
# ==== Parameters
|
12
|
+
# * DBSubnetGroupName <~String> - The name of a specific database subnet group to return details for.
|
13
|
+
# ==== Returns
|
14
|
+
# * response<~Excon::Response>:
|
15
|
+
# * body<~Hash>:
|
16
|
+
def describe_db_subnet_groups(name = nil, opts = {})
|
17
|
+
params = {}
|
18
|
+
if opts[:marker]
|
19
|
+
params['Marker'] = opts[:marker]
|
20
|
+
end
|
21
|
+
if name
|
22
|
+
params['DBSubnetGroupName'] = name
|
23
|
+
end
|
24
|
+
if opts[:max_records]
|
25
|
+
params['MaxRecords'] = opts[:max_records]
|
26
|
+
end
|
27
|
+
|
28
|
+
request({
|
29
|
+
'Action' => 'DescribeDBSubnetGroups',
|
30
|
+
:parser => Fog::Parsers::AWS::RDS::DescribeDBSubnetGroups.new
|
31
|
+
}.merge(params))
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
class Mock
|
37
|
+
|
38
|
+
def describe_db_subnet_groups(name = nil, opts = {})
|
39
|
+
response = Excon::Response.new
|
40
|
+
|
41
|
+
subnet_group_set = []
|
42
|
+
if name
|
43
|
+
if subnet_group = self.data[:subnet_groups][name]
|
44
|
+
subnet_group_set << subnet_group
|
45
|
+
else
|
46
|
+
raise Fog::AWS::RDS::NotFound.new("Subnet Group #{name} not found")
|
47
|
+
end
|
48
|
+
else
|
49
|
+
subnet_group_set = self.data[:subnet_groups].values
|
50
|
+
end
|
51
|
+
|
52
|
+
response.status = 200
|
53
|
+
response.body = {
|
54
|
+
"ResponseMetadata"=>{ "RequestId"=> Fog::AWS::Mock.request_id },
|
55
|
+
"DescribeDBSubnetGroupsResult" => { "DBSubnetGroups" => subnet_group_set }
|
56
|
+
}
|
57
|
+
response
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class RDS
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/aws/parsers/rds/event_list'
|
7
|
+
|
8
|
+
# Returns a list of service events
|
9
|
+
#
|
10
|
+
# For more information see:
|
11
|
+
# http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/API_DescribeEvents.html
|
12
|
+
#
|
13
|
+
# === Parameters (optional)
|
14
|
+
# * options <~Hash> (optional):
|
15
|
+
# * :start_time <~DateTime> - starting time for event records
|
16
|
+
# * :end_time <~DateTime> - ending time for event records
|
17
|
+
# * :duration <~Integer> - The number of minutes to retrieve events for
|
18
|
+
# Default = 60 Mins
|
19
|
+
# * :marker <~String> - marker provided in the previous request
|
20
|
+
# * :max_records <~Integer> - the maximum number of records to include
|
21
|
+
# Default = 100
|
22
|
+
# Constraints: min = 20, maximum 100
|
23
|
+
# * :source_identifier <~String> - identifier of the event source
|
24
|
+
# * :source_type <~DateTime> - event type, one of:
|
25
|
+
# (db-instance | db-parameter-group | db-security-group | db-snapshot)
|
26
|
+
# === Returns
|
27
|
+
# * response <~Excon::Response>:
|
28
|
+
# * body <~Hash>
|
29
|
+
def describe_events(options = {})
|
30
|
+
request(
|
31
|
+
'Action' => 'DescribeEvents',
|
32
|
+
'StartTime' => options[:start_time],
|
33
|
+
'EndTime' => options[:end_time],
|
34
|
+
'Duration' => options[:duration],
|
35
|
+
'Marker' => options[:marker],
|
36
|
+
'MaxRecords' => options[:max_records],
|
37
|
+
'SourceIdentifier' => options[:source_identifier],
|
38
|
+
'SourceType' => options[:source_type],
|
39
|
+
:parser => Fog::Parsers::AWS::RDS::EventListParser.new
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
class Mock
|
46
|
+
def describe_events
|
47
|
+
Fog::Mock.not_implemented
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class RDS
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/aws/parsers/rds/tag_list_parser'
|
7
|
+
|
8
|
+
# returns a Hash of tags for a database instance
|
9
|
+
# http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/API_ListTagsForResource.html
|
10
|
+
# ==== Parameters
|
11
|
+
# * rds_id <~String> - name of the RDS instance whose tags are to be retrieved
|
12
|
+
# ==== Returns
|
13
|
+
# * response<~Excon::Response>:
|
14
|
+
# * body<~Hash>:
|
15
|
+
def list_tags_for_resource(rds_id)
|
16
|
+
request(
|
17
|
+
'Action' => 'ListTagsForResource',
|
18
|
+
'ResourceName' => "arn:aws:rds:#{@region}:#{owner_id}:db:#{rds_id}",
|
19
|
+
:parser => Fog::Parsers::AWS::RDS::TagListParser.new
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
class Mock
|
26
|
+
|
27
|
+
def list_tags_for_resource(rds_id)
|
28
|
+
response = Excon::Response.new
|
29
|
+
if server = self.data[:servers][rds_id]
|
30
|
+
response.status = 200
|
31
|
+
response.body = {
|
32
|
+
"ListTagsForResourceResult" =>
|
33
|
+
{"TagList" => self.data[:tags][rds_id]}
|
34
|
+
}
|
35
|
+
response
|
36
|
+
else
|
37
|
+
raise Fog::AWS::RDS::NotFound.new("DBInstance #{rds_id} not found")
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class RDS
|
4
|
+
class Real
|
5
|
+
|
6
|
+
# removes tags from a database instance
|
7
|
+
# http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/API_RemoveTagsFromResource.html
|
8
|
+
# ==== Parameters
|
9
|
+
# * rds_id <~String> - name of the RDS instance whose tags are to be retrieved
|
10
|
+
# * keys <~Array> A list of String keys for the tags to remove
|
11
|
+
# ==== Returns
|
12
|
+
# * response<~Excon::Response>:
|
13
|
+
# * body<~Hash>:
|
14
|
+
def remove_tags_from_resource(rds_id, keys)
|
15
|
+
request(
|
16
|
+
{ 'Action' => 'RemoveTagsFromResource',
|
17
|
+
'ResourceName' => "arn:aws:rds:#{@region}:#{owner_id}:db:#{rds_id}",
|
18
|
+
:parser => Fog::Parsers::AWS::RDS::Base.new,
|
19
|
+
}.merge(Fog::AWS.indexed_param('TagKeys.member.%d', keys))
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
class Mock
|
26
|
+
|
27
|
+
def remove_tags_from_resource(rds_id, keys)
|
28
|
+
response = Excon::Response.new
|
29
|
+
if server = self.data[:servers][rds_id]
|
30
|
+
keys.each {|key| self.data[:tags][rds_id].delete key}
|
31
|
+
response.status = 200
|
32
|
+
response.body = {
|
33
|
+
"ResponseMetadata"=>{ "RequestId"=> Fog::AWS::Mock.request_id }
|
34
|
+
}
|
35
|
+
response
|
36
|
+
else
|
37
|
+
raise Fog::AWS::RDS::NotFound.new("DBInstance #{rds_id} not found")
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/lib/fog/aws/sqs.rb
CHANGED
data/lib/fog/aws/storage.rb
CHANGED
@@ -263,7 +263,7 @@ module Fog
|
|
263
263
|
@use_iam_profile = options[:use_iam_profile]
|
264
264
|
setup_credentials(options)
|
265
265
|
@connection_options = options[:connection_options] || {}
|
266
|
-
|
266
|
+
|
267
267
|
if @endpoint = options[:endpoint]
|
268
268
|
endpoint = URI.parse(@endpoint)
|
269
269
|
@host = endpoint.host
|
data/lib/fog/bin/openstack.rb
CHANGED
@@ -7,6 +7,8 @@ class OpenStack < Fog::Bin
|
|
7
7
|
Fog::Compute::OpenStack
|
8
8
|
when :identity
|
9
9
|
Fog::Identity::OpenStack
|
10
|
+
when :network
|
11
|
+
Fog::Network::OpenStack
|
10
12
|
else
|
11
13
|
raise ArgumentError, "Unrecognized service: #{key}"
|
12
14
|
end
|
@@ -21,6 +23,9 @@ class OpenStack < Fog::Bin
|
|
21
23
|
when :identity
|
22
24
|
Fog::Logger.warning("OpenStack[:identity] is not recommended, use Compute[:openstack] for portability")
|
23
25
|
Fog::Compute.new(:provider => 'OpenStack')
|
26
|
+
when :network
|
27
|
+
Fog::Logger.warning("OpenStack[:network] is not recommended, use Network[:openstack] for portability")
|
28
|
+
Fog::Network.new(:provider => 'OpenStack')
|
24
29
|
else
|
25
30
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
26
31
|
end
|