deltacloud-client 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +176 -502
- data/Rakefile +12 -11
- data/bin/deltacloudc +12 -11
- data/init.rb +12 -11
- data/lib/deltacloud.rb +31 -21
- data/lib/documentation.rb +77 -22
- data/specs/hardware_profiles_spec.rb +21 -14
- data/specs/images_spec.rb +12 -11
- data/specs/initialization_spec.rb +12 -11
- data/specs/instance_states_spec.rb +12 -11
- data/specs/instances_spec.rb +12 -13
- data/specs/realms_spec.rb +12 -11
- data/specs/shared/resources.rb +12 -11
- data/specs/spec_helper.rb +12 -11
- data/specs/storage_snapshot_spec.rb +12 -11
- data/specs/storage_volume_spec.rb +12 -11
- metadata +36 -17
data/Rakefile
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
#
|
2
2
|
# Copyright (C) 2009 Red Hat, Inc.
|
3
3
|
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
5
|
+
# contributor license agreements. See the NOTICE file distributed with
|
6
|
+
# this work for additional information regarding copyright ownership. The
|
7
|
+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
8
|
+
# "License"); you may not use this file except in compliance with the
|
9
|
+
# License. You may obtain a copy of the License at
|
8
10
|
#
|
9
|
-
#
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12
|
-
# Lesser General Public License for more details.
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
13
12
|
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
16
|
+
# License for the specific language governing permissions and limitations
|
17
|
+
# under the License.
|
17
18
|
|
18
19
|
require 'rake/gempackagetask'
|
19
20
|
|
data/bin/deltacloudc
CHANGED
@@ -2,19 +2,20 @@
|
|
2
2
|
#
|
3
3
|
# Copyright (C) 2009 Red Hat, Inc.
|
4
4
|
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
5
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
6
|
+
# contributor license agreements. See the NOTICE file distributed with
|
7
|
+
# this work for additional information regarding copyright ownership. The
|
8
|
+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
9
|
+
# "License"); you may not use this file except in compliance with the
|
10
|
+
# License. You may obtain a copy of the License at
|
9
11
|
#
|
10
|
-
#
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
-
# Lesser General Public License for more details.
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
14
13
|
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
16
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
17
|
+
# License for the specific language governing permissions and limitations
|
18
|
+
# under the License.
|
18
19
|
|
19
20
|
require 'rubygems'
|
20
21
|
require 'optparse'
|
data/init.rb
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
#
|
2
2
|
# Copyright (C) 2009 Red Hat, Inc.
|
3
3
|
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
5
|
+
# contributor license agreements. See the NOTICE file distributed with
|
6
|
+
# this work for additional information regarding copyright ownership. The
|
7
|
+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
8
|
+
# "License"); you may not use this file except in compliance with the
|
9
|
+
# License. You may obtain a copy of the License at
|
8
10
|
#
|
9
|
-
#
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12
|
-
# Lesser General Public License for more details.
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
13
12
|
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
16
|
+
# License for the specific language governing permissions and limitations
|
17
|
+
# under the License.
|
17
18
|
|
18
19
|
|
19
20
|
require 'deltacloud'
|
data/lib/deltacloud.rb
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
#
|
2
2
|
# Copyright (C) 2009 Red Hat, Inc.
|
3
3
|
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
5
|
+
# contributor license agreements. See the NOTICE file distributed with
|
6
|
+
# this work for additional information regarding copyright ownership. The
|
7
|
+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
8
|
+
# "License"); you may not use this file except in compliance with the
|
9
|
+
# License. You may obtain a copy of the License at
|
8
10
|
#
|
9
|
-
#
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12
|
-
# Lesser General Public License for more details.
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
13
12
|
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
16
|
+
# License for the specific language governing permissions and limitations
|
17
|
+
# under the License.
|
17
18
|
|
18
19
|
require 'nokogiri'
|
19
20
|
require 'rest_client'
|
@@ -190,12 +191,13 @@ module DeltaCloud
|
|
190
191
|
end
|
191
192
|
# Property attribute is handled differently
|
192
193
|
when "property":
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
194
|
+
attr_accessor :"#{attribute['name'].sanitize}"
|
195
|
+
if attribute['value'] =~ /^(\d+)$/
|
196
|
+
obj.send(:"#{attribute['name'].sanitize}=",
|
197
|
+
DeltaCloud::HWP::FloatProperty.new(attribute, attribute['name']))
|
198
|
+
else
|
199
|
+
obj.send(:"#{attribute['name'].sanitize}=",
|
200
|
+
DeltaCloud::HWP::Property.new(attribute, attribute['name']))
|
199
201
|
end
|
200
202
|
# Public and private addresses are returned as Array
|
201
203
|
when "public_addresses", "private_addresses":
|
@@ -293,12 +295,20 @@ module DeltaCloud
|
|
293
295
|
end
|
294
296
|
logger << "[#{conf[:method].to_s.upcase}] #{conf[:path]}\n"
|
295
297
|
if conf[:method].eql?(:post)
|
296
|
-
RestClient.send(:post, conf[:path], conf[:form_data], default_headers) do |response|
|
297
|
-
|
298
|
+
RestClient.send(:post, conf[:path], conf[:form_data], default_headers) do |response, request, block|
|
299
|
+
if response.respond_to?('body')
|
300
|
+
yield response.body if block_given?
|
301
|
+
else
|
302
|
+
yield response.to_s if block_given?
|
303
|
+
end
|
298
304
|
end
|
299
305
|
else
|
300
|
-
RestClient.send(conf[:method], conf[:path], default_headers) do |response|
|
301
|
-
|
306
|
+
RestClient.send(conf[:method], conf[:path], default_headers) do |response, request, block|
|
307
|
+
if response.respond_to?('body')
|
308
|
+
yield response.body if block_given?
|
309
|
+
else
|
310
|
+
yield response.to_s if block_given?
|
311
|
+
end
|
302
312
|
end
|
303
313
|
end
|
304
314
|
end
|
data/lib/documentation.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'lib/deltacloud'
|
2
|
-
require 'ap'
|
3
2
|
|
4
3
|
skip_methods = [ "id=", "uri=" ]
|
5
4
|
|
@@ -13,30 +12,86 @@ end
|
|
13
12
|
@dc.entry_points.keys.each do |ep|
|
14
13
|
@dc.send(ep)
|
15
14
|
end
|
16
|
-
|
17
15
|
class_list = @dc.classes
|
18
16
|
|
17
|
+
def read_method_description(c, method)
|
18
|
+
if method =~ /es$/
|
19
|
+
" # Read #{c.downcase} collection from Deltacloud API"
|
20
|
+
else
|
21
|
+
case method
|
22
|
+
when "uri"
|
23
|
+
" # Return URI to API for this object"
|
24
|
+
when "action_urls"
|
25
|
+
" # Return available actions API URL"
|
26
|
+
when "client"
|
27
|
+
" # Return instance of API client"
|
28
|
+
else
|
29
|
+
" # Get #{method} attribute value from #{c.downcase}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def read_parameters(c, method)
|
35
|
+
out = []
|
36
|
+
if method =~ /es$/
|
37
|
+
out << " # @param [String, #id] Filter by ID"
|
38
|
+
end
|
39
|
+
out.join("\n")
|
40
|
+
end
|
41
|
+
|
42
|
+
def read_return_value(c, method)
|
43
|
+
if method =~ /es$/
|
44
|
+
rt = "Array"
|
45
|
+
else
|
46
|
+
rt = "String"
|
47
|
+
end
|
48
|
+
" # @return [String] Value of #{method}"
|
49
|
+
end
|
50
|
+
|
19
51
|
out = []
|
20
52
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
out << "
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
53
|
+
class_list.each do |c|
|
54
|
+
class_name = "#{c}".gsub(/^DeltaCloud::/, '')
|
55
|
+
out << "module DeltaCloud"
|
56
|
+
out << " class API"
|
57
|
+
@dc.entry_points.keys.each do |ep|
|
58
|
+
out << "# Return #{ep.to_s.classify} object with given id\n"
|
59
|
+
out << "# "
|
60
|
+
out << "# *#{@dc.documentation(ep.to_s).description}*"
|
61
|
+
out << "# @return [#{ep.to_s.classify}]"
|
62
|
+
out << "def #{ep.to_s.gsub(/s$/, '')}"
|
63
|
+
out << "end"
|
64
|
+
out << "# Return collection of #{ep.to_s.classify} objects"
|
65
|
+
out << "# "
|
66
|
+
out << "# *#{@dc.documentation(ep.to_s).description}*"
|
67
|
+
@dc.documentation(ep.to_s, 'index').params.each do |p|
|
68
|
+
out << p.to_comment
|
69
|
+
end
|
70
|
+
out << "# @return [Array] [#{ep.to_s.classify}]"
|
71
|
+
out << "def #{ep}(opts={})"
|
72
|
+
out << "end"
|
73
|
+
end
|
74
|
+
out << " end"
|
75
|
+
out << " class #{class_name}"
|
76
|
+
c.instance_methods(false).each do |method|
|
77
|
+
next if skip_methods.include?(method)
|
78
|
+
params = read_parameters(class_name, method)
|
79
|
+
retval = read_return_value(class_name, method)
|
80
|
+
out << read_method_description(class_name, method)
|
81
|
+
out << params if params
|
82
|
+
out << retval if retval
|
83
|
+
out << " def #{method}"
|
84
|
+
out << " # This method was generated dynamically from API"
|
85
|
+
out << " end\n"
|
86
|
+
end
|
87
|
+
out << " end"
|
29
88
|
out << "end"
|
30
89
|
end
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
# f.puts(out.join("\n"))
|
40
|
-
#end
|
41
|
-
#system("yardoc -m markdown --readme README --title 'Deltacloud Client Library' 'lib/*.rb' 'doc/deltacloud.rb' --verbose")
|
42
|
-
#FileUtils.rm('doc/deltacloud.rb')
|
90
|
+
|
91
|
+
FileUtils.rm_r('doc') rescue nil
|
92
|
+
FileUtils.mkdir_p('doc')
|
93
|
+
File.open('doc/deltacloud.rb', 'w') do |f|
|
94
|
+
f.puts(out.join("\n"))
|
95
|
+
end
|
96
|
+
system("yardoc -m markdown --readme README --title 'Deltacloud Client Library' 'lib/*.rb' 'doc/deltacloud.rb' --verbose")
|
97
|
+
FileUtils.rm('doc/deltacloud.rb')
|
@@ -1,19 +1,20 @@
|
|
1
1
|
#
|
2
2
|
# Copyright (C) 2009 Red Hat, Inc.
|
3
3
|
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
5
|
+
# contributor license agreements. See the NOTICE file distributed with
|
6
|
+
# this work for additional information regarding copyright ownership. The
|
7
|
+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
8
|
+
# "License"); you may not use this file except in compliance with the
|
9
|
+
# License. You may obtain a copy of the License at
|
8
10
|
#
|
9
|
-
#
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12
|
-
# Lesser General Public License for more details.
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
13
12
|
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
16
|
+
# License for the specific language governing permissions and limitations
|
17
|
+
# under the License.
|
17
18
|
|
18
19
|
|
19
20
|
require 'specs/spec_helper'
|
@@ -36,9 +37,7 @@ describe "hardware_profiles" do
|
|
36
37
|
hardware_profiles.each do |hwp|
|
37
38
|
hwp.uri.should_not be_nil
|
38
39
|
hwp.uri.should be_a(String)
|
39
|
-
prop_check(hwp.architecture, String)
|
40
|
-
prop_check(hwp.storage, Float)
|
41
|
-
prop_check(hwp.memory, Float)
|
40
|
+
prop_check(hwp.architecture, String) if hwp.architecture
|
42
41
|
end
|
43
42
|
end
|
44
43
|
end
|
@@ -60,6 +59,14 @@ describe "hardware_profiles" do
|
|
60
59
|
end
|
61
60
|
end
|
62
61
|
|
62
|
+
it "should allow fetching different hardware_profiles" do
|
63
|
+
client = DeltaCloud.new( API_NAME, API_PASSWORD, API_URL )
|
64
|
+
hwp1 = client.hardware_profile( 'm1-small' )
|
65
|
+
hwp2 = client.hardware_profile( 'm1-xlarge' )
|
66
|
+
hwp1.storage.value.should_not eql(hwp2.storage.value)
|
67
|
+
hwp1.memory.value.should_not eql(hwp2.memory.value)
|
68
|
+
end
|
69
|
+
|
63
70
|
it "should allow fetching a hardware_profile by URI" do
|
64
71
|
DeltaCloud.new( API_NAME, API_PASSWORD, API_URL ) do |client|
|
65
72
|
hwp = client.fetch_hardware_profile( API_URL + '/hardware_profiles/m1-small' )
|
data/specs/images_spec.rb
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
#
|
2
2
|
# Copyright (C) 2009 Red Hat, Inc.
|
3
3
|
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
5
|
+
# contributor license agreements. See the NOTICE file distributed with
|
6
|
+
# this work for additional information regarding copyright ownership. The
|
7
|
+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
8
|
+
# "License"); you may not use this file except in compliance with the
|
9
|
+
# License. You may obtain a copy of the License at
|
8
10
|
#
|
9
|
-
#
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12
|
-
# Lesser General Public License for more details.
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
13
12
|
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
16
|
+
# License for the specific language governing permissions and limitations
|
17
|
+
# under the License.
|
17
18
|
|
18
19
|
|
19
20
|
require 'specs/spec_helper'
|
@@ -1,19 +1,20 @@
|
|
1
1
|
#
|
2
2
|
# Copyright (C) 2009 Red Hat, Inc.
|
3
3
|
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
5
|
+
# contributor license agreements. See the NOTICE file distributed with
|
6
|
+
# this work for additional information regarding copyright ownership. The
|
7
|
+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
8
|
+
# "License"); you may not use this file except in compliance with the
|
9
|
+
# License. You may obtain a copy of the License at
|
8
10
|
#
|
9
|
-
#
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12
|
-
# Lesser General Public License for more details.
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
13
12
|
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
16
|
+
# License for the specific language governing permissions and limitations
|
17
|
+
# under the License.
|
17
18
|
|
18
19
|
require 'specs/spec_helper'
|
19
20
|
|
@@ -1,19 +1,20 @@
|
|
1
1
|
#
|
2
2
|
# Copyright (C) 2009 Red Hat, Inc.
|
3
3
|
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
5
|
+
# contributor license agreements. See the NOTICE file distributed with
|
6
|
+
# this work for additional information regarding copyright ownership. The
|
7
|
+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
8
|
+
# "License"); you may not use this file except in compliance with the
|
9
|
+
# License. You may obtain a copy of the License at
|
8
10
|
#
|
9
|
-
#
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12
|
-
# Lesser General Public License for more details.
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
13
12
|
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
16
|
+
# License for the specific language governing permissions and limitations
|
17
|
+
# under the License.
|
17
18
|
|
18
19
|
|
19
20
|
require 'specs/spec_helper'
|
data/specs/instances_spec.rb
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
#
|
2
2
|
# Copyright (C) 2009 Red Hat, Inc.
|
3
3
|
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
5
|
+
# contributor license agreements. See the NOTICE file distributed with
|
6
|
+
# this work for additional information regarding copyright ownership. The
|
7
|
+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
8
|
+
# "License"); you may not use this file except in compliance with the
|
9
|
+
# License. You may obtain a copy of the License at
|
8
10
|
#
|
9
|
-
#
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12
|
-
# Lesser General Public License for more details.
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
13
12
|
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
16
|
+
# License for the specific language governing permissions and limitations
|
17
|
+
# under the License.
|
17
18
|
|
18
19
|
|
19
20
|
require 'specs/spec_helper'
|
@@ -172,10 +173,8 @@ describe "instances" do
|
|
172
173
|
instance.uri.should eql( API_URL + '/instances/inst1' )
|
173
174
|
instance.id.should eql( 'inst1' )
|
174
175
|
instance.stop!
|
175
|
-
instance = client.instance( 'inst1' )
|
176
176
|
instance.state.should eql( "STOPPED" )
|
177
177
|
instance.start!
|
178
|
-
instance = client.instance( 'inst1' )
|
179
178
|
instance.state.should eql( "RUNNING" )
|
180
179
|
end
|
181
180
|
end
|
data/specs/realms_spec.rb
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
#
|
2
2
|
# Copyright (C) 2009 Red Hat, Inc.
|
3
3
|
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
5
|
+
# contributor license agreements. See the NOTICE file distributed with
|
6
|
+
# this work for additional information regarding copyright ownership. The
|
7
|
+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
8
|
+
# "License"); you may not use this file except in compliance with the
|
9
|
+
# License. You may obtain a copy of the License at
|
8
10
|
#
|
9
|
-
#
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12
|
-
# Lesser General Public License for more details.
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
13
12
|
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
16
|
+
# License for the specific language governing permissions and limitations
|
17
|
+
# under the License.
|
17
18
|
|
18
19
|
require 'specs/spec_helper'
|
19
20
|
|
data/specs/shared/resources.rb
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
#
|
2
2
|
# Copyright (C) 2009 Red Hat, Inc.
|
3
3
|
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
5
|
+
# contributor license agreements. See the NOTICE file distributed with
|
6
|
+
# this work for additional information regarding copyright ownership. The
|
7
|
+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
8
|
+
# "License"); you may not use this file except in compliance with the
|
9
|
+
# License. You may obtain a copy of the License at
|
8
10
|
#
|
9
|
-
#
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12
|
-
# Lesser General Public License for more details.
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
13
12
|
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
16
|
+
# License for the specific language governing permissions and limitations
|
17
|
+
# under the License.
|
17
18
|
|
18
19
|
|
19
20
|
shared_examples_for "all resources" do
|
data/specs/spec_helper.rb
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
#
|
2
2
|
# Copyright (C) 2009 Red Hat, Inc.
|
3
3
|
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
5
|
+
# contributor license agreements. See the NOTICE file distributed with
|
6
|
+
# this work for additional information regarding copyright ownership. The
|
7
|
+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
8
|
+
# "License"); you may not use this file except in compliance with the
|
9
|
+
# License. You may obtain a copy of the License at
|
8
10
|
#
|
9
|
-
#
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12
|
-
# Lesser General Public License for more details.
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
13
12
|
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
16
|
+
# License for the specific language governing permissions and limitations
|
17
|
+
# under the License.
|
17
18
|
|
18
19
|
require 'rubygems'
|
19
20
|
require 'yaml'
|