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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 186c6ba434808e7cc8e6d5ac0e7e703118698cbd
4
- data.tar.gz: f53774dadcf6ed48fdcee6f3519d13461109bbf6
3
+ metadata.gz: ed752c1a4519969b83c7f240f0ecbd36e1b5c691
4
+ data.tar.gz: 1e7dd04ad2bedb015039056a6c6cc3e373c37c22
5
5
  SHA512:
6
- metadata.gz: 60b75966452c090d07aec57ff3bdf67e5100ce575be45fe038ffe256c863c8415edfad2ce23343af60ac52b93fa67818b1cac2e653be2de2844e3b34b0ad2e1d
7
- data.tar.gz: 8e1b1c7ade0845986befba7a2bb0a34a34b519b0a5d7922fe9b3195692b205438770c2f7d261a2a4ae28ce3fb578905cfe96b0af9a7ebc67e7d8edd252287f4f
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/student_v1_md.html)
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/student_v2_md.html)
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/student_v3_md.html)
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/student_v4_md.html)
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
- Reproducind what the main `examples/yaml_students/students.rb` is doing.<BR>
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/student_v5_md.html)
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/concept_md.html)
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/overview_md.html)
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](../students_2/student_v2_md.html)
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](../students_3/student_v3_md.html)
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/student_v4_md.html)
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
- # :get_e => :forj_get_image
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
@@ -16,5 +16,5 @@
16
16
 
17
17
  # Lorj version
18
18
  module Lorj
19
- VERSION = '1.0.2'
19
+ VERSION = '1.0.3'
20
20
  end
@@ -98,4 +98,8 @@ module HPCompute
98
98
  def self.delete_server(oComputeConnect, server)
99
99
  oComputeConnect.servers.get(server.id).destroy
100
100
  end
101
+
102
+ def self.get_image(oComputeConnect, oImageID)
103
+ oComputeConnect.images.get(oImageID)
104
+ end
101
105
  end
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.2
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-10 00:00:00.000000000 Z
11
+ date: 2015-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler