Akamai API for changes to Property Manager etc via CLI
These steps assume that you have ruby 2.3.1 or 2.4.2 installed
- Get credentials in Akamai control panel (Luna)
https://developer.akamai.com/introduction/Prov_Creds.html
- Once you get New Credential Client Secret copy them to local in ~/.edgerc file
It should resemble like this:
[default]
host = akaa-xxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx.luna.akamaiapis.net
client_token = akab-xxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx
client_secret = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
access_token = akab-xxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx
-
Ensure you have bundler installed:
gem install akamai_cloudlet_manager
This Gem provides a CLI, which makes akamai-cloudlet api calls very easy.
$ acm --help
// Lists all available commands
To update a policy version with new set of rules, these are series of steps you need to perform in order:
- Get policy version
# Get all versions of a policy
acm get_policy_versions --policy-id=POLICY_ID
- Clone policy version
# Clones the current policy version
acm clone_policy_version --policy-id=POLICY_ID
- Update the cloned policy(draft policy)
acm update_policy_version --draft-version=DRAFT_VERSION --file-path=FILE_PATH --origin-id=ORIGIN_ID --policy-id=POLICY_ID --rule-name=RULE_NAME
Optional parameter to the above command are:
--rule_type, rule type, e.g. "albMatchRule"
--cookie_rules, from which cookie rules can be constructed and updated to policy version, e.g. "abc=xyz"
- Activate policy version
Once rules look good in luna panel, you can activate policy to a given network(staging/production)
acm activate_policy_version --network=NETWORK --policy-id=POLICY_ID --version=VERSION