ruby_aem 2.4.0 → 2.5.0

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: 9c9215f9a650d92319539dde5ba0b8615faee5e5
4
- data.tar.gz: 8708b4749e05bfe631147e37cef177e26aa875bb
3
+ metadata.gz: 21a31d6c9da74d8fdcc7158eb768496ec2d482eb
4
+ data.tar.gz: d10ee973d2a14ae04bd0c4531759811c8acc0753
5
5
  SHA512:
6
- metadata.gz: b12dcdef53ba5294d64b683aa5e9e3c66162f8466586ac747eba0ba2625430c37a732222310956f0afc35d7e7495d19e2603dac7deeada302068b24dbe08867a
7
- data.tar.gz: 6bc342f1c6b44bc5b0a99fee76322865387f7969b706e7b828fbf3195d21b14b4537ff8f3e640477b26bbeeb07fcd899d97685999a8405fbb86f99a7ca8f6a1a
6
+ metadata.gz: bb40c1a8ba9da476e13c2d1da1e0226e5405494cdbdf3a01c0e0c6aa66c54af109c1fddc81e2ac7c98013677851f40d2d08b68920a546263eb17262a2aedc480
7
+ data.tar.gz: 714b5db42bbc030af70ea0f888f897e171b1acdd52e8d3ebb1322b037e7d73e789c63713e81393e6a38e00c5f28a12741244212e6fe097c0dfbfb694981cc789
data/conf/spec.yaml CHANGED
@@ -21,6 +21,18 @@ aem:
21
21
  200:
22
22
  handler: json_aem_health_check
23
23
  message: 'AEM health check retrieved'
24
+ get_package_manager_servlet_status:
25
+ api: crx
26
+ operation: getPackageManagerServlet
27
+ params:
28
+ required:
29
+ responses:
30
+ 405:
31
+ handler: simple_true
32
+ message: 'Package Manager active'
33
+ 404:
34
+ handler: simple_false
35
+ message: 'Package Manager disabled'
24
36
  get_agents:
25
37
  api: sling
26
38
  operation: getAgents
@@ -60,6 +60,13 @@ module RubyAem
60
60
  @client.call(self.class, __callee__.to_s, @call_params)
61
61
  end
62
62
 
63
+ # Retrieve AEM CRX Package Manager Servlet status state.
64
+ #
65
+ # @return RubyAem::Result
66
+ def get_package_manager_servlet_status
67
+ @client.call(self.class, __callee__.to_s, @call_params)
68
+ end
69
+
63
70
  # Retrieve AEM login page with retries until it is successful.
64
71
  #
65
72
  # @param opts optional parameters:
@@ -151,6 +158,39 @@ module RubyAem
151
158
  result
152
159
  end
153
160
 
161
+ # Retrieve AEM CRX Package Manager Servlet status state. with retries until its status is OK.
162
+ #
163
+ # @param opts optional parameters:
164
+ # - _retries: retries library's options (http://www.rubydoc.info/gems/retries/0.0.5#Usage), restricted to max_trie, base_sleep_seconds, max_sleep_seconds
165
+ # @return RubyAem::Result
166
+ def get_package_manager_servlet_status_wait_until_ready(
167
+ opts = {
168
+ _retries: {
169
+ max_tries: 30,
170
+ base_sleep_seconds: 2,
171
+ max_sleep_seconds: 2
172
+ }
173
+ }
174
+ )
175
+ opts[:_retries] ||= {}
176
+ opts[:_retries][:max_tries] ||= 30
177
+ opts[:_retries][:base_sleep_seconds] ||= 2
178
+ opts[:_retries][:max_sleep_seconds] ||= 2
179
+
180
+ # ensure integer retries setting (Puppet 3 passes numeric string)
181
+ opts[:_retries][:max_tries] = opts[:_retries][:max_tries].to_i
182
+ opts[:_retries][:base_sleep_seconds] = opts[:_retries][:base_sleep_seconds].to_i
183
+ opts[:_retries][:max_sleep_seconds] = opts[:_retries][:max_sleep_seconds].to_i
184
+
185
+ result = nil
186
+ with_retries(max_tries: opts[:_retries][:max_tries], base_sleep_seconds: opts[:_retries][:base_sleep_seconds], max_sleep_seconds: opts[:_retries][:max_sleep_seconds]) { |retries_count|
187
+ result = get_package_manager_servlet_status
188
+ puts format('Check CRX Package Manager service attempt #%<retries_count>d: %<result_message>s', retries_count: retries_count, result_message: result.message)
189
+ raise StandardError.new(result.message) if result.data == false
190
+ }
191
+ result
192
+ end
193
+
154
194
  # List the name of all agents under /etc/replication.
155
195
  #
156
196
  # @param run_mode AEM run mode: author or publish
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_aem
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shine Solutions
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-01-07 00:00:00.000000000 Z
12
+ date: 2019-02-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri