occi 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -2
- data/Gemfile.lock +4 -4
- data/VERSION +1 -1
- data/lib/occi/resource.rb +1 -1
- data/occi.gemspec +12 -11
- data/test/fixtures/cassettes/compute_all.yml +28 -0
- data/test/fixtures/cassettes/{compute_delete.yml → compute_destroy.yml} +0 -0
- data/test/fixtures/cassettes/{network_delete.yml → network_destroy.yml} +0 -0
- data/test/fixtures/cassettes/{storage_delete.yml → storage_destroy.yml} +0 -0
- data/test/lib/occi/compute_test.rb +14 -14
- data/test/lib/occi/network_test.rb +7 -7
- data/test/lib/occi/storage_test.rb +8 -8
- data/test/test_helper.rb +2 -2
- metadata +11 -10
data/Gemfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
|
-
gem "hugs", "~> 2.
|
3
|
+
gem "hugs", "~> 2.3.0"
|
4
4
|
#gem "hugs", :path => "~/git/hugs"
|
5
5
|
gem "multipart-post", "~> 1.0.1"
|
6
6
|
gem "nokogiri", "~> 1.4.4"
|
@@ -8,7 +8,7 @@ gem "nokogiri", "~> 1.4.4"
|
|
8
8
|
group :development, :test do
|
9
9
|
gem "rake"
|
10
10
|
gem "jeweler", "~> 1.5.1"
|
11
|
-
gem "webmock", "~> 1.6.
|
11
|
+
gem "webmock", "~> 1.6.2"
|
12
12
|
gem "vcr", "~> 1.4.0"
|
13
13
|
gem "minitest", "~> 2.0.0"
|
14
14
|
gem "ZenTest", "~> 4.4.2"
|
data/Gemfile.lock
CHANGED
@@ -5,7 +5,7 @@ GEM
|
|
5
5
|
addressable (2.2.2)
|
6
6
|
crack (0.1.8)
|
7
7
|
git (1.2.5)
|
8
|
-
hugs (2.
|
8
|
+
hugs (2.3.0)
|
9
9
|
multipart-post (~> 1.0.1)
|
10
10
|
net-http-persistent (~> 1.4.1)
|
11
11
|
nokogiri (~> 1.4.4)
|
@@ -20,17 +20,17 @@ GEM
|
|
20
20
|
nokogiri (1.4.4)
|
21
21
|
rake (0.8.7)
|
22
22
|
vcr (1.4.0)
|
23
|
-
webmock (1.6.
|
23
|
+
webmock (1.6.2)
|
24
24
|
addressable (>= 2.2.2)
|
25
25
|
crack (>= 0.1.7)
|
26
|
-
yajl-ruby (0.7.
|
26
|
+
yajl-ruby (0.7.9)
|
27
27
|
|
28
28
|
PLATFORMS
|
29
29
|
ruby
|
30
30
|
|
31
31
|
DEPENDENCIES
|
32
32
|
ZenTest (~> 4.4.2)
|
33
|
-
hugs (~> 2.
|
33
|
+
hugs (~> 2.3.0)
|
34
34
|
jeweler (~> 1.5.1)
|
35
35
|
minitest (~> 2.0.0)
|
36
36
|
multipart-post (~> 1.0.1)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.1
|
data/lib/occi/resource.rb
CHANGED
data/occi.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{occi}
|
8
|
-
s.version = "1.2.
|
8
|
+
s.version = "1.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["retr0h"]
|
12
|
-
s.date = %q{2011-01-
|
12
|
+
s.date = %q{2011-01-13}
|
13
13
|
s.email = %q{john@dewey.ws}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"LICENSE",
|
@@ -31,17 +31,18 @@ Gem::Specification.new do |s|
|
|
31
31
|
"lib/occi/resource.rb",
|
32
32
|
"lib/occi/storage.rb",
|
33
33
|
"occi.gemspec",
|
34
|
+
"test/fixtures/cassettes/compute_all.yml",
|
34
35
|
"test/fixtures/cassettes/compute_create.yml",
|
35
|
-
"test/fixtures/cassettes/
|
36
|
+
"test/fixtures/cassettes/compute_destroy.yml",
|
36
37
|
"test/fixtures/cassettes/compute_find.yml",
|
37
38
|
"test/fixtures/cassettes/compute_update.yml",
|
38
39
|
"test/fixtures/cassettes/network_all.yml",
|
39
40
|
"test/fixtures/cassettes/network_create.yml",
|
40
|
-
"test/fixtures/cassettes/
|
41
|
+
"test/fixtures/cassettes/network_destroy.yml",
|
41
42
|
"test/fixtures/cassettes/network_find.yml",
|
42
43
|
"test/fixtures/cassettes/storage_all.yml",
|
43
44
|
"test/fixtures/cassettes/storage_create.yml",
|
44
|
-
"test/fixtures/cassettes/
|
45
|
+
"test/fixtures/cassettes/storage_destroy.yml",
|
45
46
|
"test/fixtures/cassettes/storage_find.yml",
|
46
47
|
"test/lib/occi/compute_test.rb",
|
47
48
|
"test/lib/occi/network_test.rb",
|
@@ -64,33 +65,33 @@ Gem::Specification.new do |s|
|
|
64
65
|
s.specification_version = 3
|
65
66
|
|
66
67
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
67
|
-
s.add_runtime_dependency(%q<hugs>, ["~> 2.
|
68
|
+
s.add_runtime_dependency(%q<hugs>, ["~> 2.3.0"])
|
68
69
|
s.add_runtime_dependency(%q<multipart-post>, ["~> 1.0.1"])
|
69
70
|
s.add_runtime_dependency(%q<nokogiri>, ["~> 1.4.4"])
|
70
71
|
s.add_development_dependency(%q<rake>, [">= 0"])
|
71
72
|
s.add_development_dependency(%q<jeweler>, ["~> 1.5.1"])
|
72
|
-
s.add_development_dependency(%q<webmock>, ["~> 1.6.
|
73
|
+
s.add_development_dependency(%q<webmock>, ["~> 1.6.2"])
|
73
74
|
s.add_development_dependency(%q<vcr>, ["~> 1.4.0"])
|
74
75
|
s.add_development_dependency(%q<minitest>, ["~> 2.0.0"])
|
75
76
|
s.add_development_dependency(%q<ZenTest>, ["~> 4.4.2"])
|
76
77
|
else
|
77
|
-
s.add_dependency(%q<hugs>, ["~> 2.
|
78
|
+
s.add_dependency(%q<hugs>, ["~> 2.3.0"])
|
78
79
|
s.add_dependency(%q<multipart-post>, ["~> 1.0.1"])
|
79
80
|
s.add_dependency(%q<nokogiri>, ["~> 1.4.4"])
|
80
81
|
s.add_dependency(%q<rake>, [">= 0"])
|
81
82
|
s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
|
82
|
-
s.add_dependency(%q<webmock>, ["~> 1.6.
|
83
|
+
s.add_dependency(%q<webmock>, ["~> 1.6.2"])
|
83
84
|
s.add_dependency(%q<vcr>, ["~> 1.4.0"])
|
84
85
|
s.add_dependency(%q<minitest>, ["~> 2.0.0"])
|
85
86
|
s.add_dependency(%q<ZenTest>, ["~> 4.4.2"])
|
86
87
|
end
|
87
88
|
else
|
88
|
-
s.add_dependency(%q<hugs>, ["~> 2.
|
89
|
+
s.add_dependency(%q<hugs>, ["~> 2.3.0"])
|
89
90
|
s.add_dependency(%q<multipart-post>, ["~> 1.0.1"])
|
90
91
|
s.add_dependency(%q<nokogiri>, ["~> 1.4.4"])
|
91
92
|
s.add_dependency(%q<rake>, [">= 0"])
|
92
93
|
s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
|
93
|
-
s.add_dependency(%q<webmock>, ["~> 1.6.
|
94
|
+
s.add_dependency(%q<webmock>, ["~> 1.6.2"])
|
94
95
|
s.add_dependency(%q<vcr>, ["~> 1.4.0"])
|
95
96
|
s.add_dependency(%q<minitest>, ["~> 2.0.0"])
|
96
97
|
s.add_dependency(%q<ZenTest>, ["~> 4.4.2"])
|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: http://oneadmin:a9464e3228ae563be6207bbf50437a219550f48b@one.example.com:4567/compute
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
accept:
|
9
|
+
- application/xml
|
10
|
+
connection:
|
11
|
+
- keep-alive
|
12
|
+
keep-alive:
|
13
|
+
- 30
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
content-type:
|
20
|
+
- text/html;charset=utf-8
|
21
|
+
content-length:
|
22
|
+
- "799"
|
23
|
+
connection:
|
24
|
+
- keep-alive
|
25
|
+
server:
|
26
|
+
- thin 1.2.7 codename No Hup
|
27
|
+
body: "<COMPUTE_COLLECTION><COMPUTE href=\"http://cm-01.cloud.int.ev1.atti.com:4567/compute/150\" name=\"Centos-5-4_x86_64\"/><COMPUTE href=\"http://cm-01.cloud.int.ev1.atti.com:4567/compute/164\" name=\"Centos-5-4_x86_64\"/><COMPUTE href=\"http://cm-01.cloud.int.ev1.atti.com:4567/compute/170\" name=\"Centos-5-4_x86_64\"/><COMPUTE href=\"http://cm-01.cloud.int.ev1.atti.com:4567/compute/171\" name=\"Centos-5-4_x86_64\"/><COMPUTE href=\"http://cm-01.cloud.int.ev1.atti.com:4567/compute/172\" name=\"Centos-5-4_x86_64\"/><COMPUTE href=\"http://cm-01.cloud.int.ev1.atti.com:4567/compute/174\" name=\"Test Framework\"/><COMPUTE href=\"http://cm-01.cloud.int.ev1.atti.com:4567/compute/175\" name=\"Test Framework\"/><COMPUTE href=\"http://cm-01.cloud.int.ev1.atti.com:4567/compute/176\" name=\"Test Framework\"/></COMPUTE_COLLECTION> "
|
28
|
+
http_version: "1.1"
|
File without changes
|
File without changes
|
File without changes
|
@@ -2,13 +2,13 @@ require "test_helper"
|
|
2
2
|
|
3
3
|
describe Occi::Compute do
|
4
4
|
describe "#all" do
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
it "returns a parsed XML document" do
|
6
|
+
VCR.use_cassette "compute_all" do
|
7
|
+
response = CONNECTION.compute.all
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
is_okay response
|
10
|
+
end
|
11
|
+
end
|
12
12
|
end
|
13
13
|
|
14
14
|
describe "#create" do
|
@@ -19,7 +19,7 @@ describe Occi::Compute do
|
|
19
19
|
# boot. Then we no longer need the coupling in the XML.
|
20
20
|
# CLOUD-35 open to address this.
|
21
21
|
|
22
|
-
@
|
22
|
+
@xml = Nokogiri::XML::Builder.new do
|
23
23
|
COMPUTE {
|
24
24
|
NAME "Test Framework"
|
25
25
|
INSTANCE_TYPE "small"
|
@@ -38,7 +38,7 @@ describe Occi::Compute do
|
|
38
38
|
|
39
39
|
it "returns a parsed XML document" do
|
40
40
|
VCR.use_cassette "compute_create" do
|
41
|
-
response =
|
41
|
+
response = CONNECTION.compute.create @xml
|
42
42
|
|
43
43
|
is_created response
|
44
44
|
end
|
@@ -50,19 +50,19 @@ describe Occi::Compute do
|
|
50
50
|
id = cassette_for("compute_create").xpath('//ID').text
|
51
51
|
|
52
52
|
VCR.use_cassette "compute_find" do
|
53
|
-
response =
|
53
|
+
response = CONNECTION.compute.find id
|
54
54
|
|
55
55
|
is_okay response
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
describe "#
|
60
|
+
describe "#destroy" do
|
61
61
|
it "returns a parsed XML document" do
|
62
62
|
id = cassette_for("compute_create").xpath('//ID').text
|
63
63
|
|
64
|
-
VCR.use_cassette "
|
65
|
-
response =
|
64
|
+
VCR.use_cassette "compute_destroy" do
|
65
|
+
response = CONNECTION.compute.destroy id
|
66
66
|
|
67
67
|
is_no_content response
|
68
68
|
end
|
@@ -71,7 +71,7 @@ describe Occi::Compute do
|
|
71
71
|
|
72
72
|
describe "#update" do
|
73
73
|
before do
|
74
|
-
@
|
74
|
+
@xml = Nokogiri::XML::Builder.new do
|
75
75
|
COMPUTE {
|
76
76
|
STATE "shutdown"
|
77
77
|
}
|
@@ -82,7 +82,7 @@ describe Occi::Compute do
|
|
82
82
|
id = cassette_for("compute_create").xpath('//ID').text
|
83
83
|
|
84
84
|
VCR.use_cassette "compute_update" do
|
85
|
-
response =
|
85
|
+
response = CONNECTION.compute.update id, @xml
|
86
86
|
|
87
87
|
is_accepted response
|
88
88
|
end
|
@@ -4,7 +4,7 @@ describe Occi::Network do
|
|
4
4
|
describe "#all" do
|
5
5
|
it "returns a parsed XML document" do
|
6
6
|
VCR.use_cassette "network_all" do
|
7
|
-
response =
|
7
|
+
response = CONNECTION.network.all
|
8
8
|
|
9
9
|
is_okay response
|
10
10
|
end
|
@@ -13,7 +13,7 @@ describe Occi::Network do
|
|
13
13
|
|
14
14
|
describe "#create" do
|
15
15
|
before do
|
16
|
-
@
|
16
|
+
@xml = Nokogiri::XML::Builder.new do
|
17
17
|
NETWORK {
|
18
18
|
NAME "Test Framework"
|
19
19
|
ADDRESS "192.168.1.1"
|
@@ -24,7 +24,7 @@ describe Occi::Network do
|
|
24
24
|
|
25
25
|
it "returns a parsed XML document" do
|
26
26
|
VCR.use_cassette "network_create" do
|
27
|
-
response =
|
27
|
+
response = CONNECTION.network.create @xml
|
28
28
|
|
29
29
|
is_created response
|
30
30
|
end
|
@@ -36,19 +36,19 @@ describe Occi::Network do
|
|
36
36
|
id = cassette_for("network_create").xpath('//ID').text
|
37
37
|
|
38
38
|
VCR.use_cassette "network_find" do
|
39
|
-
response =
|
39
|
+
response = CONNECTION.network.find id
|
40
40
|
|
41
41
|
is_okay response
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
describe "#
|
46
|
+
describe "#destroy" do
|
47
47
|
it "returns a parsed XML document" do
|
48
48
|
id = cassette_for("network_create").xpath('//ID').text
|
49
49
|
|
50
|
-
VCR.use_cassette "
|
51
|
-
response =
|
50
|
+
VCR.use_cassette "network_destroy" do
|
51
|
+
response = CONNECTION.network.destroy id
|
52
52
|
|
53
53
|
is_no_content response
|
54
54
|
end
|
@@ -4,7 +4,7 @@ describe Occi::Storage do
|
|
4
4
|
describe "#all" do
|
5
5
|
it "returns a parsed XML document" do
|
6
6
|
VCR.use_cassette "storage_all" do
|
7
|
-
response =
|
7
|
+
response = CONNECTION.network.all
|
8
8
|
|
9
9
|
is_okay response
|
10
10
|
end
|
@@ -13,7 +13,7 @@ describe Occi::Storage do
|
|
13
13
|
|
14
14
|
describe "#create" do
|
15
15
|
before do
|
16
|
-
@
|
16
|
+
@xml = Nokogiri::XML::Builder.new do
|
17
17
|
STORAGE {
|
18
18
|
NAME "Test Framework"
|
19
19
|
DESCRIPTION "Test Framework Image."
|
@@ -26,7 +26,7 @@ describe Occi::Storage do
|
|
26
26
|
@upload = {
|
27
27
|
:parts => {
|
28
28
|
:file => "/dev/null",
|
29
|
-
:occixml => @
|
29
|
+
:occixml => @xml,
|
30
30
|
},
|
31
31
|
:content_type => "application/octet-stream"
|
32
32
|
}
|
@@ -34,7 +34,7 @@ describe Occi::Storage do
|
|
34
34
|
|
35
35
|
it "returns a parsed XML document" do
|
36
36
|
VCR.use_cassette "storage_create" do
|
37
|
-
response =
|
37
|
+
response = CONNECTION.storage.create @upload
|
38
38
|
|
39
39
|
is_created response
|
40
40
|
end
|
@@ -46,19 +46,19 @@ describe Occi::Storage do
|
|
46
46
|
id = cassette_for("storage_create").xpath('//ID').text
|
47
47
|
|
48
48
|
VCR.use_cassette "storage_find" do
|
49
|
-
response =
|
49
|
+
response = CONNECTION.storage.find id
|
50
50
|
|
51
51
|
is_okay response
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
describe "#
|
56
|
+
describe "#destroy" do
|
57
57
|
it "returns a parsed XML document" do
|
58
58
|
id = cassette_for("storage_create").xpath('//ID').text
|
59
59
|
|
60
|
-
VCR.use_cassette "
|
61
|
-
response =
|
60
|
+
VCR.use_cassette "storage_destroy" do
|
61
|
+
response = CONNECTION.storage.destroy id
|
62
62
|
|
63
63
|
is_no_content response
|
64
64
|
end
|
data/test/test_helper.rb
CHANGED
@@ -4,15 +4,15 @@ Bundler.setup :default, :test
|
|
4
4
|
%w(minitest/autorun minitest/spec nokogiri vcr webmock occi).each { |r| require r }
|
5
5
|
|
6
6
|
class MiniTest::Unit::TestCase
|
7
|
-
|
7
|
+
CONNECTION = Occi::Client.new(
|
8
8
|
:host => "one.example.com",
|
9
9
|
:user => ENV['ONE_USER'],
|
10
10
|
:password => ENV['ONE_PASSWORD'],
|
11
11
|
)
|
12
12
|
|
13
13
|
def okay response, code
|
14
|
-
response.body.must_be_kind_of Nokogiri::XML::Document
|
15
14
|
response.code.must_equal code
|
15
|
+
response.body.errors.must_be_empty
|
16
16
|
end
|
17
17
|
|
18
18
|
def is_okay response
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 1.2.
|
8
|
+
- 1
|
9
|
+
version: 1.2.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- retr0h
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-01-
|
17
|
+
date: 2011-01-13 00:00:00 -08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -26,9 +26,9 @@ dependencies:
|
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
segments:
|
28
28
|
- 2
|
29
|
-
-
|
29
|
+
- 3
|
30
30
|
- 0
|
31
|
-
version: 2.
|
31
|
+
version: 2.3.0
|
32
32
|
type: :runtime
|
33
33
|
prerelease: false
|
34
34
|
version_requirements: *id001
|
@@ -100,8 +100,8 @@ dependencies:
|
|
100
100
|
segments:
|
101
101
|
- 1
|
102
102
|
- 6
|
103
|
-
-
|
104
|
-
version: 1.6.
|
103
|
+
- 2
|
104
|
+
version: 1.6.2
|
105
105
|
type: :development
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: *id006
|
@@ -175,17 +175,18 @@ files:
|
|
175
175
|
- lib/occi/resource.rb
|
176
176
|
- lib/occi/storage.rb
|
177
177
|
- occi.gemspec
|
178
|
+
- test/fixtures/cassettes/compute_all.yml
|
178
179
|
- test/fixtures/cassettes/compute_create.yml
|
179
|
-
- test/fixtures/cassettes/
|
180
|
+
- test/fixtures/cassettes/compute_destroy.yml
|
180
181
|
- test/fixtures/cassettes/compute_find.yml
|
181
182
|
- test/fixtures/cassettes/compute_update.yml
|
182
183
|
- test/fixtures/cassettes/network_all.yml
|
183
184
|
- test/fixtures/cassettes/network_create.yml
|
184
|
-
- test/fixtures/cassettes/
|
185
|
+
- test/fixtures/cassettes/network_destroy.yml
|
185
186
|
- test/fixtures/cassettes/network_find.yml
|
186
187
|
- test/fixtures/cassettes/storage_all.yml
|
187
188
|
- test/fixtures/cassettes/storage_create.yml
|
188
|
-
- test/fixtures/cassettes/
|
189
|
+
- test/fixtures/cassettes/storage_destroy.yml
|
189
190
|
- test/fixtures/cassettes/storage_find.yml
|
190
191
|
- test/lib/occi/compute_test.rb
|
191
192
|
- test/lib/occi/network_test.rb
|