fog 0.0.91 → 0.0.92

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.
Files changed (91) hide show
  1. data/Gemfile +1 -1
  2. data/Gemfile.lock +39 -39
  3. data/fog.gemspec +17 -16
  4. data/lib/fog.rb +1 -1
  5. data/lib/fog/aws/elb.rb +4 -0
  6. data/lib/fog/aws/models/ec2/snapshot.rb +3 -0
  7. data/lib/fog/aws/parsers/ec2/create_snapshot.rb +5 -1
  8. data/lib/fog/aws/parsers/ec2/describe_snapshots.rb +5 -1
  9. data/lib/fog/aws/parsers/elb/create_load_balancer.rb +26 -0
  10. data/lib/fog/aws/parsers/elb/delete_load_balancer.rb +24 -0
  11. data/lib/fog/aws/parsers/s3/access_control_list.rb +46 -0
  12. data/lib/fog/aws/requests/ec2/create_snapshot.rb +11 -7
  13. data/lib/fog/aws/requests/ec2/describe_snapshots.rb +3 -0
  14. data/lib/fog/aws/requests/ec2/revoke_security_group_ingress.rb +0 -1
  15. data/lib/fog/aws/requests/ec2/run_instances.rb +0 -2
  16. data/lib/fog/aws/requests/ec2/terminate_instances.rb +0 -1
  17. data/lib/fog/aws/requests/elb/create_load_balancer.rb +57 -0
  18. data/lib/fog/aws/requests/elb/delete_load_balancer.rb +40 -0
  19. data/lib/fog/aws/requests/s3/copy_object.rb +0 -1
  20. data/lib/fog/aws/requests/s3/get_bucket.rb +2 -3
  21. data/lib/fog/aws/requests/s3/get_bucket_acl.rb +53 -0
  22. data/lib/fog/aws/requests/s3/get_object.rb +1 -31
  23. data/lib/fog/aws/requests/s3/get_object_acl.rb +58 -0
  24. data/lib/fog/aws/requests/s3/get_object_torrent.rb +55 -0
  25. data/lib/fog/aws/requests/s3/get_object_url.rb +54 -0
  26. data/lib/fog/aws/requests/s3/put_bucket_acl.rb +80 -0
  27. data/lib/fog/aws/s3.rb +8 -2
  28. data/lib/fog/collection.rb +1 -1
  29. data/lib/fog/connection.rb +7 -5
  30. data/lib/fog/model.rb +5 -2
  31. data/lib/fog/rackspace/files.rb +2 -2
  32. data/lib/fog/rackspace/requests/files/get_object.rb +1 -1
  33. data/lib/fog/terremark/parsers/shared/get_internet_services.rb +2 -2
  34. data/lib/fog/terremark/parsers/shared/get_node_services.rb +3 -0
  35. data/lib/fog/terremark/parsers/shared/vapp.rb +33 -3
  36. data/lib/fog/terremark/requests/shared/delete_internet_service.rb +0 -12
  37. data/lib/fog/terremark/requests/shared/delete_node_service.rb +0 -12
  38. data/lib/fog/terremark/requests/shared/delete_vapp.rb +0 -12
  39. data/lib/fog/terremark/shared.rb +0 -1
  40. data/spec/aws/models/s3/file_spec.rb +2 -2
  41. data/spec/aws/models/s3/files_spec.rb +2 -2
  42. data/spec/aws/requests/ec2/get_console_output_spec.rb +4 -4
  43. data/spec/aws/requests/s3/get_bucket_spec.rb +9 -9
  44. data/tests/aws/helper.rb +105 -0
  45. data/tests/aws/requests/ec2/address_tests.rb +88 -0
  46. data/tests/aws/requests/ec2/snapshot_tests.rb +50 -0
  47. data/tests/aws/requests/ec2/volume_tests.rb +84 -0
  48. data/tests/helper.rb +21 -6
  49. data/tests/helper_tests.rb +38 -7
  50. data/tests/rackspace/requests/servers/create_image_tests.rb +1 -1
  51. data/tests/rackspace/requests/servers/create_server_tests.rb +1 -1
  52. data/tests/rackspace/requests/servers/delete_image_tests.rb +1 -4
  53. data/tests/rackspace/requests/servers/delete_server_tests.rb +1 -4
  54. data/tests/rackspace/requests/servers/get_flavor_details_tests.rb +2 -5
  55. data/tests/rackspace/requests/servers/get_image_details_tests.rb +2 -5
  56. data/tests/rackspace/requests/servers/get_server_details_tests.rb +2 -5
  57. data/tests/rackspace/requests/servers/list_addresses_tests.rb +2 -5
  58. data/tests/rackspace/requests/servers/list_flavors_detail_tests.rb +1 -1
  59. data/tests/rackspace/requests/servers/list_flavors_tests.rb +1 -1
  60. data/tests/rackspace/requests/servers/list_images_detail_tests.rb +1 -1
  61. data/tests/rackspace/requests/servers/list_images_tests.rb +1 -1
  62. data/tests/rackspace/requests/servers/list_private_addresses_tests.rb +2 -5
  63. data/tests/rackspace/requests/servers/list_public_addresses_tests.rb +2 -5
  64. data/tests/rackspace/requests/servers/list_servers_detail_tests.rb +1 -1
  65. data/tests/rackspace/requests/servers/list_servers_tests.rb +1 -1
  66. data/tests/rackspace/requests/servers/reboot_server_tests.rb +1 -4
  67. data/tests/rackspace/requests/servers/update_server_tests.rb +2 -5
  68. data/tests/slicehost/requests/create_slice_tests.rb +1 -1
  69. data/tests/slicehost/requests/delete_slice_tests.rb +1 -4
  70. data/tests/slicehost/requests/get_backups_tests.rb +1 -2
  71. data/tests/slicehost/requests/get_flavor_tests.rb +2 -5
  72. data/tests/slicehost/requests/get_flavors_tests.rb +1 -1
  73. data/tests/slicehost/requests/get_image_tests.rb +2 -5
  74. data/tests/slicehost/requests/get_images_tests.rb +1 -1
  75. data/tests/slicehost/requests/get_slice_tests.rb +2 -5
  76. data/tests/slicehost/requests/get_slices_tests.rb +1 -1
  77. data/tests/slicehost/requests/reboot_slice_tests.rb +2 -5
  78. metadata +19 -18
  79. data/spec/aws/requests/ec2/allocate_address_spec.rb +0 -18
  80. data/spec/aws/requests/ec2/associate_address_spec.rb +0 -43
  81. data/spec/aws/requests/ec2/attach_volume_spec.rb +0 -51
  82. data/spec/aws/requests/ec2/create_snapshot_spec.rb +0 -36
  83. data/spec/aws/requests/ec2/create_volume_spec.rb +0 -23
  84. data/spec/aws/requests/ec2/delete_snapshot_spec.rb +0 -34
  85. data/spec/aws/requests/ec2/delete_volume_spec.rb +0 -26
  86. data/spec/aws/requests/ec2/describe_addresses_spec.rb +0 -38
  87. data/spec/aws/requests/ec2/describe_snapshots_spec.rb +0 -50
  88. data/spec/aws/requests/ec2/describe_volumes_spec.rb +0 -50
  89. data/spec/aws/requests/ec2/detach_volume_spec.rb +0 -41
  90. data/spec/aws/requests/ec2/disassociate_address_spec.rb +0 -36
  91. data/spec/aws/requests/ec2/release_address_spec.rb +0 -26
