aio-cli-plugin-aep
A plugin for CRUD operations on aep resources
Follow the steps below to start using this plugin.
1. Set up necessary dependencies for npm to work
-
Install brew: $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
-
Install npm: $ brew install npm
-
Install yarn: $ npm install --global yarn
-
Upgrade yarn: $ npm upgrade --global yarn
2. Set up necessary adobe I/O dependencies
-
Install aio-cli core libraries$ npm install -g @adobe/aio-cli
-
Install aep aio plugin$ npm install -g @adobe/aio-cli-plugin-aep
-
Link aep with aio $ aio plugins:install @adobe/aio-cli-plugin-aep
-
When you run $ aio -h
now you should be able to see aep in the list of available plugins
3. Set up adobe I/O (PROD/STG/INT) integration
For PROD
-
Go to https://console.adobe.io/integrations and create a production integration for test
-
Follow the instructions on https://www.adobe.io/apis/experienceplatform/home/tutorials/alltutorials.html#!api-specification/markdown/narrative/tutorials/authenticate_to_acp_tutorial/authenticate_to_acp_tutorial.md
to get the necessary I/O config credentials
-
Create a config.json file with the following content
{
"client_id": "your_client_id",
"client_secret": "your_client_secret",
"jwt_payload": {
"exp": your_expiration_time_value,
"iss": "your_org@AdobeOrg",
"sub": "your_tech_id@techacct.adobe.com",
"https://ims-na1.adobelogin.com/s/ent_dataservices_sdk": true,
"aud": "https://ims-na1.adobelogin.com/c/${your_client_id}"
},
"token_exchange_url": "https://ims-na1.adobelogin.com/ims/exchange/jwt/"
}
-
Run the following commands now (no particular order)
-
$ aio config:set jwt-auth ${path_to_the_above_config.json} --file --json
-
$ aio config:set jwt-auth.jwt_private_key ${path_to_the_private_key_file_used_in_integration}
-
$ aio config:set x-sandbox-id ${your_sanbox_id}
-
$ aio config:set x-sandbox-name ${your_sanbox_name}
-
$ aio config:set env prod
Additionally set the 'access_token' value in config with the following command. Think of it as the same parameter we pass in the 'Authorization' header on postman/Curl. You can get the access_token value from STG/INT Adobe I/O portal https://console-stage.adobe.io/. Please follow the instructions as suggested in this article, to get the access_token https://www.adobe.io/apis/experienceplatform/home/tutorials/alltutorials.html#!api-specification/markdown/narrative/tutorials/authenticate_to_acp_tutorial/authenticate_to_acp_tutorial.md#generate-access-token
$ aio config:set jwt-auth.access_token ${your_access_token_generated_through_adobeI/O_integration}
For STG/INT (This sample is for INT)
-
Go to https://console-stage.adobe.io/integrations and create a production integration for test
-
Follow the instructions on https://www.adobe.io/apis/experienceplatform/home/tutorials/alltutorials.html#!api-specification/markdown/narrative/tutorials/authenticate_to_acp_tutorial/authenticate_to_acp_tutorial.md
to get the necessary I/O config credentials
-
Create a config.json file with the following content
{
"client_id": "your_client_id",
"client_secret": "your_client_secret",
"jwt_payload": {
"exp": your_expiration_time_value,
"iss": "your_org@AdobeOrg",
"sub": "your_tech_id@techacct.adobe.com",
"https://ims-na1-stg1.adobelogin.com/s/ent_dataservices_sdk": true,
"aud": "https://ims-na1-stg1.adobelogin.com/c/${your_client_id}"
},
"token_exchange_url": "https://ims-na1-stg1.adobelogin.com/ims/exchange/jwt/"
}
-
Run the following commands now (no particular order)
-
$ aio config:set jwt-auth ${path_to_the_above_config.json} --file --json
-
$ aio config:set jwt-auth.jwt_private_key ${path_to_the_private_key_file_used_in_integration}
-
$ aio config:set x-sandbox-id ${your_sanbox_id}
-
$ aio config:set x-sandbox-name ${your_sanbox_name}
-
$ aio config:set env int
4. Finally run this simple command to list datasets in your org to make sure the configuration is all correct
$ aio aep:ds:list
Output would look something like...
{
'abc': {
tags: {
targetDataSetId: ['abc'],
'aep/siphon/partitions': [],
'adobe/pqs/table': ['abc'],
sandboxId: ['abc'],
mappingId: ['abc'],
acp_validationContext: ['enabled']
},
imsOrg: 'abc@AdobeOrg',
name: 'Mapping DataSet_abc',
namespace: 'ACP',
state: 'DRAFT',
lastBatchId: 'abc',
lastBatchStatus: 'success',
version: '1.0.3',
created: 1573866068596,
updated: 1573866132606,
createdClient: 'acp_foundation_connectors',
createdUser: 'abc@AdobeID',
updatedUser: 'acp_foundation_dataTracker@AdobeID',
lastSuccessfulBatch: 'abc',
viewId: 'abc',
aspect: 'production',
status: 'enabled',
fileDescription: {
persisted: false
},
files: '@/dataSets/abc/views/abc/files',
schemaMetadata: {
primaryKey: [],
delta: [],
dule: [],
gdpr: []
},
schemaRef: {
id: 'https://ns.adobe.com/acponboarding/schemas/abc',
contentType: 'application/vnd.adobe.xed-full+json;version=1'
},
streamingIngestionEnabled: 'false'
},
...
5. (Developers) To run unit tests from the root folder of the project run the commands in following order
$ npm install
$ jest
$ jest --coverage
(to see coverage report)