occi-api 4.2.0.beta.15 → 4.2.0.beta.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -6
  3. data/lib/occi/api/client/base/stubs.rb +0 -36
  4. data/lib/occi/api/client/client_http.rb +0 -47
  5. data/lib/occi/api/client/http/helpers.rb +0 -2
  6. data/lib/occi/api/dsl.rb +3 -3
  7. data/lib/occi/api/version.rb +1 -1
  8. data/occi-api.gemspec +1 -1
  9. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/creates_a_new_compute_resource.yml +840 -0
  10. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/creates_a_new_network_resource.yml +848 -0
  11. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/creates_a_new_storage_resource.yml +840 -0
  12. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/deletes_a_compute_resource.yml +836 -0
  13. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/deletes_a_network_resource.yml +844 -0
  14. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/deletes_a_storage_resource.yml +836 -0
  15. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/describes_all_available_mixins.yml +647 -0
  16. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/describes_compute_resources.yml +885 -0
  17. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/describes_network_resources.yml +1038 -0
  18. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/describes_os_tpl_mixins.yml +647 -0
  19. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/describes_resource_tpl_mixins.yml +648 -0
  20. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/describes_storage_resources.yml +1144 -0
  21. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/establishes_connection.yml +789 -0
  22. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/lists_all_available_mixins.yml +647 -0
  23. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/lists_compute_resources.yml +836 -0
  24. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/lists_network_resources.yml +842 -0
  25. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/lists_os_tpl_mixins.yml +647 -0
  26. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/lists_resource_tpl_mixins.yml +647 -0
  27. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/lists_storage_resources.yml +846 -0
  28. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/refreshes_its_model.yml +1524 -0
  29. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/triggers_an_action_on_a_compute_resource.yml +846 -0
  30. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/triggers_an_action_on_a_network_resource.yml +840 -0
  31. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/triggers_an_action_on_a_storage_resource.yml +846 -0
  32. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/creates_a_new_compute_resource.yml +321 -0
  33. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/creates_a_new_network_resource.yml +326 -0
  34. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/creates_a_new_storage_resource.yml +321 -0
  35. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/deletes_a_compute_resource.yml +311 -0
  36. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/deletes_a_network_resource.yml +310 -0
  37. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/deletes_a_storage_resource.yml +311 -0
  38. data/spec/cassettes/Occi_Api_Client_ClientHttp/{using_media_type_text_plain/refreshes_its_model.yml → using_media_type_text/plain/describes_all_available_mixins.yml} +160 -124
  39. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/describes_compute_resources.yml +752 -0
  40. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/describes_network_resources.yml +977 -0
  41. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/describes_storage_resources.yml +1178 -0
  42. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/establishes_connection.yml +262 -0
  43. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/fails_to_list_mixins_with_only_self_no_related_without_include_self_true.yml +262 -0
  44. data/spec/cassettes/Occi_Api_Client_ClientHttp/{using_media_type_text_plain/describes_storage_resources.yml → using_media_type_text/plain/finds_and_describes_scoped_os_tpl_mixin.yml} +196 -104
  45. data/spec/cassettes/Occi_Api_Client_ClientHttp/{using_media_type_text_plain/describes_network_resources.yml → using_media_type_text/plain/finds_and_describes_scoped_resource_tpl_mixin.yml} +203 -51
  46. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/finds_and_describes_unscoped_mixin.yml +262 -0
  47. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/instantiates_a_compute_resource_using_type_identifier.yml +262 -0
  48. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/instantiates_a_compute_resource_using_type_name.yml +262 -0
  49. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/instantiates_a_network_resource_using_type_identifier.yml +262 -0
  50. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/instantiates_a_network_resource_using_type_name.yml +262 -0
  51. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/instantiates_a_storage_resource_using_type_identifier.yml +262 -0
  52. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/instantiates_a_storage_resource_using_type_name.yml +262 -0
  53. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_all_available_entity_type_identifiers.yml +262 -0
  54. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_all_available_entity_types.yml +262 -0
  55. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_all_available_link_type_identifiers.yml +262 -0
  56. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_all_available_link_types.yml +262 -0
  57. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_all_available_mixin_type_identifiers.yml +262 -0
  58. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_all_available_mixin_types.yml +262 -0
  59. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_all_available_mixins.yml +262 -0
  60. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_all_available_resource_type_identifiers.yml +262 -0
  61. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_all_available_resource_types.yml +262 -0
  62. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_compute_resources.yml +311 -0
  63. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_mixins_including_self.yml +262 -0
  64. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_mixins_with_only_self_no_related_.yml +262 -0
  65. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_network_resources.yml +315 -0
  66. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_os_tpl_mixins.yml +262 -0
  67. data/spec/cassettes/Occi_Api_Client_ClientHttp/{using_media_type_text_plain/describes_compute_resources.yml → using_media_type_text/plain/lists_resource_tpl_mixins.yml} +209 -55
  68. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_storage_resources.yml +321 -0
  69. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/looks_up_a_mixin_type_identifier_for_os_tpl.yml +262 -0
  70. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/looks_up_a_mixin_type_identifier_for_resource_tpl.yml +262 -0
  71. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/raises_an_error_when_looking_for_a_non-existent_mixin_type.yml +262 -0
  72. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/refreshes_its_model.yml +472 -0
  73. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/returns_nil_when_looking_for_a_non-existent_mixin.yml +262 -0
  74. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/returns_nil_when_looking_for_a_non-existent_mixin_of_a_specific_type.yml +262 -0
  75. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/triggers_an_action_on_a_compute_resource.yml +312 -0
  76. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/triggers_an_action_on_a_network_resource.yml +315 -0
  77. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/triggers_an_action_on_a_storage_resource.yml +312 -0
  78. data/spec/cassettes/Occi_Api_Dsl/_connect/accepts_block_options.yml +261 -0
  79. data/spec/cassettes/Occi_Api_Dsl/_connect/connects_successfully_through_HTTP.yml +259 -0
  80. data/spec/occi/api/client/client_http_spec.rb +253 -99
  81. data/spec/occi/api/dsl_spec.rb +53 -3
  82. data/spec/occi/helpers/helpers_spec.rb +11 -0
  83. data/spec/spec_helper.rb +1 -0
  84. metadata +76 -15
  85. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/establishes_connection.yml +0 -266
  86. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_compute_resources.yml +0 -308
  87. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_network_resources.yml +0 -308
  88. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_storage_resources.yml +0 -310
  89. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/net_http_example_response.yml +0 -266
  90. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/replacements.txt +0 -38
  91. data/spec/occi/api/client/base/stubs_spec.rb +0 -53