@@ -33,7 +33,6 @@ module Fog
33
33
 
34
34
  class Mock
35
35
 
36
- # TODO: handle the GroupName/Source/Source case
37
36
  def revoke_security_group_ingress(options = {})
38
37
  if options['GroupName'] && options['SourceSecurityGroupName'] && options['SourceSecurityGroupOwnerId']
39
38
  raise MockNotImplemented.new("Contributions welcome!")
@@ -92,8 +92,6 @@ module Fog
92
92
 
93
93
  class Mock
94
94
 
95
- # TODO: allow for block device mapping in mocks
96
- # TODO: allow for rootDeviceType specification
97
95
  def run_instances(image_id, min_count, max_count, options = {})
98
96
  response = Excon::Response.new
99
97
  response.status = 200
@@ -44,7 +44,6 @@ module Fog
44
44
  for id in instance_id
45
45
  instance = @data[:instances][id]
46
46
  @data[:deleted_at][id] = Time.now
47
- # TODO: the codes are mostly educated guessing, not certainty
48
47
  code = case instance['instanceState']['name']
49
48
  when 'pending'
50
49
  0
@@ -0,0 +1,57 @@
1
+ module Fog
2
+ module AWS
3
+ module ELB
4
+ class Real
5
+
6
+ # Create a new Elastic Load Balancer
7
+ #
8
+ # ==== Parameters
9
+ # * availability_zones<~Array> - List of availability zones for the ELB
10
+ # * lb_name<~String> - Name for the new ELB -- must be unique
11
+ # * listeners<~Array> - Array of Hashes describing ELB listeners to assign to the ELB
12
+ # * 'Protocol'<~String> - Protocol to use. Either HTTP or TCP.
13
+ # * 'LoadBalancerPort'<~Integer> - The port that the ELB will listen to for outside traffic
14
+ # * 'InstancePort'<~Integer> - The port on the instance that the ELB will forward traffic to
15
+ # ==== Returns
16
+ # * response<~Excon::Response>:
17
+ # * body<~Hash>:
18
+ # * 'ResponseMetadata'<~Hash>:
19
+ # * 'RequestId'<~String> - Id of request
20
+ # * 'CreateLoadBalancerResult'<~Hash>:
21
+ # * 'DNSName'<~String> - DNS name for the newly created ELB
22
+ def create_load_balancer(availability_zones, lb_name, listeners)
23
+ params = ELB.indexed_param('AvailabilityZones.member', [*availability_zones], 1)
24
+
25
+ listener_protocol = []
26
+ listener_lb_port = []
27
+ listener_instance_port = []
28
+ listeners.each do |listener|
29
+ listener_protocol.push(listener['Protocol'])
30
+ listener_lb_port.push(listener['LoadBalancerPort'])
31
+ listener_instance_port.push(listener['InstancePort'])
32
+ end
33
+
34
+ params.merge!(ELB.indexed_param('Listeners.member.%.Protocol', listener_protocol, 1))
35
+ params.merge!(ELB.indexed_param('Listeners.member.%.LoadBalancerPort', listener_lb_port, 1))
36
+ params.merge!(ELB.indexed_param('Listeners.member.%.InstancePort', listener_instance_port, 1))
37
+
38
+ request({
39
+ 'Action' => 'CreateLoadBalancer',
40
+ 'LoadBalancerName' => lb_name,
41
+ :parser => Fog::Parsers::AWS::ELB::CreateLoadBalancer.new
42
+ }.merge!(params))
43
+ end
44
+
45
+ end
46
+
47
+ class Mock
48
+
49
+ def create_load_balancer(availability_zones, lb_name, listeners)
50
+ raise MockNotImplemented.new("Contributions welcome!")
51
+ end
52
+
53
+ end
54
+
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,40 @@
1
+ module Fog
2
+ module AWS
3
+ module ELB
4
+ class Real
5
+
6
+ # Delete an existing Elastic Load Balancer
7
+ #
8
+ # Note that this API call, as defined by Amazon, is idempotent.
9
+ # That is, it will not return an error if you try to delete an
10
+ # ELB that does not exist.
11
+ #
12
+ # ==== Parameters
13
+ # * lb_name<~String> - Name of the ELB to be deleted
14
+ # ==== Returns
15
+ # * response<~Excon::Response>:
16
+ # * body<~Hash>:
17
+ # * 'DeleteLoadBalancerResponse'<~nil>
18
+ # * 'ResponseMetadata'<~Hash>:
19
+ # * 'RequestId'<~String> - Id of request
20
+ def delete_load_balancer(lb_name)
21
+ request({
22
+ 'Action' => 'DeleteLoadBalancer',
23
+ 'LoadBalancerName' => lb_name,
24
+ :parser => Fog::Parsers::AWS::ELB::DeleteLoadBalancer.new
25
+ })
26
+ end
27
+
28
+ end
29
+
30
+ class Mock
31
+
32
+ def delete_load_balancer(lb_name)
33
+ raise MockNotImplemented.new("Contributions welcome!")
34
+ end
35
+
36
+ end
37
+
38
+ end
39
+ end
40
+ end
@@ -23,7 +23,6 @@ module Fog
23
23
  # * 'ETag'<~String> - etag of new object
