PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, September 28, 2022

[FIXED] How to tell an AEM publish node and author node apart via REST API

 September 28, 2022     aem, continuous-deployment, devops     No comments   

Issue

I have been using package manager commands to deploy AEM packages to author nodes as part of a Continuous Deployment pipeline. I am now extending this to deploy directly to publish nodes. I need (according to the node owners) to do this slightly differently.

Since I am programming these interactions and have to support a whole bunch of nodes, I was wondering if the pipeline can call some endpoint which is somehow unique to an author or a publish so I can detect which was selected this time around?

For context here's an example of the calls I am making.

curl -u admin:admin -X POST http://localhost:4502/crx/packmgr/service/.json/etc/packages/my_packages/samplepackage.zip?cmd=uninstall

I regret I am not (yet) that familiar with AEM beyond the package manager API. I got this example from AEM CQ5 Tutorials but have found nothing else there directly useful, perhaps because I am unsure whcih REST APIs relate to which kinds of node.

If I could find a cheap and harmless GET that is unique to one or the other I would be sorted.


Solution

I have used this SlingSettings API to get sling runmodes using which you can determine whether it is author or publish. It's a pretty lightweight call.

http(s):<host:port>/system/console/status-slingsettings.json



Answered By - Abhishek
Answer Checked By - Senaida (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing