fog 0.0.29 → 0.0.30
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/bin/fog +18 -11
- data/fog.gemspec +43 -14
- data/lib/fog.rb +7 -1
- data/lib/fog/aws/ec2.rb +0 -7
- data/lib/fog/aws/models/ec2/address.rb +22 -26
- data/lib/fog/aws/models/ec2/addresses.rb +7 -22
- data/lib/fog/aws/models/ec2/instance.rb +2 -15
- data/lib/fog/aws/models/ec2/instances.rb +6 -23
- data/lib/fog/aws/models/ec2/key_pair.rb +2 -17
- data/lib/fog/aws/models/ec2/key_pairs.rb +6 -23
- data/lib/fog/aws/models/ec2/security_group.rb +18 -22
- data/lib/fog/aws/models/ec2/security_groups.rb +6 -23
- data/lib/fog/aws/models/ec2/snapshot.rb +2 -15
- data/lib/fog/aws/models/ec2/snapshots.rb +7 -20
- data/lib/fog/aws/models/ec2/volume.rb +23 -22
- data/lib/fog/aws/models/ec2/volumes.rb +8 -22
- data/lib/fog/aws/models/s3/bucket.rb +1 -1
- data/lib/fog/aws/models/s3/buckets.rb +3 -20
- data/lib/fog/aws/models/s3/objects.rb +11 -22
- data/lib/fog/aws/requests/ec2/allocate_address.rb +1 -1
- data/lib/fog/aws/requests/ec2/associate_address.rb +2 -2
- data/lib/fog/aws/requests/ec2/attach_volume.rb +2 -2
- data/lib/fog/aws/requests/ec2/authorize_security_group_ingress.rb +1 -1
- data/lib/fog/aws/requests/ec2/create_key_pair.rb +2 -2
- data/lib/fog/aws/requests/ec2/create_security_group.rb +2 -2
- data/lib/fog/aws/requests/ec2/create_snapshot.rb +2 -2
- data/lib/fog/aws/requests/ec2/create_volume.rb +3 -3
- data/lib/fog/aws/requests/ec2/delete_key_pair.rb +1 -1
- data/lib/fog/aws/requests/ec2/delete_security_group.rb +2 -2
- data/lib/fog/aws/requests/ec2/delete_snapshot.rb +2 -2
- data/lib/fog/aws/requests/ec2/delete_volume.rb +2 -2
- data/lib/fog/aws/requests/ec2/describe_addresses.rb +2 -2
- data/lib/fog/aws/requests/ec2/describe_availability_zones.rb +1 -1
- data/lib/fog/aws/requests/ec2/describe_images.rb +1 -1
- data/lib/fog/aws/requests/ec2/describe_instances.rb +2 -2
- data/lib/fog/aws/requests/ec2/describe_key_pairs.rb +2 -2
- data/lib/fog/aws/requests/ec2/describe_regions.rb +1 -1
- data/lib/fog/aws/requests/ec2/describe_security_groups.rb +2 -2
- data/lib/fog/aws/requests/ec2/describe_snapshots.rb +2 -2
- data/lib/fog/aws/requests/ec2/describe_volumes.rb +2 -2
- data/lib/fog/aws/requests/ec2/detach_volume.rb +2 -2
- data/lib/fog/aws/requests/ec2/disassociate_address.rb +2 -2
- data/lib/fog/aws/requests/ec2/get_console_output.rb +2 -2
- data/lib/fog/aws/requests/ec2/reboot_instances.rb +2 -2
- data/lib/fog/aws/requests/ec2/release_address.rb +2 -2
- data/lib/fog/aws/requests/ec2/revoke_security_group_ingress.rb +1 -1
- data/lib/fog/aws/requests/ec2/run_instances.rb +2 -2
- data/lib/fog/aws/requests/ec2/terminate_instances.rb +2 -2
- data/lib/fog/aws/requests/s3/copy_object.rb +2 -2
- data/lib/fog/aws/requests/s3/delete_bucket.rb +3 -3
- data/lib/fog/aws/requests/s3/delete_object.rb +2 -2
- data/lib/fog/aws/requests/s3/get_bucket.rb +2 -2
- data/lib/fog/aws/requests/s3/get_bucket_location.rb +2 -2
- data/lib/fog/aws/requests/s3/get_object.rb +2 -2
- data/lib/fog/aws/requests/s3/get_request_payment.rb +2 -2
- data/lib/fog/aws/requests/s3/get_service.rb +1 -1
- data/lib/fog/aws/requests/s3/head_object.rb +1 -1
- data/lib/fog/aws/requests/s3/put_bucket.rb +1 -1
- data/lib/fog/aws/requests/s3/put_object.rb +2 -2
- data/lib/fog/aws/requests/s3/put_request_payment.rb +1 -1
- data/lib/fog/aws/requests/simpledb/batch_put_attributes.rb +2 -2
- data/lib/fog/aws/requests/simpledb/create_domain.rb +1 -1
- data/lib/fog/aws/requests/simpledb/delete_attributes.rb +2 -2
- data/lib/fog/aws/requests/simpledb/delete_domain.rb +1 -1
- data/lib/fog/aws/requests/simpledb/domain_metadata.rb +2 -2
- data/lib/fog/aws/requests/simpledb/get_attributes.rb +2 -2
- data/lib/fog/aws/requests/simpledb/list_domains.rb +1 -1
- data/lib/fog/aws/requests/simpledb/put_attributes.rb +1 -1
- data/lib/fog/aws/requests/simpledb/select.rb +1 -1
- data/lib/fog/aws/s3.rb +0 -7
- data/lib/fog/aws/simpledb.rb +0 -4
- data/lib/fog/collection.rb +35 -7
- data/lib/fog/connection.rb +10 -130
- data/lib/fog/model.rb +18 -13
- data/lib/fog/parser.rb +0 -5
- data/lib/fog/rackspace.rb +35 -15
- data/lib/fog/rackspace/files.rb +36 -6
- data/lib/fog/rackspace/models/servers/server.rb +2 -16
- data/lib/fog/rackspace/models/servers/servers.rb +6 -21
- data/lib/fog/rackspace/requests/files/delete_container.rb +38 -0
- data/lib/fog/rackspace/requests/files/delete_object.rb +39 -0
- data/lib/fog/rackspace/requests/files/get_container.rb +61 -0
- data/lib/fog/rackspace/requests/files/get_containers.rb +5 -7
- data/lib/fog/rackspace/requests/files/head_container.rb +44 -0
- data/lib/fog/rackspace/requests/files/head_containers.rb +1 -1
- data/lib/fog/rackspace/requests/files/put_container.rb +38 -0
- data/lib/fog/rackspace/requests/files/put_object.rb +41 -0
- data/lib/fog/rackspace/requests/servers/create_image.rb +6 -0
- data/lib/fog/rackspace/requests/servers/create_server.rb +21 -2
- data/lib/fog/rackspace/requests/servers/delete_server.rb +18 -3
- data/lib/fog/rackspace/requests/servers/get_server_details.rb +17 -5
- data/lib/fog/rackspace/requests/servers/list_addresses.rb +52 -0
- data/lib/fog/rackspace/requests/servers/list_flavors.rb +2 -4
- data/lib/fog/rackspace/requests/servers/list_flavors_detail.rb +41 -0
- data/lib/fog/rackspace/requests/servers/list_images.rb +1 -1
- data/lib/fog/rackspace/requests/servers/list_images_detail.rb +1 -1
- data/lib/fog/rackspace/requests/servers/list_private_addresses.rb +50 -0
- data/lib/fog/rackspace/requests/servers/list_public_addresses.rb +50 -0
- data/lib/fog/rackspace/requests/servers/list_servers.rb +11 -2
- data/lib/fog/rackspace/requests/servers/list_servers_detail.rb +17 -2
- data/lib/fog/rackspace/requests/servers/reboot_server.rb +3 -6
- data/lib/fog/rackspace/requests/servers/update_server.rb +18 -5
- data/lib/fog/rackspace/servers.rb +20 -0
- data/spec/aws/models/ec2/address_spec.rb +4 -4
- data/spec/aws/models/ec2/instance_spec.rb +6 -6
- data/spec/aws/models/ec2/key_pair_spec.rb +5 -5
- data/spec/aws/models/ec2/security_group_spec.rb +5 -5
- data/spec/aws/models/ec2/snapshot_spec.rb +8 -8
- data/spec/aws/models/ec2/snapshots_spec.rb +6 -6
- data/spec/aws/models/ec2/volume_spec.rb +6 -5
- data/spec/aws/models/ec2/volumes_spec.rb +4 -4
- data/spec/aws/requests/ec2/associate_address_spec.rb +2 -2
- data/spec/aws/requests/ec2/attach_volume_spec.rb +2 -2
- data/spec/aws/requests/ec2/create_key_pair_spec.rb +1 -1
- data/spec/aws/requests/ec2/create_security_group_spec.rb +1 -1
- data/spec/aws/requests/ec2/create_snapshot_spec.rb +1 -1
- data/spec/aws/requests/ec2/delete_security_group_spec.rb +1 -1
- data/spec/aws/requests/ec2/delete_snapshot_spec.rb +1 -1
- data/spec/aws/requests/ec2/delete_volume_spec.rb +2 -2
- data/spec/aws/requests/ec2/describe_addresses_spec.rb +1 -1
- data/spec/aws/requests/ec2/describe_instances_spec.rb +1 -1
- data/spec/aws/requests/ec2/describe_key_pairs_spec.rb +1 -1
- data/spec/aws/requests/ec2/describe_security_groups_spec.rb +1 -1
- data/spec/aws/requests/ec2/describe_snapshots_spec.rb +1 -1
- data/spec/aws/requests/ec2/describe_volumes_spec.rb +1 -1
- data/spec/aws/requests/ec2/detach_volume_spec.rb +1 -1
- data/spec/aws/requests/ec2/disassociate_address_spec.rb +1 -1
- data/spec/aws/requests/ec2/get_console_output_spec.rb +1 -1
- data/spec/aws/requests/ec2/reboot_instances_spec.rb +1 -1
- data/spec/aws/requests/ec2/release_address_spec.rb +1 -1
- data/spec/aws/requests/ec2/terminate_instances_spec.rb +1 -1
- data/spec/aws/requests/s3/copy_object_spec.rb +4 -5
- data/spec/aws/requests/s3/delete_bucket_spec.rb +3 -4
- data/spec/aws/requests/s3/delete_object_spec.rb +2 -3
- data/spec/aws/requests/s3/get_bucket_location_spec.rb +1 -1
- data/spec/aws/requests/s3/get_bucket_spec.rb +4 -6
- data/spec/aws/requests/s3/get_object_spec.rb +6 -10
- data/spec/aws/requests/s3/get_request_payment_spec.rb +1 -1
- data/spec/aws/requests/s3/head_object_spec.rb +2 -4
- data/spec/aws/requests/s3/put_object_spec.rb +4 -7
- data/spec/aws/requests/s3/put_request_payment_spec.rb +1 -1
- data/spec/aws/requests/simpledb/batch_put_attributes_spec.rb +1 -1
- data/spec/aws/requests/simpledb/delete_attributes_spec.rb +1 -1
- data/spec/aws/requests/simpledb/domain_metadata_spec.rb +1 -1
- data/spec/aws/requests/simpledb/get_attributes_spec.rb +1 -1
- data/spec/aws/requests/simpledb/put_attributes_spec.rb +1 -1
- data/spec/rackspace/requests/files/delete_container_spec.rb +24 -0
- data/spec/rackspace/requests/files/delete_object_spec.rb +37 -0
- data/spec/rackspace/requests/files/get_container_spec.rb +33 -0
- data/spec/rackspace/requests/files/get_containers_spec.rb +12 -1
- data/spec/rackspace/requests/files/head_container_spec.rb +30 -0
- data/spec/rackspace/requests/files/head_containers_spec.rb +9 -1
- data/spec/rackspace/requests/files/put_container_spec.rb +15 -0
- data/spec/rackspace/requests/files/put_object_spec.rb +20 -0
- data/spec/rackspace/requests/servers/create_image_spec.rb +16 -2
- data/spec/rackspace/requests/servers/create_server_spec.rb +1 -1
- data/spec/rackspace/requests/servers/delete_image_spec.rb +32 -0
- data/spec/rackspace/requests/servers/delete_server_spec.rb +1 -1
- data/spec/rackspace/requests/servers/get_server_details_spec.rb +1 -1
- data/spec/rackspace/requests/servers/list_addresses_spec.rb +34 -0
- data/spec/rackspace/requests/servers/list_flavors_detail_spec.rb +17 -0
- data/spec/rackspace/requests/servers/list_flavors_spec.rb +6 -3
- data/spec/rackspace/requests/servers/list_images_detail_spec.rb +18 -0
- data/spec/rackspace/requests/servers/list_images_spec.rb +5 -2
- data/spec/rackspace/requests/servers/list_private_addresses_spec.rb +32 -0
- data/spec/rackspace/requests/servers/list_public_addresses_spec.rb +32 -0
- data/spec/rackspace/requests/servers/list_servers_detail_spec.rb +1 -1
- data/spec/rackspace/requests/servers/reboot_server_spec.rb +31 -0
- data/spec/rackspace/requests/servers/update_server_spec.rb +33 -0
- data/spec/spec_helper.rb +5 -1
- metadata +50 -14
- data/benchs/headers_split_vs_match.rb +0 -18
- data/benchs/stripping.rb +0 -26
- data/lib/fog/errors.rb +0 -145
- data/lib/fog/response.rb +0 -12
- data/spec/rackspace/requests/servers/delete_image.rb +0 -12
- data/spec/rackspace/requests/servers/list_images_detail.rb +0 -12
- data/spec/rackspace/requests/servers/reboot_server.rb +0 -12
- data/spec/rackspace/requests/servers/update_server.rb +0 -12
@@ -14,7 +14,7 @@ unless Fog.mocking?
|
|
14
14
|
# * 'InstanceId'<~String> - Id of instance to associate volume with
|
15
15
|
#
|
16
16
|
# ==== Returns
|
17
|
-
# * response<~
|
17
|
+
# * response<~Excon::Response>:
|
18
18
|
# * body<~Hash>:
|
19
19
|
# * 'attachTime'<~Time> - Time of attachment was initiated at
|
20
20
|
# * 'device'<~String> - Device as it is exposed to the instance
|
@@ -50,7 +50,7 @@ else
|
|
50
50
|
}.merge!(data)
|
51
51
|
else
|
52
52
|
response.status = 400
|
53
|
-
raise(
|
53
|
+
raise(Excon::Errors.status_error(200, 400, response))
|
54
54
|
end
|
55
55
|
response
|
56
56
|
end
|
@@ -10,7 +10,7 @@ unless Fog.mocking?
|
|
10
10
|
# * public_ip<~String> - Public ip to assign to instance
|
11
11
|
#
|
12
12
|
# ==== Returns
|
13
|
-
# * response<~
|
13
|
+
# * response<~Excon::Response>:
|
14
14
|
# * body<~Hash>:
|
15
15
|
# * 'requestId'<~String> - Id of request
|
16
16
|
# * 'return'<~Boolean> - success?
|
@@ -43,7 +43,7 @@ else
|
|
43
43
|
}
|
44
44
|
else
|
45
45
|
response.status = 400
|
46
|
-
raise(
|
46
|
+
raise(Excon::Errors.status_error(200, 400, response))
|
47
47
|
end
|
48
48
|
response
|
49
49
|
end
|
@@ -10,7 +10,7 @@ unless Fog.mocking?
|
|
10
10
|
# * instance_id<~String> - Id of instance to get console output from
|
11
11
|
#
|
12
12
|
# ==== Returns
|
13
|
-
# # * response<~
|
13
|
+
# # * response<~Excon::Response>:
|
14
14
|
# * body<~Hash>:
|
15
15
|
# * 'instanceId'<~String> - Id of instance
|
16
16
|
# * 'output'<~String> - Console output
|
@@ -45,7 +45,7 @@ else
|
|
45
45
|
}
|
46
46
|
else
|
47
47
|
response.status = 400
|
48
|
-
raise(
|
48
|
+
raise(Excon::Errors.status_error(200, 400, response))
|
49
49
|
end
|
50
50
|
response
|
51
51
|
end
|
@@ -10,7 +10,7 @@ unless Fog.mocking?
|
|
10
10
|
# * instance_id<~Array> - Ids of instances to reboot
|
11
11
|
#
|
12
12
|
# ==== Returns
|
13
|
-
# # * response<~
|
13
|
+
# # * response<~Excon::Response>:
|
14
14
|
# * body<~Hash>:
|
15
15
|
# * 'requestId'<~String> - Id of request
|
16
16
|
# * 'return'<~Boolean> - success?
|
@@ -45,7 +45,7 @@ else
|
|
45
45
|
}
|
46
46
|
else
|
47
47
|
response.status = 400
|
48
|
-
raise(
|
48
|
+
raise(Excon::Errors.status_error(200, 400, response))
|
49
49
|
end
|
50
50
|
response
|
51
51
|
end
|
@@ -7,7 +7,7 @@ unless Fog.mocking?
|
|
7
7
|
# Release an elastic IP address.
|
8
8
|
#
|
9
9
|
# ==== Returns
|
10
|
-
# * response<~
|
10
|
+
# * response<~Excon::Response>:
|
11
11
|
# * body<~Hash>:
|
12
12
|
# * 'requestId'<~String> - Id of request
|
13
13
|
# * 'return'<~Boolean> - success?
|
@@ -38,7 +38,7 @@ else
|
|
38
38
|
}
|
39
39
|
else
|
40
40
|
response.status = 400
|
41
|
-
raise(
|
41
|
+
raise(Excon::Errors.status_error(200, 400, response))
|
42
42
|
end
|
43
43
|
response
|
44
44
|
end
|
@@ -19,7 +19,7 @@ unless Fog.mocking?
|
|
19
19
|
# * 'ToPort' - End of port range (or -1 for ICMP wildcard)
|
20
20
|
#
|
21
21
|
# === Returns
|
22
|
-
# * response<~
|
22
|
+
# * response<~Excon::Response>:
|
23
23
|
# * body<~Hash>:
|
24
24
|
# * 'requestId'<~String> - Id of request
|
25
25
|
# * 'return'<~Boolean> - success?
|
@@ -35,7 +35,7 @@ unless Fog.mocking?
|
|
35
35
|
# * 'VirtualName'<~String> - ?
|
36
36
|
#
|
37
37
|
# ==== Returns
|
38
|
-
# * response<~
|
38
|
+
# * response<~Excon::Response>:
|
39
39
|
# * body<~Hash>:
|
40
40
|
# * 'groupSet'<~Array>: groups the instances are members in
|
41
41
|
# * 'groupName'<~String> - Name of group
|
@@ -115,7 +115,7 @@ else
|
|
115
115
|
'ramdiskId' => options['RamdiskId'] || Fog::AWS::Mock.ramdisk_id,
|
116
116
|
'reason' => '',
|
117
117
|
'reservationId' => reservation_id,
|
118
|
-
'
|
118
|
+
'instanceState' => 'pending'
|
119
119
|
}
|
120
120
|
Fog::AWS::EC2.data[:instances][instance_id] = data
|
121
121
|
instances_set << data.reject{|key,value| !['amiLaunchIndex', 'dnsName', 'imageId', 'instanceId', 'instanceState', 'instanceType', 'kernelId', 'keyName', 'launchTime', 'monitoring', 'placement', 'privateDnsName', 'productCodes', 'ramdiskId', 'reason'].include?(key)}
|
@@ -10,7 +10,7 @@ unless Fog.mocking?
|
|
10
10
|
# * instance_id<~Array> - Ids of instances to terminates
|
11
11
|
#
|
12
12
|
# ==== Returns
|
13
|
-
# # * response<~
|
13
|
+
# # * response<~Excon::Response>:
|
14
14
|
# * body<~Hash>:
|
15
15
|
# * 'requestId'<~String> - Id of request
|
16
16
|
# * 'instancesSet'<~Array>:
|
@@ -72,7 +72,7 @@ else
|
|
72
72
|
end
|
73
73
|
else
|
74
74
|
response.status = 400
|
75
|
-
raise(
|
75
|
+
raise(Excon::Errors.status_error(200, 400, response))
|
76
76
|
end
|
77
77
|
response
|
78
78
|
end
|
@@ -19,7 +19,7 @@ unless Fog.mocking?
|
|
19
19
|
# * 'x-amz-copy_source-if-unmodified-since'<~Time> - Copies object it it has not been modified since this time
|
20
20
|
#
|
21
21
|
# ==== Returns
|
22
|
-
# * response<~
|
22
|
+
# * response<~Excon::Response>:
|
23
23
|
# * body<~Hash>:
|
24
24
|
# * 'ETag'<~String> - etag of new object
|
25
25
|
# * 'LastModified'<~Time> - date object was last modified
|
@@ -66,7 +66,7 @@ else
|
|
66
66
|
}
|
67
67
|
else
|
68
68
|
response.status = 404
|
69
|
-
raise(
|
69
|
+
raise(Excon::Errors.status_error(200, 404, response))
|
70
70
|
end
|
71
71
|
|
72
72
|
response
|
@@ -10,7 +10,7 @@ unless Fog.mocking?
|
|
10
10
|
# * bucket_name<~String> - name of bucket to delete
|
11
11
|
#
|
12
12
|
# ==== Returns
|
13
|
-
# * response<~
|
13
|
+
# * response<~Excon::Response>:
|
14
14
|
# * status<~Integer> - 204
|
15
15
|
def delete_bucket(bucket_name)
|
16
16
|
request({
|
@@ -35,10 +35,10 @@ else
|
|
35
35
|
response = Fog::Response.new
|
36
36
|
if Fog::AWS::S3.data[:buckets][bucket_name].nil?
|
37
37
|
response.status = 404
|
38
|
-
raise(
|
38
|
+
raise(Excon::Errors.status_error(204, 404, response))
|
39
39
|
elsif Fog::AWS::S3.data[:buckets][bucket_name] && !Fog::AWS::S3.data[:buckets][bucket_name][:objects].empty?
|
40
40
|
response.status = 409
|
41
|
-
raise(
|
41
|
+
raise(Excon::Errors.status_error(204, 409, response))
|
42
42
|
else
|
43
43
|
Fog::AWS::S3.data[:buckets].delete(bucket_name)
|
44
44
|
response.status = 204
|
@@ -11,7 +11,7 @@ unless Fog.mocking?
|
|
11
11
|
# * object_name<~String> - Name of object to delete
|
12
12
|
#
|
13
13
|
# ==== Returns
|
14
|
-
# * response<~
|
14
|
+
# * response<~Excon::Response>:
|
15
15
|
# * status<~Integer> - 204
|
16
16
|
def delete_object(bucket_name, object_name)
|
17
17
|
request({
|
@@ -40,7 +40,7 @@ else
|
|
40
40
|
bucket[:objects].delete(object_name)
|
41
41
|
else
|
42
42
|
response.status = 404
|
43
|
-
raise(
|
43
|
+
raise(Excon::Errors.status_error(204, 404, response))
|
44
44
|
end
|
45
45
|
response
|
46
46
|
end
|
@@ -17,7 +17,7 @@ unless Fog.mocking?
|
|
17
17
|
# value and the first occurence of delimiter to be rolled up
|
18
18
|
#
|
19
19
|
# ==== Returns
|
20
|
-
# * response<~
|
20
|
+
# * response<~Excon::Response>:
|
21
21
|
# * body<~Hash>:
|
22
22
|
# * 'Delimeter'<~String> - Delimiter specified for query
|
23
23
|
# * 'Marker'<~String> - Marker specified for query
|
@@ -94,7 +94,7 @@ else
|
|
94
94
|
end
|
95
95
|
else
|
96
96
|
response.status = 404
|
97
|
-
raise(
|
97
|
+
raise(Excon::Errors.status_error(200, 404, response))
|
98
98
|
end
|
99
99
|
response
|
100
100
|
end
|
@@ -10,7 +10,7 @@ unless Fog.mocking?
|
|
10
10
|
# * bucket_name<~String> - name of bucket to get location constraint for
|
11
11
|
#
|
12
12
|
# ==== Returns
|
13
|
-
# * response<~
|
13
|
+
# * response<~Excon::Response>:
|
14
14
|
# * body<~Hash>:
|
15
15
|
# * 'LocationConstraint'<~String> - Location constraint of the bucket
|
16
16
|
def get_bucket_location(bucket_name)
|
@@ -41,7 +41,7 @@ else
|
|
41
41
|
response.body = {'LocationConstraint' => bucket['LocationConstraint'] }
|
42
42
|
else
|
43
43
|
response.status = 404
|
44
|
-
raise(
|
44
|
+
raise(Excon::Errors.status_error(200, 404, response))
|
45
45
|
end
|
46
46
|
response
|
47
47
|
end
|
@@ -16,7 +16,7 @@ unless Fog.mocking?
|
|
16
16
|
# * 'If-Unmodified-Since'<~Time> - Returns object only if it has not been modified since this time, otherwise returns 412 (Precodition Failed).
|
17
17
|
# * 'Range'<~String> - Range of object to download
|
18
18
|
# ==== Returns
|
19
|
-
# * response<~
|
19
|
+
# * response<~Excon::Response>:
|
20
20
|
# * body<~String> - Contents of object
|
21
21
|
# * headers<~Hash>:
|
22
22
|
# * 'Content-Length'<~String> - Size of object contents
|
@@ -108,7 +108,7 @@ else
|
|
108
108
|
end
|
109
109
|
else
|
110
110
|
response.status = 404
|
111
|
-
raise(
|
111
|
+
raise(Excon::Errors.status_error(200, 404, response))
|
112
112
|
end
|
113
113
|
response
|
114
114
|
end
|
@@ -10,7 +10,7 @@ unless Fog.mocking?
|
|
10
10
|
# * bucket_name<~String> - name of bucket to get payer for
|
11
11
|
#
|
12
12
|
# ==== Returns
|
13
|
-
# * response<~
|
13
|
+
# * response<~Excon::Response>:
|
14
14
|
# * body<~Hash>:
|
15
15
|
# * 'Payer'<~String> - Specifies who pays for download and requests
|
16
16
|
def get_request_payment(bucket_name)
|
@@ -41,7 +41,7 @@ else
|
|
41
41
|
response.body = { 'Payer' => bucket['Payer'] }
|
42
42
|
else
|
43
43
|
response.status = 404
|
44
|
-
raise(
|
44
|
+
raise(Excon::Errors.status_error(200, 404, response))
|
45
45
|
end
|
46
46
|
response
|
47
47
|
end
|
@@ -17,7 +17,7 @@ unless Fog.mocking?
|
|
17
17
|
# * 'Range'<~String> - Range of object to download
|
18
18
|
#
|
19
19
|
# ==== Returns
|
20
|
-
# * response<~
|
20
|
+
# * response<~Excon::Response>:
|
21
21
|
# * body<~String> - Contents of object
|
22
22
|
# * headers<~Hash>:
|
23
23
|
# * 'Content-Length'<~String> - Size of object contents
|
@@ -12,7 +12,7 @@ unless Fog.mocking?
|
|
12
12
|
# * :location_constraint<~Symbol> - sets the location for the bucket
|
13
13
|
#
|
14
14
|
# ==== Returns
|
15
|
-
# * response<~
|
15
|
+
# * response<~Excon::Response>:
|
16
16
|
# * status<~Integer> - 200
|
17
17
|
def put_bucket(bucket_name, options = {})
|
18
18
|
if options['LocationConstraint']
|
@@ -21,7 +21,7 @@ unless Fog.mocking?
|
|
21
21
|
# * "x-amz-meta-#{name}" - Headers to be returned with object, note total size of request without body must be less than 8 KB.
|
22
22
|
#
|
23
23
|
# ==== Returns
|
24
|
-
# * response<~
|
24
|
+
# * response<~Excon::Response>:
|
25
25
|
# * headers<~Hash>:
|
26
26
|
# * 'ETag'<~String> - etag of new object
|
27
27
|
def put_object(bucket_name, object_name, data, options = {})
|
@@ -64,7 +64,7 @@ else
|
|
64
64
|
bucket[:objects][object_name]['Content-Type'] = data[:headers]['Content-Type']
|
65
65
|
else
|
66
66
|
response.status = 404
|
67
|
-
raise(
|
67
|
+
raise(Excon::Errors.status_error(200, 404, response))
|
68
68
|
end
|
69
69
|
response
|
70
70
|
end
|
@@ -17,7 +17,7 @@ unless Fog.mocking?
|
|
17
17
|
# not valid. Each name and value can be up to 1024 bytes long.
|
18
18
|
#
|
19
19
|
# ==== Returns
|
20
|
-
# * response<~
|
20
|
+
# * response<~Excon::Response>:
|
21
21
|
# * body<~Hash>:
|
22
22
|
# * 'BoxUsage'
|
23
23
|
# * 'RequestId'
|
@@ -59,7 +59,7 @@ else
|
|
59
59
|
}
|
60
60
|
else
|
61
61
|
response.status = 400
|
62
|
-
raise(
|
62
|
+
raise(Excon::Errors.status_error(200, 400, response))
|
63
63
|
end
|
64
64
|
response
|
65
65
|
end
|
@@ -19,7 +19,7 @@ unless Fog.mocking?
|
|
19
19
|
# bytes long.
|
20
20
|
#
|
21
21
|
# ==== Returns
|
22
|
-
# * response<~
|
22
|
+
# * response<~Excon::Response>:
|
23
23
|
# * body<~Hash>:
|
24
24
|
# * 'BoxUsage'
|
25
25
|
# * 'RequestId'
|
@@ -60,7 +60,7 @@ else
|
|
60
60
|
}
|
61
61
|
else
|
62
62
|
response.status = 400
|
63
|
-
raise(
|
63
|
+
raise(Excon::Errors.status_error(200, 400, response))
|
64
64
|
end
|
65
65
|
response
|
66
66
|
end
|
@@ -11,7 +11,7 @@ unless Fog.mocking?
|
|
11
11
|
# following characters: a-z, A-Z, 0-9, '_', '-' and '.'.
|
12
12
|
#
|
13
13
|
# ==== Returns
|
14
|
-
# * response<~
|
14
|
+
# * response<~Excon::Response>:
|
15
15
|
# * body<~Hash>:
|
16
16
|
# * 'AttributeNameCount' - number of unique attribute names in domain
|
17
17
|
# * 'AttributeNamesSizeBytes' - total size of unique attribute names, in bytes
|
@@ -68,7 +68,7 @@ else
|
|
68
68
|
}
|
69
69
|
else
|
70
70
|
response.status = 400
|
71
|
-
raise(
|
71
|
+
raise(Excon::Errors.status_error(200, 400, response))
|
72
72
|
end
|
73
73
|
response
|
74
74
|
end
|
@@ -19,7 +19,7 @@ unless Fog.mocking?
|
|
19
19
|
# bytes long.
|
20
20
|
#
|
21
21
|
# ==== Returns
|
22
|
-
# * response<~
|
22
|
+
# * response<~Excon::Response>:
|
23
23
|
# * body<~Hash>:
|
24
24
|
# * 'Attributes' - list of attribute name/values for the item
|
25
25
|
# * 'BoxUsage'
|
@@ -63,7 +63,7 @@ else
|
|
63
63
|
}
|
64
64
|
else
|
65
65
|
response.status = 400
|
66
|
-
raise(
|
66
|
+
raise(Excon::Errors.status_error(200, 400, response))
|
67
67
|
end
|
68
68
|
response
|
69
69
|
end
|
@@ -13,7 +13,7 @@ unless Fog.mocking?
|
|
13
13
|
# * 'NextToken'<~String> - Offset token to start listing, defaults to nil
|
14
14
|
#
|
15
15
|
# ==== Returns
|
16
|
-
# * response<~
|
16
|
+
# * response<~Excon::Response>:
|
17
17
|
# * body<~Hash>:
|
18
18
|
# * 'BoxUsage'
|
19
19
|
# * 'Domains' - array of domain names.
|