occi-api 4.3.9 → 4.3.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/occi/api/client/base/stubs.rb +13 -1
- data/lib/occi/api/client/client_http.rb +17 -0
- data/lib/occi/api/client/http/party_wrappers.rb +2 -1
- data/lib/occi/api/version.rb +1 -1
- data/occi-api.gemspec +2 -2
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/fails_to_update_without_mixins.yml +262 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/fails_to_update_without_resource.yml +262 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/triggers_an_action_with_return_mixin.yml +312 -0
- data/spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/updates_resource_with_mixins.yml +321 -0
- data/spec/occi/api/client/client_http_spec.rb +24 -2
- metadata +15 -7
@@ -37,14 +37,14 @@ module Occi
|
|
37
37
|
|
38
38
|
it "instantiates a compute resource using type name" do
|
39
39
|
compute = @client.get_resource "compute"
|
40
|
-
|
40
|
+
|
41
41
|
compute.should be_a_kind_of Occi::Core::Resource
|
42
42
|
compute.kind.type_identifier.should eq "http://schemas.ogf.org/occi/infrastructure#compute"
|
43
43
|
end
|
44
44
|
|
45
45
|
it "instantiates a compute resource using type identifier" do
|
46
46
|
compute = @client.get_resource "http://schemas.ogf.org/occi/infrastructure#compute"
|
47
|
-
|
47
|
+
|
48
48
|
compute.should be_a_kind_of Occi::Core::Resource
|
49
49
|
compute.kind.type_identifier.should eq "http://schemas.ogf.org/occi/infrastructure#compute"
|
50
50
|
end
|
@@ -338,6 +338,28 @@ module Occi
|
|
338
338
|
expect(@client.trigger "https://localhost:3300/network/66", upactioninstance).to eq true
|
339
339
|
end
|
340
340
|
|
341
|
+
it "triggers an action with return mixin" do
|
342
|
+
saveaction = Occi::Core::Action.new scheme='http://schemas.ogf.org/occi/infrastructure/compute/action#', term='save', title='save compute'
|
343
|
+
saveactioninstance = Occi::Core::ActionInstance.new saveaction, nil
|
344
|
+
expect(@client.trigger "https://localhost:3300/compute/4096", saveactioninstance).to be_a_kind_of(Occi::Core::Mixins)
|
345
|
+
end
|
346
|
+
|
347
|
+
it 'fails to update without mixins' do
|
348
|
+
expect { @client.update "https://localhost:3300/compute/4096", nil }.to raise_error(RuntimeError)
|
349
|
+
expect { @client.update "https://localhost:3300/compute/4096", Occi::Core::Mixins.new }.to raise_error(RuntimeError)
|
350
|
+
end
|
351
|
+
|
352
|
+
it 'fails to update without resource' do
|
353
|
+
mxns = Occi::Core::Mixins.new << Occi::Core::Mixin.new("http://sitespecific.localhost/occi/infrastructure/resource_tpl", "small")
|
354
|
+
expect { @client.update nil, mxns }.to raise_error(RuntimeError)
|
355
|
+
expect { @client.update '', mxns }.to raise_error(RuntimeError)
|
356
|
+
end
|
357
|
+
|
358
|
+
it 'updates resource with mixins' do
|
359
|
+
mxns = Occi::Core::Mixins.new << Occi::Core::Mixin.new("http://sitespecific.localhost/occi/infrastructure/resource_tpl", "small")
|
360
|
+
expect(@client.update "https://localhost:3300/compute/4096", mxns).to eq "/compute/4096"
|
361
|
+
end
|
362
|
+
|
341
363
|
it "refreshes its model" do
|
342
364
|
@client.refresh
|
343
365
|
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.3.
|
4
|
+
version: 4.3.10
|
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: 2017-02-
|
13
|
+
date: 2017-02-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: occi-core
|
@@ -41,7 +41,7 @@ dependencies:
|
|
41
41
|
version: 0.13.1
|
42
42
|
- - "<"
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version: '
|
44
|
+
version: '0.14'
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
47
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -51,7 +51,7 @@ dependencies:
|
|
51
51
|
version: 0.13.1
|
52
52
|
- - "<"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0.14'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: json
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,7 +101,7 @@ dependencies:
|
|
101
101
|
version: 0.2.4
|
102
102
|
- - "<"
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: '
|
104
|
+
version: '0.3'
|
105
105
|
type: :development
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -111,7 +111,7 @@ dependencies:
|
|
111
111
|
version: 0.2.4
|
112
112
|
- - "<"
|
113
113
|
- !ruby/object:Gem::Version
|
114
|
-
version: '
|
114
|
+
version: '0.3'
|
115
115
|
- !ruby/object:Gem::Dependency
|
116
116
|
name: rspec
|
117
117
|
requirement: !ruby/object:Gem::Requirement
|
@@ -390,6 +390,8 @@ files:
|
|
390
390
|
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/describes_storage_resources.yml
|
391
391
|
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/establishes_connection.yml
|
392
392
|
- 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
|
393
|
+
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/fails_to_update_without_mixins.yml
|
394
|
+
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/fails_to_update_without_resource.yml
|
393
395
|
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/finds_and_describes_scoped_os_tpl_mixin.yml
|
394
396
|
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/finds_and_describes_scoped_resource_tpl_mixin.yml
|
395
397
|
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/finds_and_describes_unscoped_mixin.yml
|
@@ -428,6 +430,8 @@ files:
|
|
428
430
|
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/triggers_an_action_on_a_compute_resource.yml
|
429
431
|
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/triggers_an_action_on_a_network_resource.yml
|
430
432
|
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/triggers_an_action_on_a_storage_resource.yml
|
433
|
+
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/triggers_an_action_with_return_mixin.yml
|
434
|
+
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/updates_resource_with_mixins.yml
|
431
435
|
- spec/cassettes/Occi_Api_Dsl/_connect/accepts_block_options.yml
|
432
436
|
- spec/cassettes/Occi_Api_Dsl/_connect/connects_successfully_through_HTTP.yml
|
433
437
|
- spec/cassettes/tools/generalize_yml.sh
|
@@ -459,7 +463,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
459
463
|
version: '0'
|
460
464
|
requirements: []
|
461
465
|
rubyforge_project:
|
462
|
-
rubygems_version: 2.
|
466
|
+
rubygems_version: 2.4.8
|
463
467
|
signing_key:
|
464
468
|
specification_version: 4
|
465
469
|
summary: OCCI development library providing a high-level client API
|
@@ -499,6 +503,8 @@ test_files:
|
|
499
503
|
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/describes_storage_resources.yml
|
500
504
|
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/establishes_connection.yml
|
501
505
|
- 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
|
506
|
+
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/fails_to_update_without_mixins.yml
|
507
|
+
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/fails_to_update_without_resource.yml
|
502
508
|
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/finds_and_describes_scoped_os_tpl_mixin.yml
|
503
509
|
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/finds_and_describes_scoped_resource_tpl_mixin.yml
|
504
510
|
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/finds_and_describes_unscoped_mixin.yml
|
@@ -537,6 +543,8 @@ test_files:
|
|
537
543
|
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/triggers_an_action_on_a_compute_resource.yml
|
538
544
|
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/triggers_an_action_on_a_network_resource.yml
|
539
545
|
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/triggers_an_action_on_a_storage_resource.yml
|
546
|
+
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/triggers_an_action_with_return_mixin.yml
|
547
|
+
- spec/cassettes/Occi_Api_Client_ClientHttp/using_media_type_text/plain/updates_resource_with_mixins.yml
|
540
548
|
- spec/cassettes/Occi_Api_Dsl/_connect/accepts_block_options.yml
|
541
549
|
- spec/cassettes/Occi_Api_Dsl/_connect/connects_successfully_through_HTTP.yml
|
542
550
|
- spec/cassettes/tools/generalize_yml.sh
|