amazon-pricing 0.0.7 → 0.0.8
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.
@@ -30,7 +30,7 @@ module AwsPricing
|
|
30
30
|
end
|
31
31
|
|
32
32
|
# reserved_usage_type = :light, :medium, :heavy
|
33
|
-
def ec2_reserved_instance_types(reserved_usage_type)
|
33
|
+
def ec2_reserved_instance_types(reserved_usage_type = nil)
|
34
34
|
case reserved_usage_type
|
35
35
|
when :light
|
36
36
|
@_ec2_reserved_instance_types_light.values
|
@@ -38,6 +38,8 @@ module AwsPricing
|
|
38
38
|
@_ec2_reserved_instance_types_medium.values
|
39
39
|
when :heavy
|
40
40
|
@_ec2_reserved_instance_types_heavy.values
|
41
|
+
else
|
42
|
+
@_ec2_reserved_instance_types_light.values << @_ec2_reserved_instance_types_medium.values << @_ec2_reserved_instance_types_heavy.values
|
41
43
|
end
|
42
44
|
end
|
43
45
|
|
@@ -50,7 +50,7 @@ module AwsPricing
|
|
50
50
|
'hiMemResI' => {'xl' => 'm2.xlarge', 'xxl' => 'm2.2xlarge', 'xxxxl' => 'm2.4xlarge'},
|
51
51
|
'hiCPUResI' => {'med' => 'c1.medium', 'xl' => 'c1.xlarge'},
|
52
52
|
'clusterGPUResI' => {'xxxxl' => 'cg1.4xlarge'},
|
53
|
-
'clusterCompResI' => {'xxxxl' => 'cc1.4xlarge', 'xxxxxxxxl' => '
|
53
|
+
'clusterCompResI' => {'xxxxl' => 'cc1.4xlarge', 'xxxxxxxxl' => 'cc2.8xlarge'},
|
54
54
|
'uResI' => {'u' => 't1.micro'},
|
55
55
|
}
|
56
56
|
@@Name_Lookup_Reserved = {
|
@@ -14,33 +14,36 @@ require File.dirname(__FILE__) + '/helper.rb'
|
|
14
14
|
require 'test/unit'
|
15
15
|
|
16
16
|
class TestEc2InstanceTypes < Test::Unit::TestCase
|
17
|
+
def test_cc8xlarge_issue
|
18
|
+
pricing = AwsPricing::PriceList.new
|
19
|
+
obj = pricing.get_instance_type('us-east-1d', :reserved, 'cc2.8xlarge', :medium)
|
20
|
+
puts obj.inspect
|
21
|
+
assert obj.api_name == 'cc2.8xlarge'
|
22
|
+
end
|
23
|
+
|
17
24
|
def test_name_lookup
|
18
25
|
pricing = AwsPricing::PriceList.new
|
19
26
|
pricing.regions.each do |region|
|
20
27
|
assert_not_nil region.name
|
21
28
|
region.ec2_on_demand_instance_types.each do |instance_type|
|
22
|
-
puts "On-demand: #{instance_type.api_name}"
|
23
29
|
assert_not_nil instance_type.api_name
|
24
30
|
assert_not_nil instance_type.name
|
25
|
-
|
31
|
+
assert instance_type.api_name != instance_type.name
|
26
32
|
end
|
27
33
|
region.ec2_reserved_instance_types(:light).each do |instance_type|
|
28
|
-
puts "Light: #{instance_type.api_name}"
|
29
34
|
assert_not_nil instance_type.api_name
|
30
35
|
assert_not_nil instance_type.name
|
31
|
-
|
36
|
+
assert instance_type.api_name != instance_type.name
|
32
37
|
end
|
33
38
|
region.ec2_reserved_instance_types(:medium).each do |instance_type|
|
34
|
-
puts "Medium: #{instance_type.api_name}"
|
35
39
|
assert_not_nil instance_type.api_name
|
36
40
|
assert_not_nil instance_type.name
|
37
|
-
|
41
|
+
assert instance_type.api_name != instance_type.name
|
38
42
|
end
|
39
43
|
region.ec2_reserved_instance_types(:heavy).each do |instance_type|
|
40
|
-
puts "Heavy: #{instance_type.api_name}"
|
41
44
|
assert_not_nil instance_type.api_name
|
42
45
|
assert_not_nil instance_type.name
|
43
|
-
|
46
|
+
assert instance_type.api_name != instance_type.name
|
44
47
|
end
|
45
48
|
end
|
46
49
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amazon-pricing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 8
|
10
|
+
version: 0.0.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Joe Kinsella
|