This example was designed to update configurations that are active in the production and to update the variables provided and it will promote the changes to production, staging or both. It's meant to be a starting point to show how to edit Akamai Delivery Configurations using Akamai-OPEN API's when Akamai CLI is not an option.
- Search configuration
- Fetch Configuration details
- Fetch Configuration Rules
- Update Configuration Rules
- Modify Variables
- Create Configuration Version
- Activate Configuration
- Monitor Activation of Configuration.
-h, --help Show allowed Arguments and values.
-properties List of configurations to update. *
-network Akamai Network to Activate the configuration.
Allowed Values: STAGING,PRODUCTION,BOTH,NONE *
-baseline Configuration version to be used as the baseline. Production will be the only one allowed unless updated.
Allowed Values: Production, STAGING. *
-emails List of emails to be once activated. *
-note Note to be used when activating the configuration. *
-variables List of property variables to updated. *
-values List of variable values to updated. *
Note: * Required argument.
Based on the Arguments above here is an example of how to execute this script.
python akamaiapi.py -properties devops.somecompany.net -emails [email protected] -note "Sample Automation Script Run" -network STAGING -baseline PRODUCTION -variables PMUSER_EPS_ENABLED PMUSER_PSE_ENABLED -values FALSE FALSE
This are the liberies that you'll need to make sure it runs smoothly.
- requests
- json
- urllib
- datetime
- multiprocessing
- argparse
- time
- edgegrid
To run this script you will need python3 , pip3 and setuptools. Once pip3 and python3 are installed all additional dependencies are installed using the requierement.txt in the attachment provided.
pip3 install -r requirements.txt
If you don’t have python3 nor pip3 here are sample commands for Debian/Linux to get you to the wanted state.
apt-get install python3 python3-pip -y
python3 -m pip install setuptools
pip3 install -r requirements.txt
Keep in mind that is meant to be a sample script to build on top of, it is functional but it by no means cover every single scenario.
I am providing code and resources in this repository to you under an open source license. Because this is my personal repository, the license you receive to my code and resources is from me and not my employer (Akamai).
Copyright 2019 Roy Martinez
Creative Commons Attribution 4.0 International License (CC BY 4.0)
http://creativecommons.org/licenses/by/4.0/