@@ -2,14 +2,64 @@ require 'rspec'
2
2
 
3
3
  module Occi
4
4
  module Api
5
- describe Dsl do
6
5
 
7
- context "using ClientHttp" do
6
+ # vcr_options = { :record => :new_episodes }
7
+ vcr_options = { :record => :none }
8
8
 
9
- it "does something"
9
+ describe Dsl, :vcr => vcr_options do
10
+ class DummyClass
11
+ end
12
+
13
+ before(:each) do
14
+ @dummy = DummyClass.new
15
+ @dummy.extend Occi::Api::Dsl
16
+ end
17
+
18
+ context ".connect" do
19
+
20
+ it "connects successfully through HTTP" do
21
+
22
+ expect(
23
+ @dummy.connect(:http,
24
+ {
25
+ :endpoint => ENV['ROCCI_SPEC_ENDPOINT'] || 'https://localhost:3300',
26
+ :auth => hash_or_nil_helper( ENV['ROCCI_SPEC_AUTH_JSON'] ) || { :type => "basic", :username => "rocci-test", :password => "edited"},
27
+ :log => { :out => "/dev/null",
28
+ :level => Occi::Log::DEBUG },
29
+ :auto_connect => true,
30
+ :media_type => "text/plain,text/occi"
31
+ } )).to eql true
32
+ end
33
+
34
+ it "raises exception for unsupported protocol" do
35
+
36
+ expect{
37
+ @dummy.connect(:ftp,
38
+ {
39
+ :endpoint => ENV['ROCCI_SPEC_ENDPOINT'] || 'https://localhost:3300',
40
+ :auth => hash_or_nil_helper( ENV['ROCCI_SPEC_AUTH_JSON'] ) || { :type => "basic", :username => "rocci-test", :password => "edited"},
41
+ :log => { :out => "/dev/null",
42
+ :level => Occi::Log::DEBUG },
43
+ :auto_connect => true,
44
+ :media_type => "text/plain,text/occi"
45
+ } ) }.to raise_exception(ArgumentError)
46
+ end
10
47
 
