https://github.com/microwaves/ccu-tool
Ruby bindings and CLI to interact with the Akamai CCU API
https://github.com/microwaves/ccu-tool
akamai akamai-api cdn devops ruby
Last synced: 2 months ago
JSON representation
Ruby bindings and CLI to interact with the Akamai CCU API
- Host: GitHub
- URL: https://github.com/microwaves/ccu-tool
- Owner: microwaves
- License: bsd-3-clause
- Created: 2017-10-17T15:33:07.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-17T16:04:45.000Z (over 7 years ago)
- Last Synced: 2025-02-15T10:16:27.300Z (4 months ago)
- Topics: akamai, akamai-api, cdn, devops, ruby
- Language: Ruby
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ccu-tool
ccu-tool provides ruby bindings and a CLI to easily interact with the Akamai CCU API(the API used for cache invalidation).
## API
Currently there are bindings for the three methods provided by the CCU API v2.
- POST `/ccu/v2/queues/`: Sends a purge request to the queue, containing the desired objects in JSON format.
- GET `/ccu/v2/queues/`: Gets the length of the queue, informing the objects to be purged.
- GET `/ccu/v2/purges/`: Gets the status of a previous purge request.## Dependencies
Before start to use the Library or the CLI tool, it's necessary to install the required dependencies.
Install [httpie](https://github.com/jkbrzt/httpie), on Debian-based systems the following installation should satisfy the dependencies.
```
$ sudo apt-get install httpie
```And on Red Hat-based systems:
```
$ sudo yum install httpie
```After the system dependencies were installed, you may now proceed to the Akamai's httpie plugin installation.
```
$ pip install httpie-edgegrid
```## Configuration
Create the `~/.edgerc` file containing the credentials for the API access(provided by Akamai).
## CLI tool usage
As the `--help` option suggests:
```
$ ccu-tool --help
Usage: ccu-tool [option] [argument]
-a, --arl-purge x,y,z Send purge request for the desired objects based on ARL
-c, --cp-purge x,y,z Send purge request for the desired objects based on CP codes
-l, --get-queue-length Get the length of the queue for purge requests
-s, --get-purge-status id Get the status of a previous purge request
```## Library usage
```
require_relative 'src/ccu_tool'objects = ["http://www.example.com/graphics/picture.gif", "http://www.example.com/documents/brochure.pdf"]
CCUTool.purge(objects)CCUTool.get_queue_length
CCUTool.get_purge_status(purge_id)
```## Author
Stephano Zanzin - [@microwaves](https://github.com/microwaves)