The Akamai Network List Kit is a CLI that wraps Akamai's {OPEN} APIs to let you manage network lists and their items along with activation. You can create/list/remove and search for items and lists.
Should you miss something we gladly accept patches :)
CLI uses custom Akamai API client
=================
Set up your credential files as described in the authorization and credentials sections of the getting started guide on developer.akamai.com.
Tools expect proper format of sections in edgerc file which example is shown below
NOTE: Default file location is ~/.edgerc
[default]
client_secret = XXXXXXXXXXXX
host = XXXXXXXXXXXX
access_token = XXXXXXXXXXXX
client_token = XXXXXXXXXXXX
In order to change config file which is being used you can
--config parameter
of the tool itselfexport AKAMAI_EDGERC_CONFIG=/Users/jsmitsh/.edgerc
In order to change section which is being actively used you can
--section parameter
of the tool itselfexport AKAMAI_EDGERC_SECTION=mycustomsection
NOTE: Make sure your API client do have appropriate scopes enabled
The tool can be used as completly standalone binary or in conjuction with akamai-cli
akamai install https://github.com/apiheat/akamai-cli-netlist
As part of automated releases/builds you can download latest version from the project release page
From version 5.0.0 you can now enjoy using single credentials across all of your accounts.Please make sure the scopes are set correctly and that you have correct rights across your contracts.
> akamai netlist --account-switch-key 1123-ACS search --searchPattern "some-Pattern_" | jq '.[] | { name, type}'
> akamai netlist --account-switch-key 1-ABC782 get by-name --name some-list-name
> akamai netlist -ask 1-8282AD get by-name --name other_name_of_list
In the section you will find all information regarding the usage of our tool.
Getting a network list is possible either with name of the netlist or with the id.
get a specific network list by unique Id
akamai netlist get by-id --id 1234_UNIQID
get a specific network list by name
akamai netlist get by-name --name SOME-NAME
Get elements from a network list based on its name
akamai netlist get by-name --name some_list_name --includeElements | jq -r '.[].list'
You can search through network list based on name or elements which list includes
Find all network list where it has specific element or name
akamai netlist search --searchPattern 1.2.3.4 | jq
akamai netlist search --searchPattern someneNa | jq
akamai netlist items remove --id 1234_UNIQID --element 1.2.3.4
akamai netlist create list --name whitelist_placeholder
akamai netlist items add --id 1234_UNIQID --items ITEM1,ITEM2,ITEM3
akamai netlist items add --id 1234_UNIQID --from-file /path/to/file
This new functionality ( introduced from v6 ) allows you to synchronize destination list from either local file or from another network list.
To be sure that no mistakes are made sync supports --dry-run
option which will only display changes which would be applied.
bash-5.0# akamai netlist sync --dry-run aka --id-src 1231_UNIQID1 --id-dst 1234_UNIQID
{
"remmove": [
"1.2.3.4"
],
"add": [
"5.6.6.8"
]
}
Before applying changes duplicates are automatically removed
In all cases if the sync process will recognize addresses that would need to be removed from the target list you need to use
--force
switch to indicate that you allow for that action.
Synchronize from file
akamai netlist sync local --from-file /path/to/file --id-dst 1234_UNIQID
Synchronize two network lists in Akamai
akamai netlist sync aka --id-src 1234_DUMMYDELETE1 --id-dst 1234_UNIQID --force
Subscribe to notifications
akamai netlist notification --networkListsIDs 1234_UNIQID --notificationRecipients rafpe@mailinator.com
Unsubscribe from notifications
akamai netlist notification --networkListsIDs 1234_UNIQID --notificationRecipients rafpe@mailinator.com --unsubscribe
Activate network list
akamai netlist activate list --id 1234_UNIQID --notificationRecipients rafpe@mailinator.com
akamai netlist activate list --id 1234_UNIQID --notificationRecipients rafpe@mailinator.com --prd
Get activation status
akamai netlist activate status --id 1234_UNIQID
In order to develop the tool with us do the following:
dep ensure -v
go build -ldflags="-s -w -X main.appVer=1.2.3 -X main.appName=$(basename `pwd`)"