ruby_aem 1.0.19 → 1.1.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: b683ebcb4d5d0623b410102cc07623d0bc07ea6b
4
- data.tar.gz: b0571ec2aa221353484b79247c6fc3e77d4be386
3
+ metadata.gz: 97851edf1e7a4b4c838864604a991355c9ef0071
4
+ data.tar.gz: 99b3c4f1f07766110d9174c36e37f60b44cd0975
5
5
  SHA512:
6
- metadata.gz: 9c27de523856d5ba67e28383b20a12d2eacdda5323f765b55196dacc8ea33fc5e063691ac550627b6d88e041af32e9fc0583ab5daba5eb4012b521607b6ce664
7
- data.tar.gz: 1746e50ceff0c78e4a153ecad7e76adc12e6a2b399e5f392a33ae9ad7648f2a1729aa8df917ef3438cc4779314d46629e8ad776529f626cc1907bc08dc903459
6
+ metadata.gz: f8ac2b962b2c7a669e2cdf366b29e827b64e9bc3b1fd489e7d6e66cd04b01d4e2b98b4056c96473406508de9a88ffa9d97a2d0df17222816d7b56e83b104177c
7
+ data.tar.gz: 67bf883b2bac58be4328c2d96b68b6e1dba2bc7730bb2b39b35e933e05f692fe3062f984d918ddb649e19b914204083c61b57a82ea3af22c75be80032fa9461f
@@ -21,6 +21,16 @@ aem:
21
21
  200:
22
22
  handler: json_aem_health_check
23
23
  message: 'AEM health check retrieved'
24
+ get_agents:
25
+ api: sling
26
+ operation: getAgents
27
+ params:
28
+ required:
29
+ runmode: '%{run_mode}'
30
+ responses:
31
+ 200:
32
+ handler: json_agents
33
+ message: 'Retrieved agents on %{run_mode}'
24
34
  bundle:
25
35
  responses:
26
36
  404:
@@ -84,6 +94,7 @@ flushagent:
84
94
  jcrcontenttrigger_specific: true
85
95
  jcrcontentcqtemplate: /libs/cq/replication/templates/agent
86
96
  jcrcontentenabled: true
97
+ jcrcontentssl: '%{ssl}'
87
98
  responses:
88
99
  200:
89
100
  handler: simple
@@ -107,5 +107,30 @@ module RubyAem
107
107
 
108
108
  end
109
109
 
110
+ # Extract a list of agent names from getAgents JSON payload.
111
+ #
112
+ # @param response HTTP response containing status_code, body, and headers
113
+ # @param response_spec response specification as configured in conf/spec.yaml
114
+ # @param call_params additional call_params information
115
+ # @return RubyAem::Result
116
+ def Handlers.json_agents(response, response_spec, call_params)
117
+
118
+ json = JSON.parse(response.body)
119
+
120
+ agent_names = []
121
+ json.each do |key, value|
122
+ if !key.start_with? 'jcr:' and !key.start_with? 'rep:'
123
+ agent_names.push(key)
124
+ end
125
+ end
126
+
127
+ message = response_spec['message'] % call_params
128
+
129
+ result = RubyAem::Result.new(message, response)
130
+ result.data = agent_names
131
+ result
132
+
133
+ end
134
+
110
135
  end
111
136
  end
@@ -142,6 +142,15 @@ module RubyAem
142
142
  result
143
143
  end
144
144
 
145
+ # List the name of all agents under /etc/replication.
146
+ #
147
+ # @param run_mode AEM run mode: author or publish
148
+ # @return RubyAem::Result
149
+ def get_agents(run_mode)
150
+ @call_params[:run_mode] = run_mode
151
+ @client.call(self.class, __callee__.to_s, @call_params)
152
+ end
153
+
145
154
  end
146
155
  end
147
156
  end
@@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  =end
16
+ require 'uri'
16
17
 
17
18
  module RubyAem
18
19
  module Resources
@@ -50,6 +51,10 @@ module RubyAem
50
51
  @call_params[:title] = title
51
52
  @call_params[:description] = description
52
53
  @call_params[:dest_base_url] = dest_base_url
54
+
55
+ uri = URI.parse(dest_base_url)
56
+ @call_params[:ssl] = uri.scheme == 'https' ? 'relaxed' : ''
57
+
53
58
  @call_params = @call_params.merge(opts)
54
59
  @client.call(self.class, __callee__.to_s, @call_params)
55
60
  end
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: 1.0.19
4
+ version: 1.1.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: 2017-05-04 00:00:00.000000000 Z
12
+ date: 2017-05-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri