cloud-instancetype 0.0.3 → 1.0.0
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.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/cloud/instancetype.rb +13 -5
- data/lib/cloud/instancetype/version.rb +1 -1
- data/rubygem-cloud-instancetype.spec +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e816cc2954520421bf0199595ab06035f262da484fcd046950269cb2b61fc1d
|
4
|
+
data.tar.gz: c01ee4b3979df11673abb3ecc10d8e17e25ed0e79b028c06e6676439610c86aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f960ac3b96dcf14606bf4784c09151003d9bff80d968cdd5aa9254ac9a9ab009fc735cb535eba3c7088967b941304ce441018c032152584e19067300c5e0bb4
|
7
|
+
data.tar.gz: 1eb60f2260787b5ab9d19859ac4b21dab107c0cf2663bcf6ca964f56f2576a95f9957f774944b39515ac13e982d9bf5d81d839b4c90f4d8ca789b41dfb0070ac
|
data/README.md
CHANGED
@@ -60,6 +60,8 @@ Either way, the return is a collection of `InstanceType`, so iterate along your
|
|
60
60
|
```
|
61
61
|
instance_types.each do |instance_type|
|
62
62
|
puts instance_type.key
|
63
|
+
puts instance_type.name
|
64
|
+
puts instance_type.vcpu_count
|
63
65
|
puts instance_type.category.features
|
64
66
|
end
|
65
67
|
```
|
data/lib/cloud/instancetype.rb
CHANGED
@@ -4,17 +4,23 @@ require "json"
|
|
4
4
|
module Cloud
|
5
5
|
# Describe a public cloud instance type
|
6
6
|
class InstanceType
|
7
|
-
attr_reader :sort_value, :key, :category, :vcpu_count, :ram_bytes,
|
7
|
+
attr_reader :name, :sort_value, :key, :category, :vcpu_count, :ram_bytes,
|
8
8
|
:ram_si_units, :details
|
9
9
|
|
10
10
|
def initialize(key, raw_data)
|
11
11
|
@key = key
|
12
|
+
@name = raw_data["name"]
|
12
13
|
@sort_value = raw_data["sort_value"]
|
13
|
-
@category = Cloud::InstanceCategory.new(raw_data["category"])
|
14
14
|
@vcpu_count = raw_data["vcpu_count"]
|
15
15
|
@ram_bytes = raw_data["ram_bytes"]
|
16
16
|
@ram_si_units = raw_data["ram_si_units"]
|
17
17
|
@details = raw_data["details"]
|
18
|
+
return unless raw_data["category_key"]
|
19
|
+
|
20
|
+
@category = Cloud::InstanceCategory.new(
|
21
|
+
raw_data["category_key"],
|
22
|
+
raw_data["category"]
|
23
|
+
)
|
18
24
|
end
|
19
25
|
|
20
26
|
def <=>(other)
|
@@ -46,6 +52,7 @@ module Cloud
|
|
46
52
|
|
47
53
|
def instance_type_collection_factory(raw_types, raw_categories)
|
48
54
|
raw_types.collect do |key, values|
|
55
|
+
values["category_key"] = values["category"]
|
49
56
|
values["category"] = raw_categories[values["category"]]
|
50
57
|
InstanceType.new(key, values)
|
51
58
|
end.sort!
|
@@ -55,10 +62,11 @@ module Cloud
|
|
55
62
|
|
56
63
|
# Describe a public cloud category
|
57
64
|
class InstanceCategory
|
58
|
-
attr_reader :name, :description, :features
|
65
|
+
attr_reader :key, :name, :description, :features
|
59
66
|
|
60
|
-
def initialize(args)
|
61
|
-
@
|
67
|
+
def initialize(key, args)
|
68
|
+
@key = key
|
69
|
+
@name = args["name"]
|
62
70
|
@description = args["description"]
|
63
71
|
@features = args["features"]
|
64
72
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# spec file for package
|
2
|
+
# spec file for package rubygem-cloud-instancetype
|
3
3
|
# this code base is under development
|
4
4
|
#
|
5
5
|
# Copyright (c) 2020 SUSE LLC
|
@@ -17,7 +17,7 @@
|
|
17
17
|
#
|
18
18
|
|
19
19
|
Name: rubygem-cloud-instancetype
|
20
|
-
Version: 0.0
|
20
|
+
Version: 1.0.0
|
21
21
|
Release: 0
|
22
22
|
%define mod_name cloud-instancetype
|
23
23
|
%define mod_full_name %{mod_name}-%{version}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloud-instancetype
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Mason
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
rubygems_version: 3.0.
|
106
|
+
rubygems_version: 3.0.8
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: Describe public cloud instance types
|