- new version 0.5: I removed the associative arrays in the script for have the compatibility of bash version 3.x.
- In the User-Agent I added the version of the script.
- new version 0.4 of script. It's work too if the jq tool is not installed: in this case a INFO message displayed.
- new version 0.3 of script. I have fix the issue with the array compatibility in bash.
I have tested with bash version 4.1.2(2), 4.3.48(1), 4.4.12(3)
- new version 0.2 of script. Now it works correctly with cpcode and without domain option.
In collaboration with Marco De March of Akamai Italy I created a simple bash script for fast purging the Akamai cache.
You will find the files attached and run the script:
$> ./aka_purge.sh --help
To display options:
usage: aka_purge.sh [OPTIONS] -o <obj1[,obj2,obj3,...]>
Purge the Akamai cache via CCU REST API v3.
Please create a config file in ~/.akarc or /etc/.akarc
-o | --objects List of objects to purge (with comma separated values)
-t | --type Type of objects
Possible values: url, cpcode or tag
-d | --domain Domain site (es. your.domain.com).
To use with type=url
-a | --action The desired action to manage the cache
Possible values: invalidate or delete
-n | --network The network on which you want to invalidate or delete content
Possible values: staging or production
-h | --help Show this message
-v | --version Show version
In the config file the following values have to been declared:
client_secret = <your client secret>
client_token = <your client token>
access_token = <your access token>
host = <your akamai host>
There is the possibility to set the default values:
network = <staging | production>
action = <invalidate | delete>
type = <url | cpcode | tag>
If no values are declared the default ones are:
network = staging
action = invalidate
type = url
I hope that this script helps someone.