48
+ it "accepts block options" do
49
+ expect(
50
+ @dummy.connect(:http, { :auth => 'https://localhost:3300a' } ) { |opts|
51
+ opts.endpoint = ENV['ROCCI_SPEC_ENDPOINT'] || 'https://localhost:3300'
52
+ opts.auth = hash_or_nil_helper( ENV['ROCCI_SPEC_AUTH_JSON'] ) || { :type => "basic", :username => "rocci-test", :password => "edited"}
53
+ opts.log = { :out => "/dev/null",
54
+ :level => Occi::Log::DEBUG }
55
+ opts.auto_connect = true
56
+ opts.media_type = "text/plain,text/occi"
57
+ } ).to eql true
11
58
  end
12
59
 
60
+
13
61
  end
62
+
63
+ end
14
64
  end
15
65
  end
@@ -0,0 +1,11 @@
1
+ module Occi
2
+ module Helpers
3
+
4
+ def hash_or_nil_helper(json_string)
5
+ return nil if json_string.blank?
6
+ hash = JSON.parse(json_string)
7
+ hash.inject({}){ |memo,(k,v)| memo[k.to_sym] = v; memo }
8
+ end
9
+
10
+ end
11
+ end
data/spec/spec_helper.rb CHANGED
@@ -38,4 +38,5 @@ end
38
38
  RSpec.configure do |c|
39
39
  # in RSpec 3 this will no longer be necessary.
40
40
  c.treat_symbols_as_metadata_keys_with_true_values = true
41
+ c.include(Occi::Helpers)
41
42
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: occi-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0.beta.15
4
+ version: 4.2.0.beta.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Feldhaus
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-02-09 00:00:00.000000000 Z
13
+ date: 2014-02-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: occi-core
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 4.2.9
21
+ version: 4.2.10
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - ~>
27
27
  - !ruby/object:Gem::Version
28
- version: 4.2.9
28
+ version: 4.2.10
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: httparty
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -115,19 +115,79 @@ files:
115
115
  - lib/occi/api/log.rb
116
116
  - lib/occi/api/version.rb
117
117
  - occi-api.gemspec
