ruby_aem 1.0.12 → 1.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/conf/spec.yaml +140 -2
- data/lib/ruby_aem/resources/outbox_replication_agent.rb +77 -0
- data/lib/ruby_aem/resources/reverse_replication_agent.rb +79 -0
- data/lib/ruby_aem.rb +20 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc959f1b88c9396ec820a4c8e0cf8331ed08f76d
|
4
|
+
data.tar.gz: b046f12c5210eea8d24fa5aa832fd126daee9748
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d738fc6972793e3162776f74ac50912b4e4018f40f4cb7154bcda41f3c60d65ce70ae2eeb4138d99c7cebbaffe598ce6e1102026355b61a8ff50a88f2b7b13a8
|
7
|
+
data.tar.gz: e65927e6dc78e51d86844c8d61ddd53adee726d7f6c9d5d3dee0bcf493e3775d5249700ed0aa5c0fd74ea54d5104429c02b0e431d5a17a4fd2d78fd0e5e011cb
|
data/conf/spec.yaml
CHANGED
@@ -55,7 +55,7 @@ flushagent:
|
|
55
55
|
jcrcontentcqname: '%{name}'
|
56
56
|
jcrcontentjcrtitle: '%{title}'
|
57
57
|
jcrcontentjcrdescription: '%{description}'
|
58
|
-
jcrcontentslingresource_type:
|
58
|
+
jcrcontentslingresource_type: cq/replication/components/agent
|
59
59
|
jcrcontenttransport_uri: '%{dest_base_url}/dispatcher/invalidate.cache'
|
60
60
|
jcrcontentlog_level: '%{log_level}'
|
61
61
|
jcrcontentno_versioning: true
|
@@ -101,6 +101,9 @@ flushagent:
|
|
101
101
|
302:
|
102
102
|
handler: simple_true
|
103
103
|
message: 'Flush agent %{name} exists on %{run_mode}'
|
104
|
+
403:
|
105
|
+
handler: simple_false
|
106
|
+
message: 'Flush agent %{name} not found on %{run_mode}'
|
104
107
|
404:
|
105
108
|
handler: simple_false
|
106
109
|
message: 'Flush agent %{name} not found on %{run_mode}'
|
@@ -162,6 +165,9 @@ group:
|
|
162
165
|
302:
|
163
166
|
handler: simple_true
|
164
167
|
message: 'Group %{name} exists at /%{path}/%{authorizable_id}'
|
168
|
+
403:
|
169
|
+
handler: simple_false
|
170
|
+
message: 'Group %{name} not found'
|
165
171
|
404:
|
166
172
|
handler: simple_false
|
167
173
|
message: 'Group %{name} not found'
|
@@ -486,7 +492,7 @@ replicationagent:
|
|
486
492
|
jcrcontentcqname: '%{name}'
|
487
493
|
jcrcontentjcrtitle: '%{title}'
|
488
494
|
jcrcontentjcrdescription: '%{description}'
|
489
|
-
jcrcontentslingresource_type:
|
495
|
+
jcrcontentslingresource_type: cq/replication/components/agent
|
490
496
|
jcrcontentserialization_type: durbo
|
491
497
|
jcrcontenttransport_uri: '%{dest_base_url}/bin/receive?sling:authRequestLogin=1'
|
492
498
|
jcrcontenttransport_user: '%{transport_user}'
|
@@ -524,9 +530,138 @@ replicationagent:
|
|
524
530
|
302:
|
525
531
|
handler: simple_true
|
526
532
|
message: 'Replication agent %{name} exists on %{run_mode}'
|
533
|
+
403:
|
534
|
+
handler: simple_false
|
535
|
+
message: 'Replication agent %{name} not found on %{run_mode}'
|
527
536
|
404:
|
528
537
|
handler: simple_false
|
529
538
|
message: 'Replication agent %{name} not found on %{run_mode}'
|
539
|
+
outboxreplicationagent:
|
540
|
+
responses:
|
541
|
+
404:
|
542
|
+
handler: simple_error
|
543
|
+
message: 'Outbox replication agent %{name} not found on %{run_mode}'
|
544
|
+
actions:
|
545
|
+
create_update:
|
546
|
+
api: sling
|
547
|
+
operation: postAgent
|
548
|
+
params:
|
549
|
+
required:
|
550
|
+
runmode: '%{run_mode}'
|
551
|
+
name: '%{name}'
|
552
|
+
optional:
|
553
|
+
jcrprimary_type: cq:Page
|
554
|
+
jcrcontentcqname: '%{name}'
|
555
|
+
jcrcontentjcrtitle: '%{title}'
|
556
|
+
jcrcontentjcrdescription: '%{description}'
|
557
|
+
jcrcontentslingresource_type: cq/replication/components/agent
|
558
|
+
jcrcontenttransport_uri: repo://var/replication/outbox
|
559
|
+
jcrcontentno_versioning: true
|
560
|
+
jcrcontentlog_level: '%{log_level}'
|
561
|
+
jcrcontentcqtemplate: /libs/cq/replication/templates/agent
|
562
|
+
jcrcontentenabled: true
|
563
|
+
jcrcontenttrigger_distribute: true
|
564
|
+
jcrcontenttrigger_modified: true
|
565
|
+
jcrcontenttrigger_specific: true
|
566
|
+
jcrcontentuser_id: '%{user_id}'
|
567
|
+
responses:
|
568
|
+
200:
|
569
|
+
handler: simple
|
570
|
+
message: 'Outbox replication agent %{name} updated on %{run_mode}'
|
571
|
+
201:
|
572
|
+
handler: simple
|
573
|
+
message: 'Outbox replication agent %{name} created on %{run_mode}'
|
574
|
+
delete:
|
575
|
+
api: sling
|
576
|
+
operation: deleteAgent
|
577
|
+
params:
|
578
|
+
required:
|
579
|
+
runmode: '%{run_mode}'
|
580
|
+
name: '%{name}'
|
581
|
+
responses:
|
582
|
+
204:
|
583
|
+
handler: simple
|
584
|
+
message: 'Outbox replication agent %{name} deleted on %{run_mode}'
|
585
|
+
exists:
|
586
|
+
api: sling
|
587
|
+
operation: getAgent
|
588
|
+
params:
|
589
|
+
required:
|
590
|
+
runmode: '%{run_mode}'
|
591
|
+
name: '%{name}'
|
592
|
+
responses:
|
593
|
+
302:
|
594
|
+
handler: simple_true
|
595
|
+
message: 'Outbox replication agent %{name} exists on %{run_mode}'
|
596
|
+
403:
|
597
|
+
handler: simple_false
|
598
|
+
message: 'Outbox replication agent %{name} not found on %{run_mode}'
|
599
|
+
404:
|
600
|
+
handler: simple_false
|
601
|
+
message: 'Outbox replication agent %{name} not found on %{run_mode}'
|
602
|
+
reversereplicationagent:
|
603
|
+
responses:
|
604
|
+
404:
|
605
|
+
handler: simple_error
|
606
|
+
message: 'Reverse replication agent %{name} not found on %{run_mode}'
|
607
|
+
actions:
|
608
|
+
create_update:
|
609
|
+
api: sling
|
610
|
+
operation: postAgent
|
611
|
+
params:
|
612
|
+
required:
|
613
|
+
runmode: '%{run_mode}'
|
614
|
+
name: '%{name}'
|
615
|
+
optional:
|
616
|
+
jcrprimary_type: cq:Page
|
617
|
+
jcrcontentcqname: '%{name}'
|
618
|
+
jcrcontentjcrtitle: '%{title}'
|
619
|
+
jcrcontentjcrdescription: '%{description}'
|
620
|
+
jcrcontentslingresource_type: cq/replication/components/agent
|
621
|
+
jcrcontentserialization_type: durbo
|
622
|
+
jcrcontenttransport_uri: '%{dest_base_url}/bin/receive?sling:authRequestLogin=1'
|
623
|
+
jcrcontenttransport_user: '%{transport_user}'
|
624
|
+
jcrcontenttransport_password: '%{transport_password}'
|
625
|
+
jcrcontentlog_level: '%{log_level}'
|
626
|
+
jcrcontentretry_delay: '%{retry_delay}'
|
627
|
+
jcrcontentcqtemplate: /libs/cq/replication/templates/agent
|
628
|
+
jcrcontentenabled: true
|
629
|
+
jcrcontentreverse_replication: true
|
630
|
+
responses:
|
631
|
+
200:
|
632
|
+
handler: simple
|
633
|
+
message: 'Reverse replication agent %{name} updated on %{run_mode}'
|
634
|
+
201:
|
635
|
+
handler: simple
|
636
|
+
message: 'Reverse replication agent %{name} created on %{run_mode}'
|
637
|
+
delete:
|
638
|
+
api: sling
|
639
|
+
operation: deleteAgent
|
640
|
+
params:
|
641
|
+
required:
|
642
|
+
runmode: '%{run_mode}'
|
643
|
+
name: '%{name}'
|
644
|
+
responses:
|
645
|
+
204:
|
646
|
+
handler: simple
|
647
|
+
message: 'Reverse replication agent %{name} deleted on %{run_mode}'
|
648
|
+
exists:
|
649
|
+
api: sling
|
650
|
+
operation: getAgent
|
651
|
+
params:
|
652
|
+
required:
|
653
|
+
runmode: '%{run_mode}'
|
654
|
+
name: '%{name}'
|
655
|
+
responses:
|
656
|
+
302:
|
657
|
+
handler: simple_true
|
658
|
+
message: 'Reverse replication agent %{name} exists on %{run_mode}'
|
659
|
+
403:
|
660
|
+
handler: simple_false
|
661
|
+
message: 'Reverse replication agent %{name} not found on %{run_mode}'
|
662
|
+
404:
|
663
|
+
handler: simple_false
|
664
|
+
message: 'Reverse replication agent %{name} not found on %{run_mode}'
|
530
665
|
repository:
|
531
666
|
actions:
|
532
667
|
block_writes:
|
@@ -607,6 +742,9 @@ user:
|
|
607
742
|
302:
|
608
743
|
handler: simple_true
|
609
744
|
message: 'User %{name} exists at /%{path}/%{authorizable_id}'
|
745
|
+
403:
|
746
|
+
handler: simple_false
|
747
|
+
message: 'User %{name} not found'
|
610
748
|
404:
|
611
749
|
handler: simple_false
|
612
750
|
message: 'User %{name} not found'
|
@@ -0,0 +1,77 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright 2016 Shine Solutions
|
3
|
+
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
you may not use this file except in compliance with the License.
|
6
|
+
You may obtain a copy of the License at
|
7
|
+
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
See the License for the specific language governing permissions and
|
14
|
+
limitations under the License.
|
15
|
+
=end
|
16
|
+
|
17
|
+
module RubyAem
|
18
|
+
module Resources
|
19
|
+
# OutboxReplicationAgent class contains API calls related to managing an AEM outbox replication agent.
|
20
|
+
class OutboxReplicationAgent
|
21
|
+
|
22
|
+
# Initialise a outbox replication agent.
|
23
|
+
#
|
24
|
+
# @param client RubyAem::Client
|
25
|
+
# @param run_mode AEM run mode: author or publish
|
26
|
+
# @param name the outbox replication agent's name, e.g. some-replication-agent
|
27
|
+
# @return new RubyAem::Resources::OutboxReplicationAgent instance
|
28
|
+
def initialize(client, run_mode, name)
|
29
|
+
@client = client
|
30
|
+
@call_params = {
|
31
|
+
run_mode: run_mode,
|
32
|
+
name: name
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
# Create or update a outbox replication agent.
|
37
|
+
#
|
38
|
+
# @param title outbox replication agent title
|
39
|
+
# @param description outbox replication agent description
|
40
|
+
# @param dest_base_url base URL of the agent target destination, e.g. https://somepublisher:4503
|
41
|
+
# @param opts optional parameters:
|
42
|
+
# - user_id: outbox agent's user ID, default is admin
|
43
|
+
# - log_level: error, info, debug, default is error
|
44
|
+
# - retry_delay: in milliseconds, default is 30000
|
45
|
+
# @return RubyAem::Result
|
46
|
+
def create_update(title, description, dest_base_url,
|
47
|
+
opts = {
|
48
|
+
user_id: 'admin',
|
49
|
+
log_level: 'error',
|
50
|
+
retry_delay: 30000
|
51
|
+
})
|
52
|
+
@call_params[:title] = title
|
53
|
+
@call_params[:description] = description
|
54
|
+
@call_params[:dest_base_url] = dest_base_url
|
55
|
+
@call_params = @call_params.merge(opts)
|
56
|
+
@client.call(self.class, __callee__.to_s, @call_params)
|
57
|
+
end
|
58
|
+
|
59
|
+
# Delete the outbox replication agent.
|
60
|
+
#
|
61
|
+
# @return RubyAem::Result
|
62
|
+
def delete()
|
63
|
+
@client.call(self.class, __callee__.to_s, @call_params)
|
64
|
+
end
|
65
|
+
|
66
|
+
# Check whether the outbox replication agent exists or not.
|
67
|
+
# If the outbox replication agent exists, this method returns a true result data,
|
68
|
+
# false otherwise.
|
69
|
+
#
|
70
|
+
# @return RubyAem::Result
|
71
|
+
def exists()
|
72
|
+
@client.call(self.class, __callee__.to_s, @call_params)
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright 2016 Shine Solutions
|
3
|
+
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
you may not use this file except in compliance with the License.
|
6
|
+
You may obtain a copy of the License at
|
7
|
+
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
See the License for the specific language governing permissions and
|
14
|
+
limitations under the License.
|
15
|
+
=end
|
16
|
+
|
17
|
+
module RubyAem
|
18
|
+
module Resources
|
19
|
+
# ReverseReplicationAgent class contains API calls related to managing an AEM reverse replication agent.
|
20
|
+
class ReverseReplicationAgent
|
21
|
+
|
22
|
+
# Initialise a reverse replication agent.
|
23
|
+
#
|
24
|
+
# @param client RubyAem::Client
|
25
|
+
# @param run_mode AEM run mode: author or publish
|
26
|
+
# @param name the reverse replication agent's name, e.g. some-replication-agent
|
27
|
+
# @return new RubyAem::Resources::ReverseReplicationAgent instance
|
28
|
+
def initialize(client, run_mode, name)
|
29
|
+
@client = client
|
30
|
+
@call_params = {
|
31
|
+
run_mode: run_mode,
|
32
|
+
name: name
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
# Create or update a reverse replication agent.
|
37
|
+
#
|
38
|
+
# @param title reverse replication agent title
|
39
|
+
# @param description reverse replication agent description
|
40
|
+
# @param dest_base_url base URL of the agent target destination, e.g. https://somepublisher:4503
|
41
|
+
# @param opts optional parameters:
|
42
|
+
# - transport_user: username for transport user, default is admin
|
43
|
+
# - transport_password: password for transport user, default is admin
|
44
|
+
# - log_level: error, info, debug, default is error
|
45
|
+
# - retry_delay: in milliseconds, default is 30000
|
46
|
+
# @return RubyAem::Result
|
47
|
+
def create_update(title, description, dest_base_url,
|
48
|
+
opts = {
|
49
|
+
transport_user: 'admin',
|
50
|
+
transport_password: 'admin',
|
51
|
+
log_level: 'error',
|
52
|
+
retry_delay: 30000
|
53
|
+
})
|
54
|
+
@call_params[:title] = title
|
55
|
+
@call_params[:description] = description
|
56
|
+
@call_params[:dest_base_url] = dest_base_url
|
57
|
+
@call_params = @call_params.merge(opts)
|
58
|
+
@client.call(self.class, __callee__.to_s, @call_params)
|
59
|
+
end
|
60
|
+
|
61
|
+
# Delete the reverse replication agent.
|
62
|
+
#
|
63
|
+
# @return RubyAem::Result
|
64
|
+
def delete()
|
65
|
+
@client.call(self.class, __callee__.to_s, @call_params)
|
66
|
+
end
|
67
|
+
|
68
|
+
# Check whether the reverse replication agent exists or not.
|
69
|
+
# If the reverse replication agent exists, this method returns a true result data,
|
70
|
+
# false otherwise.
|
71
|
+
#
|
72
|
+
# @return RubyAem::Result
|
73
|
+
def exists()
|
74
|
+
@client.call(self.class, __callee__.to_s, @call_params)
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
data/lib/ruby_aem.rb
CHANGED
@@ -24,6 +24,8 @@ require 'ruby_aem/resources/node'
|
|
24
24
|
require 'ruby_aem/resources/package'
|
25
25
|
require 'ruby_aem/resources/path'
|
26
26
|
require 'ruby_aem/resources/replication_agent'
|
27
|
+
require 'ruby_aem/resources/outbox_replication_agent'
|
28
|
+
require 'ruby_aem/resources/reverse_replication_agent'
|
27
29
|
require 'ruby_aem/resources/repository'
|
28
30
|
require 'ruby_aem/resources/user'
|
29
31
|
require 'swagger_aem'
|
@@ -151,6 +153,24 @@ module RubyAem
|
|
151
153
|
RubyAem::Resources::ReplicationAgent.new(@client, run_mode, name)
|
152
154
|
end
|
153
155
|
|
156
|
+
# Create an outbox replication agent instance.
|
157
|
+
#
|
158
|
+
# @param run_mode AEM run mode: author or publish
|
159
|
+
# @param name the outbox replication agent's name, e.g. some-outbox-replication-agent
|
160
|
+
# @return new RubyAem::Resources::OutboxReplicationAgent instance
|
161
|
+
def outbox_replication_agent(run_mode, name)
|
162
|
+
RubyAem::Resources::OutboxReplicationAgent.new(@client, run_mode, name)
|
163
|
+
end
|
164
|
+
|
165
|
+
# Create a reverse replication agent instance.
|
166
|
+
#
|
167
|
+
# @param run_mode AEM run mode: author or publish
|
168
|
+
# @param name the reverse replication agent's name, e.g. some-reverse-replication-agent
|
169
|
+
# @return new RubyAem::Resources::ReverseReplicationAgent instance
|
170
|
+
def reverse_replication_agent(run_mode, name)
|
171
|
+
RubyAem::Resources::ReverseReplicationAgent.new(@client, run_mode, name)
|
172
|
+
end
|
173
|
+
|
154
174
|
# Create a repository instance.
|
155
175
|
#
|
156
176
|
# @return new RubyAem::Resources::Repository instance
|
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.
|
4
|
+
version: 1.0.13
|
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-03-
|
12
|
+
date: 2017-03-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -51,14 +51,14 @@ dependencies:
|
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.9.
|
54
|
+
version: 0.9.9
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
57
|
version_requirements: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.9.
|
61
|
+
version: 0.9.9
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: rspec
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -111,10 +111,12 @@ files:
|
|
111
111
|
- lib/ruby_aem/resources/flush_agent.rb
|
112
112
|
- lib/ruby_aem/resources/group.rb
|
113
113
|
- lib/ruby_aem/resources/node.rb
|
114
|
+
- lib/ruby_aem/resources/outbox_replication_agent.rb
|
114
115
|
- lib/ruby_aem/resources/package.rb
|
115
116
|
- lib/ruby_aem/resources/path.rb
|
116
117
|
- lib/ruby_aem/resources/replication_agent.rb
|
117
118
|
- lib/ruby_aem/resources/repository.rb
|
119
|
+
- lib/ruby_aem/resources/reverse_replication_agent.rb
|
118
120
|
- lib/ruby_aem/resources/user.rb
|
119
121
|
- lib/ruby_aem/response.rb
|
120
122
|
- lib/ruby_aem/result.rb
|