Setting Up Adobe I/O CLI for Cloud Manager
Interacting with cloud manager
If you are an Adobe Managed Service (AMS) customer or AEM as a Cloud Service customer, this Cloud Manager plugin for Adobe I/O CLI will come in very handy to interact with the same underlying capabilities exposed through the web UI in a fully programmatic fashion. It also enables you with some additional capabilities like setting up pipeline variables, environment variables, cancel running pipelines etc. With the release of Authenticated Performance Testing support in cloud manager, setting up Adobe I/O CLI is a prerequisite in order to use this feature.
An integration must be created in the Adobe I/O Console which has the Cloud Manager service. This is the layer which handles the authentication.
Below are the step by step instructions on setting up Adobe I/O CLI cloud manager plugin from scratch.
Setting up your workstation
* Install Node.js
Ensure Node.js is installed (Node.js 10.0+) as Adobe I/O CLI is an npm module. Below is how you can install Node.js using Homebrew:
- Open your Terminal/Command Prompt
- Execute the command:
brew install node
- Verify Node.js is installed, using the command:
node -v
- Verify npm is installed, using the command:
npm -v
For Windows, download and install Node.js from the link directly.
* Install Adobe I/O CLI
$ npm install -g @adobe/aio-cli
$ aio (-v|--version|version)
@adobe/aio-cli/3.7.0 darwin-x64 node-v12.18.0
$ aio --help [COMMAND]USAGE
$ aio COMMAND
...
The complete list of aio cli commands can be found here.
* Install Cloud Manager plugin for Adobe I/O
$ aio plugins:install @adobe/aio-cli-plugin-cloudmanager
$ aio plugins:update
Setup the Adobe I/O CLI authentication
In order for the Adobe I/O CLI to communicate with Cloud Manager, a Cloud Manager integration must be created in Adobe I/O Console, and credentials must be obtained to successfully authenticate.
- Log in to console.adobe.io
- Ensure to select your organisation that includes the Cloud Manager product to connect to, in the Adobe Org switcher on top right corner.
- Click on ‘Create new project’ and give appropriate name, say “MyCMProject”
- Create on ‘Add API’ and choose ‘Cloud Manager’ from the list. Hit Next.
- Click on Generate keypair.
- This will download a config.zip file containing a certificate and a private key.
- Hit Next and Create a new Cloud Manager API integration with appropriate product profile and hit ‘Save configured API’
After you’ve created the integration, create a config.json
file on your computer and navigate to the adobe io integration Overview page. From this page, copy the client_id
and client_secret
values to the config file; if you navigate to the JWT tab in Console, you'll get the value for the jwt_payload
.
//config.json
{
"client_id": "value from your CLI integration (String)",
"client_secret": "value from your CLI integration (String)",
"jwt_payload": { value from your CLI integration (JSON Object Literal) },
"token_exchange_url": "https://ims-na1.adobelogin.com/ims/exchange/jwt"
}
The last bit you need to have at hand is the private certificate you’ve used to create the integration; you need the private key, not the public one. Now, you are ready to configure the aio
CLI.
First, configure the credentials:
aio config:set jwt-auth PATH_TO_CONFIG_JSON_FILE --file --json
Then, configure the private certificate:
aio config:set jwt-auth.jwt_private_key PATH_TO_PRIVATE_KEY_FILE --file
Set Default Program
If you want to avoid passing the program ID flag repeatedly, you can configure it using:
$ aio config:set cloudmanager_programid PROGRAMID
For example
$ aio config:set cloudmanager_programid 4
The complete set of aio cli commands for cloud manager is present here.