Giter VIP home page Giter VIP logo

ccu-tool's Introduction

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/<queue_name>: Sends a purge request to the queue, containing the desired objects in JSON format.
  • GET /ccu/v2/queues/<queue_name>: Gets the length of the queue, informing the objects to be purged.
  • GET /ccu/v2/purges/<purge_id>: 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, 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

ccu-tool's People

Contributors

microwaves avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.