occi 3.0.0.beta.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. data/Gemfile +3 -26
  2. data/Gemfile.lock +43 -35
  3. data/README.md +40 -4
  4. data/bin/occi +67 -64
  5. data/ext/mkrf_conf.rb +25 -0
  6. data/features/cassettes/Create_an_OCCI_Resource/_http_http___141_5_99_69__text_plain_201_.yml +186 -0
  7. data/features/cassettes/Delete_an_OCCI_Resource/_http_http___141_5_99_69__text_plain_201_.yml +186 -0
  8. data/features/cassettes/Discovery_Interface/Retrieving_all_OCCI_Categories_supported_by_the_OCCI_Server/_http_http___141_5_99_69__application_json_200_.yml +173 -0
  9. data/features/cassettes/Discovery_Interface/Retrieving_all_OCCI_Categories_supported_by_the_OCCI_Server/_http_http___141_5_99_69__text_plain_200_.yml +325 -0
  10. 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 +186 -0
  11. data/features/cassettes/Miscellaneous_operation_on_an_OCCI_Resource/_http_http___141_5_99_69__text_plain_201_.yml +186 -0
  12. data/features/cassettes/Read_an_OCCI_Resource/_http_http___141_5_99_69__text_plain_201_.yml +186 -0
  13. data/features/cassettes/Update_an_OCCI_Resource/_http_http___141_5_99_69__text_plain_201_.yml +186 -0
  14. data/features/occi/core/create/create.feature +3 -2
  15. data/features/occi/core/delete/delete.feature +6 -2
  16. data/features/occi/core/discovery_interface/discovery_interface.feature +4 -2
  17. data/features/occi/core/miscellaneous/miscellaneous.feature +6 -2
  18. data/features/occi/core/read/read.feature +6 -2
  19. data/features/occi/core/update/update.feature +6 -2
  20. data/features/occi/infrastructure/create/create.feature +6 -2
  21. data/features/support/env.rb +13 -1
  22. data/lib/occi/api/client/client_http.rb +914 -820
  23. data/lib/occi/api/client/http/net_http_fix.rb +7 -36
  24. data/lib/occi/api/dsl.rb +32 -2
  25. data/lib/occi/bin/occi_opts.rb +15 -1
  26. data/lib/occi/collection.rb +26 -15
  27. data/lib/occi/core/categories.rb +9 -1
  28. data/lib/occi/core/category.rb +20 -11
  29. data/lib/occi/core/link.rb +4 -5
  30. data/lib/occi/model.rb +2 -2
  31. data/lib/occi/parser.rb +51 -49
  32. data/lib/occi/version.rb +1 -1
  33. data/occi.gemspec +16 -3
  34. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/creates_a_new_compute_resource.yml +222 -0
  35. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/creates_a_new_network_resource.yml +222 -0
  36. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/creates_a_new_storage_resource.yml +222 -0
  37. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/deletes_a_compute_resource.yml +222 -0
  38. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/deletes_a_network_resource.yml +222 -0
  39. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/deletes_a_storage_resource.yml +222 -0
  40. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/deploys_an_instance_based_on_OVF_OVA_file.yml +222 -0
  41. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_all_available_mixins.yml +222 -0
  42. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_compute_resources.yml +324 -0
  43. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_network_resources.yml +326 -0
  44. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_os_tpl_mixins.yml +222 -0
  45. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_resource_tpl_mixins.yml +222 -0
  46. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/describes_storage_resources.yml +386 -0
  47. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/establishes_connection.yml +222 -0
  48. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/instantiates_a_compute_resource_using_type_identifier.yml +222 -0
  49. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/instantiates_a_compute_resource_using_type_name.yml +222 -0
  50. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/instantiates_a_network_resource_using_type_identifier.yml +222 -0
  51. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/instantiates_a_network_resource_using_type_name.yml +222 -0
  52. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/instantiates_a_storage_resource_using_type_identifier.yml +222 -0
  53. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/instantiates_a_storage_resource_using_type_name.yml +222 -0
  54. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_entity_type_identifiers.yml +222 -0
  55. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_entity_types.yml +222 -0
  56. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_link_type_identifiers.yml +222 -0
  57. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_link_types.yml +222 -0
  58. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_mixin_type_identifiers.yml +222 -0
  59. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_mixin_types.yml +222 -0
  60. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_mixins.yml +222 -0
  61. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_resource_type_identifiers.yml +222 -0
  62. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_all_available_resource_types.yml +222 -0
  63. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_compute_resources.yml +264 -0
  64. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_network_resources.yml +264 -0
  65. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_os_tpl_mixins.yml +222 -0
  66. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_resource_tpl_mixins.yml +222 -0
  67. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/lists_storage_resources.yml +266 -0
  68. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/refreshes_its_model.yml +397 -0
  69. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/triggers_an_action_on_a_compute_resource.yml +222 -0
  70. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/triggers_an_action_on_a_network_resource.yml +222 -0
  71. data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text_plain/triggers_an_action_on_a_storage_resource.yml +222 -0
  72. data/spec/occi/api/client/client_amqp_spec.rb +10 -2
  73. data/spec/occi/api/client/client_http_spec.rb +111 -117
  74. data/spec/occi/api/dsl_spec.rb +22 -0
  75. data/spec/occi/collection_spec.rb +11 -2
  76. data/spec/occi/core/resource_spec.rb +1 -1
  77. data/spec/occi/infrastructure/compute_spec.rb +3 -3
  78. data/spec/occi/log_spec.rb +1 -1
  79. data/spec/occi/model_spec.rb +4 -8
  80. data/spec/occi/parser_spec.rb +4 -4
  81. data/spec/spec_helper.rb +3 -2
  82. metadata +264 -12
  83. data/spec/cassettes/client_http_text_plain.yml +0 -1066
  84. data/spec/occi/api/client/client_http_0.5_spec.rb +0 -292
