Skip to content

manasapala/devops-1

 
 

Repository files navigation

go code examples

This will guide you through the steps necessary to set up credentials and start playing with the sample code. Note that once you've set up credentials for one language, you don't need to re-create them for another language. If you set up the credentials for python, php will use the same credentials.

These instructions expect that you are in the examples/go subdirectory of your github clone.

Authentication and Provisioning

The easiest way to walk through the needed provisioning and authentication to get your credentials is by following the instructions on Authorizing your Client from the Getting started guide on our site. Once you have done this, you'll be able to run the 'diagnostic tools' example scripts.

In order to get the go code to run correctly you'll need to set up your $GOPATH to use the right path, and pull the appropriate library.

Make sure you're in the examples/go directory before starting.

export $GOPATH=`pwd`
go install github.com/akamai-open/AkamaiOPEN-edgegrid-golang

Diagnostic Tools - diagnostic_tools.py

The first example code to test is the diagnostic_tools.go script. The credentials from the creation step give you permission to run the "dig" command from the API.

./diagnostic_tools.py

This simple script runs the 'locations' call to find out where the Akamai servers are located. The API can run the 'dig' for you from any of these locations. Once it has done that, it grabs one at random and makes the dig call from there.

By reviewing the code you can see how simple it is to make API calls.

All of the sample code in the directory also supports --verbose to see the output on the screen, and/or --debug to see all of the HTTP traffic. These flags can help enormously in figuring out what's going wrong or how it's working.

./diagnostic_tools.py --verbose
./diagnostic_tools.py --debug

CCU (Purge) - ccu.py

We have a blog post with instructions on getting set up with the CCU API. Prerequisites: ccu credentials and edit the filename to a valid file on your system

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 56.4%
  • PHP 15.7%
  • JavaScript 15.0%
  • Perl 7.3%
  • Ruby 5.6%