lorj 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -9
- data/example/students_1/student_v1.md +1 -1
- data/example/students_2/student_v2.md +1 -1
- data/example/students_3/student_v3.md +1 -1
- data/example/students_4/student_v4.md +17 -0
- data/lib/core_process/cloud/process/images.rb +18 -3
- data/lib/lorj/version.rb +1 -1
- data/lib/providers/hpcloud/compute.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed752c1a4519969b83c7f240f0ecbd36e1b5c691
|
4
|
+
data.tar.gz: 1e7dd04ad2bedb015039056a6c6cc3e373c37c22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6cd78cba3f041dd7982afc192776075a9e3548195f0d8984dd194645b248986e21ccabbbee5015eb166812a89251ae553514e3247bd9780c1acd9f41c25042b
|
7
|
+
data.tar.gz: 6f42a29853960ae4778c3751226b56775ede547911a3bd691b14cf6297df4049c358ea66c1c3528c040c20e4c76a877540bc99f9d4294ce20d766c6bd76f5dae
|
data/README.md
CHANGED
@@ -71,40 +71,40 @@ next, we will write 3 versions, which will introduce how to deal with process an
|
|
71
71
|
* version 1:
|
72
72
|
Writing your first 'do nothing' process, with no controller.
|
73
73
|
|
74
|
-
[Details is explained here](example/students_1/
|
74
|
+
[Details is explained here](https://github.com/forj-oss/lorj/blob/master/example/students_1/student_v1.md)
|
75
75
|
|
76
76
|
* version 2:
|
77
77
|
Complete the process to have create/query/get and delete capability, with mock controller.
|
78
78
|
The mock controller is basically a controller keeping data in memory.
|
79
79
|
|
80
|
-
[Details is explained here](example/students_2/
|
80
|
+
[Details is explained here](https://github.com/forj-oss/lorj/blob/master/example/students_2/student_v2.md)
|
81
81
|
|
82
82
|
* version 3:
|
83
83
|
In this version, we will just create a controller, to replace mock.
|
84
84
|
|
85
|
-
[Details is explained here](example/students_3/
|
85
|
+
[Details is explained here](https://github.com/forj-oss/lorj/blob/master/example/students_3/student_v3.md)
|
86
86
|
|
87
87
|
* version 4:
|
88
88
|
In this version, we are going to improve the process, to find way to simplify
|
89
89
|
the previous code.
|
90
90
|
|
91
|
-
[Details is explained here](example/students_4/
|
91
|
+
[Details is explained here](https://github.com/forj-oss/lorj/blob/master/example/students_4/student_v4.md)
|
92
92
|
|
93
93
|
* version 5:
|
94
94
|
Update the version 4 to fully implement the example of an yaml_student API.
|
95
95
|
ie :
|
96
|
-
|
96
|
+
Reproducing what the main `examples/yaml_students/students.rb` is doing.<BR>
|
97
97
|
The API is `examples/yaml_students/yaml_students.rb`
|
98
98
|
|
99
|
-
[Details is explained here](example/students_5/
|
99
|
+
[Details is explained here](https://github.com/forj-oss/lorj/blob/master/example/students_5/student_v5.md)
|
100
100
|
|
101
101
|
# What next?
|
102
102
|
|
103
|
-
If you want to understand the concept, check [here](lib/
|
103
|
+
If you want to understand the concept, check [here](https://github.com/forj-oss/lorj/blob/master/lib/concept.md)
|
104
104
|
|
105
|
-
If you want to get an overview of functionnalities per context, see [here](lib/
|
105
|
+
If you want to get an overview of functionnalities per context, see [here](https://github.com/forj-oss/lorj/blob/master/lib/overview.md)
|
106
106
|
|
107
|
-
For details, see API documentation.
|
107
|
+
For details, [see API documentation](http://www.rubydoc.info/gems/lorj).
|
108
108
|
|
109
109
|
# Contributing to Lorj
|
110
110
|
|
@@ -112,4 +112,4 @@ There is 2 warnings.
|
|
112
112
|
Complete the process to have create/query/get and delete capability, with mock controller.
|
113
113
|
The mock controller is basically a controller keeping data in memory.
|
114
114
|
|
115
|
-
[Details is explained here](
|
115
|
+
[Details is explained here](https://github.com/forj-oss/lorj/blob/master/example/students_2/student_v2.md)
|
@@ -87,4 +87,4 @@ Let's move to the most interesting version. Integrate an API example in lorj!
|
|
87
87
|
|
88
88
|
# Next?
|
89
89
|
|
90
|
-
[Details is explained here](
|
90
|
+
[Details is explained here](https://github.com/forj-oss/lorj/blob/master/example/students_3/student_v3.md)
|
@@ -280,4 +280,4 @@ You can enhance your main by selecting between mock or yaml_students
|
|
280
280
|
In next version, we will enhance the process to remove duplicates, and ensure
|
281
281
|
a student is created if it does not exist.
|
282
282
|
|
283
|
-
[Details is explained here](example/students_4/
|
283
|
+
[Details is explained here](https://github.com/forj-oss/lorj/blob/master/example/students_4/student_v4.md)
|
@@ -189,3 +189,20 @@ As you saw, the main program has not changed. Just process and controllers.
|
|
189
189
|
|
190
190
|
In the next version is the full implementation of what `yaml_students/students.rb`
|
191
191
|
main basic tool running the YamlStudent API.
|
192
|
+
|
193
|
+
# next?
|
194
|
+
|
195
|
+
You can update version 5 to fully implement the example of the yaml_student API.
|
196
|
+
|
197
|
+
ie :
|
198
|
+
|
199
|
+
Reproducing what the main `examples/yaml_students/students.rb` is doing.<BR>
|
200
|
+
The API is `examples/yaml_students/yaml_students.rb`
|
201
|
+
|
202
|
+
[Details is explained here](https://github.com/forj-oss/lorj/blob/master/example/students_5/student_v5.md)
|
203
|
+
|
204
|
+
If you want to understand the concept, check [here](https://github.com/forj-oss/lorj/blob/master/lib/concept.md)
|
205
|
+
|
206
|
+
If you want to get an overview of functionnalities per context, see [here](https://github.com/forj-oss/lorj/blob/master/lib/overview.md)
|
207
|
+
|
208
|
+
For details, [see API documentation](http://www.rubydoc.info/gems/lorj).
|
@@ -54,10 +54,14 @@ class CloudProcess
|
|
54
54
|
rescue => e
|
55
55
|
retry unless ssl_error_obj.error_detected(e.message, e.backtrace, e)
|
56
56
|
end
|
57
|
+
add_ssh_user(images)
|
58
|
+
images
|
59
|
+
end
|
60
|
+
|
61
|
+
def add_ssh_user(images)
|
57
62
|
images.each do |image|
|
58
63
|
image[:ssh_user] = ssh_user(image[:name])
|
59
64
|
end
|
60
|
-
images
|
61
65
|
end
|
62
66
|
|
63
67
|
def ssh_user(image_name)
|
@@ -65,6 +69,17 @@ class CloudProcess
|
|
65
69
|
return 'centos' if image_name =~ /centos/i
|
66
70
|
'ubuntu'
|
67
71
|
end
|
72
|
+
|
73
|
+
def forj_get_image(sCloudObj, sId, _hParams)
|
74
|
+
ssl_error_obj = SSLErrorMgt.new
|
75
|
+
begin
|
76
|
+
image = controller_get(sCloudObj, sId)
|
77
|
+
rescue => e
|
78
|
+
retry unless ssl_error_obj.error_detected(e.message, e.backtrace, e)
|
79
|
+
end
|
80
|
+
add_ssh_user([image])
|
81
|
+
image
|
82
|
+
end
|
68
83
|
end
|
69
84
|
|
70
85
|
# Define framework object on BaseDefinition
|
@@ -75,8 +90,8 @@ module Lorj
|
|
75
90
|
define_obj(:image,
|
76
91
|
|
77
92
|
:create_e => :forj_get_or_create_image,
|
78
|
-
:query_e => :forj_query_image
|
79
|
-
|
93
|
+
:query_e => :forj_query_image,
|
94
|
+
:get_e => :forj_get_image
|
80
95
|
# :update_e => :forj_update_image
|
81
96
|
# :delete_e => :forj_delete_image
|
82
97
|
)
|
data/lib/lorj/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lorj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- forj team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|