24
24
  # * 'LastModified'<~Time> - date object was last modified
25
25
  #
26
- # TODO: allow specifying new metadata (support all/some of put_object?)
27
26
  def copy_object(source_bucket_name, source_object_name, target_bucket_name, target_object_name, options = {})
28
27
  headers = { 'x-amz-copy-source' => "/#{source_bucket_name}/#{source_object_name}" }.merge!(options)
29
28
  request({
@@ -57,7 +57,6 @@ module Fog
57
57
 
58
58
  class Mock
59
59
 
60
- # FIXME: implement delimiter
61
60
  def get_bucket(bucket_name, options = {})
62
61
  unless bucket_name
63
62
  raise ArgumentError.new('bucket_name is required')
@@ -79,10 +78,10 @@ module Fog
79
78
  data
80
79
  end,
81
80
  'IsTruncated' => false,
82
- 'Marker' => options['marker'] || '',
81
+ 'Marker' => options['marker'],
83
82
  'MaxKeys' => options['max-keys'] || 1000,
84
83
  'Name' => bucket['Name'],
85
- 'Prefix' => options['prefix'] || ''
84
+ 'Prefix' => options['prefix']
86
85
  }
87
86
  if options['max-keys'] && options['max-keys'] < response.body['Contents'].length
88
87
  response.body['IsTruncated'] = true
@@ -0,0 +1,53 @@
1
+ module Fog
2
+ module AWS
3
+ module S3
4
+ class Real
5
+
6
+ # Get access control list for an S3 bucket
7
+ #
8
+ # ==== Parameters
9
+ # * bucket_name<~String> - name of bucket to get access control list for
10
+ #
11
+ # ==== Returns
12
+ # * response<~Excon::Response>:
13
+ # * body<~Hash>:
14
+ # * 'AccessControlPolicy'<~Hash>
15
+ # * 'Owner'<~Hash>:
16
+ # * 'DisplayName'<~String> - Display name of object owner
17
+ # * 'ID'<~String> - Id of object owner
18
+ # * 'AccessControlList'<~Array>:
19
+ # * 'Grant'<~Hash>:
20
+ # * 'Grantee'<~Hash>:
21
+ # * 'DisplayName'<~String> - Display name of grantee
22
+ # * 'ID'<~String> - Id of grantee
23
+ # or
24
+ # * 'URI'<~String> - URI of group to grant access for
25
+ # * 'Permission'<~String> - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]
26
+ #
27
+ def get_bucket_acl(bucket_name)
28
+ unless bucket_name
29
+ raise ArgumentError.new('bucket_name is required')
30
+ end
31
+ request({
32
+ :expects => 200,
33
+ :headers => {},
34
+ :host => "#{bucket_name}.#{@host}",
35
+ :idempotent => true,
36
+ :method => 'GET',
37
+ :parser => Fog::Parsers::AWS::S3::AccessControlList.new,
38
+ :query => 'acl'
39
+ })
40
+ end
41
+
42
+ end
43
+
44
+ class Mock
45
+
46
+ def get_bucket_acl(bucket_name)
47
+ raise MockNotImplemented.new("Contributions welcome!")
48
+ end
49
+
50
+ end
51
+ end
52
+ end
53
+ end
@@ -34,29 +34,13 @@ module Fog
34
34
  headers['If-Unmodified-Since'] = options['If-Unmodified-Since'].utc.strftime("%a, %d %b %Y %H:%M:%S +0000") if options['If-Modified-Since']
35
35
  headers.merge!(options)
36
36
  request({
37
- :block => block,
38
37
  :expects => 200,
39
38
  :headers => headers,
40
39
  :host => "#{bucket_name}.#{@host}",
41
40
  :idempotent => true,
42
41
  :method => 'GET',
43
42
  :path => CGI.escape(object_name)
44
- })
45
- end
46
-
47
- def get_object_url(bucket_name, object_name, expires)
48
- unless bucket_name
49
- raise ArgumentError.new('bucket_name is required')
50
- end
51
- unless object_name
52
- raise ArgumentError.new('object_name is required')
53
- end
54
- url({
55
- :headers => {},
56
- :host => "#{bucket_name}.#{@host}",
57
- :method => 'GET',
58
- :path => CGI.escape(object_name)
59
- }, expires)
43
+ }, &block)
60
44
  end
