occi 3.0.0 → 3.1.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +0 -1
- data/.travis.yml +26 -2
- data/Gemfile +5 -2
- data/Gemfile.lock +42 -26
- data/README.md +64 -4
- data/Rakefile +7 -3
- data/bin/occi +15 -58
- data/config/warble.rb +151 -0
- data/doc/macosx.md +27 -0
- data/examples/dsl_example.rb +16 -7
- data/examples/x509auth_example.rb +13 -7
- data/ext/mkrf_conf.rb +4 -3
- data/features/common/step_definitions/common_steps.rb +9 -9
- data/lib/occi/api/client/client_amqp.rb +25 -14
- data/lib/occi/api/client/client_http.rb +173 -156
- data/lib/occi/api/client/http/authn_utils.rb +82 -0
- data/lib/occi/bin/helpers.rb +84 -26
- data/lib/occi/bin/occi_opts.rb +166 -48
- data/lib/occi/version.rb +1 -1
- data/occi.gemspec +1 -1
- data/spec/occi/api/client/client_amqp_spec.rb +6 -3
- data/spec/occi/api/client/client_http_spec.rb +16 -16
- data/spec/occi/api/client/http/authn_utils_spec.rb +55 -0
- data/spec/occi/api/client/http/httparty_fix_spec.rb +0 -0
- data/spec/occi/api/client/http/net_http_fix_spec.rb +0 -0
- data/spec/occi/api/client/http/rocci-cred-cert.pem +3 -0
- data/spec/occi/api/client/http/rocci-cred-key-jruby.pem +3 -0
- data/spec/occi/api/client/http/rocci-cred-key.pem +3 -0
- data/spec/occi/api/client/http/rocci-cred.p12 +0 -0
- data/spec/occi/bin/helpers_spec.rb +12 -0
- data/spec/occi/bin/occi_opts_spec.rb +60 -0
- data/spec/occi/bin/resource_output_factory_spec.rb +12 -0
- data/spec/spec_helper.rb +26 -0
- metadata +35 -86
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,11 +1,35 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
3
|
- 1.8.7
|
4
|
-
- 1.9.2
|
5
4
|
- 1.9.3
|
5
|
+
- ruby-head
|
6
6
|
- jruby-18mode
|
7
7
|
- jruby-19mode
|
8
|
+
- jruby-head
|
9
|
+
|
10
|
+
jdk:
|
11
|
+
- openjdk7
|
12
|
+
- oraclejdk7
|
13
|
+
- openjdk6
|
14
|
+
|
15
|
+
matrix:
|
16
|
+
allow_failures:
|
17
|
+
- rvm: ruby-head
|
18
|
+
- rvm: jruby-head
|
19
|
+
exclude:
|
20
|
+
- rvm: 1.8.7
|
21
|
+
jdk: openjdk7
|
22
|
+
- rvm: 1.8.7
|
23
|
+
jdk: oraclejdk7
|
24
|
+
- rvm: 1.9.3
|
25
|
+
jdk: openjdk7
|
26
|
+
- rvm: 1.9.3
|
27
|
+
jdk: oraclejdk7
|
28
|
+
- rvm: ruby-head
|
29
|
+
jdk: openjdk7
|
30
|
+
- rvm: ruby-head
|
31
|
+
jdk: oraclejdk7
|
8
32
|
|
9
33
|
branches:
|
10
34
|
only:
|
11
|
-
- master
|
35
|
+
- master
|
data/Gemfile
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
-
source
|
1
|
+
source "https://rubygems.org/"
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
|
5
|
+
group :development do
|
6
|
+
gem 'vcr', :git => 'git://github.com/arax/vcr.git', :branch => 'test_framework_patches'
|
7
|
+
gem 'warbler', :git => 'git://github.com/jruby/warbler.git'
|
8
|
+
end
|
6
9
|
|
7
10
|
platforms :jruby do
|
8
11
|
gem 'jruby-openssl' if ((defined? JRUBY_VERSION) && (JRUBY_VERSION.split('.')[1].to_i < 7))
|
data/Gemfile.lock
CHANGED
@@ -5,10 +5,20 @@ GIT
|
|
5
5
|
specs:
|
6
6
|
vcr (2.4.0)
|
7
7
|
|
8
|
+
GIT
|
9
|
+
remote: git://github.com/jruby/warbler.git
|
10
|
+
revision: ce3ce4df137504822e4cbb9399dee7e7dd767c44
|
11
|
+
specs:
|
12
|
+
warbler (1.3.7.dev)
|
13
|
+
jruby-jars (>= 1.5.6)
|
14
|
+
jruby-rack (>= 1.0.0)
|
15
|
+
rake (>= 0.9.6)
|
16
|
+
rubyzip (>= 0.9.8)
|
17
|
+
|
8
18
|
PATH
|
9
19
|
remote: .
|
10
20
|
specs:
|
11
|
-
occi (3.
|
21
|
+
occi (3.1.0.beta.1)
|
12
22
|
activesupport
|
13
23
|
amqp
|
14
24
|
antlr3
|
@@ -21,19 +31,19 @@ PATH
|
|
21
31
|
uuidtools (>= 2.1.3)
|
22
32
|
|
23
33
|
GEM
|
24
|
-
remote:
|
34
|
+
remote: https://rubygems.org/
|
25
35
|
specs:
|
26
|
-
activesupport (3.2.
|
36
|
+
activesupport (3.2.12)
|
27
37
|
i18n (~> 0.6)
|
28
38
|
multi_json (~> 1.0)
|
29
|
-
addressable (2.3.
|
30
|
-
amq-client (0.9.
|
31
|
-
amq-protocol (>=
|
39
|
+
addressable (2.3.3)
|
40
|
+
amq-client (0.9.12)
|
41
|
+
amq-protocol (>= 1.2.0)
|
32
42
|
eventmachine
|
33
|
-
amq-protocol (1.0
|
34
|
-
amqp (0.9.
|
35
|
-
amq-client (~> 0.9.
|
36
|
-
amq-protocol (
|
43
|
+
amq-protocol (1.2.0)
|
44
|
+
amqp (0.9.9)
|
45
|
+
amq-client (~> 0.9.12)
|
46
|
+
amq-protocol (~> 1.2.0)
|
37
47
|
eventmachine
|
38
48
|
antlr3 (1.8.12)
|
39
49
|
builder (3.1.4)
|
@@ -46,20 +56,22 @@ GEM
|
|
46
56
|
diff-lcs (1.1.3)
|
47
57
|
eventmachine (1.0.0)
|
48
58
|
eventmachine (1.0.0-java)
|
49
|
-
gherkin (2.11.
|
50
|
-
json (>= 1.
|
51
|
-
gherkin (2.11.
|
52
|
-
json (>= 1.
|
53
|
-
hashie (
|
59
|
+
gherkin (2.11.6)
|
60
|
+
json (>= 1.7.6)
|
61
|
+
gherkin (2.11.6-java)
|
62
|
+
json (>= 1.7.6)
|
63
|
+
hashie (2.0.2)
|
54
64
|
highline (1.6.15)
|
55
|
-
httparty (0.
|
65
|
+
httparty (0.10.2)
|
56
66
|
multi_json (~> 1.0)
|
57
|
-
multi_xml
|
67
|
+
multi_xml (>= 0.5.2)
|
58
68
|
i18n (0.6.1)
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
69
|
+
jruby-jars (1.7.3)
|
70
|
+
jruby-rack (1.1.13.1)
|
71
|
+
json (1.7.7)
|
72
|
+
json (1.7.7-java)
|
73
|
+
multi_json (1.6.1)
|
74
|
+
multi_xml (0.5.3)
|
63
75
|
nokogiri (1.5.6)
|
64
76
|
nokogiri (1.5.6-java)
|
65
77
|
rake (10.0.3)
|
@@ -72,17 +84,19 @@ GEM
|
|
72
84
|
diff-lcs (~> 1.1.3)
|
73
85
|
rspec-http (0.10.0)
|
74
86
|
rspec (~> 2.0)
|
75
|
-
rspec-mocks (2.12.
|
87
|
+
rspec-mocks (2.12.2)
|
88
|
+
rubygems-tasks (0.2.3)
|
89
|
+
rubyzip (0.9.9)
|
76
90
|
simplecov (0.7.1)
|
77
91
|
multi_json (~> 1.0)
|
78
92
|
simplecov-html (~> 0.7.1)
|
79
93
|
simplecov-html (0.7.1)
|
80
94
|
uuidtools (2.1.3)
|
81
|
-
webmock (1.9.
|
95
|
+
webmock (1.9.3)
|
82
96
|
addressable (>= 2.2.7)
|
83
|
-
crack (>= 0.
|
84
|
-
yard (0.8.
|
85
|
-
yard-cucumber (2.2.
|
97
|
+
crack (>= 0.3.2)
|
98
|
+
yard (0.8.4.1)
|
99
|
+
yard-cucumber (2.2.3)
|
86
100
|
cucumber (>= 0.7.5)
|
87
101
|
gherkin (>= 2.2.9)
|
88
102
|
yard (>= 0.8.1)
|
@@ -101,8 +115,10 @@ DEPENDENCIES
|
|
101
115
|
rake
|
102
116
|
rspec
|
103
117
|
rspec-http
|
118
|
+
rubygems-tasks
|
104
119
|
simplecov
|
105
120
|
vcr!
|
121
|
+
warbler!
|
106
122
|
webmock
|
107
123
|
yard
|
108
124
|
yard-cucumber
|
data/README.md
CHANGED
@@ -14,8 +14,19 @@ The following setup is recommended
|
|
14
14
|
* Ruby 1.9.3
|
15
15
|
* RubyGems installed
|
16
16
|
|
17
|
+
The following libraries / packages may be required to use rOCCI
|
18
|
+
|
19
|
+
* libxslt-dev
|
20
|
+
* libxml2-dev
|
21
|
+
|
22
|
+
To use rOCCI with Java, you need JRE 6 or 7. To build rOCCI for Java, you need JDK 6 or 7.
|
23
|
+
|
17
24
|
Installation
|
18
25
|
------------
|
26
|
+
|
27
|
+
**[Mac OS X has some special requirements for the installation. Detailed information can be found in
|
28
|
+
doc/macosx.md.](doc/macosx.md)**
|
29
|
+
|
19
30
|
To install the most recent stable version
|
20
31
|
|
21
32
|
gem install occi
|
@@ -24,12 +35,39 @@ To install the most recent beta version
|
|
24
35
|
|
25
36
|
gem install occi --pre
|
26
37
|
|
38
|
+
### Installation from source
|
39
|
+
|
40
|
+
To use rOCCI from source it is very much recommended to use RVM. [Install RVM](https://rvm.io/rvm/install/) with
|
41
|
+
|
42
|
+
curl -L https://get.rvm.io | bash -s stable --ruby
|
43
|
+
|
44
|
+
#### Ruby
|
45
|
+
|
27
46
|
To build and install the bleeding edge version from master
|
28
47
|
|
29
48
|
git clone git://github.com/gwdg/rOCCI.git
|
30
49
|
cd rOCCI
|
50
|
+
rvm install ruby-1.9.3
|
51
|
+
rvm --create --ruby-version use 1.9.3@rOCCI
|
52
|
+
bundle install --deployment
|
31
53
|
rake install
|
32
54
|
|
55
|
+
#### Java
|
56
|
+
|
57
|
+
To build a Java jar file from master use
|
58
|
+
|
59
|
+
git clone git://github.com/gwdg/rOCCI.git
|
60
|
+
cd rOCCI
|
61
|
+
rvm install jruby-1.7.1
|
62
|
+
rvm --create --ruby-version use jruby-1.7.1@rOCCI
|
63
|
+
gem install bundler
|
64
|
+
bundle install
|
65
|
+
warble
|
66
|
+
|
67
|
+
For Linux / Mac OS X you can create a OCCI Java executable from the jar file using
|
68
|
+
|
69
|
+
sudo echo '#!/usr/bin/java -jar' | cat - occi.jar > occi ; sudo chmod +x occi
|
70
|
+
|
33
71
|
Usage
|
34
72
|
-----
|
35
73
|
### Client
|
@@ -116,13 +154,26 @@ For keystone auth use
|
|
116
154
|
#### DSL
|
117
155
|
In your scripts, you can use the OCCI client DSL.
|
118
156
|
|
119
|
-
To include the DSL definitions in
|
157
|
+
To include the DSL definitions in a script use
|
120
158
|
|
121
159
|
extend Occi::Api::Dsl
|
122
160
|
|
161
|
+
To include the DSL definitions in a class use
|
162
|
+
|
163
|
+
include Occi::Api:Dsl
|
164
|
+
|
123
165
|
To connect to an OCCI endpoint/server (e.g. running on http://localhost:3300/ )
|
124
166
|
|
125
|
-
|
167
|
+
# defaults
|
168
|
+
options = {
|
169
|
+
:endpoint => "http://localhost:3300/",
|
170
|
+
:auth => {:type => "none"},
|
171
|
+
:log => {:out => STDERR, :level => Occi::Log::WARN, :logger => nil},
|
172
|
+
:auto_connect => "value", auto_connect => true,
|
173
|
+
:media_type => nil
|
174
|
+
}
|
175
|
+
|
176
|
+
connect(:http, options ||= {})
|
126
177
|
|
127
178
|
To get the list of available resource, mixin, entity or link types use
|
128
179
|
|
@@ -190,7 +241,16 @@ at a time, you should use the OCCI client API directly.
|
|
190
241
|
|
191
242
|
To connect to an OCCI endpoint/server (e.g. running on http://localhost:3300/ )
|
192
243
|
|
193
|
-
|
244
|
+
# defaults
|
245
|
+
options = {
|
246
|
+
:endpoint => "http://localhost:3300/",
|
247
|
+
:auth => {:type => "none"},
|
248
|
+
:log => {:out => STDERR, :level => Occi::Log::WARN, :logger => nil},
|
249
|
+
:auto_connect => "value", auto_connect => true,
|
250
|
+
:media_type => nil
|
251
|
+
}
|
252
|
+
|
253
|
+
client = Occi::Api::Client::ClientHttp.new(options ||= {})
|
194
254
|
|
195
255
|
All available categories are automatically registered to the OCCI model during client initialization. You can get them via
|
196
256
|
|
@@ -385,7 +445,7 @@ Change to rOCCI folder
|
|
385
445
|
|
386
446
|
Install dependencies for deployment
|
387
447
|
|
388
|
-
bundle install
|
448
|
+
bundle install
|
389
449
|
|
390
450
|
### Code Documentation
|
391
451
|
|
data/Rakefile
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
-
require '
|
2
|
-
Bundler::GemHelper.install_tasks
|
1
|
+
require 'rubygems/tasks'
|
3
2
|
|
4
|
-
task :default => '
|
3
|
+
task :default => 'test'
|
4
|
+
|
5
|
+
desc "Run all tests; includes rspec, cucumber and coverage reports"
|
6
|
+
task :test => 'rcov:all'
|
7
|
+
|
8
|
+
Gem::Tasks.new(:build => {:tar => true, :zip => true}, :sign => {:checksum => true, :pgp => true})
|
5
9
|
|
6
10
|
namespace :rcov do
|
7
11
|
|
data/bin/occi
CHANGED
@@ -41,28 +41,6 @@ output = Occi::Bin::ResourceOutputFactory.new options.output_format
|
|
41
41
|
Occi::Log.info "Starting OCCI client ..."
|
42
42
|
Occi::Log.debug "Options: #{options}"
|
43
43
|
|
44
|
-
# TODO: this part isn't necessary, just annoying
|
45
|
-
# to make the interactive mode completely self-sufficient
|
46
|
-
# ask for endpoint and auth method (provide defaults)
|
47
|
-
#if options.interactive
|
48
|
-
# Occi::Log.debug "Checking for endpoint and auth changes ..."
|
49
|
-
#
|
50
|
-
# options.endpoint = ask("What endpoint should I use? ") {
|
51
|
-
# |q| q.default = options.endpoint
|
52
|
-
# }
|
53
|
-
#
|
54
|
-
# # separate menus
|
55
|
-
# say "\n"
|
56
|
-
#
|
57
|
-
# choose do |menu|
|
58
|
-
# menu.prompt = "Which auth method should I use? "
|
59
|
-
#
|
60
|
-
# Occi::Bin::OcciOpts::AUTH_METHODS.each do |auth_m|
|
61
|
-
# menu.choice(auth_m) { options.auth[:type] = auth_m.to_s }
|
62
|
-
# end
|
63
|
-
# end
|
64
|
-
#end
|
65
|
-
|
66
44
|
# running with an empty password, we should ask the user for one
|
67
45
|
# if auth method is not "none"
|
68
46
|
if options.auth[:password].nil? || options.auth[:user_cert_password].nil? || options.auth[:token].nil?
|
@@ -82,7 +60,9 @@ end
|
|
82
60
|
# no effect on the non-interactive one
|
83
61
|
begin
|
84
62
|
Occi::Log.info "Establishing a connection to #{options.endpoint} ..."
|
85
|
-
|
63
|
+
|
64
|
+
options.auto_connect = true
|
65
|
+
connect :http, options
|
86
66
|
rescue OpenSSL::SSL::SSLError => ssl_ex
|
87
67
|
# generic SSL error raised whilst establishing a connection
|
88
68
|
# possibly an untrusted server cert or invalid user credentials
|
@@ -118,7 +98,7 @@ end
|
|
118
98
|
if options.dump_model
|
119
99
|
|
120
100
|
if !model.respond_to? :instance_variables
|
121
|
-
|
101
|
+
Occi::Log.error "Your Ruby doesn't support 'instance_variables' calls!"
|
122
102
|
exit!
|
123
103
|
end
|
124
104
|
|
@@ -261,17 +241,19 @@ begin
|
|
261
241
|
# if the user didn't choose "Back", ask for details
|
262
242
|
# TODO: currently only COMPUTE is supported
|
263
243
|
if options.action == :create
|
264
|
-
options.
|
244
|
+
options.attributes = {} if options.attributes.nil?
|
245
|
+
|
246
|
+
options.attributes[:title] = ask("What name should I give to the new resource? ")
|
265
247
|
number_of_mixins = ask("How many mixins do you wish me to mix into this resource? ",
|
266
248
|
Integer) { |q| q.in = 0..2 }
|
267
249
|
|
268
|
-
options.
|
250
|
+
options.mixins = {}
|
269
251
|
(1..number_of_mixins).each do |mixin_number|
|
270
252
|
mixin = ask("What mixin should I mix in? ") { |q| q.validate = /\A\w+#\w+\Z/ }
|
271
253
|
parts = mixin.split("#")
|
272
254
|
|
273
|
-
options.
|
274
|
-
options.
|
255
|
+
options.mixins[parts[0]] = [] if options.mixins[parts[0]].nil?
|
256
|
+
options.mixins[parts[0]] << parts[1]
|
275
257
|
end
|
276
258
|
end
|
277
259
|
}
|
@@ -340,40 +322,15 @@ begin
|
|
340
322
|
# call the appropriate helper and then format its output
|
341
323
|
case options.action
|
342
324
|
when :list
|
343
|
-
|
344
|
-
|
345
|
-
valid = Occi::Bin::ResourceOutputFactory.allowed_resource_types.include? options.resource.to_sym
|
346
|
-
Occi::Log.error "Not printing, the resource type is not supported!" unless valid
|
347
|
-
|
348
|
-
puts output.format(found, :locations, options.resource.to_sym) if valid
|
325
|
+
helper_list options, output
|
349
326
|
when :describe
|
350
|
-
|
351
|
-
|
352
|
-
if options.resource.start_with? options.endpoint
|
353
|
-
resource_type = options.resource.split("/")[3].to_sym
|
354
|
-
elsif mixin_types.include? options.resource.split('#').first
|
355
|
-
resource_type = options.resource.split('#').first.to_sym
|
356
|
-
else
|
357
|
-
resource_type = options.resource.to_sym
|
358
|
-
end
|
359
|
-
|
360
|
-
valid = Occi::Bin::ResourceOutputFactory.allowed_resource_types.include? resource_type
|
361
|
-
Occi::Log.error "Not printing, the resource type is not supported!" unless valid
|
362
|
-
|
363
|
-
puts output.format(found, :resources, resource_type) if valid
|
327
|
+
helper_describe options, output
|
364
328
|
when :create
|
365
|
-
|
366
|
-
puts location
|
329
|
+
helper_create options, output
|
367
330
|
when :delete
|
368
|
-
|
369
|
-
|
370
|
-
if result
|
371
|
-
puts "Resource #{options.resource} successfully removed!"
|
372
|
-
else
|
373
|
-
puts "Failed to remove resource #{options.resource}!"
|
374
|
-
end
|
331
|
+
helper_delete options, output
|
375
332
|
when :trigger
|
376
|
-
helper_trigger options
|
333
|
+
helper_trigger options, output
|
377
334
|
when :refresh
|
378
335
|
refresh
|
379
336
|
when :skip
|
data/config/warble.rb
ADDED
@@ -0,0 +1,151 @@
|
|
1
|
+
# Disable Rake-environment-task framework detection by uncommenting/setting to false
|
2
|
+
# Warbler.framework_detection = false
|
3
|
+
|
4
|
+
# Warbler web application assembly configuration file
|
5
|
+
Warbler::Config.new do |config|
|
6
|
+
# Features: additional options controlling how the jar is built.
|
7
|
+
# Currently the following features are supported:
|
8
|
+
# - gemjar: package the gem repository in a jar file in WEB-INF/lib
|
9
|
+
# - executable: embed a web server and make the war executable
|
10
|
+
# - compiled: compile .rb files to .class files
|
11
|
+
config.features = %w(compiled)
|
12
|
+
|
13
|
+
# Application directories to be included in the webapp.
|
14
|
+
config.dirs = %w(config lib)
|
15
|
+
|
16
|
+
# Additional files/directories to include, above those in config.dirs
|
17
|
+
# config.includes = FileList["db"]
|
18
|
+
|
19
|
+
# Additional files/directories to exclude
|
20
|
+
# config.excludes = FileList["lib/tasks/*"]
|
21
|
+
|
22
|
+
# Additional Java .jar files to include. Note that if .jar files are placed
|
23
|
+
# in lib (and not otherwise excluded) then they need not be mentioned here.
|
24
|
+
# JRuby and JRuby-Rack are pre-loaded in this list. Be sure to include your
|
25
|
+
# own versions if you directly set the value
|
26
|
+
# config.java_libs += FileList["lib/java/*.jar"]
|
27
|
+
|
28
|
+
# Loose Java classes and miscellaneous files to be included.
|
29
|
+
# config.java_classes = FileList["target/classes/**.*"]
|
30
|
+
|
31
|
+
# One or more pathmaps defining how the java classes should be copied into
|
32
|
+
# the archive. The example pathmap below accompanies the java_classes
|
33
|
+
# configuration above. See http://rake.rubyforge.org/classes/String.html#M000017
|
34
|
+
# for details of how to specify a pathmap.
|
35
|
+
# config.pathmaps.java_classes << "%{target/classes/,}p"
|
36
|
+
|
37
|
+
# Bundler support is built-in. If Warbler finds a Gemfile in the
|
38
|
+
# project directory, it will be used to collect the gems to bundle
|
39
|
+
# in your application. If you wish to explicitly disable this
|
40
|
+
# functionality, uncomment here.
|
41
|
+
# config.bundler = false
|
42
|
+
|
43
|
+
# An array of Bundler groups to avoid including in the war file.
|
44
|
+
# Defaults to ["development", "test", "assets"].
|
45
|
+
# config.bundle_without = []
|
46
|
+
|
47
|
+
# Other gems to be included. If you don't use Bundler or a gemspec
|
48
|
+
# file, you need to tell Warbler which gems your application needs
|
49
|
+
# so that they can be packaged in the archive.
|
50
|
+
# For Rails applications, the Rails gems are included by default
|
51
|
+
# unless the vendor/rails directory is present.
|
52
|
+
# config.gems += ["activerecord-jdbcmysql-adapter", "jruby-openssl"]
|
53
|
+
# config.gems << "tzinfo"
|
54
|
+
|
55
|
+
# Uncomment this if you don't want to package rails gem.
|
56
|
+
# config.gems -= ["rails"]
|
57
|
+
|
58
|
+
# The most recent versions of gems are used.
|
59
|
+
# You can specify versions of gems by using a hash assignment:
|
60
|
+
# config.gems["rails"] = "2.3.10"
|
61
|
+
|
62
|
+
# You can also use regexps or Gem::Dependency objects for flexibility or
|
63
|
+
# finer-grained control.
|
64
|
+
# config.gems << /^merb-/
|
65
|
+
# config.gems << Gem::Dependency.new("merb-core", "= 0.9.3")
|
66
|
+
|
67
|
+
# Include gem dependencies not mentioned specifically. Default is
|
68
|
+
# true, uncomment to turn off.
|
69
|
+
# config.gem_dependencies = false
|
70
|
+
|
71
|
+
# Array of regular expressions matching relative paths in gems to be
|
72
|
+
# excluded from the war. Defaults to empty, but you can set it like
|
73
|
+
# below, which excludes test files.
|
74
|
+
# config.gem_excludes = [/^(test|spec)\//]
|
75
|
+
|
76
|
+
# Pathmaps for controlling how application files are copied into the archive
|
77
|
+
# config.pathmaps.application = ["WEB-INF/%p"]
|
78
|
+
|
79
|
+
# Name of the archive (without the extension). Defaults to the basename
|
80
|
+
# of the project directory.
|
81
|
+
config.jar_name = "occi"
|
82
|
+
|
83
|
+
# Name of the MANIFEST.MF template for the war file. Defaults to a simple
|
84
|
+
# MANIFEST.MF that contains the version of Warbler used to create the war file.
|
85
|
+
# config.manifest_file = "config/MANIFEST.MF"
|
86
|
+
|
87
|
+
# When using the 'compiled' feature and specified, only these Ruby
|
88
|
+
# files will be compiled. Default is to compile all \.rb files in
|
89
|
+
# the application.
|
90
|
+
# config.compiled_ruby_files = FileList['app/**/*.rb']
|
91
|
+
|
92
|
+
# === War files only below here ===
|
93
|
+
|
94
|
+
# Path to the pre-bundled gem directory inside the war file. Default
|
95
|
+
# is 'WEB-INF/gems'. Specify path if gems are already bundled
|
96
|
+
# before running Warbler. This also sets 'gem.path' inside web.xml.
|
97
|
+
# config.gem_path = "WEB-INF/vendor/bundler_gems"
|
98
|
+
|
99
|
+
# Files for WEB-INF directory (next to web.xml). This contains
|
100
|
+
# web.xml by default. If there is an .erb-File it will be processed
|
101
|
+
# with webxml-config. You may want to exclude this file via
|
102
|
+
# config.excludes.
|
103
|
+
# config.webinf_files += FileList["jboss-web.xml"]
|
104
|
+
|
105
|
+
# Files to be included in the root of the webapp. Note that files in public
|
106
|
+
# will have the leading 'public/' part of the path stripped during staging.
|
107
|
+
# config.public_html = FileList["public/**/*", "doc/**/*"]
|
108
|
+
|
109
|
+
# Pathmaps for controlling how public HTML files are copied into the .war
|
110
|
+
# config.pathmaps.public_html = ["%{public/,}p"]
|
111
|
+
|
112
|
+
# Embedded webserver to use with the 'executable' feature. Currently supported
|
113
|
+
# webservers are:
|
114
|
+
# * <tt>winstone</tt> (default) - Winstone 0.9.10 from sourceforge
|
115
|
+
# * <tt>jenkins-ci.winstone</tt> - Improved Winstone from Jenkins CI
|
116
|
+
# * <tt>jetty</tt> - Embedded Jetty from Eclipse
|
117
|
+
# config.webserver = 'jetty'
|
118
|
+
|
119
|
+
# Value of RAILS_ENV for the webapp -- default as shown below
|
120
|
+
# config.webxml.rails.env = ENV['RAILS_ENV'] || 'production'
|
121
|
+
|
122
|
+
# Application booter to use, one of :rack, :rails, or :merb (autodetected by default)
|
123
|
+
# config.webxml.booter = :rails
|
124
|
+
|
125
|
+
# Set JRuby to run in 1.9 mode.
|
126
|
+
# config.webxml.jruby.compat.version = "1.9"
|
127
|
+
|
128
|
+
# When using the :rack booter, "Rackup" script to use.
|
129
|
+
# - For 'rackup.path', the value points to the location of the rackup
|
130
|
+
# script in the web archive file. You need to make sure this file
|
131
|
+
# gets included in the war, possibly by adding it to config.includes
|
132
|
+
# or config.webinf_files above.
|
133
|
+
# - For 'rackup', the rackup script you provide as an inline string
|
134
|
+
# is simply embedded in web.xml.
|
135
|
+
# The script is evaluated in a Rack::Builder to load the application.
|
136
|
+
# Examples:
|
137
|
+
# config.webxml.rackup.path = 'WEB-INF/hello.ru'
|
138
|
+
# config.webxml.rackup = %{require './lib/demo'; run Rack::Adapter::Camping.new(Demo)}
|
139
|
+
# config.webxml.rackup = require 'cgi' && CGI::escapeHTML(File.read("config.ru"))
|
140
|
+
|
141
|
+
# Control the pool of Rails runtimes. Leaving unspecified means
|
142
|
+
# the pool will grow as needed to service requests. It is recommended
|
143
|
+
# that you fix these values when running a production server!
|
144
|
+
# If you're using threadsafe! mode, you probably don't want to set these values,
|
145
|
+
# since 1 runtime(default for threadsafe mode) will be enough.
|
146
|
+
# config.webxml.jruby.min.runtimes = 2
|
147
|
+
# config.webxml.jruby.max.runtimes = 4
|
148
|
+
|
149
|
+
# JNDI data source name
|
150
|
+
# config.webxml.jndi = 'jdbc/rails'
|
151
|
+
end
|
data/doc/macosx.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# rOCCI on Mac OS X
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
To use a recent version of Ruby on Mac OS X, a few preparations are needed. Installing Ruby on Apple Mac OS X is not as
|
6
|
+
straightforward as it is on other platforms, hence following detailed instructions.
|
7
|
+
|
8
|
+
1. Install the latest version of Xcode either
|
9
|
+
[from the Mac OS X App Store](itms://itunes.apple.com/de/app/xcode/id497799835?mt=12#) or by downloading it from
|
10
|
+
[[http://developer.apple.com]] and then installing the package.
|
11
|
+
2. Open Xcode, then download and install the Xcode command line tools (Menu->Xcode->Preferences->Downloads)
|
12
|
+
3. In the Terminal, install RVM with `curl -L https://get.rvm.io | bash -s stable`
|
13
|
+
4. Read the plattform requirements for your specific setup by running `rvm requirements` in the Terminal. Execute any
|
14
|
+
tasks mentioned there for installing Ruby 1.9.3 (you can ignore hints for Ruby 1.8.7). If you need to install additional
|
15
|
+
packages it is recommended to use Homebew for it (unless you already use MacPorts). To install Homebrew paste the
|
16
|
+
following in your Terminal `ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"`
|
17
|
+
5. Install Ruby 1.9.3 with `rvm install ruby-1.9.3`
|
18
|
+
|
19
|
+
Now that you have Ruby 1.9.3 installed, you can intall rOCCI.
|
20
|
+
|
21
|
+
To install the most recent stable version
|
22
|
+
|
23
|
+
gem install occi
|
24
|
+
|
25
|
+
To install the most recent beta version
|
26
|
+
|
27
|
+
gem install occi --pre
|
data/examples/dsl_example.rb
CHANGED
@@ -17,13 +17,22 @@ CA_PATH = '/etc/grid-security/certificates'
|
|
17
17
|
ENDPOINT = 'https://localhost:3300'
|
18
18
|
|
19
19
|
## establish a connection
|
20
|
-
connect(
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
20
|
+
connect(
|
21
|
+
:http,
|
22
|
+
{
|
23
|
+
:endpoint => ENDPOINT,
|
24
|
+
:auth => {
|
25
|
+
:type => "x509",
|
26
|
+
:user_cert => USER_CERT,
|
27
|
+
:user_cert_password => USER_CERT_PASSWORD,
|
28
|
+
:ca_path => CA_PATH
|
29
|
+
},
|
30
|
+
:log => {
|
31
|
+
:out => STDERR,
|
32
|
+
:level => Occi::Log::DEBUG
|
33
|
+
}
|
34
|
+
}
|
35
|
+
)
|
27
36
|
|
28
37
|
puts "\n\nListing all available resource types:"
|
29
38
|
resource_types.each do |type|
|
@@ -14,13 +14,19 @@ CA_PATH = '/etc/grid-security/certificates'
|
|
14
14
|
ENDPOINT = 'https://localhost:3300'
|
15
15
|
|
16
16
|
## get an OCCI::Api::Client::ClientHttp instance
|
17
|
-
client = Occi::Api::Client::ClientHttp.new(
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
17
|
+
client = Occi::Api::Client::ClientHttp.new({
|
18
|
+
:endpoint => ENDPOINT,
|
19
|
+
:auth => {
|
20
|
+
:type => "x509",
|
21
|
+
:user_cert => USER_CERT,
|
22
|
+
:user_cert_password => USER_CERT_PASSWORD,
|
23
|
+
:ca_path => CA_PATH
|
24
|
+
},
|
25
|
+
:log => {
|
26
|
+
:out => STDERR,
|
27
|
+
:level => Occi::Log::DEBUG
|
28
|
+
}
|
29
|
+
})
|
24
30
|
|
25
31
|
puts "\n\nListing all available resource types:"
|
26
32
|
client.get_resource_types.each do |type|
|