occi 3.1.0.beta.1 → 3.1.0.beta.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile +3 -2
- data/README.md +25 -18
- data/Rakefile +1 -1
- data/features/cassettes/Create_an_OCCI_Resource/_http_http___141_5_99_69__text_plain_201_.yml +102 -0
- data/features/cassettes/Delete_an_OCCI_Resource/_http_http___141_5_99_69__text_plain_201_.yml +102 -0
- data/features/cassettes/Discovery_Interface/Retrieving_all_OCCI_Categories_supported_by_the_OCCI_Server/_http_http___141_5_99_69__application_json_200_.yml +160 -0
- data/features/cassettes/Discovery_Interface/Retrieving_all_OCCI_Categories_supported_by_the_OCCI_Server/_http_http___141_5_99_69__text_plain_200_.yml +204 -0
- data/features/cassettes/Discovery_Interface/Retrieving_all_OCCI_Categories_supported_by_the_OCCI_Server/_http_http___141_5_99_69__text_plain_200_action_.yml +102 -0
- data/features/cassettes/Miscellaneous_operation_on_an_OCCI_Resource/_http_http___141_5_99_69__text_plain_201_.yml +102 -0
- data/features/cassettes/Read_an_OCCI_Resource/_http_http___141_5_99_69__text_plain_201_.yml +102 -0
- data/features/cassettes/Update_an_OCCI_Resource/_http_http___141_5_99_69__text_plain_201_.yml +102 -0
- data/lib/occi/api/client/client_http.rb +70 -3
- data/lib/occi/bin/resource_output_factory.rb +8 -1
- data/lib/occi/bin/templates/compute.erb +18 -22
- data/lib/occi/bin/templates/network.erb +9 -11
- data/lib/occi/bin/templates/os_tpl.erb +7 -9
- data/lib/occi/bin/templates/resource_tpl.erb +7 -9
- data/lib/occi/bin/templates/storage.erb +8 -10
- data/lib/occi/version.rb +1 -1
- data/occi.gemspec +1 -2
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/creates_a_new_compute_resource.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/creates_a_new_network_resource.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/creates_a_new_storage_resource.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/deletes_a_compute_resource.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/deletes_a_network_resource.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/deletes_a_storage_resource.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/deploys_an_instance_based_on_OVF_OVA_file.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_all_available_mixins.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_compute_resources.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_network_resources.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_os_tpl_mixins.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_resource_tpl_mixins.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_storage_resources.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/establishes_connection.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/instantiates_a_compute_resource_using_type_identifier.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/instantiates_a_compute_resource_using_type_name.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/instantiates_a_network_resource_using_type_identifier.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/instantiates_a_network_resource_using_type_name.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/instantiates_a_storage_resource_using_type_identifier.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/instantiates_a_storage_resource_using_type_name.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_entity_type_identifiers.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_entity_types.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_link_type_identifiers.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_link_types.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_mixin_type_identifiers.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_mixin_types.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_mixins.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_resource_type_identifiers.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_resource_types.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_compute_resources.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_network_resources.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_os_tpl_mixins.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_resource_tpl_mixins.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_storage_resources.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/refreshes_its_model.yml +88 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/triggers_an_action_on_a_compute_resource.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/triggers_an_action_on_a_network_resource.yml +44 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/triggers_an_action_on_a_storage_resource.yml +44 -0
- data/spec/occi/api/client/client_http_spec.rb +1 -1
- metadata +7 -24
- data/Gemfile.lock +0 -126
data/features/cassettes/Update_an_OCCI_Resource/_http_http___141_5_99_69__text_plain_201_.yml
CHANGED
@@ -183,4 +183,106 @@ http_interactions:
|
|
183
183
|
'
|
184
184
|
http_version:
|
185
185
|
recorded_at: Thu, 10 Jan 2013 13:52:44 GMT
|
186
|
+
- request:
|
187
|
+
method: get
|
188
|
+
uri: http://141.5.99.69/
|
189
|
+
body:
|
190
|
+
encoding: US-ASCII
|
191
|
+
string: ''
|
192
|
+
headers:
|
193
|
+
Accept:
|
194
|
+
- text/plain
|
195
|
+
response:
|
196
|
+
status:
|
197
|
+
code: 200
|
198
|
+
message: OK
|
199
|
+
headers:
|
200
|
+
Date:
|
201
|
+
- Tue, 12 Mar 2013 13:29:44 GMT
|
202
|
+
Server:
|
203
|
+
- Apache/2.2.22 (Ubuntu)
|
204
|
+
X-Powered-By:
|
205
|
+
- Phusion Passenger (mod_rails/mod_rack) 3.0.18
|
206
|
+
X-Frame-Options:
|
207
|
+
- sameorigin
|
208
|
+
X-Xss-Protection:
|
209
|
+
- 1; mode=block
|
210
|
+
Accept:
|
211
|
+
- application/occi+json,application/json,text/plain,text/uri-list,application/xml,text/xml,application/occi+xml,text/occi
|
212
|
+
Set-Cookie:
|
213
|
+
- rack.session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRiJFZjhhYWFiY2M4NzI1YmM5ZDAxOTM4%0AOTlkMmY1YzQwMzIwNzU4NGZkMGI2MGQ4NTdjNTE3NjhjNzVmYTAzZGY0NEki%0ADXRyYWNraW5nBjsARnsISSIUSFRUUF9VU0VSX0FHRU5UBjsARiItZGEzOWEz%0AZWU1ZTZiNGIwZDMyNTViZmVmOTU2MDE4OTBhZmQ4MDcwOUkiGUhUVFBfQUND%0ARVBUX0VOQ09ESU5HBjsARiItZGEzOWEzZWU1ZTZiNGIwZDMyNTViZmVmOTU2%0AMDE4OTBhZmQ4MDcwOUkiGUhUVFBfQUNDRVBUX0xBTkdVQUdFBjsARiItZGEz%0AOWEzZWU1ZTZiNGIwZDMyNTViZmVmOTU2MDE4OTBhZmQ4MDcwOQ%3D%3D%0A--ed98c412bd15e6cbf4678ae0539ff96b547ab216;
|
214
|
+
path=/; HttpOnly
|
215
|
+
Content-Length:
|
216
|
+
- '738'
|
217
|
+
Status:
|
218
|
+
- '200'
|
219
|
+
Vary:
|
220
|
+
- Accept-Encoding
|
221
|
+
Content-Type:
|
222
|
+
- text/plain;charset=utf-8
|
223
|
+
body:
|
224
|
+
encoding: US-ASCII
|
225
|
+
string: ! 'X-OCCI-Location: http://141.5.99.69/compute/48e7c51c-5a7d-11e2-a300-fa163e16d22f
|
226
|
+
|
227
|
+
X-OCCI-Location: http://141.5.99.69/compute/6c706278-5a7d-11e2-a300-fa163e16d22f
|
228
|
+
|
229
|
+
X-OCCI-Location: http://141.5.99.69/compute/7582ffc4-5a7d-11e2-a300-fa163e16d22f
|
230
|
+
|
231
|
+
X-OCCI-Location: http://141.5.99.69/compute/8eb0deb2-5a7d-11e2-a300-fa163e16d22f
|
232
|
+
|
233
|
+
X-OCCI-Location: http://141.5.99.69/compute/8efa93e0-5a7d-11e2-a300-fa163e16d22f
|
234
|
+
|
235
|
+
X-OCCI-Location: http://141.5.99.69/compute/49cbeaee-5b1d-11e2-a300-fa163e16d22f
|
236
|
+
|
237
|
+
X-OCCI-Location: http://141.5.99.69/compute/c87fa76c-5b1e-11e2-a300-fa163e16d22f
|
238
|
+
|
239
|
+
X-OCCI-Location: http://141.5.99.69/compute/1cc544b2-5b1f-11e2-a300-fa163e16d22f
|
240
|
+
|
241
|
+
X-OCCI-Location: http://141.5.99.69/compute/38e2a6b2-5b1f-11e2-a300-fa163e16d22f
|
242
|
+
|
243
|
+
'
|
244
|
+
http_version:
|
245
|
+
recorded_at: Tue, 12 Mar 2013 13:29:36 GMT
|
246
|
+
- request:
|
247
|
+
method: head
|
248
|
+
uri: http://141.5.99.69/
|
249
|
+
body:
|
250
|
+
encoding: US-ASCII
|
251
|
+
string: ''
|
252
|
+
headers:
|
253
|
+
Accept:
|
254
|
+
- text/plain
|
255
|
+
response:
|
256
|
+
status:
|
257
|
+
code: 200
|
258
|
+
message: OK
|
259
|
+
headers:
|
260
|
+
Date:
|
261
|
+
- Tue, 12 Mar 2013 15:27:55 GMT
|
262
|
+
Server:
|
263
|
+
- Apache/2.2.22 (Ubuntu)
|
264
|
+
X-Powered-By:
|
265
|
+
- Phusion Passenger (mod_rails/mod_rack) 3.0.18
|
266
|
+
X-Frame-Options:
|
267
|
+
- sameorigin
|
268
|
+
X-Xss-Protection:
|
269
|
+
- 1; mode=block
|
270
|
+
Accept:
|
271
|
+
- application/occi+json,application/json,text/plain,text/uri-list,application/xml,text/xml,application/occi+xml,text/occi
|
272
|
+
Set-Cookie:
|
273
|
+
- rack.session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRiJFOWIxY2FkNmM0ODZkY2U5MzllYTZk%0ANDY3ZjgwNzRjNmI1NjA5NGRhNjBkNWZlYzg2MTA4NTk1OTIwZmIxNmRkMEki%0ADXRyYWNraW5nBjsARnsISSIUSFRUUF9VU0VSX0FHRU5UBjsARiItZGEzOWEz%0AZWU1ZTZiNGIwZDMyNTViZmVmOTU2MDE4OTBhZmQ4MDcwOUkiGUhUVFBfQUND%0ARVBUX0VOQ09ESU5HBjsARiItZGEzOWEzZWU1ZTZiNGIwZDMyNTViZmVmOTU2%0AMDE4OTBhZmQ4MDcwOUkiGUhUVFBfQUNDRVBUX0xBTkdVQUdFBjsARiItZGEz%0AOWEzZWU1ZTZiNGIwZDMyNTViZmVmOTU2MDE4OTBhZmQ4MDcwOQ%3D%3D%0A--b576238584753a3c874e52e73b6bb06a34881845;
|
274
|
+
path=/; HttpOnly
|
275
|
+
Content-Length:
|
276
|
+
- '738'
|
277
|
+
Status:
|
278
|
+
- '200'
|
279
|
+
Vary:
|
280
|
+
- Accept-Encoding
|
281
|
+
Content-Type:
|
282
|
+
- text/plain;charset=utf-8
|
283
|
+
body:
|
284
|
+
encoding: US-ASCII
|
285
|
+
string: ''
|
286
|
+
http_version:
|
287
|
+
recorded_at: Tue, 12 Mar 2013 15:27:48 GMT
|
186
288
|
recorded_with: VCR 2.4.0
|
@@ -421,7 +421,11 @@ module Occi
|
|
421
421
|
headers = self.class.headers.clone
|
422
422
|
headers['Accept'] = 'text/uri-list'
|
423
423
|
|
424
|
-
|
424
|
+
# TODO: remove the gsub OCCI-OS hack
|
425
|
+
response = self.class.get(
|
426
|
+
@endpoint + path,
|
427
|
+
:headers => headers
|
428
|
+
).body.gsub(/\# uri:\/(compute|storage|network)\/[\n]?/, '').split("\n").compact
|
425
429
|
end
|
426
430
|
|
427
431
|
# Retrieves descriptions for available resources specified by a type
|
@@ -676,6 +680,7 @@ module Occi
|
|
676
680
|
self.class.ssl_ca_file @auth_options[:ca_file] unless @auth_options[:ca_file].nil?
|
677
681
|
self.class.ssl_extra_chain_cert AuthnUtils.certs_to_file_ary(@auth_options[:proxy_ca]) unless @auth_options[:proxy_ca].nil?
|
678
682
|
when "keystone"
|
683
|
+
Occi::Log.warn "AuthN method 'keystone' is deprecated and you should use it only as a fall-back option!"
|
679
684
|
# set up OpenStack Keystone token based auth
|
680
685
|
raise ArgumentError, "Missing required option 'token' for OpenStack Keystone auth!" unless @auth_options[:token]
|
681
686
|
self.class.headers['X-Auth-Token'] = @auth_options[:token]
|
@@ -942,8 +947,14 @@ module Occi
|
|
942
947
|
#
|
943
948
|
# @example
|
944
949
|
# set_model
|
950
|
+
#
|
951
|
+
# @return [Occi::Model]
|
945
952
|
def set_model
|
946
953
|
|
954
|
+
# check credentials and handle OpenStack Keystone
|
955
|
+
# TODO: check expiration dates on Keystone tokens
|
956
|
+
raise "You are not authorized to use this endpoint!" unless check_authn
|
957
|
+
|
947
958
|
#
|
948
959
|
model = get('/-/')
|
949
960
|
@model = Occi::Model.new(model)
|
@@ -955,13 +966,69 @@ module Occi
|
|
955
966
|
|
956
967
|
#
|
957
968
|
get_os_templates.each do |os_tpl|
|
958
|
-
|
969
|
+
unless os_tpl.nil? || os_tpl.type_identifier.nil?
|
970
|
+
tid = os_tpl.type_identifier.strip
|
971
|
+
@mixins[:os_tpl] << tid unless tid.empty?
|
972
|
+
end
|
959
973
|
end
|
960
974
|
|
961
975
|
#
|
962
976
|
get_resource_templates.each do |res_tpl|
|
963
|
-
|
977
|
+
unless res_tpl.nil? || res_tpl.type_identifier.nil?
|
978
|
+
tid = res_tpl.type_identifier.strip
|
979
|
+
@mixins[:resource_tpl] << tid unless tid.empty?
|
980
|
+
end
|
964
981
|
end
|
982
|
+
|
983
|
+
model
|
984
|
+
end
|
985
|
+
|
986
|
+
# Checks provided credentials and attempts transparent
|
987
|
+
# authentication with OS Keystone using the "www-authenticate"
|
988
|
+
# header.
|
989
|
+
#
|
990
|
+
# @example
|
991
|
+
# check_authn
|
992
|
+
#
|
993
|
+
# @return [true, false]
|
994
|
+
def check_authn
|
995
|
+
response = self.class.head @endpoint
|
996
|
+
|
997
|
+
return true if response.success?
|
998
|
+
|
999
|
+
if response.code == 401 && response.headers["www-authenticate"]
|
1000
|
+
if response.headers["www-authenticate"].start_with? "Keystone"
|
1001
|
+
keystone_uri = /^Keystone uri='(.+)'$/.match(response.headers["www-authenticate"])[1]
|
1002
|
+
|
1003
|
+
if keystone_uri
|
1004
|
+
if @auth_options[:type] == "x509"
|
1005
|
+
body = { "auth" => { "voms" => true } }
|
1006
|
+
else
|
1007
|
+
body = {
|
1008
|
+
"auth" => {
|
1009
|
+
"passwordCredentials" => {
|
1010
|
+
"username" => @auth_options[:username],
|
1011
|
+
"password" => @auth_options[:password]
|
1012
|
+
}
|
1013
|
+
}
|
1014
|
+
}
|
1015
|
+
end
|
1016
|
+
|
1017
|
+
headers = self.class.headers.clone
|
1018
|
+
headers['Content-Type'] = "application/json"
|
1019
|
+
headers['Accept'] = headers['Content-Type']
|
1020
|
+
|
1021
|
+
response = self.class.post(keystone_uri + "/v2.0/tokens", :body => body.to_json, :headers => headers)
|
1022
|
+
|
1023
|
+
if response.success?
|
1024
|
+
self.class.headers['X-Auth-Token'] = response['access']['token']['id']
|
1025
|
+
return true
|
1026
|
+
end
|
1027
|
+
end
|
1028
|
+
end
|
1029
|
+
end
|
1030
|
+
|
1031
|
+
false
|
965
1032
|
end
|
966
1033
|
|
967
1034
|
# Retrieves available os_tpls from the model.
|
@@ -57,7 +57,14 @@ module Occi
|
|
57
57
|
file = File.expand_path("..", __FILE__) + '/templates/' + resource_type.to_s + ".erb"
|
58
58
|
template = ERB.new File.new(file).read
|
59
59
|
|
60
|
-
|
60
|
+
formatted_output = ""
|
61
|
+
|
62
|
+
occi_resources.each do |occi_resource|
|
63
|
+
json_resource = occi_resource.as_json
|
64
|
+
formatted_output << template.result(binding) unless json_resource.nil? || json_resource.empty?
|
65
|
+
end
|
66
|
+
|
67
|
+
formatted_output
|
61
68
|
end
|
62
69
|
|
63
70
|
def self.locations_to_json(url_locations, resource_type)
|
@@ -1,22 +1,18 @@
|
|
1
|
-
<%# We always get
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
MOUNT POINT: <%= link.attributes.occi.storagelink.deviceid %>
|
20
|
-
<% end %>
|
21
|
-
<% end %><% end %>
|
22
|
-
<% end %>
|
1
|
+
<%# We always get a JSON %>
|
2
|
+
COMPUTE:
|
3
|
+
ID: <%= json_resource.resources.first.attributes.occi.core.id %>
|
4
|
+
TITLE: <%= json_resource.resources.first.attributes.occi.core.title %>
|
5
|
+
STATE: <%= json_resource.resources.first.attributes.occi.compute.state %>
|
6
|
+
LINKS:
|
7
|
+
<% if json_resource.links %><% json_resource.links.each do |link| %>
|
8
|
+
LINK "<%= link.attributes.occi.core.target.split("/")[1] %>":
|
9
|
+
ID: <%= link.attributes.occi.core.id %>
|
10
|
+
TITLE: <%= link.attributes.occi.core.title %>
|
11
|
+
TARGET: <%= link.attributes.occi.core.target %>
|
12
|
+
<% if link.attributes.occi.networkinterface %>
|
13
|
+
IP ADDRESS: <%= link.attributes.occi.networkinterface.address %>
|
14
|
+
MAC ADDRESS: <%= link.attributes.occi.networkinterface.mac %>
|
15
|
+
<% elsif link.attributes.occi.storagelink %>
|
16
|
+
MOUNT POINT: <%= link.attributes.occi.storagelink.deviceid %>
|
17
|
+
<% end %>
|
18
|
+
<% end %><% end %>
|
@@ -1,11 +1,9 @@
|
|
1
|
-
<%# We always get
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
ADDRESS: <%= network.resources.first.attributes.occi.network.address %>
|
11
|
-
<% end %>
|
1
|
+
<%# We always get a JSON %>
|
2
|
+
NETWORK:
|
3
|
+
ID: <%= json_resource.resources.first.attributes.occi.core.id %>
|
4
|
+
TITLE: <%= json_resource.resources.first.attributes.occi.core.title %>
|
5
|
+
STATE: <%= json_resource.resources.first.attributes.occi.network.state %>
|
6
|
+
ALLOCATION: <%= json_resource.resources.first.attributes.occi.network.allocation %>
|
7
|
+
ADDRESS: <%= json_resource.resources.first.attributes.occi.network.address %>
|
8
|
+
|
9
|
+
|
@@ -1,9 +1,7 @@
|
|
1
|
-
<%# We always get
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
LOCATION: <%= os_tpl.location %>
|
9
|
-
<% end %>
|
1
|
+
<%# We always get a JSON %>
|
2
|
+
OS_TPL:
|
3
|
+
TITLE: <%= json_resource.title %>
|
4
|
+
TERM: <%= json_resource.term %>
|
5
|
+
LOCATION: <%= json_resource.location %>
|
6
|
+
|
7
|
+
|
@@ -1,9 +1,7 @@
|
|
1
|
-
<%# We always get
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
LOCATION: <%= res_tpl.location %>
|
9
|
-
<% end %>
|
1
|
+
<%# We always get a JSON %>
|
2
|
+
RESOURCE_TPL:
|
3
|
+
TITLE: <%= json_resource.title %>
|
4
|
+
TERM: <%= json_resource.term %>
|
5
|
+
LOCATION: <%= json_resource.location %>
|
6
|
+
|
7
|
+
|
@@ -1,10 +1,8 @@
|
|
1
|
-
<%# We always get
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
DESCRIPTION: <%= storage.resources.first.attributes.occi.core.summary %>
|
10
|
-
<% end %>
|
1
|
+
<%# We always get a JSON %>
|
2
|
+
STORAGE:
|
3
|
+
ID: <%= json_resource.resources.first.attributes.occi.core.id %>
|
4
|
+
TITLE: <%= json_resource.resources.first.attributes.occi.core.title %>
|
5
|
+
STATE: <%= json_resource.resources.first.attributes.occi.storage.state%>
|
6
|
+
DESCRIPTION: <%= json_resource.resources.first.attributes.occi.core.summary %>
|
7
|
+
|
8
|
+
|
data/lib/occi/version.rb
CHANGED
data/occi.gemspec
CHANGED
@@ -39,8 +39,7 @@ Gem::Specification.new do |gem|
|
|
39
39
|
gem.add_development_dependency "yard-rspec"
|
40
40
|
gem.add_development_dependency "yard-cucumber"
|
41
41
|
gem.add_development_dependency "rspec-http"
|
42
|
-
gem.add_development_dependency "
|
43
|
-
gem.add_development_dependency "webmock"
|
42
|
+
gem.add_development_dependency "webmock", "~>1.9.3"
|
44
43
|
|
45
44
|
gem.required_ruby_version = ">= 1.8.7"
|
46
45
|
end
|
@@ -1,5 +1,49 @@
|
|
1
1
|
---
|
2
2
|
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: head
|
5
|
+
uri: https://localhost:3300/
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- text/plain,text/occi;q=0.2
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message: OK
|
16
|
+
headers:
|
17
|
+
Date:
|
18
|
+
- Thu, 10 Jan 2013 17:44:39 GMT
|
19
|
+
Server:
|
20
|
+
- Apache/2.2.20 (Ubuntu)
|
21
|
+
X-Powered-By:
|
22
|
+
- Phusion Passenger (mod_rails/mod_rack) 3.0.12
|
23
|
+
X-Frame-Options:
|
24
|
+
- sameorigin
|
25
|
+
X-Xss-Protection:
|
26
|
+
- 1; mode=block
|
27
|
+
Accept:
|
28
|
+
- application/occi+json,application/json,text/plain,text/uri-list,application/xml,text/xml,application/occi+xml,text/occi
|
29
|
+
Set-Cookie:
|
30
|
+
- GRIDHTTP_PASSCODE=ec9b4b21351052e5aPTUJs; domain=localhost; path=/;
|
31
|
+
secure
|
32
|
+
- rack.session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRiJFZTIyZmM5ZmI2OTliY2JiZWQyMjYz%0AN2IyNTQ3NjMyMDkxYTFkNWVhOGIwYjVkYTNhYTllMTYyYjdkZTZiMzhkY0ki%0ADXRyYWNraW5nBjsARnsISSIUSFRUUF9VU0VSX0FHRU5UBjsARiItZGEzOWEz%0AZWU1ZTZiNGIwZDMyNTViZmVmOTU2MDE4OTBhZmQ4MDcwOUkiGUhUVFBfQUND%0ARVBUX0VOQ09ESU5HBjsARiItZGEzOWEzZWU1ZTZiNGIwZDMyNTViZmVmOTU2%0AMDE4OTBhZmQ4MDcwOUkiGUhUVFBfQUNDRVBUX0xBTkdVQUdFBjsARiItZGEz%0AOWEzZWU1ZTZiNGIwZDMyNTViZmVmOTU2MDE4OTBhZmQ4MDcwOQ%3D%3D%0A--24c9906d0e0c02c6976b065151f161a7e299022a;
|
33
|
+
path=/; HttpOnly
|
34
|
+
Content-Length:
|
35
|
+
- '294'
|
36
|
+
Status:
|
37
|
+
- '200'
|
38
|
+
Vary:
|
39
|
+
- Accept-Encoding
|
40
|
+
Content-Type:
|
41
|
+
- text/plain;charset=utf-8
|
42
|
+
body:
|
43
|
+
encoding: US-ASCII
|
44
|
+
string: ''
|
45
|
+
http_version:
|
46
|
+
recorded_at: Thu, 10 Jan 2013 17:44:39 GMT
|
3
47
|
- request:
|
4
48
|
method: head
|
5
49
|
uri: https://localhost:3300/
|
@@ -1,5 +1,49 @@
|
|
1
1
|
---
|
2
2
|
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: head
|
5
|
+
uri: https://localhost:3300/
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- text/plain,text/occi;q=0.2
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message: OK
|
16
|
+
headers:
|
17
|
+
Date:
|
18
|
+
- Thu, 10 Jan 2013 17:44:39 GMT
|
19
|
+
Server:
|
20
|
+
- Apache/2.2.20 (Ubuntu)
|
21
|
+
X-Powered-By:
|
22
|
+
- Phusion Passenger (mod_rails/mod_rack) 3.0.12
|
23
|
+
X-Frame-Options:
|
24
|
+
- sameorigin
|
25
|
+
X-Xss-Protection:
|
26
|
+
- 1; mode=block
|
27
|
+
Accept:
|
28
|
+
- application/occi+json,application/json,text/plain,text/uri-list,application/xml,text/xml,application/occi+xml,text/occi
|
29
|
+
Set-Cookie:
|
30
|
+
- GRIDHTTP_PASSCODE=ec9b4b21351052e5aPTUJs; domain=localhost; path=/;
|
31
|
+
secure
|
32
|
+
- rack.session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRiJFZTIyZmM5ZmI2OTliY2JiZWQyMjYz%0AN2IyNTQ3NjMyMDkxYTFkNWVhOGIwYjVkYTNhYTllMTYyYjdkZTZiMzhkY0ki%0ADXRyYWNraW5nBjsARnsISSIUSFRUUF9VU0VSX0FHRU5UBjsARiItZGEzOWEz%0AZWU1ZTZiNGIwZDMyNTViZmVmOTU2MDE4OTBhZmQ4MDcwOUkiGUhUVFBfQUND%0ARVBUX0VOQ09ESU5HBjsARiItZGEzOWEzZWU1ZTZiNGIwZDMyNTViZmVmOTU2%0AMDE4OTBhZmQ4MDcwOUkiGUhUVFBfQUNDRVBUX0xBTkdVQUdFBjsARiItZGEz%0AOWEzZWU1ZTZiNGIwZDMyNTViZmVmOTU2MDE4OTBhZmQ4MDcwOQ%3D%3D%0A--24c9906d0e0c02c6976b065151f161a7e299022a;
|
33
|
+
path=/; HttpOnly
|
34
|
+
Content-Length:
|
35
|
+
- '294'
|
36
|
+
Status:
|
37
|
+
- '200'
|
38
|
+
Vary:
|
39
|
+
- Accept-Encoding
|
40
|
+
Content-Type:
|
41
|
+
- text/plain;charset=utf-8
|
42
|
+
body:
|
43
|
+
encoding: US-ASCII
|
44
|
+
string: ''
|
45
|
+
http_version:
|
46
|
+
recorded_at: Thu, 10 Jan 2013 17:44:39 GMT
|
3
47
|
- request:
|
4
48
|
method: head
|
5
49
|
uri: https://localhost:3300/
|