![Page 2: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/2.jpg)
Arkadiusz Kita CQ Developer
![Page 3: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/3.jpg)
Wednesday morning, 9th April 2014...
...another beautiful day at work!
There is time for my favouritecoffee!
![Page 4: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/4.jpg)
Wednesday morning, 9th April 2014...
...another beautiful day at work!
...but wait - there is an importante-mail in my inbox!
![Page 5: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/5.jpg)
1 The client needs PoC ASAP
2 Next week 1 mln hits campaign!
3 Agency is ready for content entry!
Mainframe
4 Ad-hoc infrastructure!
5 Monitoring/maintenance required!
![Page 6: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/6.jpg)
1 The client needs PoC ASAP
2 Next week 1 mln hits campaign!
3 Agency is ready for content entry!
Mainframe
4 Ad-hoc infrastructure!
5 Monitoring/maintenance required!
![Page 7: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/7.jpg)
1 The client needs PoC ASAP
2 Next week 1 mln hits campaign!
3 Agency is ready for content entry!
Mainframe
4 Ad-hoc infrastructure!
5 Monitoring/maintenance required!
![Page 8: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/8.jpg)
1 The client needs PoC ASAP
2 Next week 1 mln hits campaign!
3 Agency is ready for content entry!
Mainframe
4 Ad-hoc infrastructure!
5 Monitoring/maintenance required!
![Page 9: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/9.jpg)
1 The client needs PoC ASAP
2 Next week 1 mln hits campaign!
3 Agency is ready for content entry!
Mainframe
4 Ad-hoc infrastructure!
5 Monitoring/maintenance required!
![Page 10: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/10.jpg)
It seems like huge pressure and a lot of work to do...
![Page 11: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/11.jpg)
...or maybe rather a lot of CQ clicks!
![Page 12: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/12.jpg)
Managing a cloud of...
...thousands of AEM/CQ instances
...hundreds of dev, test, qa, uat, live environments...tens of client deployments
in a consistent way!
![Page 13: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/13.jpg)
Managing a cloud of...
...thousands of AEM/CQ instances...hundreds of dev, test, qa, uat, live environments
...tens of client deployments
in a consistent way!
![Page 14: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/14.jpg)
Managing a cloud of...
...thousands of AEM/CQ instances...hundreds of dev, test, qa, uat, live environments
...tens of client deployments
in a consistent way!
![Page 15: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/15.jpg)
Managing a cloud of...
...thousands of AEM/CQ instances...hundreds of dev, test, qa, uat, live environments
...tens of client deployments
in a consistent way!
![Page 16: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/16.jpg)
Providing condensed...
checklists knowledge know-how
...for developers/administrators
in a reusable way!
![Page 17: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/17.jpg)
Providing condensed...
checklists
knowledge know-how
...for developers/administrators
in a reusable way!
![Page 18: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/18.jpg)
Providing condensed...
checklists knowledge
know-how
...for developers/administrators
in a reusable way!
![Page 19: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/19.jpg)
Providing condensed...
checklists knowledge know-how
...for developers/administrators
in a reusable way!
![Page 20: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/20.jpg)
Providing condensed...
checklists knowledge know-how
...for developers/administrators
in a reusable way!
![Page 21: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/21.jpg)
Last but not least!
1 Automating repetetive tasks
2 Improving safety and security by not touching anything twice3 Focusing on real challenges!!! Discovering new possibilities!4 Being happy, not bored!5 Loving what you do!
![Page 22: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/22.jpg)
Last but not least!
1 Automating repetetive tasks2 Improving safety and security by not touching anything twice
3 Focusing on real challenges!!! Discovering new possibilities!4 Being happy, not bored!5 Loving what you do!
![Page 23: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/23.jpg)
Last but not least!
1 Automating repetetive tasks2 Improving safety and security by not touching anything twice3 Focusing on real challenges!!! Discovering new possibilities!
4 Being happy, not bored!5 Loving what you do!
![Page 24: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/24.jpg)
Last but not least!
1 Automating repetetive tasks2 Improving safety and security by not touching anything twice3 Focusing on real challenges!!! Discovering new possibilities!4 Being happy, not bored!
5 Loving what you do!
![Page 25: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/25.jpg)
Last but not least!
1 Automating repetetive tasks2 Improving safety and security by not touching anything twice3 Focusing on real challenges!!! Discovering new possibilities!4 Being happy, not bored!5 Loving what you do!
![Page 26: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/26.jpg)
Use AEM/CQ REST infinitive possibilities!
UNIXUNIXTry the github.com/Cognifide/CQ-Unix-Toolkit!
Start using it!Help us develop it!
![Page 27: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/27.jpg)
What is the CQ Unix Toolkit?
+ + = UNIXUNIX
open source user-friendly curl wrapper
set of independent simple micro tools
AEM/CQ HTTP REST semi-code/semi-documentation
allows to control CQ/dispatcher by HTTP
Commons are extracted into one cqapi tool.
![Page 28: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/28.jpg)
What is the CQ Unix Toolkit?
+ + = UNIXUNIX
open source user-friendly curl wrapper
set of independent simple micro tools
AEM/CQ HTTP REST semi-code/semi-documentation
allows to control CQ/dispatcher by HTTP
Commons are extracted into one cqapi tool.
![Page 29: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/29.jpg)
What is the CQ Unix Toolkit?
+ + = UNIXUNIX
open source user-friendly curl wrapper
set of independent simple micro tools
AEM/CQ HTTP REST semi-code/semi-documentation
allows to control CQ/dispatcher by HTTP
Commons are extracted into one cqapi tool.
![Page 30: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/30.jpg)
What is the CQ Unix Toolkit?
+ + = UNIXUNIX
open source user-friendly curl wrapper
set of independent simple micro tools
AEM/CQ HTTP REST semi-code/semi-documentation
allows to control CQ/dispatcher by HTTP
Commons are extracted into one cqapi tool.
![Page 31: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/31.jpg)
What is the CQ Unix Toolkit?
+ + = UNIXUNIX
open source user-friendly curl wrapper
set of independent simple micro tools
AEM/CQ HTTP REST semi-code/semi-documentation
allows to control CQ/dispatcher by HTTP
Commons are extracted into one cqapi tool.
![Page 32: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/32.jpg)
What is the CQ Unix Toolkit?
+ + = UNIXUNIX
open source user-friendly curl wrapper
set of independent simple micro tools
AEM/CQ HTTP REST semi-code/semi-documentation
allows to control CQ/dispatcher by HTTP
Commons are extracted into one cqapi tool.
![Page 33: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/33.jpg)
Use cases
![Page 34: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/34.jpg)
Case 1 — distributed REST knowledge
No common place for AEM/CQ REST documentation!
![Page 35: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/35.jpg)
Case 2 — hacking packages
1 Installing hotfixes/releases automaticallycqput; cqrun
2 Synchronizing content between instancescqpkg; cqput; cqbld; cqcp; cqrun; cqsnp
3 Making path-based backupscqpkg; cqput; cqbld; cqcp
4 Uninstalling deleted packagescqsnp
5 Clearing content pathscqpkg; cqput; cqrun
6 Moving paths from repository externallycqpkg; cqput; cqrun; cqsnp; cqsnp
7 Deleting unknown/garbage packagescqls; cqdel; cqsnp
![Page 36: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/36.jpg)
Case 2 — hacking packages
1 Installing hotfixes/releases automaticallycqput; cqrun
2 Synchronizing content between instancescqpkg; cqput; cqbld; cqcp; cqrun; cqsnp
3 Making path-based backupscqpkg; cqput; cqbld; cqcp
4 Uninstalling deleted packagescqsnp
5 Clearing content pathscqpkg; cqput; cqrun
6 Moving paths from repository externallycqpkg; cqput; cqrun; cqsnp; cqsnp
7 Deleting unknown/garbage packagescqls; cqdel; cqsnp
![Page 37: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/37.jpg)
Case 2 — hacking packages
1 Installing hotfixes/releases automaticallycqput; cqrun
2 Synchronizing content between instancescqpkg; cqput; cqbld; cqcp; cqrun; cqsnp
3 Making path-based backupscqpkg; cqput; cqbld; cqcp
4 Uninstalling deleted packagescqsnp
5 Clearing content pathscqpkg; cqput; cqrun
6 Moving paths from repository externallycqpkg; cqput; cqrun; cqsnp; cqsnp
7 Deleting unknown/garbage packagescqls; cqdel; cqsnp
![Page 38: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/38.jpg)
Case 2 — hacking packages
1 Installing hotfixes/releases automaticallycqput; cqrun
2 Synchronizing content between instancescqpkg; cqput; cqbld; cqcp; cqrun; cqsnp
3 Making path-based backupscqpkg; cqput; cqbld; cqcp
4 Uninstalling deleted packagescqsnp
5 Clearing content pathscqpkg; cqput; cqrun
6 Moving paths from repository externallycqpkg; cqput; cqrun; cqsnp; cqsnp
7 Deleting unknown/garbage packagescqls; cqdel; cqsnp
![Page 39: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/39.jpg)
Case 2 — hacking packages
1 Installing hotfixes/releases automaticallycqput; cqrun
2 Synchronizing content between instancescqpkg; cqput; cqbld; cqcp; cqrun; cqsnp
3 Making path-based backupscqpkg; cqput; cqbld; cqcp
4 Uninstalling deleted packagescqsnp
5 Clearing content pathscqpkg; cqput; cqrun
6 Moving paths from repository externallycqpkg; cqput; cqrun; cqsnp; cqsnp
7 Deleting unknown/garbage packagescqls; cqdel; cqsnp
![Page 40: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/40.jpg)
Case 2 — hacking packages
1 Installing hotfixes/releases automaticallycqput; cqrun
2 Synchronizing content between instancescqpkg; cqput; cqbld; cqcp; cqrun; cqsnp
3 Making path-based backupscqpkg; cqput; cqbld; cqcp
4 Uninstalling deleted packagescqsnp
5 Clearing content pathscqpkg; cqput; cqrun
6 Moving paths from repository externallycqpkg; cqput; cqrun; cqsnp; cqsnp
7 Deleting unknown/garbage packagescqls; cqdel; cqsnp
![Page 41: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/41.jpg)
Case 2 — hacking packages
1 Installing hotfixes/releases automaticallycqput; cqrun
2 Synchronizing content between instancescqpkg; cqput; cqbld; cqcp; cqrun; cqsnp
3 Making path-based backupscqpkg; cqput; cqbld; cqcp
4 Uninstalling deleted packagescqsnp
5 Clearing content pathscqpkg; cqput; cqrun
6 Moving paths from repository externallycqpkg; cqput; cqrun; cqsnp; cqsnp
7 Deleting unknown/garbage packagescqls; cqdel; cqsnp
![Page 42: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/42.jpg)
Case 2 — hacking packages
1 Installing hotfixes/releases automaticallycqput; cqrun
2 Synchronizing content between instancescqpkg; cqput; cqbld; cqcp; cqrun; cqsnp
3 Making path-based backupscqpkg; cqput; cqbld; cqcp
4 Uninstalling deleted packagescqsnp
5 Clearing content pathscqpkg; cqput; cqrun
6 Moving paths from repository externallycqpkg; cqput; cqrun; cqsnp; cqsnp
7 Deleting unknown/garbage packagescqls; cqdel; cqsnp
![Page 43: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/43.jpg)
Case 3 — monitoring/maintenance
1 cqmon – Sling JMX monitoring2 cqwfl – running/stale workflows status3 cqchk – repository consistency checks4 cqtpm – TarPM compaction5 cqmrg – Lucene indexes merge6 cqgc – DataStore garbage collection7 cqdam – AEM/CQ DAM Health Tool8 cqosgi + diff – bundle states (by using patterns)$ cqosgi -m > pattern-file;$ cqosgi -s org.apache.sling.jcr.davexStopping bundle: org.apache.sling.jcr.davex (#109)$ cqosgi -m | diff -q - pattern-fileFiles - and pattern-file differ
![Page 44: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/44.jpg)
Case 3 — monitoring/maintenance
1 cqmon – Sling JMX monitoring
2 cqwfl – running/stale workflows status3 cqchk – repository consistency checks4 cqtpm – TarPM compaction5 cqmrg – Lucene indexes merge6 cqgc – DataStore garbage collection7 cqdam – AEM/CQ DAM Health Tool8 cqosgi + diff – bundle states (by using patterns)$ cqosgi -m > pattern-file;$ cqosgi -s org.apache.sling.jcr.davexStopping bundle: org.apache.sling.jcr.davex (#109)$ cqosgi -m | diff -q - pattern-fileFiles - and pattern-file differ
![Page 45: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/45.jpg)
Case 3 — monitoring/maintenance
1 cqmon – Sling JMX monitoring2 cqwfl – running/stale workflows status
3 cqchk – repository consistency checks4 cqtpm – TarPM compaction5 cqmrg – Lucene indexes merge6 cqgc – DataStore garbage collection7 cqdam – AEM/CQ DAM Health Tool8 cqosgi + diff – bundle states (by using patterns)$ cqosgi -m > pattern-file;$ cqosgi -s org.apache.sling.jcr.davexStopping bundle: org.apache.sling.jcr.davex (#109)$ cqosgi -m | diff -q - pattern-fileFiles - and pattern-file differ
![Page 46: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/46.jpg)
Case 3 — monitoring/maintenance
1 cqmon – Sling JMX monitoring2 cqwfl – running/stale workflows status3 cqchk – repository consistency checks
4 cqtpm – TarPM compaction5 cqmrg – Lucene indexes merge6 cqgc – DataStore garbage collection7 cqdam – AEM/CQ DAM Health Tool8 cqosgi + diff – bundle states (by using patterns)$ cqosgi -m > pattern-file;$ cqosgi -s org.apache.sling.jcr.davexStopping bundle: org.apache.sling.jcr.davex (#109)$ cqosgi -m | diff -q - pattern-fileFiles - and pattern-file differ
![Page 47: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/47.jpg)
Case 3 — monitoring/maintenance
1 cqmon – Sling JMX monitoring2 cqwfl – running/stale workflows status3 cqchk – repository consistency checks4 cqtpm – TarPM compaction
5 cqmrg – Lucene indexes merge6 cqgc – DataStore garbage collection7 cqdam – AEM/CQ DAM Health Tool8 cqosgi + diff – bundle states (by using patterns)$ cqosgi -m > pattern-file;$ cqosgi -s org.apache.sling.jcr.davexStopping bundle: org.apache.sling.jcr.davex (#109)$ cqosgi -m | diff -q - pattern-fileFiles - and pattern-file differ
![Page 48: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/48.jpg)
Case 3 — monitoring/maintenance
1 cqmon – Sling JMX monitoring2 cqwfl – running/stale workflows status3 cqchk – repository consistency checks4 cqtpm – TarPM compaction5 cqmrg – Lucene indexes merge
6 cqgc – DataStore garbage collection7 cqdam – AEM/CQ DAM Health Tool8 cqosgi + diff – bundle states (by using patterns)$ cqosgi -m > pattern-file;$ cqosgi -s org.apache.sling.jcr.davexStopping bundle: org.apache.sling.jcr.davex (#109)$ cqosgi -m | diff -q - pattern-fileFiles - and pattern-file differ
![Page 49: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/49.jpg)
Case 3 — monitoring/maintenance
1 cqmon – Sling JMX monitoring2 cqwfl – running/stale workflows status3 cqchk – repository consistency checks4 cqtpm – TarPM compaction5 cqmrg – Lucene indexes merge6 cqgc – DataStore garbage collection
7 cqdam – AEM/CQ DAM Health Tool8 cqosgi + diff – bundle states (by using patterns)$ cqosgi -m > pattern-file;$ cqosgi -s org.apache.sling.jcr.davexStopping bundle: org.apache.sling.jcr.davex (#109)$ cqosgi -m | diff -q - pattern-fileFiles - and pattern-file differ
![Page 50: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/50.jpg)
Case 3 — monitoring/maintenance
1 cqmon – Sling JMX monitoring2 cqwfl – running/stale workflows status3 cqchk – repository consistency checks4 cqtpm – TarPM compaction5 cqmrg – Lucene indexes merge6 cqgc – DataStore garbage collection7 cqdam – AEM/CQ DAM Health Tool
8 cqosgi + diff – bundle states (by using patterns)$ cqosgi -m > pattern-file;$ cqosgi -s org.apache.sling.jcr.davexStopping bundle: org.apache.sling.jcr.davex (#109)$ cqosgi -m | diff -q - pattern-fileFiles - and pattern-file differ
![Page 51: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/51.jpg)
Case 3 — monitoring/maintenance
1 cqmon – Sling JMX monitoring2 cqwfl – running/stale workflows status3 cqchk – repository consistency checks4 cqtpm – TarPM compaction5 cqmrg – Lucene indexes merge6 cqgc – DataStore garbage collection7 cqdam – AEM/CQ DAM Health Tool8 cqosgi + diff – bundle states (by using patterns)
$ cqosgi -m > pattern-file;$ cqosgi -s org.apache.sling.jcr.davexStopping bundle: org.apache.sling.jcr.davex (#109)$ cqosgi -m | diff -q - pattern-fileFiles - and pattern-file differ
![Page 52: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/52.jpg)
Case 3 — monitoring/maintenance
1 cqmon – Sling JMX monitoring2 cqwfl – running/stale workflows status3 cqchk – repository consistency checks4 cqtpm – TarPM compaction5 cqmrg – Lucene indexes merge6 cqgc – DataStore garbage collection7 cqdam – AEM/CQ DAM Health Tool8 cqosgi + diff – bundle states (by using patterns)$ cqosgi -m > pattern-file;$ cqosgi -s org.apache.sling.jcr.davexStopping bundle: org.apache.sling.jcr.davex (#109)$ cqosgi -m | diff -q - pattern-fileFiles - and pattern-file differ
![Page 53: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/53.jpg)
Case 4 — common devops tasks
1 cqosgi – automated bundle management2 cqpkg – create ad-hoc empty packages3 cqrepkg – fast offline repackaging for your content snapshots4 cqclr – clear dispatcher cache5 cqcfg – change bundle configuration remotely
configure SMTP clienttune Sling Main servlet
6 cqjcr – list JCR nodes, change and add themdynamically-scoped backups:cqjcr; cqpkg; cqbld; cqcp; cqdelchange Sling redirect/disable ContentFinder
![Page 54: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/54.jpg)
Case 4 — common devops tasks
1 cqosgi – automated bundle management
2 cqpkg – create ad-hoc empty packages3 cqrepkg – fast offline repackaging for your content snapshots4 cqclr – clear dispatcher cache5 cqcfg – change bundle configuration remotely
configure SMTP clienttune Sling Main servlet
6 cqjcr – list JCR nodes, change and add themdynamically-scoped backups:cqjcr; cqpkg; cqbld; cqcp; cqdelchange Sling redirect/disable ContentFinder
![Page 55: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/55.jpg)
Case 4 — common devops tasks
1 cqosgi – automated bundle management2 cqpkg – create ad-hoc empty packages
3 cqrepkg – fast offline repackaging for your content snapshots4 cqclr – clear dispatcher cache5 cqcfg – change bundle configuration remotely
configure SMTP clienttune Sling Main servlet
6 cqjcr – list JCR nodes, change and add themdynamically-scoped backups:cqjcr; cqpkg; cqbld; cqcp; cqdelchange Sling redirect/disable ContentFinder
![Page 56: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/56.jpg)
Case 4 — common devops tasks
1 cqosgi – automated bundle management2 cqpkg – create ad-hoc empty packages3 cqrepkg – fast offline repackaging for your content snapshots
4 cqclr – clear dispatcher cache5 cqcfg – change bundle configuration remotely
configure SMTP clienttune Sling Main servlet
6 cqjcr – list JCR nodes, change and add themdynamically-scoped backups:cqjcr; cqpkg; cqbld; cqcp; cqdelchange Sling redirect/disable ContentFinder
![Page 57: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/57.jpg)
Case 4 — common devops tasks
1 cqosgi – automated bundle management2 cqpkg – create ad-hoc empty packages3 cqrepkg – fast offline repackaging for your content snapshots4 cqclr – clear dispatcher cache
5 cqcfg – change bundle configuration remotelyconfigure SMTP clienttune Sling Main servlet
6 cqjcr – list JCR nodes, change and add themdynamically-scoped backups:cqjcr; cqpkg; cqbld; cqcp; cqdelchange Sling redirect/disable ContentFinder
![Page 58: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/58.jpg)
Case 4 — common devops tasks
1 cqosgi – automated bundle management2 cqpkg – create ad-hoc empty packages3 cqrepkg – fast offline repackaging for your content snapshots4 cqclr – clear dispatcher cache5 cqcfg – change bundle configuration remotely
configure SMTP clienttune Sling Main servlet
6 cqjcr – list JCR nodes, change and add themdynamically-scoped backups:cqjcr; cqpkg; cqbld; cqcp; cqdelchange Sling redirect/disable ContentFinder
![Page 59: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/59.jpg)
Case 4 — common devops tasks
1 cqosgi – automated bundle management2 cqpkg – create ad-hoc empty packages3 cqrepkg – fast offline repackaging for your content snapshots4 cqclr – clear dispatcher cache5 cqcfg – change bundle configuration remotely
configure SMTP clienttune Sling Main servlet
6 cqjcr – list JCR nodes, change and add themdynamically-scoped backups:cqjcr; cqpkg; cqbld; cqcp; cqdelchange Sling redirect/disable ContentFinder
![Page 60: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/60.jpg)
Development
Create new tools with us!Organize the AEM/CQ REST World!
![Page 61: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/61.jpg)
DevelopmentCreate new tools with us!
Organize the AEM/CQ REST World!
![Page 62: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/62.jpg)
Rule 1 — Capture day to day requests
![Page 63: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/63.jpg)
Rule 2 — Write user-friendly usage messages
$ cqbldUsage: cqbld [OPTION...] package-nameBuild (rebuild) already uploaded package by group id and name in CQ PackageManager using instance URL. Examples: cqbld -u admin pack # Build package named pack cqbld -u admin -g GRP pack # Build package named pack in group GRP cqbld -i http://localhost:5510 # Build package for localhost instance on tcp -g com.group stuff # port 5510 named stuff in group:com.group -p secret # with password provided: secret
Options:
-u use specified usernamed for connection -p use provided password for authentication -i use specified instance URL to connect -g locate package by additional group ID
![Page 64: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/64.jpg)
Rule 3 — Choose descriptive code over comments
# Invoke curl tool with current referer and # instance URL and credentials to get list # of packages STATUS=`$CURLBIN -s --write-out "%{http_code}"\ -u "$u:$p" -H "Referer: $url/crx/packmgr"\ -F cmd=ls "$url/crx/packmgr/service.jsp"`
![Page 65: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/65.jpg)
Rule 3 — Choose descriptive code over comments
# Invoke curl tool with current referer and # instance URL and credentials to get list # of packages STATUS=`$CURLBIN -s --write-out "%{http_code}"\ -u "$u:$p" -H "Referer: $url/crx/packmgr"\ -F cmd=ls "$url/crx/packmgr/service.jsp"`
![Page 66: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/66.jpg)
Rule 3 — Choose descriptive code over comments
PACKAGE_MANAGER_PATH="/crx/packmgr"REFERER="${instance}${PACKAGE_MANAGER_PATH}" AUTH="${username}:${password}" FILEPATH="${PACKAGE_MANAGER_PATH}/service.jsp" FULL_URL="${instance}${FILEPATH}" REFERER_HEADER= "Referer: ${REFERER}" COMMAND="cmd=ls"
Use shellcheck.net to validate POSIX shell syntax!
![Page 67: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/67.jpg)
Rule 3 — Choose descriptive code over comments
STATUS=$("${CURLBIN}" \ -s \ --write-out "%{http_code}" \ -u "${AUTH}" \ -H "${REFERER_HEADER}" \ -F "${COMMAND}" \ "${FULL_URL}")
![Page 68: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/68.jpg)
Rule 3 — Choose descriptive code over comments
STATUS=$("${CURLBIN}" \ -s \ --write-out "%{http_code}" \ -u "${AUTH}" \ -H "${REFERER_HEADER}" \ -F "${COMMAND}" \ "${FULL_URL}")
![Page 69: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/69.jpg)
Rule 4 — Use POSIX getopts for custom parameters
while getopts ":abc${apigetopts}" optdo case "${opt}" in
...
\?) echo "Invalid option: -${OPTARG}" >&2; _usage;; :) echo "Option -${OPTARG} requires an argument." >&2;
_usage;; esac done
![Page 70: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/70.jpg)
Rule 5 — Use cqapi to detect/handle curl command
cqapi
shared code, status, parsing common options, error handling
![Page 71: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/71.jpg)
Rule 6 — Use the most usable REST HTTP
pick!
rate!
choose!
![Page 72: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/72.jpg)
Rule 7 — Reserve API cmdline options for CQ/AEM connectivity
-u username-i instance URL-p password
![Page 73: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/73.jpg)
Rule 8 — Avoid including external custom dependencies
This can be harmful,hard in use and notportable!
![Page 74: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/74.jpg)
Rule 9 — Keep It Simple Stupid
KiSS
Keep toolkit filesas small as possibleup to 400 LOC
Manage complexity!Simplify logic!
![Page 75: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/75.jpg)
Rule 9 — Keep It Simple Stupid
KiSS
Keep toolkit filesas small as possibleup to 400 LOC
Manage complexity!Simplify logic!
![Page 76: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/76.jpg)
Thank you!
Q&A
![Page 77: Organizing The World Of CQ REST Infinitive Possibilities](https://reader037.vdocument.in/reader037/viewer/2022102922/54919610ac79592f288b4585/html5/thumbnails/77.jpg)
Resources
https://github.com/Cognifide/CQ-Unix-Toolkit
Presentation symbols provided by Tango Desktop Project
blog entry on Cognifide website