fog 0.0.87 → 0.0.88
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/Gemfile +0 -1
- data/Gemfile.lock +13 -23
- data/bin/fog +1 -1
- data/fog.gemspec +2 -1
- data/lib/fog.rb +2 -2
- data/lib/fog/aws/ec2.rb +1 -0
- data/lib/fog/aws/models/s3/file.rb +5 -5
- data/lib/fog/aws/models/s3/files.rb +4 -4
- data/lib/fog/aws/requests/ec2/modify_image_attributes.rb +38 -0
- data/lib/fog/deprecation.rb +4 -1
- data/lib/fog/model.rb +4 -0
- data/spec/aws/models/s3/directories_spec.rb +6 -6
- data/spec/aws/models/s3/directory_spec.rb +1 -1
- metadata +3 -2
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -2,34 +2,28 @@
|
|
2
2
|
specs:
|
3
3
|
- rake:
|
4
4
|
version: 0.8.7
|
5
|
-
- annals:
|
6
|
-
version: 0.0.3
|
7
5
|
- excon:
|
8
6
|
version: 0.0.21
|
9
7
|
- formatador:
|
10
|
-
version: 0.0.
|
8
|
+
version: 0.0.14
|
9
|
+
- gestalt:
|
10
|
+
version: 0.0.6
|
11
11
|
- json:
|
12
|
-
version: 1.4.
|
12
|
+
version: 1.4.2
|
13
13
|
- mime-types:
|
14
14
|
version: "1.16"
|
15
15
|
- net-ssh:
|
16
16
|
version: 2.0.22
|
17
17
|
- nokogiri:
|
18
18
|
version: 1.4.1
|
19
|
-
- ruby-hmac:
|
20
|
-
version: 0.4.0
|
21
|
-
- fog:
|
22
|
-
version: 0.0.84
|
23
|
-
source: 0
|
24
19
|
- rspec:
|
25
20
|
version: 1.3.0
|
21
|
+
- ruby-hmac:
|
22
|
+
version: 0.4.0
|
26
23
|
- shindo:
|
27
|
-
version: 0.0.
|
28
|
-
hash:
|
24
|
+
version: 0.0.18
|
25
|
+
hash: e443f12a9a7794f2ff4fc8e8d201b12b1e8b30bb
|
29
26
|
sources:
|
30
|
-
- Path:
|
31
|
-
path: !ruby/object:Pathname
|
32
|
-
path: .
|
33
27
|
- Rubygems:
|
34
28
|
uri: http://gemcutter.org
|
35
29
|
dependencies:
|
@@ -41,19 +35,19 @@ dependencies:
|
|
41
35
|
version: ">= 0"
|
42
36
|
group:
|
43
37
|
- :default
|
44
|
-
|
38
|
+
rake:
|
45
39
|
version: ">= 0"
|
46
40
|
group:
|
47
41
|
- :default
|
48
|
-
|
42
|
+
rspec:
|
49
43
|
version: ">= 0"
|
50
44
|
group:
|
51
45
|
- :default
|
52
|
-
|
46
|
+
ruby-hmac:
|
53
47
|
version: ">= 0"
|
54
48
|
group:
|
55
49
|
- :default
|
56
|
-
|
50
|
+
mime-types:
|
57
51
|
version: ">= 0"
|
58
52
|
group:
|
59
53
|
- :default
|
@@ -61,7 +55,7 @@ dependencies:
|
|
61
55
|
version: ">= 0"
|
62
56
|
group:
|
63
57
|
- :default
|
64
|
-
|
58
|
+
json:
|
65
59
|
version: ">= 0"
|
66
60
|
group:
|
67
61
|
- :default
|
@@ -69,10 +63,6 @@ dependencies:
|
|
69
63
|
version: ">= 0.0.21"
|
70
64
|
group:
|
71
65
|
- :default
|
72
|
-
json:
|
73
|
-
version: ">= 0"
|
74
|
-
group:
|
75
|
-
- :default
|
76
66
|
shindo:
|
77
67
|
version: ">= 0"
|
78
68
|
group:
|
data/bin/fog
CHANGED
data/fog.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
## If your rubyforge_project name is different, then edit it and comment out
|
8
8
|
## the sub! line in the Rakefile
|
9
9
|
s.name = 'fog'
|
10
|
-
s.version = '0.0.
|
10
|
+
s.version = '0.0.88'
|
11
11
|
s.date = '2010-05-03'
|
12
12
|
s.rubyforge_project = 'fog'
|
13
13
|
|
@@ -155,6 +155,7 @@ Gem::Specification.new do |s|
|
|
155
155
|
lib/fog/aws/requests/ec2/detach_volume.rb
|
156
156
|
lib/fog/aws/requests/ec2/disassociate_address.rb
|
157
157
|
lib/fog/aws/requests/ec2/get_console_output.rb
|
158
|
+
lib/fog/aws/requests/ec2/modify_image_attributes.rb
|
158
159
|
lib/fog/aws/requests/ec2/reboot_instances.rb
|
159
160
|
lib/fog/aws/requests/ec2/release_address.rb
|
160
161
|
lib/fog/aws/requests/ec2/revoke_security_group_ingress.rb
|
data/lib/fog.rb
CHANGED
data/lib/fog/aws/ec2.rb
CHANGED
@@ -66,6 +66,7 @@ module Fog
|
|
66
66
|
require 'fog/aws/requests/ec2/detach_volume'
|
67
67
|
require 'fog/aws/requests/ec2/disassociate_address'
|
68
68
|
require 'fog/aws/requests/ec2/get_console_output'
|
69
|
+
require 'fog/aws/requests/ec2/modify_image_attributes'
|
69
70
|
require 'fog/aws/requests/ec2/reboot_instances'
|
70
71
|
require 'fog/aws/requests/ec2/release_address'
|
71
72
|
require 'fog/aws/requests/ec2/revoke_security_group_ingress'
|
@@ -29,10 +29,10 @@ module Fog
|
|
29
29
|
@directory
|
30
30
|
end
|
31
31
|
|
32
|
-
def copy(
|
32
|
+
def copy(target_directory_key, target_file_key)
|
33
33
|
requires :directory, :key
|
34
|
-
data = connection.copy_object(directory.
|
35
|
-
target_directory = connection.directories.new(:
|
34
|
+
data = connection.copy_object(directory.key, @key, target_directory_key, target_file_key).body
|
35
|
+
target_directory = connection.directories.new(:key => target_directory_key)
|
36
36
|
target_file = target_directory.files.new(attributes.merge!(:key => target_file_key))
|
37
37
|
copy_data = {}
|
38
38
|
for key, value in data
|
@@ -46,7 +46,7 @@ module Fog
|
|
46
46
|
|
47
47
|
def destroy
|
48
48
|
requires :directory, :key
|
49
|
-
connection.delete_object(directory.
|
49
|
+
connection.delete_object(directory.key, @key)
|
50
50
|
true
|
51
51
|
end
|
52
52
|
|
@@ -61,7 +61,7 @@ module Fog
|
|
61
61
|
|
62
62
|
def save(options = {})
|
63
63
|
requires :body, :directory, :key
|
64
|
-
data = connection.put_object(directory.
|
64
|
+
data = connection.put_object(directory.key, @key, @body, options)
|
65
65
|
@etag = data.headers['ETag']
|
66
66
|
true
|
67
67
|
end
|
@@ -26,7 +26,7 @@ module Fog
|
|
26
26
|
options = options.reject {|key,value| value.nil? || value.to_s.empty?}
|
27
27
|
merge_attributes(options)
|
28
28
|
parent = directory.collection.get(
|
29
|
-
directory.
|
29
|
+
directory.key,
|
30
30
|
options
|
31
31
|
)
|
32
32
|
if parent
|
@@ -37,7 +37,7 @@ module Fog
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def get(key, options = {}, &block)
|
40
|
-
data = connection.get_object(directory.
|
40
|
+
data = connection.get_object(directory.key, key, options, &block)
|
41
41
|
file_data = {
|
42
42
|
:body => data.body,
|
43
43
|
:key => key
|
@@ -53,11 +53,11 @@ module Fog
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def get_url(key, expires)
|
56
|
-
connection.get_object_url(directory.
|
56
|
+
connection.get_object_url(directory.key, key, expires)
|
57
57
|
end
|
58
58
|
|
59
59
|
def head(key, options = {})
|
60
|
-
data = connection.head_object(directory.
|
60
|
+
data = connection.head_object(directory.key, key, options)
|
61
61
|
file_data = {
|
62
62
|
:key => key
|
63
63
|
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
module EC2
|
4
|
+
class Real
|
5
|
+
|
6
|
+
# Modify image attributes
|
7
|
+
#
|
8
|
+
# ==== Parameters
|
9
|
+
# * image_id<~String> - Id of machine image to modify
|
10
|
+
# * attribute<~String> - Attribute to modify, in ['launchPermission', 'productCodes']
|
11
|
+
# * operation_type<~String> - Operation to perform on attribute, in ['add', 'remove']
|
12
|
+
#
|
13
|
+
def modify_image_attributes(image_id, attribute, operation_type, options = {})
|
14
|
+
params = {}
|
15
|
+
params.merge!(AWS.indexed_param('UserId', options['UserId']))
|
16
|
+
params.merge!(AWS.indexed_param('UserGroup', options['UserGroup']))
|
17
|
+
params.merge!(AWS.indexed_param('ProductCode', options['ProductCode']))
|
18
|
+
request({
|
19
|
+
'Action' => 'ModifyImageAttribute',
|
20
|
+
'Attribute' => attribute,
|
21
|
+
'ImageId' => image_id,
|
22
|
+
'OperationType' => operation,
|
23
|
+
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
24
|
+
}.merge!(params))
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
class Mock
|
30
|
+
|
31
|
+
def modify_image_attributes(image_id, user_id, options = {})
|
32
|
+
raise MockNotImplemented.new("Contributions welcome!")
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/fog/deprecation.rb
CHANGED
@@ -4,7 +4,10 @@ module Fog
|
|
4
4
|
def deprecate(older, newer)
|
5
5
|
class_eval <<-EOS, __FILE__, __LINE__
|
6
6
|
def #{older}(*args)
|
7
|
-
|
7
|
+
location = caller.first
|
8
|
+
warning = "[yellow][WARN] #{self} => ##{older} is deprecated, use ##{newer} instead[/]"
|
9
|
+
warning << " [light_black](" << location << ")[/] "
|
10
|
+
Formatador.display_line(warning)
|
8
11
|
#{newer}(*args)
|
9
12
|
end
|
10
13
|
EOS
|
data/lib/fog/model.rb
CHANGED
@@ -5,8 +5,8 @@ describe 'Fog::AWS::S3::Directories' do
|
|
5
5
|
describe "#all" do
|
6
6
|
|
7
7
|
it "should include persisted directories" do
|
8
|
-
@directory = AWS[:s3].directories.create(:
|
9
|
-
AWS[:s3].directories.all.map {|directory| @directory.
|
8
|
+
@directory = AWS[:s3].directories.create(:key => 'fogdirectorykey')
|
9
|
+
AWS[:s3].directories.all.map {|directory| @directory.key}.should include('fogdirectorykey')
|
10
10
|
@directory.destroy
|
11
11
|
end
|
12
12
|
|
@@ -15,8 +15,8 @@ describe 'Fog::AWS::S3::Directories' do
|
|
15
15
|
describe "#create" do
|
16
16
|
|
17
17
|
it "should exist on s3" do
|
18
|
-
directory = AWS[:s3].directories.create(:
|
19
|
-
AWS[:s3].directories.get(directory.
|
18
|
+
directory = AWS[:s3].directories.create(:key => 'fogdirectorykey')
|
19
|
+
AWS[:s3].directories.get(directory.key).should_not be_nil
|
20
20
|
directory.destroy
|
21
21
|
end
|
22
22
|
|
@@ -25,8 +25,8 @@ describe 'Fog::AWS::S3::Directories' do
|
|
25
25
|
describe "#get" do
|
26
26
|
|
27
27
|
it "should return a Fog::AWS::S3::Directory if a matching directory exists" do
|
28
|
-
directory = AWS[:s3].directories.create(:
|
29
|
-
get = AWS[:s3].directories.get('
|
28
|
+
directory = AWS[:s3].directories.create(:key => 'fogdirectorykey')
|
29
|
+
get = AWS[:s3].directories.get('fogdirectorykey')
|
30
30
|
directory.attributes.should == get.attributes
|
31
31
|
directory.destroy
|
32
32
|
end
|
@@ -8,7 +8,7 @@ describe 'Fog::AWS::S3::Directory' do
|
|
8
8
|
now = Time.now
|
9
9
|
directory = Fog::AWS::S3::Directory.new(
|
10
10
|
'CreationDate' => now,
|
11
|
-
'
|
11
|
+
'Name' => 'directorykey'
|
12
12
|
)
|
13
13
|
directory.creation_date.should == now
|
14
14
|
directory.key.should == 'directorykey'
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 88
|
9
|
+
version: 0.0.88
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- geemus (Wesley Beary)
|
@@ -233,6 +233,7 @@ files:
|
|
233
233
|
- lib/fog/aws/requests/ec2/detach_volume.rb
|
234
234
|
- lib/fog/aws/requests/ec2/disassociate_address.rb
|
235
235
|
- lib/fog/aws/requests/ec2/get_console_output.rb
|
236
|
+
- lib/fog/aws/requests/ec2/modify_image_attributes.rb
|
236
237
|
- lib/fog/aws/requests/ec2/reboot_instances.rb
|
237
238
|
- lib/fog/aws/requests/ec2/release_address.rb
|
238
239
|
- lib/fog/aws/requests/ec2/revoke_security_group_ingress.rb
|