项目作者: apiheat

项目描述 :
Akamai Diagnostic Tools CLI
高级语言: Go
项目地址: git://github.com/apiheat/akamai-cli-diagnostic-tools.git
创建时间: 2018-11-16T13:52:48Z
项目社区:https://github.com/apiheat/akamai-cli-diagnostic-tools

开源协议:Apache License 2.0

下载


Akamai CLI for Diagnostic Tools

The Diagnostic Tools API allows you to diagnose many common problems Akamai customers experience when delivering content to their end users. It offers a programmatic alternative to many of the features available in the Luna Control Center, under the Resolve ⇒ Diagnostic Tools menu.

Should you miss something we gladly accept patches :)

CLI uses custom Akamai API client

Configuration & Installation

Credentials

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

  1. [default]
  2. client_secret = XXXXXXXXXXXX
  3. host = XXXXXXXXXXXX
  4. access_token = XXXXXXXXXXXX
  5. client_token = XXXXXXXXXXXX

In order to change section which is being actively used you can

  • change it via --config parameter of the tool itself
  • change it via env variable export AKAMAI_EDGERC_CONFIG=/Users/jsmitsh/.edgerc

In order to change section which is being actively used you can

  • change it via --section parameter of the tool itself
  • change it via env variable export AKAMAI_EDGERC_SECTION=mycustomsection

NOTE: Make sure your API client do have appropriate scopes enabled

Installation

The tool can be used as a stand-alone binary or in conjuction with Akamai CLI.

Execute the following from console

  1. > akamai install https://github.com/apiheat/akamai-cli-diagnostic-tools

Stand-alone

As part of automated releases/builds you can download latest version from the project release page

Usage

  1. NAME:
  2. akamai-cli-diagnostic-tools - A CLI to interact with Akamai Diagnostic Tools
  3. USAGE:
  4. akamai-cli-diagnostic-tools [global options] command [command options] [arguments...]
  5. VERSION:
  6. X.X.X
  7. AUTHORS:
  8. Petr Artamonov
  9. Rafal Pieniazek
  10. COMMANDS:
  11. diagnostic-link Generate/List/Get a unique link to send to a user to diagnose a problem
  12. ghost Ghost Location related actions, like 'dig', 'curl', 'mtr'
  13. gtm Get information about Global Traffic Management properties and gets test and target IPs for a domain and property.
  14. ip IP addresses related actions, like 'dig', 'curl', 'mtr', 'is cdn ip?' or 'ip geolocation' and so on
  15. translate-error, t Get information about error strings produced by edge servers when a request to retrieve content fails
  16. translate-request, tr Same as 'translate-error' command, but this is not waiting for final results and you need to 'launch', 'check' and 'get' requested information
  17. help, h Shows a list of commands or help for one command
  18. GLOBAL OPTIONS:
  19. --config FILE, -c FILE Location of the credentials FILE (default: "/Users/USERNAME/.edgerc") [$AKAMAI_EDGERC_CONFIG]
  20. --debug value Debug Level [$AKAMAI_EDGERC_DEBUGLEVEL]
  21. --section NAME, -s NAME NAME of section to use from credentials file (default: "default") [$AKAMAI_EDGERC_SECTION]
  22. --help, -h show help
  23. --version, -v print the version

Development

In order to develop the tool with us do the following:

  1. Fork repository
  2. Clone it to your folder ( within GO path )
  3. Ensure you can restore dependencies by running

    1. dep ensure
  4. Make necessary changes

  5. Make sure solution builds properly ( feel free to add tests )

    1. go build -ldflags="-s -w -X main.appVer=1.2.3 -X main.appName=$(basename `pwd`)"