fog 0.0.43 → 0.0.44
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/fog.gemspec +12 -2
- data/lib/fog/aws/ec2.rb +2 -0
- data/lib/fog/aws/parsers/ec2/describe_reserved_instances.rb +36 -0
- data/lib/fog/aws/requests/ec2/describe_reserved_instances.rb +52 -0
- data/spec/aws/models/ec2/flavors_spec.rb +14 -0
- data/spec/aws/models/ec2/snapshot_spec.rb +2 -2
- data/spec/rackspace/models/servers/flavors_spec.rb +14 -0
- data/spec/shared_examples/flavors_examples.rb +16 -0
- data/spec/slicehost/models/flavors_spec.rb +14 -0
- metadata +12 -2
data/VERSION.yml
CHANGED
data/fog.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{fog}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.44"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["geemus (Wesley Beary)"]
|
12
|
-
s.date = %q{2010-02-
|
12
|
+
s.date = %q{2010-02-18}
|
13
13
|
s.default_executable = %q{fog}
|
14
14
|
s.description = %q{brings clouds to you}
|
15
15
|
s.email = %q{me@geemus.com}
|
@@ -64,6 +64,7 @@ Gem::Specification.new do |s|
|
|
64
64
|
"lib/fog/aws/parsers/ec2/describe_instances.rb",
|
65
65
|
"lib/fog/aws/parsers/ec2/describe_key_pairs.rb",
|
66
66
|
"lib/fog/aws/parsers/ec2/describe_regions.rb",
|
67
|
+
"lib/fog/aws/parsers/ec2/describe_reserved_instances.rb",
|
67
68
|
"lib/fog/aws/parsers/ec2/describe_security_groups.rb",
|
68
69
|
"lib/fog/aws/parsers/ec2/describe_snapshots.rb",
|
69
70
|
"lib/fog/aws/parsers/ec2/describe_volumes.rb",
|
@@ -99,6 +100,7 @@ Gem::Specification.new do |s|
|
|
99
100
|
"lib/fog/aws/requests/ec2/describe_instances.rb",
|
100
101
|
"lib/fog/aws/requests/ec2/describe_key_pairs.rb",
|
101
102
|
"lib/fog/aws/requests/ec2/describe_regions.rb",
|
103
|
+
"lib/fog/aws/requests/ec2/describe_reserved_instances.rb",
|
102
104
|
"lib/fog/aws/requests/ec2/describe_security_groups.rb",
|
103
105
|
"lib/fog/aws/requests/ec2/describe_snapshots.rb",
|
104
106
|
"lib/fog/aws/requests/ec2/describe_volumes.rb",
|
@@ -215,6 +217,7 @@ Gem::Specification.new do |s|
|
|
215
217
|
"lib/fog/terremark/requests/get_vdc.rb",
|
216
218
|
"spec/aws/models/ec2/address_spec.rb",
|
217
219
|
"spec/aws/models/ec2/addresses_spec.rb",
|
220
|
+
"spec/aws/models/ec2/flavors_spec.rb",
|
218
221
|
"spec/aws/models/ec2/key_pair_spec.rb",
|
219
222
|
"spec/aws/models/ec2/key_pairs_spec.rb",
|
220
223
|
"spec/aws/models/ec2/security_group_spec.rb",
|
@@ -281,6 +284,7 @@ Gem::Specification.new do |s|
|
|
281
284
|
"spec/aws/requests/simpledb/select_spec.rb",
|
282
285
|
"spec/compact_progress_bar_formatter.rb",
|
283
286
|
"spec/lorem.txt",
|
287
|
+
"spec/rackspace/models/servers/flavors_spec.rb",
|
284
288
|
"spec/rackspace/models/servers/server_spec.rb",
|
285
289
|
"spec/rackspace/models/servers/servers_spec.rb",
|
286
290
|
"spec/rackspace/requests/files/delete_container_spec.rb",
|
@@ -308,8 +312,10 @@ Gem::Specification.new do |s|
|
|
308
312
|
"spec/rackspace/requests/servers/list_servers_spec.rb",
|
309
313
|
"spec/rackspace/requests/servers/reboot_server_spec.rb",
|
310
314
|
"spec/rackspace/requests/servers/update_server_spec.rb",
|
315
|
+
"spec/shared_examples/flavors_examples.rb",
|
311
316
|
"spec/shared_examples/server_examples.rb",
|
312
317
|
"spec/shared_examples/servers_examples.rb",
|
318
|
+
"spec/slicehost/models/flavors_spec.rb",
|
313
319
|
"spec/slicehost/models/server_spec.rb",
|
314
320
|
"spec/slicehost/models/servers_spec.rb",
|
315
321
|
"spec/slicehost/requests/create_slice_spec.rb",
|
@@ -366,6 +372,7 @@ Gem::Specification.new do |s|
|
|
366
372
|
s.test_files = [
|
367
373
|
"spec/aws/models/ec2/address_spec.rb",
|
368
374
|
"spec/aws/models/ec2/addresses_spec.rb",
|
375
|
+
"spec/aws/models/ec2/flavors_spec.rb",
|
369
376
|
"spec/aws/models/ec2/key_pair_spec.rb",
|
370
377
|
"spec/aws/models/ec2/key_pairs_spec.rb",
|
371
378
|
"spec/aws/models/ec2/security_group_spec.rb",
|
@@ -431,6 +438,7 @@ Gem::Specification.new do |s|
|
|
431
438
|
"spec/aws/requests/simpledb/put_attributes_spec.rb",
|
432
439
|
"spec/aws/requests/simpledb/select_spec.rb",
|
433
440
|
"spec/compact_progress_bar_formatter.rb",
|
441
|
+
"spec/rackspace/models/servers/flavors_spec.rb",
|
434
442
|
"spec/rackspace/models/servers/server_spec.rb",
|
435
443
|
"spec/rackspace/models/servers/servers_spec.rb",
|
436
444
|
"spec/rackspace/requests/files/delete_container_spec.rb",
|
@@ -458,8 +466,10 @@ Gem::Specification.new do |s|
|
|
458
466
|
"spec/rackspace/requests/servers/list_servers_spec.rb",
|
459
467
|
"spec/rackspace/requests/servers/reboot_server_spec.rb",
|
460
468
|
"spec/rackspace/requests/servers/update_server_spec.rb",
|
469
|
+
"spec/shared_examples/flavors_examples.rb",
|
461
470
|
"spec/shared_examples/server_examples.rb",
|
462
471
|
"spec/shared_examples/servers_examples.rb",
|
472
|
+
"spec/slicehost/models/flavors_spec.rb",
|
463
473
|
"spec/slicehost/models/server_spec.rb",
|
464
474
|
"spec/slicehost/models/servers_spec.rb",
|
465
475
|
"spec/slicehost/requests/create_slice_spec.rb",
|
data/lib/fog/aws/ec2.rb
CHANGED
@@ -47,6 +47,7 @@ module Fog
|
|
47
47
|
"fog/aws/parsers/ec2/describe_availability_zones.rb",
|
48
48
|
"fog/aws/parsers/ec2/describe_images.rb",
|
49
49
|
"fog/aws/parsers/ec2/describe_instances.rb",
|
50
|
+
"fog/aws/parsers/ec2/describe_reserved_instances.rb",
|
50
51
|
"fog/aws/parsers/ec2/describe_key_pairs.rb",
|
51
52
|
"fog/aws/parsers/ec2/describe_regions.rb",
|
52
53
|
"fog/aws/parsers/ec2/describe_security_groups.rb",
|
@@ -72,6 +73,7 @@ module Fog
|
|
72
73
|
"fog/aws/requests/ec2/describe_availability_zones.rb",
|
73
74
|
"fog/aws/requests/ec2/describe_images.rb",
|
74
75
|
"fog/aws/requests/ec2/describe_instances.rb",
|
76
|
+
"fog/aws/requests/ec2/describe_reserved_instances.rb",
|
75
77
|
"fog/aws/requests/ec2/describe_key_pairs.rb",
|
76
78
|
"fog/aws/requests/ec2/describe_regions.rb",
|
77
79
|
"fog/aws/requests/ec2/describe_security_groups.rb",
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Fog
|
2
|
+
module Parsers
|
3
|
+
module AWS
|
4
|
+
module EC2
|
5
|
+
|
6
|
+
class DescribeReservedInstances < Fog::Parsers::Base
|
7
|
+
|
8
|
+
def reset
|
9
|
+
@reserved_instance = {}
|
10
|
+
@response = { 'reservedInstancesSet' => [] }
|
11
|
+
end
|
12
|
+
|
13
|
+
def end_element(name)
|
14
|
+
case name
|
15
|
+
when 'availabilityZone', 'instanceType', 'productDescription', 'reservedInstancesId', 'state'
|
16
|
+
@reserved_instance[name] = @value
|
17
|
+
when 'duration', 'instanceCount'
|
18
|
+
@reserved_instance[name] = @value.to_i
|
19
|
+
when 'fixedPrice', 'usagePrice'
|
20
|
+
@reserved_instance[name] = @value.to_f
|
21
|
+
when 'item'
|
22
|
+
@response['reservedInstancesSet'] << @reserved_instance
|
23
|
+
@reserved_instance = {}
|
24
|
+
when 'requestId'
|
25
|
+
@response[name] = @value
|
26
|
+
when 'start'
|
27
|
+
@response[name] = Time.parse(@value)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
unless Fog.mocking?
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module AWS
|
5
|
+
class EC2
|
6
|
+
|
7
|
+
# Describe all or specified reserved instances
|
8
|
+
#
|
9
|
+
# ==== Parameters
|
10
|
+
# * reserved_instances_id<~Array> - List of reserved instance ids to describe, defaults to all
|
11
|
+
#
|
12
|
+
# ==== Returns
|
13
|
+
# * response<~Excon::Response>:
|
14
|
+
# * body<~Hash>:
|
15
|
+
# * 'requestId'<~String> - Id of request
|
16
|
+
# * 'reservedInstancesSet'<~Array>:
|
17
|
+
# * 'availabilityZone'<~String> - availability zone of the instance
|
18
|
+
# * 'duration'<~Integer> - duration of reservation, in seconds
|
19
|
+
# * 'fixedPrice'<~Float> - purchase price of reserved instance
|
20
|
+
# * 'instanceType'<~String> - type of instance
|
21
|
+
# * 'instanceCount'<~Integer> - number of reserved instances
|
22
|
+
# * 'productDescription'<~String> - reserved instance description
|
23
|
+
# * 'reservedInstancesId'<~String> - id of the instance
|
24
|
+
# * 'start'<~Time> - start time for reservation
|
25
|
+
# * 'state'<~String> - state of reserved instance purchase, in .[pending-payment, active, payment-failed, retired]
|
26
|
+
# * 'usagePrice"<~Float> - usage price of reserved instances, per hour
|
27
|
+
def describe_reserved_instances(reserved_instances_id = [])
|
28
|
+
params = AWS.indexed_param('ReservedInstancesId', reserved_instances_id)
|
29
|
+
request({
|
30
|
+
'Action' => 'DescribeReservedInstances'
|
31
|
+
}.merge!(params), Fog::Parsers::AWS::EC2::DescribeReservedInstances.new)
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
else
|
39
|
+
|
40
|
+
module Fog
|
41
|
+
module AWS
|
42
|
+
class EC2
|
43
|
+
|
44
|
+
def describe_reserved_instances(reserved_instances_id = {})
|
45
|
+
raise MockNotImplemented.new("Contributions welcome!")
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
+
require File.dirname(__FILE__) + '/../../../shared_examples/flavors_examples'
|
3
|
+
|
4
|
+
describe 'Fog::AWS::EC2::Flavors' do
|
5
|
+
|
6
|
+
it_should_behave_like "Flavors"
|
7
|
+
|
8
|
+
subject { @flavor = @flavors.all.first }
|
9
|
+
|
10
|
+
before(:each) do
|
11
|
+
@flavors = AWS[:ec2].flavors
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
@@ -83,11 +83,11 @@ describe 'Fog::AWS::EC2::Snapshots' do
|
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
|
-
it "should not exist in
|
86
|
+
it "should not exist in snapshots before save" do
|
87
87
|
AWS[:ec2].snapshots.get(@snapshot.id).should be_nil
|
88
88
|
end
|
89
89
|
|
90
|
-
it "should exist in
|
90
|
+
it "should exist in snapshots after save" do
|
91
91
|
@snapshot.save
|
92
92
|
AWS[:ec2].snapshots.get(@snapshot.id).should_not be_nil
|
93
93
|
@snapshot.destroy
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
+
require File.dirname(__FILE__) + '/../../../shared_examples/flavors_examples'
|
3
|
+
|
4
|
+
describe 'Fog::AWS::Rackspace::Flavors' do
|
5
|
+
|
6
|
+
it_should_behave_like "Flavors"
|
7
|
+
|
8
|
+
subject { @flavor = @flavors.all.first }
|
9
|
+
|
10
|
+
before(:each) do
|
11
|
+
@flavors = Rackspace[:servers].flavors
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
shared_examples_for "Flavors" do
|
2
|
+
|
3
|
+
describe "#get" do
|
4
|
+
|
5
|
+
it "should return a matching flavor if one exists" do
|
6
|
+
get = @flavors.get(subject.id)
|
7
|
+
subject.attributes.should == get.attributes
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should return nil if no matching server exists" do
|
11
|
+
@flavors.get('0').should be_nil
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
+
require File.dirname(__FILE__) + '/../../../shared_examples/flavors_examples'
|
3
|
+
|
4
|
+
describe 'Fog::AWS::Slicehost::Flavors' do
|
5
|
+
|
6
|
+
it_should_behave_like "Flavors"
|
7
|
+
|
8
|
+
subject { @flavor = @flavors.all.first }
|
9
|
+
|
10
|
+
before(:each) do
|
11
|
+
@flavors = Slicehost[:slices].flavors
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.44
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- geemus (Wesley Beary)
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-02-
|
12
|
+
date: 2010-02-18 00:00:00 -08:00
|
13
13
|
default_executable: fog
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -127,6 +127,7 @@ files:
|
|
127
127
|
- lib/fog/aws/parsers/ec2/describe_instances.rb
|
128
128
|
- lib/fog/aws/parsers/ec2/describe_key_pairs.rb
|
129
129
|
- lib/fog/aws/parsers/ec2/describe_regions.rb
|
130
|
+
- lib/fog/aws/parsers/ec2/describe_reserved_instances.rb
|
130
131
|
- lib/fog/aws/parsers/ec2/describe_security_groups.rb
|
131
132
|
- lib/fog/aws/parsers/ec2/describe_snapshots.rb
|
132
133
|
- lib/fog/aws/parsers/ec2/describe_volumes.rb
|
@@ -162,6 +163,7 @@ files:
|
|
162
163
|
- lib/fog/aws/requests/ec2/describe_instances.rb
|
163
164
|
- lib/fog/aws/requests/ec2/describe_key_pairs.rb
|
164
165
|
- lib/fog/aws/requests/ec2/describe_regions.rb
|
166
|
+
- lib/fog/aws/requests/ec2/describe_reserved_instances.rb
|
165
167
|
- lib/fog/aws/requests/ec2/describe_security_groups.rb
|
166
168
|
- lib/fog/aws/requests/ec2/describe_snapshots.rb
|
167
169
|
- lib/fog/aws/requests/ec2/describe_volumes.rb
|
@@ -278,6 +280,7 @@ files:
|
|
278
280
|
- lib/fog/terremark/requests/get_vdc.rb
|
279
281
|
- spec/aws/models/ec2/address_spec.rb
|
280
282
|
- spec/aws/models/ec2/addresses_spec.rb
|
283
|
+
- spec/aws/models/ec2/flavors_spec.rb
|
281
284
|
- spec/aws/models/ec2/key_pair_spec.rb
|
282
285
|
- spec/aws/models/ec2/key_pairs_spec.rb
|
283
286
|
- spec/aws/models/ec2/security_group_spec.rb
|
@@ -344,6 +347,7 @@ files:
|
|
344
347
|
- spec/aws/requests/simpledb/select_spec.rb
|
345
348
|
- spec/compact_progress_bar_formatter.rb
|
346
349
|
- spec/lorem.txt
|
350
|
+
- spec/rackspace/models/servers/flavors_spec.rb
|
347
351
|
- spec/rackspace/models/servers/server_spec.rb
|
348
352
|
- spec/rackspace/models/servers/servers_spec.rb
|
349
353
|
- spec/rackspace/requests/files/delete_container_spec.rb
|
@@ -371,8 +375,10 @@ files:
|
|
371
375
|
- spec/rackspace/requests/servers/list_servers_spec.rb
|
372
376
|
- spec/rackspace/requests/servers/reboot_server_spec.rb
|
373
377
|
- spec/rackspace/requests/servers/update_server_spec.rb
|
378
|
+
- spec/shared_examples/flavors_examples.rb
|
374
379
|
- spec/shared_examples/server_examples.rb
|
375
380
|
- spec/shared_examples/servers_examples.rb
|
381
|
+
- spec/slicehost/models/flavors_spec.rb
|
376
382
|
- spec/slicehost/models/server_spec.rb
|
377
383
|
- spec/slicehost/models/servers_spec.rb
|
378
384
|
- spec/slicehost/requests/create_slice_spec.rb
|
@@ -450,6 +456,7 @@ summary: fog = clouds + you
|
|
450
456
|
test_files:
|
451
457
|
- spec/aws/models/ec2/address_spec.rb
|
452
458
|
- spec/aws/models/ec2/addresses_spec.rb
|
459
|
+
- spec/aws/models/ec2/flavors_spec.rb
|
453
460
|
- spec/aws/models/ec2/key_pair_spec.rb
|
454
461
|
- spec/aws/models/ec2/key_pairs_spec.rb
|
455
462
|
- spec/aws/models/ec2/security_group_spec.rb
|
@@ -515,6 +522,7 @@ test_files:
|
|
515
522
|
- spec/aws/requests/simpledb/put_attributes_spec.rb
|
516
523
|
- spec/aws/requests/simpledb/select_spec.rb
|
517
524
|
- spec/compact_progress_bar_formatter.rb
|
525
|
+
- spec/rackspace/models/servers/flavors_spec.rb
|
518
526
|
- spec/rackspace/models/servers/server_spec.rb
|
519
527
|
- spec/rackspace/models/servers/servers_spec.rb
|
520
528
|
- spec/rackspace/requests/files/delete_container_spec.rb
|
@@ -542,8 +550,10 @@ test_files:
|
|
542
550
|
- spec/rackspace/requests/servers/list_servers_spec.rb
|
543
551
|
- spec/rackspace/requests/servers/reboot_server_spec.rb
|
544
552
|
- spec/rackspace/requests/servers/update_server_spec.rb
|
553
|
+
- spec/shared_examples/flavors_examples.rb
|
545
554
|
- spec/shared_examples/server_examples.rb
|
546
555
|
- spec/shared_examples/servers_examples.rb
|
556
|
+
- spec/slicehost/models/flavors_spec.rb
|
547
557
|
- spec/slicehost/models/server_spec.rb
|
548
558
|
- spec/slicehost/models/servers_spec.rb
|
549
559
|
- spec/slicehost/requests/create_slice_spec.rb
|