61
45
 
62
46
  end
@@ -107,20 +91,6 @@ module Fog
107
91
  response
108
92
  end
109
93
 
110
- def get_object_url(bucket_name, object_name, expires)
111
- unless bucket_name
112
- raise ArgumentError.new('bucket_name is required')
113
- end
114
- unless object_name
115
- raise ArgumentError.new('object_name is required')
116
- end
117
- url({
118
- :headers => {},
119
- :host => "#{bucket_name}.#{@host}",
120
- :method => 'GET',
121
- :path => CGI.escape(object_name)
122
- }, expires)
123
- end
124
94
  end
125
95
  end
126
96
  end
@@ -0,0 +1,58 @@
1
+ module Fog
2
+ module AWS
3
+ module S3
4
+ class Real
5
+
6
+ # Get access control list for an S3 object
7
+ #
8
+ # ==== Parameters
9
+ # * bucket_name<~String> - name of bucket containing object
10
+ # * object_name<~String> - name of object to get access control list for
11
+ #
12
+ # ==== Returns
13
+ # * response<~Excon::Response>:
14
+ # * body<~Hash>:
15
+ # * 'AccessControlPolicy'<~Hash>
16
+ # * 'Owner'<~Hash>:
17
+ # * 'DisplayName'<~String> - Display name of object owner
18
+ # * 'ID'<~String> - Id of object owner
19
+ # * 'AccessControlList'<~Array>:
20
+ # * 'Grant'<~Hash>:
21
+ # * 'Grantee'<~Hash>:
22
+ # * 'DisplayName'<~String> - Display name of grantee
23
+ # * 'ID'<~String> - Id of grantee
24
+ # or
25
+ # * 'URI'<~String> - URI of group to grant access for
26
+ # * 'Permission'<~String> - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]
27
+ #
28
+ def get_object_acl(bucket_name, object_name)
29
+ unless bucket_name
30
+ raise ArgumentError.new('bucket_name is required')
31
+ end
32
+ unless object_name
33
+ raise ArgumentError.new('object_name is required')
34
+ end
35
+ request({
36
+ :expects => 200,
37
+ :headers => {},
38
+ :host => "#{bucket_name}.#{@host}",
39
+ :idempotent => true,
40
+ :method => 'GET',
41
+ :parser => Fog::Parsers::AWS::S3::AccessControlList.new,
42
+ :path => CGI.escape(object_name),
43
+ :query => 'acl'
44
+ })
45
+ end
46
+
47
+ end
48
+
49
+ class Mock
50
+
51
+ def get_object_acl(bucket_name, object_name)
52
+ raise MockNotImplemented.new("Contributions welcome!")
53
+ end
54
+
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,55 @@
1
+ module Fog
2
+ module AWS
3
+ module S3
4
+ class Real
5
+
6
+ # Get torrent for an S3 object
7
+ #
8
+ # ==== Parameters
9
+ # * bucket_name<~String> - name of bucket containing object
10
+ # * object_name<~String> - name of object to get torrent for
11
+ #
12
+ # ==== Returns
13
+ # * response<~Excon::Response>:
14
+ # * body<~Hash>:
15
+ # * 'AccessControlPolicy'<~Hash>
16
+ # * 'Owner'<~Hash>:
17
+ # * 'DisplayName'<~String> - Display name of object owner
18
+ # * 'ID'<~String> - Id of object owner
19
+ # * 'AccessControlList'<~Array>:
20
+ # * 'Grant'<~Hash>:
21
+ # * 'Grantee'<~Hash>:
22
+ # * 'DisplayName'<~String> - Display name of grantee
23
+ # * 'ID'<~String> - Id of grantee
24
+ # * 'Permission'<~String> - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]
25
+ #
26
+ def get_object_torrent(bucket_name, object_name)
27
+ unless bucket_name
28
+ raise ArgumentError.new('bucket_name is required')
29
+ end
30
+ unless object_name
31
+ raise ArgumentError.new('object_name is required')
32
+ end
33
+ request({
34
+ :expects => 200,
35
+ :headers => {},
36
+ :host => "#{bucket_name}.#{@host}",
37
+ :idempotent => true,
38
+ :method => 'GET',
39
+ :path => CGI.escape(object_name),
40
+ :query => 'torrent'
41
+ })
42
+ end
43
+
44
+ end
45
+
46
+ class Mock
47
+
48
+ def get_object_object(bucket_name, object_name)
49
+ raise MockNotImplemented.new("Contributions welcome!")
50
+ end
51
+
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,54 @@
1
+ module Fog
2
+ module AWS
3
+ module S3
4
+ class Real
5
+
6
+ # Get an expiring object url from S3
7
+ #
8
+ # ==== Parameters
9
+ # * bucket_name<~String> - Name of bucket containing object
10
+ # * object_name<~String> - Name of object to get expiring url for
11
+ # * expires<~Time> - An expiry time for this url
12
+ #
13
+ # ==== Returns
14
+ # * response<~Excon::Response>:
15
+ # * body<~String> - url for object
16
+ #
17
+ def get_object_url(bucket_name, object_name, expires)
18
+ unless bucket_name
19
+ raise ArgumentError.new('bucket_name is required')
20
+ end
21
+ unless object_name
22
+ raise ArgumentError.new('object_name is required')
23
+ end
24
+ url({
25
+ :headers => {},
26
+ :host => "#{bucket_name}.#{@host}",
27
+ :method => 'GET',
28
+ :path => CGI.escape(object_name)
29
+ }, expires)
30
+ end
31
+
32
+ end
33
+
34
+ class Mock
35
+
36
+ def get_object_url(bucket_name, object_name, expires)
37
+ unless bucket_name
38
+ raise ArgumentError.new('bucket_name is required')
39
+ end
40
+ unless object_name
41
+ raise ArgumentError.new('object_name is required')
42
+ end
43
+ url({
44
+ :headers => {},
45
+ :host => "#{bucket_name}.#{@host}",
46
+ :method => 'GET',
47
+ :path => CGI.escape(object_name)
48
+ }, expires)
49
+ end
50
+
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,80 @@
1
+ module Fog
2
+ module AWS
3
+ module S3
4
+ class Real
5
+
6
+ # Change access control list for an S3 bucket
7
+ #
8
+ # ==== Parameters
9
+ # * bucket_name<~String> - name of bucket to modify
10
+ # * acl<~Hash>:
11
+ # * Owner<~Hash>:
12
+ # * ID<~String>: id of owner
13
+ # * DisplayName<~String>: display name of owner
14
+ # * AccessControlList<~Array>:
15
+ # * Grantee<~Hash>:
16
+ # * 'DisplayName'<~String> - Display name of grantee
17
+ # * 'ID'<~String> - Id of grantee
18
+ # or
19
+ # * 'EmailAddress'<~String> - Email address of grantee
20
+ # or
21
+ # * 'URI'<~String> - URI of group to grant access for
22
+ # * Permission<~String> - Permission, in [FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP]
23
+ def put_bucket_acl(bucket_name, acl)
24
+ data =
25
+ <<-DATA
26
+ <AccessControlPolicy>
27
+ <Owner>
28
+ <ID>#{acl['Owner']['ID']}</ID>
29
+ <DisplayName>#{acl['Owner']['DisplayName']}</DisplayName>
30
+ </Owner>
31
+ <AccessControlList>
32
+ DATA
33
+
34
+ acl['AccessControlList'].each do |grant|
35
+ data << " <Grant>"
36
+ type = case grant['Grantee'].keys.sort
37
+ when ['DisplayName', 'ID']
38
+ 'CanonicalUser'
39
+ when ['EmailAddress']
40
+ 'AmazonCustomerByEmail'
41
+ when ['URI']
42
+ 'Group'
43
+ end
44
+ data << " <Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"#{type}\">"
45
+ for key, value in grant['Grantee']
46
+ data << " <#{key}>#{value}</#{key}>"
47
+ end
48
+ data << " </Grantee>"
49
+ data << " <Permission>#{grant['Permission']}</Permission>"
50
+ data << " </Grant>"
51
+ end
52
+
53
+ data <<
54
+ <<-DATA
55
+ </AccessControlList>
56
+ </AccessControlPolicy>
57
+ DATA
58
+
59
+ request({
60
+ :body => data,
61
+ :expects => 200,
62
+ :headers => {},
63
+ :host => "#{bucket_name}.#{@host}",
64
+ :method => 'PUT',
65
+ :query => 'acl'
66
+ })
67
+ end
68
+
69
+ end
70
+
71
+ class Mock
72
+
73
+ def put_bucket_acl(bucket_name, acl)
74
+ raise MockNotImplemented.new("Contributions welcome!")
75
+ end
76
+
77
+ end
78
+ end
79
+ end
80
+ end