118
- - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_compute_resources.yml
119
- - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_network_resources.yml
120
- - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_storage_resources.yml
121
- - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/establishes_connection.yml
122
- - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_compute_resources.yml
123
- - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_network_resources.yml
124
- - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_storage_resources.yml
125
- - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/net_http_example_response.yml
126
- - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/refreshes_its_model.yml
127
- - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/replacements.txt
118
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/creates_a_new_compute_resource.yml
119
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/creates_a_new_network_resource.yml
120
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/creates_a_new_storage_resource.yml
121
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/deletes_a_compute_resource.yml
122
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/deletes_a_network_resource.yml
123
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/deletes_a_storage_resource.yml
124
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/describes_all_available_mixins.yml
125
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/describes_compute_resources.yml
126
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/describes_network_resources.yml
127
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/describes_os_tpl_mixins.yml
128
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/describes_resource_tpl_mixins.yml
129
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/describes_storage_resources.yml
130
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/establishes_connection.yml
131
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/lists_all_available_mixins.yml
132
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/lists_compute_resources.yml
133
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/lists_network_resources.yml
134
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/lists_os_tpl_mixins.yml
135
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/lists_resource_tpl_mixins.yml
136
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/lists_storage_resources.yml
137
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/refreshes_its_model.yml
138
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/triggers_an_action_on_a_compute_resource.yml
139
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/triggers_an_action_on_a_network_resource.yml
140
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_application/occi_json/triggers_an_action_on_a_storage_resource.yml
141
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/creates_a_new_compute_resource.yml
142
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/creates_a_new_network_resource.yml
143
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/creates_a_new_storage_resource.yml
144
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/deletes_a_compute_resource.yml
145
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/deletes_a_network_resource.yml
146
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/deletes_a_storage_resource.yml
147
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/describes_all_available_mixins.yml
148
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/describes_compute_resources.yml
149
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/describes_network_resources.yml
150
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/describes_storage_resources.yml
151
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/establishes_connection.yml
152
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/fails_to_list_mixins_with_only_self_no_related_without_include_self_true.yml
153
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/finds_and_describes_scoped_os_tpl_mixin.yml
154
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/finds_and_describes_scoped_resource_tpl_mixin.yml
155
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/finds_and_describes_unscoped_mixin.yml
156
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/instantiates_a_compute_resource_using_type_identifier.yml
157
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/instantiates_a_compute_resource_using_type_name.yml
158
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/instantiates_a_network_resource_using_type_identifier.yml
159
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/instantiates_a_network_resource_using_type_name.yml
160
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/instantiates_a_storage_resource_using_type_identifier.yml
161
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/instantiates_a_storage_resource_using_type_name.yml
162
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_all_available_entity_type_identifiers.yml
163
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_all_available_entity_types.yml
164
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_all_available_link_type_identifiers.yml
165
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_all_available_link_types.yml
166
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_all_available_mixin_type_identifiers.yml
167
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_all_available_mixin_types.yml
168
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_all_available_mixins.yml
169
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_all_available_resource_type_identifiers.yml
170
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_all_available_resource_types.yml
171
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_compute_resources.yml
172
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_mixins_including_self.yml
173
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_mixins_with_only_self_no_related_.yml
174
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_network_resources.yml
175
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_os_tpl_mixins.yml
176
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_resource_tpl_mixins.yml
177
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/lists_storage_resources.yml
178
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/looks_up_a_mixin_type_identifier_for_os_tpl.yml
179
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/looks_up_a_mixin_type_identifier_for_resource_tpl.yml
180
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/raises_an_error_when_looking_for_a_non-existent_mixin_type.yml
181
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/refreshes_its_model.yml
182
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/returns_nil_when_looking_for_a_non-existent_mixin.yml
183
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/returns_nil_when_looking_for_a_non-existent_mixin_of_a_specific_type.yml
184
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/triggers_an_action_on_a_compute_resource.yml
185
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/triggers_an_action_on_a_network_resource.yml
186
+ - spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/triggers_an_action_on_a_storage_resource.yml
187
+ - spec/cassettes/Occi_Api_Dsl/_connect/accepts_block_options.yml
188
+ - spec/cassettes/Occi_Api_Dsl/_connect/connects_successfully_through_HTTP.yml
128
189
  - spec/cassettes/tools/generalize_yml.sh
129
190
  - spec/occi/api/client/authn_utils_spec.rb
130
- - spec/occi/api/client/base/stubs_spec.rb
131
191
  - spec/occi/api/client/client_http_spec.rb
132
192
  - spec/occi/api/client/http/httparty_fix_spec.rb
133
193
  - spec/occi/api/client/http/net_http_fix_spec.rb
@@ -136,6 +196,7 @@ files:
136
196
  - spec/occi/api/client/rocci-cred-key.pem