@@ -5,11 +5,10 @@ module Occi
5
5
  module Api
6
6
  module Client
7
7
 
8
- describe ClientHttp do
8
+ vcr_options = { :record => :new_episodes }
9
+ describe ClientHttp, :vcr => vcr_options do
9
10
 
10
- describe "using media type text/plain" do
11
-
12
- use_vcr_cassette "client_http_text_plain"
11
+ context "using media type text/plain" do
13
12
 
14
13
  before(:each) do
15
14
  @client = Occi::Api::Client::ClientHttp.new(
@@ -26,149 +25,168 @@ module Occi
26
25
  @client.logger.close
27
26
  end
28
27
 
29
- it "should establish connection" do
28
+ it "establishes connection" do
30
29
  @client.connected.should be_true
31
30
  end
32
31
 
33
- it "should create a compute resource" do
34
- @client.get_resource "compute"
35
- @client.get_resource "http://schemas.ogf.org/occi/infrastructure#compute"
32
+ it "instantiates a compute resource using type name" do
33
+ compute = @client.get_resource "compute"
34
+
35
+ compute.should be_a_kind_of Occi::Core::Resource
36
+ compute.kind.type_identifier.should eq "http://schemas.ogf.org/occi/infrastructure#compute"
37
+ end
38
+
39
+ it "instantiates a compute resource using type identifier" do
40
+ compute = @client.get_resource "http://schemas.ogf.org/occi/infrastructure#compute"
41
+
42
+ compute.should be_a_kind_of Occi::Core::Resource
43
+ compute.kind.type_identifier.should eq "http://schemas.ogf.org/occi/infrastructure#compute"
44
+ end
45
+
46
+ it "instantiates a network resource using type name" do
47
+ network = @client.get_resource "network"
48
+
49
+ network.should be_a_kind_of Occi::Core::Resource
50
+ network.kind.type_identifier.should eq "http://schemas.ogf.org/occi/infrastructure#network"
51
+ end
52
+
53
+ it "instantiates a network resource using type identifier" do
54
+ network = @client.get_resource "http://schemas.ogf.org/occi/infrastructure#network"
55
+
56
+ network.should be_a_kind_of Occi::Core::Resource
57
+ network.kind.type_identifier.should eq "http://schemas.ogf.org/occi/infrastructure#network"
58
+ end
59
+
60
+ it "instantiates a storage resource using type name" do
61
+ storage = @client.get_resource "storage"
62
+
63
+ storage.should be_a_kind_of Occi::Core::Resource
64
+ storage.kind.type_identifier.should eq "http://schemas.ogf.org/occi/infrastructure#storage"
65
+ end
66
+
67
+ it "instantiates a storage resource using type identifier" do
68
+ storage = @client.get_resource "http://schemas.ogf.org/occi/infrastructure#storage"
69
+
70
+ storage.should be_a_kind_of Occi::Core::Resource
71
+ storage.kind.type_identifier.should eq "http://schemas.ogf.org/occi/infrastructure#storage"
72
+ end
73
+
74
+ it "lists all available resource types" do
75
+ @client.get_resource_types.should include("compute", "storage", "network")
36
76
  end
37
77
 
38
- it "should create a network resource" do
39
- @client.get_resource "network"
40
- @client.get_resource "http://schemas.ogf.org/occi/infrastructure#network"
78
+ it "lists all available resource type identifiers" do
79
+ @client.get_resource_type_identifiers.should include("http://schemas.ogf.org/occi/infrastructure#compute", "http://schemas.ogf.org/occi/infrastructure#network", "http://schemas.ogf.org/occi/infrastructure#storage")
41
80
  end
42
81
 
43
- it "should create a storage resource" do
44
- @client.get_resource "storage"
45
- @client.get_resource "http://schemas.ogf.org/occi/infrastructure#storage"
82
+ it "lists all available entity types" do
83
+ @client.get_entity_types.should include("entity", "resource", "link")
46
84
  end
47
85
 
48
- it "should list all available resource types" do
49
- @client.get_resource_types
86
+ it "lists all available entity type identifiers" do
87
+ @client.get_entity_type_identifiers.should include("http://schemas.ogf.org/occi/core#entity", "http://schemas.ogf.org/occi/core#resource", "http://schemas.ogf.org/occi/core#link")
50
88
  end
51
89
 
52
- it "should list all available resource type identifiers" do
53
- @client.get_resource_type_identifiers
90
+ it "lists all available link types" do
91
+ @client.get_link_types.should include("storagelink", "networkinterface")
54
92
  end
55
93
 
56
- it "should list all available mixin types" do
57
- @client.get_mixin_types
94
+ it "lists all available link type identifiers" do
95
+ @client.get_link_type_identifiers.should include("http://schemas.ogf.org/occi/infrastructure#storagelink", "http://schemas.ogf.org/occi/infrastructure#networkinterface")
58
96
  end
59
97
 
60
- it "should list all available mixin type identifiers" do
61
- @client.get_mixin_type_identifiers
98
+ it "lists all available mixin types" do
99
+ @client.get_mixin_types.should include("os_tpl", "resource_tpl")
62
100
  end
63
101
 
64
- it "should list compute resources" do
102
+ it "lists all available mixin type identifiers" do
103
+ @client.get_mixin_type_identifiers.should include("http://schemas.ogf.org/occi/infrastructure#os_tpl", "http://schemas.ogf.org/occi/infrastructure#resource_tpl")
104
+ end
105
+
106
+ it "lists compute resources" do
65
107
  @client.list "compute"
66
108
  end
67
109
 
68
- it "should list network resources" do
110
+ it "lists network resources" do
69
111
  @client.list "network"
70
112
  end
71
113
 
72
- it "should list storage resources" do
114
+ it "lists storage resources" do
73
115
  @client.list "storage"
74
116
  end
75
117
 
76
- it "should list all available mixins" do
118
+ it "lists all available mixins" do
77
119
  @client.get_mixins
78
120
  end
79
121
 
80
- it "should list os_tpl mixins" do
122
+ it "lists os_tpl mixins" do
81
123
  @client.get_mixins "os_tpl"
82
124
  end
83
125
 
84
- it "should list resource_tpl mixins" do
126
+ it "lists resource_tpl mixins" do
85
127
  @client.get_mixins "resource_tpl"
86
128
  end
87
129
 
88
- it "should describe compute resources" do
130
+ it "describes compute resources" do
89
131
  @client.describe "compute"
90
132
  end
91
133
 
92
- it "should describe network resources" do
134
+ it "describes network resources" do
93
135
  @client.describe "network"
94
136
  end
95
137
 
96
- it "should describe storage resources" do
138
+ it "describes storage resources" do
97
139
  @client.describe "storage"
98
140
  end
99
141
 
100
- it "should describe all available mixins" do
142
+ it "describes all available mixins" do
101
143
  @client.get_mixins.each do |mixin|
102
144
  mixin_short = mixin.split("/").last
103
145
  @client.find_mixin mixin_short.split("#").last, mixin_short.split("#").first, true
104
146
  end
105
147
  end
106
148
 
107
- it "should describe os_tpl mixins" do
149
+ it "describes os_tpl mixins" do
108
150
  @client.get_mixins("os_tpl").each do |mixin|
109
151
  mixin_short = mixin.split("/").last
110
152
  @client.find_mixin mixin_short.split("#").last, "os_tpl", true
111
153
  end
112
154
  end
113
155
 
114
- it "should describe resource_tpl mixins" do
156
+ it "describes resource_tpl mixins" do
115
157
  @client.get_mixins("resource_tpl").each do |mixin|
116
158
  mixin_short = mixin.split("/").last
117
159
  @client.find_mixin mixin_short.split("#").last, "resource_tpl", true
118
160
  end
119
161
  end
120
162
 
121
- it "should create a new compute resource" do
122
- end
163
+ it "creates a new compute resource"
123
164
 
124
- it "should create a new storage resource" do
125
- # TODO
126
- end
165
+ it "creates a new storage resource"
127
166
 
128
- it "should create a new network resource" do
129
- # TODO
130
- end
167
+ it "creates a new network resource"
131
168
 
132
- it "should deploy an instance based on OVF/OVA file" do
133
- # TODO
134
- end
169
+ it "deploys an instance based on OVF/OVA file"
135
170
 
136
- it "should delete a compute resource" do
137
- end
171
+ it "deletes a compute resource"
138
172
 
139
- it "should delete a network resource" do
140
- # TODO
141
- end
173
+ it "deletes a network resource"
142
174
 
143
- it "should delete a storage resource" do
144
- # TODO
145
- end
175
+ it "deletes a storage resource"
146
176
 
147
- it "should trigger an action on a compute resource" do
148
- # TODO
149
- end
177
+ it "triggers an action on a compute resource"
150
178
 
151
- it "should trigger an action on a storage resource" do
152
- # TODO
153
- end
179
+ it "triggers an action on a storage resource"
154
180
 
155
- it "should trigger an action on a network resource" do
156
- # TODO
157
- end
181
+ it "triggers an action on a network resource"
158
182
 
159
- it "should refresh its model" do
183
+ it "refreshes its model" do
160
184
  @client.refresh
161
185
  end
162
186
 
163
187
  end
164
188
 
165
- end
166
-
167
- describe ClientHttp do
168
-
169
- describe "using media type application/occi+json" do
170
-
171
- use_vcr_cassette "client_http_application_occi_json"
189
+ context "using media type application/occi+json" do
172
190
 
173
191
  before(:each) do
174
192
  #@client = Occi::Api::ClientHttp.new(
@@ -181,75 +199,51 @@ module Occi
181
199
  #)
182
200
  end
183
201
 
184
- it "should establish connection" do
185
- # TODO
186
- end
202
+ it "establishes connection"
187
203
 
188
- it "should list compute resources" do
189
- end
204
+ it "lists compute resources"
190
205
 
191
- it "should list network resources" do
192
- end
206
+ it "lists network resources"
193
207
 
194
- it "should list storage resources" do
195
- end
208
+ it "lists storage resources"
196
209
 
197
- it "should list all available mixins" do
198
- end
210
+ it "lists all available mixins"
199
211
 
200
- it "should list os_tpl mixins" do
201
- end
212
+ it "lists os_tpl mixins"
202
213
 
203
- it "should list resource_tpl mixins" do
204
- end
214
+ it "lists resource_tpl mixins"
205
215
 
206
- it "should describe compute resources" do
207
- end
216
+ it "describes compute resources"
208
217
 
209
- it "should describe network resources" do
210
- end
218
+ it "describes network resources"
211
219
 
212
- it "should describe storage resources" do
213
- end
220
+ it "describes storage resources"
214
221
 
215
- it "should describe all available mixins" do
216
- end
222
+ it "describes all available mixins"
217
223
 
218
- it "should describe os_tpl mixins" do
219
- end
224
+ it "describes os_tpl mixins"
220
225
 
221
- it "should describe resource_tpl mixins" do
222
- end
226
+ it "describes resource_tpl mixins"
223
227
 
224
- it "should create a new compute resource" do
225
- end
228
+ it "creates a new compute resource"
226
229
 
227
- it "should create a new storage resource" do
228
- end
230
+ it "creates a new storage resource"
229
231
 
230
- it "should create a new network resource" do
231
- end
232
+ it "creates a new network resource"
232
233
 
233
- it "should delete a compute resource" do
234
- end
234
+ it "deletes a compute resource"
235
235
 
236
- it "should delete a network resource" do
237
- end
236
+ it "deletes a network resource"
238
237
 
239
- it "should delete a storage resource" do
240
- end
238
+ it "deletes a storage resource"
241
239
 
242
- it "should trigger an action on a compute resource" do
243
- end
240
+ it "triggers an action on a compute resource"
244
241
 
245
- it "should trigger an action on a storage resource" do
246
- end
242
+ it "triggers an action on a storage resource"
247
243
 
248
- it "should trigger an action on a network resource" do
249
- end
244
+ it "triggers an action on a network resource"
250
245
 
251
- it "should refresh its model" do
252
- end
246
+ it "refreshes its model"
253
247
 
254
248
  end
255
249
  end
@@ -0,0 +1,22 @@
1
+ require 'rspec'
2
+ require 'occi'
3
+
4
+ module Occi
5
+ module Api
6
+ describe Dsl do
7
+
8
+ context "using ClientHttp" do
9
+
10
+ it "does something"
11
+
12
+ end
13
+
14
+ context "using ClientAmqp" do
15
+
16
+ it "does something"
17
+
18
+ end
19
+
20
+ end
21
+ end
22
+ end
@@ -4,7 +4,7 @@ require 'occi'
4
4
  module Occi
5
5
  describe Collection do
6
6
 
7
- it "should create a new Occi collection including the Occi base objects" do
7
+ it "creates a new Occi collection including the Occi base objects" do
8
8
  collection = Occi::Collection.new
9
9
  collection.kinds << "http://schemas.ogf.org/occi/infrastructure#compute"
10
10
  collection.mixins << "http://example.com/occi/tags#my_mixin"
@@ -28,5 +28,14 @@ module Occi
28
28
  expect { collection.check }.to_not raise_error
29
29
  end
30
30
 
31
+ it 'successfully gets all categories related to a category' do
32
+ collection = Occi::Collection.new
33
+ collection.kinds << Occi::Core::Resource.kind
34
+ collection.kinds << Occi::Core::Link.kind
35
+ collection.get_related_to(Occi::Core::Entity.kind).should == collection
36
+ collection.get_related_to(Occi::Core::Resource.kind).kinds.first.should == Occi::Core::Resource.kind
37
+ collection.get_related_to(Occi::Core::Link.kind).kinds.first.should == Occi::Core::Link.kind
38
+ end
39
+
31
40
  end
32
- end
41
+ end
@@ -5,7 +5,7 @@ module Occi
5
5
  module Core
6
6
  describe Resource do
7
7
 
8
- it "should link another resource succesfully" do
8
+ it "links another resource succesfully" do
9
9
  resource = Occi::Core::Resource.new
10
10
  target = Occi::Core::Resource.new
11
11
  # create a random ID as the resource must already exist and therefore must have an ID assigned
@@ -5,7 +5,7 @@ module Occi
5
5
  module Infrastructure
6
6
  describe Compute do
7
7
 
8
- it "should create a storagelink to an existing storage resource" do
8
+ it "creates a storagelink to an existing storage resource" do
9
9
  compute = Occi::Infrastructure::Compute.new
10
10
  target = Occi::Infrastructure::Storage.new
11
11
  # create a random ID as the storage resource must already exist and therefore must have an ID assigned
@@ -16,7 +16,7 @@ module Occi
16
16
  compute.links.first.target.should be target
17
17
  end
18
18
 
19
- it "should create a networkinterface to an existing network resource" do
19
+ it "creates a networkinterface to an existing network resource" do
20
20
  compute = Occi::Infrastructure::Compute.new
21
21
  target = Occi::Infrastructure::Network.new
22
22
  # create a random ID as the network resource must already exist and therefore must have an ID assigned
@@ -29,4 +29,4 @@ module Occi
29
29
 
30
30
  end
31
31
  end
32
- end
32
+ end
@@ -4,7 +4,7 @@ require 'occi/log'
4
4
  module Occi
5
5
  describe Log do
6
6
 
7
- it "should log a message to a pipe" do
7
+ it "logs a message to a pipe" do
8
8
  r, w = IO.pipe
9
9
  logger = Occi::Log.new(w)
10
10
  logger.level = Occi::Log::INFO
@@ -38,15 +38,11 @@ describe "Model" do
38
38
  it "returns categories with filter" do
39
39
  model = Occi::Model.new
40
40
  model.register_infrastructure
41
- compute = Occi::Core::Kind.new('http://schemas.ogf.org/occi/infrastructure#','compute')
42
- ipnetwork = Occi::Core::Mixin.new('http://schemas.ogf.org/occi/infrastructure/network#','ipnetwork')
43
- filter = Occi::Collection.new
44
- filter.kinds << compute
45
- filter.mixins << ipnetwork
46
- collection = model.get(filter)
41
+ compute = Occi::Infrastructure::Compute.kind
42
+ collection = model.get(compute)
47
43
  collection.kind_of? Occi::Collection
48
- collection.kinds.first.attributes.should be_kind_of Occi::Core::Attributes
49
- collection.mixins.first.attributes.should be_kind_of Occi::Core::Attributes
44
+ collection.kinds.first.should == compute
45
+ collection.mixins.should have_at_least(2).mixins
50
46
  collection.actions.should be_empty
51
47
  collection.resources.should be_empty
52
48
  collection.links.should be_empty