occi 2.5.2 → 2.5.3
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/examples/x509auth_example.rb +6 -2
- data/lib/occi/core/resource.rb +1 -1
- data/lib/occi/version.rb +1 -1
- metadata +2 -2
@@ -83,8 +83,12 @@ else
|
|
83
83
|
pp os = client.get_os_templates.select { |template| template.term.include? OS_TEMPLATE }
|
84
84
|
pp size = client.get_resource_templates.select { |template| template.term.include? 'medium' }
|
85
85
|
|
86
|
+
puts "\nGetting identifiers"
|
87
|
+
pp os_id = os.first.type_identifier
|
88
|
+
pp size_id = size.first.type_identifier
|
89
|
+
|
86
90
|
## attach chosen resources to the compute resource
|
87
|
-
cmpt.mixins <<
|
91
|
+
cmpt.mixins << os_id << size_id
|
88
92
|
## we can change some of the values manually
|
89
93
|
cmpt.attributes.occi!.core!.title = "My rOCCI VM"
|
90
94
|
end
|
@@ -101,7 +105,7 @@ pp client.list compute
|
|
101
105
|
## using Hashie simplifies access to its attributes
|
102
106
|
puts "\n\nPrinting information about compute resource #{cmpt_loc}"
|
103
107
|
cmpt_data = client.get cmpt_loc.to_s.split('/')[3] + '/' + cmpt_loc.to_s.split('/')[4]
|
104
|
-
cmpt_hashie = Hashie::Mash.new(JSON.parse(cmpt_data.to_json))
|
108
|
+
pp cmpt_hashie = Hashie::Mash.new(JSON.parse(cmpt_data.to_json))
|
105
109
|
|
106
110
|
## wait until the resource is "active"
|
107
111
|
while cmpt_hashie.resources.first.attributes.occi.compute.state == "inactive"
|
data/lib/occi/core/resource.rb
CHANGED
@@ -59,7 +59,7 @@ module OCCI
|
|
59
59
|
# @return [Hashie::Mash] link as Hashie::Mash to be parsed into a JSON object
|
60
60
|
def as_json(options={ })
|
61
61
|
resource = Hashie::Mash.new
|
62
|
-
resource.links = @links if @links.any?
|
62
|
+
resource.links = @links.collect { |link| link.as_json } if @links.any?
|
63
63
|
resource.merge! super
|
64
64
|
resource
|
65
65
|
end
|
data/lib/occi/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: occi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-08-
|
13
|
+
date: 2012-08-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|