AEM as Cloud Service provides Cloud Manager API which allows access to Cloud Manager related activities, Adobe IO Events which can be used to handle event-driven scenarios & CLI tools. All these tools are very useful for automation process.
Adobe IO Events
In AEM as Cloud Service terms, Adobe IO Events enables building reactive, event-driven applications, based on events originating from Adobe Experience Manager. Events are triggered by Event Provider. To start listening to events, register application, specify Event Types from which Event Providers want to receive. Whenever a matching event is triggered, application is notified.
Adobe IO Events can be integrated using
- Adobe IO Events API
- Adobe IO Events CLI
- Adobe IO Events SDK
This documentation has instructions to set up IO Events Integrations with AEM as Cloud Service. To learn more about Adobe IO Events, go through links provided in References section.
Cloud Manager API
This API allows access to Cloud Manager programs, environments & pipelines by an authorized account through Adobe IO console. The base URL for this API is https://cloudmanager.adobe.io/ .
There are variety of use cases, some of the basic use cases listed below.
- Starting Cloud Manager CI/CD pipeline from external system.
- Execute additional tests before production deployments.
- Triggering additional activities after the pipeline execution.
o CDN cache invalidation once the production deployment is completed.
o Notifying on other channels.
o Notifying events on Activation/Deactivation of Pages.
o Creating issue report on bug tracking system.
There are set of steps needs to be followed to setup Adobe IO with Cloud Manager API. For more details about sample project visit links provided in References section.
- Webhook Setup – A webhook (a web callback or HTTP push API) is a way for an app to provide other applications with real-time information.
- A webhook needs to be written which acts as event handler & is compatible with Adobe IO Events.
- To use webhook with Adobe IO, it must be accessible to the public internet. ngrok is the tool is used for this purpose.
- Once webhook is available & running at a publicly accessible URL, it can be registered with Adobe IO. To do this
Go to Adobe IO Console à Create/Open Project à Click Add to Project & Select Event à Select Cloud Manager à Click Next à Select Event Types (For which events to be emitted)
- Webhook Signature Validation – The webhook setup in the 1st step will be enhanced to validate the POST requests coming from Adobe IO.
- POST requests to the webhook are signed using SHA256 stored in the x-adobe-signature header.
- Handling Events – Webhooks can be registered for one or more events. These events can be identified using the combination of @type & xdmEventEnvelope:objectType values.
- Obtain Access Token – webhook need to call the Cloud Manager API to get additional information.
- API calls should be made by obtaining an access token which will be passed to the API for the purpose of authentication.
- The webhook will create a signed JWT token & then exchange that with IMS for an access token.
- The JWT is created, signed & exchanged using
- x-gw-ims-org-id – The organization ID (ORGANIZATION_ID)
- x-api-key – The API key (API_KEY)
- Authorization – contains the access token.
- Getting Programs – If program name needs to be sent as notification in this exercise then to get the program data based on the execution, get the link to the program from the execution response.
- Sending Notifications – Once the data received notification can be send to channel.
A command-line interface (CLI) process command. Knowing CLI commands can be very useful for various approaches to automate the process. Adobe are providing different CLI tools for AEM as Cloud Service which are as below.
Setup Adobe IO CLI
The Adobe IO CLI or aio, provides command line access to a variety of Adobe Services. It plays an important role in development of AEM as Cloud Services as it provides capability to
- Tail logs from AEM as Cloud Services.
- Manage Cloud Manager pipelines from the CLI.
Prerequisites for Installation of Adobe IO CLI
- Ensure Node.js is installed as the Adobe I/O CLI is an npm module.
- Run node –version to confirm
- Execute npm install -g @adobe/aio-cli to install the aio npm module globally
Git URL – https://github.com/adobe/aio-cli
Adobe IO CLI Cloud Manager Plugin
In addition to direct HTTP usage of the Cloud Manager API, there are open source libraries & tools built on top of the API. They are as below.
It is a plugin which allows accessing Cloud Manager programs, environments & pipelines through aio CLI using aio cloudmanager command. In order for the Adobe IO CLI to communicate with Cloud Manager integration must be created with Adobe IO Console as explained in below URL.
It provides a Java Interface on top of the Cloud Manager API and enables integration in JVM-based applications.
CloudManagerApi api = new CloudManagerApiImpl(“orgId”, “x-api-key”, “valid auth token”);
Adobe IO CLI Asset Compute Plugin
The Adobe IO Cloud Manager Plugin allows the aio CLI to generate & run Asset Compute workers via the aio asset-compute command.
Adobe IO Events
As stated above, Adobe IO Events enables building reactive & event-driven applications based on events originating from AEM as Cloud Service.
AEM Cloud Service Migration CLI
This is AEM as Cloud Service Refactoring Plugin for the Adobe IO CLI. This tool unifies the code refactoring tools which refactor customers code, repository structure and configurations on user’s local machine. Below are the different refactoring tools available.
- Dispatcher Tool Converter
- Repository Modernizer Tool
- Index Converter Tool
Adobe IO Events
Cloud Manager API