Anaplan’s Application Life Cycle Management (ALM) process flow and ALM APIs for automation of ALM processes.
This article does not present ALM best practices. It is focused on the usage of ALM APIs for the automation of ALM steps. For those who are new to Anaplan ALM, we highly recommend reviewing the following resources:
Anaplan Application Life Cycle Management (ALM) APIs help orchestrate change deployments and automate ongoing maintenance of applications in Anaplan. This article introduces you to REST API endpoints that perform the following ALM tasks:
In this article, we will use the model you have built as part of the Level 1 Model Building course to illustrate how to orchestrate and automate model deployment using ALM API.
In this setup, you will set up Anaplan source & target models that will be used in deployments via API.
We will use steps outlined in ALM process below to deploy changes made toL1 Model Building Model SourcetoL1 Model Building Model Target.
Current ALM APIs support steps 0-5 & 7. Steps 3.1, 3.2, and 6 are performed manually using Anaplan UX. For this article, we will use Postman to make ALM requests.
Request Method |
POST |
Base URL |
|
Endpoint |
/models/{source_model_id}/alm/revisions |
Headers |
Authorization: AnaplanAuthToken {anaplan_auth_token} Content-Type: application/json |
Body |
{ “name”: ” “description”: ” } |
Once a revision tag is created, we will change status ofL1 Model Building Model TargettoOffline.
Note, this step is optional. Oftentimes you will want to take the model offline to make sure changes synced correctly, but it is possible to leave model online and sync changes.
Request Method |
POST |
Base URL |
|
Endpoint |
/models/{target_model_id}/onlineStatus |
Headers |
Authorization: AnaplanAuthToken {anaplan_auth_token} Content-Type: application/json |
Body |
{ “status”: “offline” } |
Next step in ALM API process is to get the id for last revision in the Target Model. We will use an environment variable last_rev_target to store revision id for the last revision tag in the target model. Our API request in Postman will automatically parse the JSON response and update this variable.
Request Method |
POSTGET |
Base URL |
|
Endpoint |
/models/{target_model_id}/alm/latestRevision |
Headers |
Authorization: AnaplanAuthToken {anaplan_auth_token} |
Tests |
pm.environment.set(“last_rev_target”, pm.response.json().revisions[0].id); |
Once we have the target revision, we will retrieve revision tag id for compatible revisions in the source model. Similar to last revision tag in target model, we will use an environment variable rev_tag_source to store revision id for the revision tag in the source model. Our API request in Postman will automatically parse the JSON response and update this variable.
Request Method |
POSTGET |
Base URL |
|
Endpoint |
/models/{target_model_id}/alm/SyncableRevisions?sourceModelId={source_model_id} |
Headers |
Authorization: AnaplanAuthToken {anaplan_auth_token} |
Tests |
pm.environment.set(“rev_tag_source”, pm.response.json().revisions[0].id); |
Retrieving the sync comparison report (which shows changes to be affected in the production model) is a three step process. We create a comparison report task, then get the details of the task to grab the URL where we can then download the comparison file.
Request Method |
POST |
Base URL |
|
Endpoint |
/ / {target_model_id} / alm / comparisonReportTask模型s |
Headers |
Authorization: AnaplanAuthToken {anaplan_auth_token} Content-Type: application/json |
Body |
{ “sourceRevisionId”:”rev_tag_source”, “sourceModelId”: “ “targetRevisionId”: “last_rev_target” } |
Tests |
pm.environment.set(“comparison_task”, pm.response.json().task.taskId); |
Request Method |
GET |
Base URL |
|
Endpoint |
/ / {target_model_id} / alm / comparisonReportTask模型s/{comparison_task} |
Headers |
Authorization: AnaplanAuthToken {anaplan_auth_token} Content-Type: application/json |
Body |
|
Tests |
pm.environment.set(“comparison_URL”, pm.response.json(). Task.result.reportFileUrl); |
Step 3.3: Retrieve Comparison Report
Request Method |
GET |
Base URL |
Just use full URL from prior step |
Endpoint |
{comparison_URL} |
Headers |
Authorization: AnaplanAuthToken {anaplan_auth_token} |
Body |
|
Tests |
Once we have identified compatible revisions in the source model and the latest revision in the target model, we are ready to execute a sync between the two models propagating changes from source model to the target model.
Request Method |
POST |
Base URL |
|
Endpoint |
/models/{target_model_id}/alm/syncTasks |
Headers |
Authorization: AnaplanAuthToken {anaplan_auth_token} Content-Type: application/json |
Body |
{ “sourceRevisionId”:”rev_tag_source”, “sourceModelId”: “ “targetRevisionId”: “last_rev_target” } |
Tests |
pm.environment.set(“rev_tag_source”, pm.response.json().revisions[0].id); |
Using taskId from Sync task execution, we can obtain status of sync task. Using following API information to check sync status.
Request Method |
GET |
Base URL |
|
Endpoint |
/models/{target_model_id}/alm/syncTasks/{sync_task_id} |
Headers |
Authorization: AnaplanAuthToken {anaplan_auth_token} |
Once sync is completed, you should new see two new countries (Chile, Portugal) and three locations (Santiago, Valparaiso, and Lisbon) in Geo Hierarchy of the target model,L1 Model Building Model Target.
Once the source to target model sync is complete, we are ready to bring the target model back online usingChange a model’s online statusAPI.
Request Method |
POST |
Base URL |
|
Endpoint |
/models/{target_model_id}/onlineStatus |
Headers |
Authorization: AnaplanAuthToken {anaplan_auth_token} Content-Type: application/json |
Body |
{ “status”: “online” } |
In this article, we outlined and described steps in an ALM process that guide automation of dev to prod model deployment using ALM APIs. You have learned how to perform following granular tasks using API:
You can, now, extend your experience with ALM APIs to other scripting languages such as python for end to end automation.
Got feedback on this content? Let us know in the comments below.
Another great article@joeymorisette@christophe_keom@pmarpakaand@annejulie
So needed.
Glad you like it@JaredDolich!
Let us know
ifwhenyou are playing with the APIs and your experience with those, we are looking forward to hearing about your experience!