137
197
  - spec/occi/api/client/rocci-cred.p12
138
198
  - spec/occi/api/dsl_spec.rb
199
+ - spec/occi/helpers/helpers_spec.rb
139
200
  - spec/spec_helper.rb
140
201
  homepage: https://github.com/gwdg/rOCCI-api
141
202
  licenses:
@@ -1,266 +0,0 @@
1
- ---
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, 01 Jan 1970 00:00:00 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=0000000000000000000000; domain=localhost; path=/;
31
- secure
32
- - rack.session=000000000000000000000000000000000000000000000000000000000000%0A000000000000000000000000000000000000000000000000000000000000%0A000000000000000000000000000000000000000000000000000000000000%0A000000000000000000000000000000000000000000000000000000000000%0A000000000000000000000000000000000000000000000000000000000000%0A000000000000000000000000000000000000000000000000000000000000%0A00000000000000000000000000000000000000000000000000%3D%3D%0A--0000000000000000000000000000000000000000;
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, 01 Jan 1970 00:00:00 GMT
47
- - request:
48
- method: head
49
- uri: https://localhost:3300/
50
- body:
51
- encoding: US-ASCII
52
- string: ''
53
- headers:
54
- Accept:
55
- - text/plain,text/occi;q=0.2
56
- response:
57
- status:
58
- code: 200
59
- message: OK
60
- headers:
61
- Date:
62
- - Thu, 01 Jan 1970 00:00:00 GMT
63
- Server:
64
- - Apache/2.2.20 (Ubuntu)
65
- X-Powered-By:
66
- - Phusion Passenger (mod_rails/mod_rack) 3.0.12
67
- X-Frame-Options:
68
- - sameorigin
69
- X-Xss-Protection:
70
- - 1; mode=block
71
- Accept:
72
- - application/occi+json,application/json,text/plain,text/uri-list,application/xml,text/xml,application/occi+xml,text/occi
73
- Set-Cookie:
74
- - GRIDHTTP_PASSCODE=0000000000000000000000; domain=localhost; path=/;
75
- secure
76
- - rack.session=000000000000000000000000000000000000000000000000000000000000%0A000000000000000000000000000000000000000000000000000000000000%0A000000000000000000000000000000000000000000000000000000000000%0A000000000000000000000000000000000000000000000000000000000000%0A000000000000000000000000000000000000000000000000000000000000%0A000000000000000000000000000000000000000000000000000000000000%0A00000000000000000000000000000000000000000000000000%3D%3D%0A--0000000000000000000000000000000000000000;
77
- path=/; HttpOnly
78
- Content-Length:
79
- - '294'
80
- Status:
81
- - '200'
82
- Vary:
83
- - Accept-Encoding
84
- Content-Type:
85
- - text/plain;charset=utf-8
86
- body:
87
- encoding: US-ASCII
88
- string: ''
89
- http_version:
90
- recorded_at: Thu, 01 Jan 1970 00:00:00 GMT
91
- - request:
92
- method: get
93
- uri: https://localhost:3300/-/
94
- body:
95
- encoding: US-ASCII
96
- string: ''
97
- headers:
98
- Accept:
99
- - text/plain,text/occi
100
- response:
101
- status:
102
- code: 200
103
- message: OK
104
- headers:
105
- Date:
106
- - Thu, 01 Jan 1970 00:00:00 GMT
107
- Server:
108
- - Apache/2.2.20 (Ubuntu)
109
- X-Powered-By:
110
- - Phusion Passenger (mod_rails/mod_rack) 3.0.12
111
- X-Frame-Options:
112
- - sameorigin
113
- X-Xss-Protection:
114
- - 1; mode=block
115
- Accept:
116
- - application/occi+json,application/json,text/plain,text/uri-list,application/xml,text/xml,application/occi+xml,text/occi
117
- Set-Cookie:
118
- - GRIDHTTP_PASSCODE=0000000000000000000000; domain=localhost; path=/;
119
- secure
120
- - rack.session=000000000000000000000000000000000000000000000000000000000000%0A000000000000000000000000000000000000000000000000000000000000%0A000000000000000000000000000000000000000000000000000000000000%0A000000000000000000000000000000000000000000000000000000000000%0A000000000000000000000000000000000000000000000000000000000000%0A000000000000000000000000000000000000000000000000000000000000%0A00000000000000000000000000000000000000000000000000%3D%3D%0A--0000000000000000000000000000000000000000;
121
- path=/; HttpOnly
122
- Content-Length:
123
- - '8975'
124
- Status:
125
- - '200'
126
- Vary:
127
- - Accept-Encoding
128
- Content-Type:
129
- - text/plain;charset=utf-8
130
- body:
131
- encoding: US-ASCII
132
- string: ! 'Category: entity;scheme="http://schemas.ogf.org/occi/core#";class="kind";title="Entity";location="/entity/";attributes="occi.core.id
133
- occi.core.title"
134
-
135
- Category: resource;scheme="http://schemas.ogf.org/occi/core#";class="kind";title="Resource";rel="http://schemas.ogf.org/occi/core#entity";location="/resource/";attributes="occi.core.summary"
136
-
137
- Category: link;scheme="http://schemas.ogf.org/occi/core#";class="kind";title="Link";rel="http://schemas.ogf.org/occi/core#entity";location="/link/";attributes="occi.core.target
138
- occi.core.source"
139
-
140
- Category: compute;scheme="http://schemas.ogf.org/occi/infrastructure#";class="kind";title="Compute
141
- Resource";rel="http://schemas.ogf.org/occi/core#resource";location="/compute/";attributes="occi.compute.architecture
142
- occi.compute.cores occi.compute.hostname occi.compute.speed occi.compute.memory
143
- occi.compute.state";actions="http://schemas.ogf.org/occi/infrastructure/compute/action#start
144
- http://schemas.ogf.org/occi/infrastructure/compute/action#stop http://schemas.ogf.org/occi/infrastructure/compute/action#restart
145
- http://schemas.ogf.org/occi/infrastructure/compute/action#suspend"
146
-
147
- Category: storagelink;scheme="http://schemas.ogf.org/occi/infrastructure#";class="kind";title="Storage
148
- Link";rel="http://schemas.ogf.org/occi/core#link";location="/storagelink/";attributes="occi.storagelink.deviceid
149
- occi.storagelink.mountpoint occi.storagelink.state"
150
-
151
- Category: network;scheme="http://schemas.ogf.org/occi/infrastructure#";class="kind";title="Network
152
- Resource";rel="http://schemas.ogf.org/occi/core#resource";location="/network/";attributes="occi.network.vlan
153
- occi.network.label occi.network.state org.opennebula.network.id org.opennebula.network.bridge
154
- org.opennebula.network.vlan org.opennebula.network.phydev org.opennebula.network.ip_start
155
- org.opennebula.network.ip_end";actions="http://schemas.ogf.org/occi/infrastructure/network/action#up
156
- http://schemas.ogf.org/occi/infrastructure/network/action#down"
157
-
158
- Category: storage;scheme="http://schemas.ogf.org/occi/infrastructure#";class="kind";title="Storage
159
- Resource";rel="http://schemas.ogf.org/occi/core#resource";location="/storage/";attributes="occi.storage.size
160
- occi.storage.state org.opennebula.storage.id org.opennebula.storage.type org.opennebula.storage.persistent
161
- org.opennebula.storage.dev_prefix org.opennebula.storage.bus org.opennebula.storage.driver
162
- org.opennebula.storage.fstype";actions="http://schemas.ogf.org/occi/infrastructure/storage/action#online
163
- http://schemas.ogf.org/occi/infrastructure/storage/action#offline http://schemas.ogf.org/occi/infrastructure/storage/action#backup
164
- http://schemas.ogf.org/occi/infrastructure/storage/action#snapshot http://schemas.ogf.org/occi/infrastructure/storage/action#resize"
165
-
166
- Category: networkinterface;scheme="http://schemas.ogf.org/occi/infrastructure#";class="kind";title="Networkinterface";rel="http://schemas.ogf.org/occi/core#link";location="/networkinterface/";attributes="occi.networkinterface.interface
167
- occi.networkinterface.mac occi.networkinterface.state"
168
-
169
- Category: console;scheme="http://schemas.ogf.org/occi/infrastructure/compute#";class="kind";title="Link
170
- to the VM''s console";rel="http://schemas.ogf.org/occi/core#link";location="/console/"
171
-
172
- Category: os_tpl;scheme="http://schemas.ogf.org/occi/infrastructure#";class="mixin";title="Operating
173
- System Template";location="/mixins/os_tpl/"
174
-
175
- Category: ipnetwork;scheme="http://schemas.ogf.org/occi/infrastructure/network#";class="mixin";title="IP
176
- Network Mixin";location="/mixins/ipnetwork/";attributes="occi.network.address
177
- occi.network.gateway occi.network.allocation occi.network.state"
178
-
179
- Category: ipnetworkinterface;scheme="http://schemas.ogf.org/occi/infrastructure/networkinterface#";class="mixin";title="IP
180
- Networkinterface Mixin";location="/mixins/ipnetworkinterface/";attributes="occi.networkinterface.address
181
- occi.networkinterface.gateway occi.networkinterface.allocation occi.networkinterface.state"
182
-
183
- Category: resource_tpl;scheme="http://schemas.ogf.org/occi/infrastructure#";class="mixin";title="Resource
184
- Template";location="/mixins/resource_tpl/"
185
-
186
- Category: compute;scheme="http://opennebula.org/occi/infrastructure#";class="mixin";title="OpenNebula
187
- specific Compute attributes";location="/mixins/compute/";attributes="org.opennebula.compute.cpu
188
- org.opennebula.compute.kernel org.opennebula.compute.initrd org.opennebula.compute.root
189
- org.opennebula.compute.kernel_cmd org.opennebula.compute.bootloader org.opennebula.compute.boot"
190
-
191
- Category: storagelink;scheme="http://opennebula.org/occi/infrastructure#";class="mixin";title="OpenNebula
192
- specific Storagelink attributes";location="/mixins/storagelink/";attributes="org.opennebula.storagelink.bus
193
- org.opennebula.storagelink.driver"
194
-
195
- Category: network;scheme="http://opennebula.org/occi/infrastructure#";class="mixin";title="OpenNebula
196
- specific Network attributes";location="/mixins/network/";attributes="org.opennebula.network.id
197
- org.opennebula.network.bridge org.opennebula.network.vlan org.opennebula.network.phydev
198
- org.opennebula.network.ip_start org.opennebula.network.ip_end"
199
-
200
- Category: storage;scheme="http://opennebula.org/occi/infrastructure#";class="mixin";title="OpenNebula
201
- specific Storage attributes";location="/mixins/storage/";attributes="org.opennebula.storage.id
202
- org.opennebula.storage.type org.opennebula.storage.persistent org.opennebula.storage.dev_prefix
203
- org.opennebula.storage.bus org.opennebula.storage.driver org.opennebula.storage.fstype"
204
-
205
- Category: networkinterface;scheme="http://opennebula.org/occi/infrastructure#";class="mixin";title="OpenNebula
206
- specific Networkinterface attributes";location="/mixins/networkinterface/";attributes="org.opennebula.networkinterface.bridge
207
- org.opennebula.networkinterface.script org.opennebula.networkinterface.model
208
- org.opennebula.networkinterface.white_ports_tcp org.opennebula.networkinterface.black_ports_tcp
209
- org.opennebula.networkinterface.white_ports_udp org.opennebula.networkinterface.black_ports_udp
210
- org.opennebula.networkinterface.icmp"
211
-
212
- Category: large;scheme="http://occi.localhost:3300/occi/infrastructure/resource_tpl#";class="mixin";title="Large
213
- Instance";rel="http://schemas.ogf.org/occi/infrastructure#resource_tpl";location="/mixins/large/";attributes="occi.compute.architecture
214
- occi.compute.cores occi.compute.speed occi.compute.memory"
215
-
216
- Category: extra_large;scheme="http://occi.localhost:3300/occi/infrastructure/resource_tpl#";class="mixin";title="Extra
217
- Large Instance";rel="http://schemas.ogf.org/occi/infrastructure#resource_tpl";location="/mixins/extra_large/";attributes="occi.compute.architecture
218
- occi.compute.cores occi.compute.speed occi.compute.memory"
219
-
220
- Category: medium;scheme="http://occi.localhost:3300/occi/infrastructure/resource_tpl#";class="mixin";title="Medium
221
- Instance";rel="http://schemas.ogf.org/occi/infrastructure#resource_tpl";location="/mixins/medium/";attributes="occi.compute.architecture
222
- occi.compute.cores occi.compute.speed occi.compute.memory"
223
-
224
- Category: small;scheme="http://occi.localhost:3300/occi/infrastructure/resource_tpl#";class="mixin";title="Small
225
- Instance";rel="http://schemas.ogf.org/occi/infrastructure#resource_tpl";location="/mixins/small/";attributes="occi.compute.architecture
226
- occi.compute.cores occi.compute.speed occi.compute.memory"
227
-
228
- Category: mytesttemplate;scheme="http://occi.localhost:3300/occi/infrastructure/os_tpl#";class="mixin";title="MyTestTemplate";rel="http://schemas.ogf.org/occi/infrastructure#os_tpl";location="/mixins/mytesttemplate/"
229
-
230
- Category: start;scheme="http://schemas.ogf.org/occi/infrastructure/compute/action#";class="action";title="Start
231
- Compute instance"
232
-
233
- Category: stop;scheme="http://schemas.ogf.org/occi/infrastructure/compute/action#";class="action";title="Stop
234
- Compute instance";attributes="method"
235
-
236
- Category: restart;scheme="http://schemas.ogf.org/occi/infrastructure/compute/action#";class="action";title="Restart
237
- Compute instance";attributes="method"
238
-
239
- Category: suspend;scheme="http://schemas.ogf.org/occi/infrastructure/compute/action#";class="action";title="Suspend
240
- Compute instance";attributes="method"
241
-
242
- Category: up;scheme="http://schemas.ogf.org/occi/infrastructure/network/action#";class="action";title="Activate
243
- network"
244
-
245
- Category: down;scheme="http://schemas.ogf.org/occi/infrastructure/network/action#";class="action";title="Activate
246
- network"
247
-
248
- Category: online;scheme="http://schemas.ogf.org/occi/infrastructure/storage/action#";class="action";title="Activate
249
- Storage"
250
-
251
- Category: offline;scheme="http://schemas.ogf.org/occi/infrastructure/storage/action#";class="action";title="Deactivate
252
- Storage"
253
-
254
- Category: backup;scheme="http://schemas.ogf.org/occi/infrastructure/storage/action#";class="action";title="Backup
255
- Storage"
256
-
257
- Category: snapshot;scheme="http://schemas.ogf.org/occi/infrastructure/storage/action#";class="action";title="Snapshot
258
- Storage"
259
-
260
- Category: resize;scheme="http://schemas.ogf.org/occi/infrastructure/storage/action#";class="action";title="Resize
261
- Storage";attributes="size"
262
-
263
- '
264
- http_version:
265
- recorded_at: Thu, 01 Jan 1970 00:00:00 GMT
266
- recorded_with: VCR 2.4.0