Coder Social home page Coder Social logo

akamai / cli Goto Github PK

View Code? Open in Web Editor NEW
205.0 42.0 83.0 7.26 MB

Manage and configure Akamai from the Command Line.

Home Page: https://techdocs.akamai.com/developer/docs/about-clis

License: Apache License 2.0

Go 93.96% Shell 5.06% Makefile 0.98%
cli akamai devexp-cli devexp akamai-cli akamai-devexp

cli's Introduction

Akamai CLI

Build Status Go Report Card GitHub release License GoDoc

Use Akamai CLI to configure Akamai platform and products directly from the command line. You can install ready-to-use product packages or build your own custom solutions to manage from CLI.

Benefits

  • Simple and task-oriented interface
  • Consistent user experience across all Akamai products
  • Wide range of supported packages and capabilities
  • Extend or build your own CLI packages with supported programming languages such as Go, Python, and JavaScript

Available Packages

Browse the list of available packages.

Install Akamai CLI

Akamai CLI doesn't have any dependencies and is quick to install. However, you may need an additional runtime for packages depending on the programming language they are based on.

Install Akamai CLI by downloading a release binary. See instructions for various operating systems.

You can also use Homebrew, Docker, or compile from source.

System dependencies for Python-based packages

If you're using a Python-based CLI package, install these extra dependencies:

Install from binaries

Follow the instructions for your operating system.

Linux and macOS

Once you download the appropriate binary for your system, make it executable, and optionally make it available in your $PATH. Run the following commands:

$ chmod +x ~/Downloads/akamai-<VERSION>-<PLATFORM>
$ mv ~/Downloads/akamai-<VERSION>-<PLATFORM> /usr/local/bin/akamai

Windows

Once you download the appropriate binary for your system, simply execute the binary from the command line. For example:

$ akamai.exe help

Install with Homebrew

You can also install Akamai CLI using the Homebrew package manager. If you haven’t used it before, check Homebrew documentation for system requirements and read the installation guide.

Once set up, simply run:

$ brew install akamai

This command compiles and globally installs the binary with all necessary dependencies.

Install with Docker

A container with Akamai CLI and pre-installed public packages is also available in Docker. All images are built using Docker files from the akamai-docker repository. You can find all Akamai builds on Docker Hub.

To start, create and run the container with Akamai Development Environment:

$ docker run -it -v $HOME/.edgerc:/root/.edgerc:ro akamai/shell

Note: This mounts your local $HOME/.edgerc into the container. To change the local path, modify the -v argument.

The akamai command and basic packages are already installed. See the akamai-docker repository for more details.

If you want to open Akamai Development Environment when calling the akamai command, add the following line to your .bashrc, .bash_profile, or .zshrc files:

alias akamai='docker run -it -v $HOME/.edgerc:/root/.edgerc:ro akamai/shell'

If you want to use a local .akamai-cli directory to configure and manage your installed packages, modify the -v argument:

$ docker run -it -v $HOME/.akamai-cli:/cli/.akamai-cli akamai/shell

This command installs the CLI and persists the configuration and packages in $HOME/.akamai-docker directory.

Compile from Source

Prerequisite: Make sure you install Go 1.17 or later.

To compile Akamai CLI from source:

  1. Change the working directory:

    $ cd $GOPATH
  2. Fetch the package:

    $ git clone github.com/akamai/cli
  3. Go to the package directory:

    $ cd cli
  4. Compile the binary:

  • For Linux, macOS, and other Unix-based systems, run: go build -o akamai cli/main.go
  • For Windows, run: go build -o akamai.exe cli/main.go
  1. Move the akamai or akamai.exe binary so that it's available in your $PATH.

API credentials

Akamai-branded packages use a .edgerc file for standard EdgeGrid authentication. By default, CLI looks for credentials in your $HOME directory.

You can override both the file location or the credentials section by passing the --edgerc or --section flags to each command.

To set up your .edgerc file, see Get started with APIs.

Upgrade

Unless you installed Akamai CLI with Homebrew, you can enable automatic check for updates when you run Akamai CLI v0.3.0 or later for the first time.

When run for the first time, CLI asks you to enable automatic upgrades. If you do not agree, last-upgrade-check=ignore is set in the .akamai-cli/config file (this option will still allow you to perform manual upgrade as explained below). Otherwise, if a new version is available, CLI prompts you to download it. Akamai CLI automatically checks the new version's SHA256 signature to verify it is not corrupt. After the update, your original command executes using the new version.

For information on manual upgrade and the supported Homebrew command, see akamai upgrade in Built-in commands.

How to use Akamai CLI

All CLI commands start with the akamai binary, followed by a command, and optionally an action or other arguments.

akamai [global flags] [command] [action] [arguments...]

Global flags

Use following flags to modify the Akamai CLI behaviour or get additional information:

  • --edgerc value, -e value

    akamai --edgerc ~/.edgerc2 ... enables to use different configuration file than default ~/.edgerc (in this case ~/.edgerc2)

  • --section value, -s value

    akamai --section cps ... enables to use different section in configuration file than default default (in this case cps)

  • --accountkey value, --account-key value

    akamai --accountkey 1-ABCD:Z-XYZ ... enables to use account switch key (in this case 1-ABCD:Z-XYZ)

  • --help

    akamai --help shows basic usage info and available commands

  • --bash

    akamai --bash shows help on using auto-complete with bash

  • --zsh

    akamai --zsh shows help on using auto-complete with zsh

  • --proxy value

    akamai --proxy http://example.com:8080 ... sets a proxy to use (in this case http://example.com:8080)

  • --version

    akamai --version shows version number of currently installed Akamai CLI

Built-in commands

Use the following commands to manage packages and the toolkit:

  • help

    akamai help shows basic usage info and available commands. To learn more about a specific command, run akamai help <command> [sub-command].

  • list

    akamai list shows a list of available commands. If a command doesn't display, ensure the binary is executable and in your $PATH.

  • install

    This installs new packages from a git repository.

    akamai install <package name or repository URL> downloads and installs the command repository to the $HOME/.akamai-cli directory.

    For Github repositories, specify user/repo or organization/repo. For official Akamai packages, you can omit the akamai/cli- prefix. For example, to install akamai/cli-property-manager, it's enough to run property-manager.

    These examples all install Akamai CLI for Property Manager from Github using various aliases:

    akamai install property-manager
    akamai install akamai/cli-property-manager
    akamai install https://github.com/akamai/cli-property-manager.git

    The install command accepts more than one argument, so you can install many packages at once using any of these types of syntax.

  • uninstall

    To remove all the package files you installed with akamai install, run akamai uninstall <command>, where <command> is any command within that package.

    The uninstall command accepts more than one argument, so you can uninstall many packages at once.

  • update

    To update a package you installed with akamai install, run akamai update <command>, where <command> is any command within that package.

    You can specify multiple packages to update at once.

    If you don't specify additional arguments, akamai update updates all packages installed with akamai install

  • upgrade

    Manually upgrade Akamai CLI to the latest version.

    If you installed Akamai CLI with Homebrew, run this command instead:

    $ brew upgrade akamai
  • search

    Search all the packages published on developer.akamai.com for the submitter string. Searches apply to the package name, alias, and description. Search results appear in the console output.

  • config

    View or modify the configuration settings that drive the common CLI behavior. Akamai CLI maintains a local configuration file in its root directory. The config command supports these sub-commands:

    • get
    • set
    • list
    • unset or rm

Installed commands

This commands depend on your installed packages. To use an installed command, run akamai <command> <action> [arguments], for example:

akamai property-manager new-property -p example.org -g grp_123456 -c ctr_X-XXXXXX -d prd_Web_App_Accel

For the list of supported commands, see the documentation for each package.

Custom commands

Akamai CLI provides a framework for writing custom CLI commands. See the extended Akamai CLI documentation to learn how to contribute, create custom packages, and build commands.

Before you start to build your own commands, make sure you meet these prerequisites:

  1. The package is available through a Git repository that supports standard SSH public key authentication.
  2. The executable is named akamai-<command> using dashed-lowercase, or akamai<Command> using camelCase.
  3. Verify that akamai-command help works for you. Ideally, CLI should allow for akamai-command help <sub-command>.
  4. If you're using Akamai APIs, the executable must support the .edgerc format, and must support both --edgerc and --section flags.
  5. If an action fails to complete, the executable exits with a non-zero status code.

As long as the result is executable, you can use any of the supported languages to build your commands, including Python, Go, and JavaScript.

Logging

To see additional log information, prepend AKAMAI_LOG=<logging-level> to any CLI command. You can specify one of the following logging levels:

  • fatal
  • error
  • warn
  • info
  • debug

For example, to see extra debug information while updating the property-manager package, run:

AKAMAI_LOG=debug akamai update property-manager

Each level is a progressive superset of all previous tiers. The output for debug also includes fatal, error, warn, and info logs.

If you want to redirect logs to a file, use the AKAMAI_CLI_LOG_PATH environmental variable:

AKAMAI_LOG=debug AKAMAI_CLI_LOG_PATH=akamai.log akamai update property-manager

Dependencies

Akamai CLI supports the following package managers that help you automatically install package dependencies:

  • Python: pip (using requirements.txt)
  • Go: go modules
  • JavaScript: npm and yarn

If you want to use other languages or package managers, make sure you include all dependencies in the package repository.

Command package metadata

The package you install needs a cli.json file. This is where you specify the command language runtime version and define all commands included in package.

Format

  • requirements: Specifies the runtime requirements. You may specify a minimum version number or use the * wildcard for any version. Possible requirements are:

    • go
    • node
    • python
  • commands: Lists commands included in the package.

    • name: The command name, used as the executable name.

    • aliases: An array of aliases that invoke the same command.

    • version: The command version.

    • description: A short description for the command.

    • bin: A URL to fetch a binary package from if it cannot be installed from source.

      The bin URL may contain the following placeholders:

      • {{.Version}}: The command version.
      • {{.Name}}: The command name.
      • {{.OS}}: The current operating system, either windows, mac, or linux.
      • {{.Arch}}: The current OS architecture, either 386 or amd64.
      • {{.BinSuffix}}: The binary suffix for the current OS: .exe for windows.

Example

{
  "requirements": {
    "go": "1.8.0"
  },
  "commands": [
    {
      "name": "purge",
      "version": "0.1.0",
      "description": "Purge content from the Edge",
      "bin": "https://github.com/akamai/cli-purge/releases/download/{{.Version}}/akamai-{{.Name}}-{{.OS}}{{.Arch}}{{.BinSuffix}}"
    }
  ]
}

Akamai CLI exit codes

When you complete an operation, Akamai CLI generates one of these exit codes:

  • 0 (Success) - Indicates that the latest command or script executed successfully.
  • 1 (Configuration error) - Indicates an error while loading AKAMAI_CLI_VERSION or AKAMAI_CLI.
  • 2 (Configuration error) - Indicates an error while creating the cache directory.
  • 3 (Configuration error) - Indicates an error while saving the cache-path.
  • 5 (Application error) - Indicates an error with the initial setup. Occurs when you run Akamai CLI for the first time.
  • 6 (Syntax error) - Indicates that the latest command or script cannot be processed.
  • 7 (Syntax error) - Indicates that the commands in your installed packages have conflicting names. To fix this, add a prefix to the commands that have the same name.

cli's People

Contributors

achuthananda avatar adedommelin avatar aetsai avatar akamaiopen avatar dawiddzhafarov avatar dependabot[bot] avatar dshafik avatar dstopka avatar edglynes avatar fossabot avatar igkoprow avatar javiergarza avatar lkowalsk-akamai-com avatar majakubiec avatar manoharams avatar mgwoj avatar mimazaka avatar nehaghateakamai avatar piotrpio avatar rahulbhatvedekar avatar rakayada avatar robertolopezlopez avatar rodriguise avatar securitylevelup avatar slonimskaia avatar synedra avatar vishnuatakamai avatar wzagrajcz avatar zenkars avatar zstlaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli's Issues

CLI package list not available

It appears that the CLI's package list URL is broken. Using a fresh download of v1.0.2 of the CLI (macOS 10.13.6 w/Homebrew), I get the following error...

tom.maher@goibniu:~$ akamai search property
Unable to fetch remote Package List (invalid character '<' looking for beginning of value)

Checking into the code (command_search.go, line 73), the URL appears to be https://developer.akamai.com/cli/package-list.json, which 302's to https://developer.akamai.com/legacy/cli/package-list.json, which 302's to https://developer.akamai.com/error

So, did this move?

Documentation of .edgerc sections

[alerts], [ccu], [papi], [default] are commonly known.

I've been able to discover [billingusage], [billingcenter], [cloudlet], [live], and [gtm] by looking through some python scripts.

Is there a document that shows the relationship of .edgerc sections to each service name in API Authorizations?

For example:

[papi] can have Property Manager as well as User Admin APIs.

image

As a new user of the CLI, it has been challenging to figure out which authorizations correspond with which .edgerc sections.

Installation experience for python packages

Can we have a more user-friendly experience for python packages?

There are instances wherein users have python 2.7 and it is better if CLI can error out with a message if the required version doesn't match with requirement.txt

similar issue is reported here akamai/cli-cps#7

Linux install constantly prompts for "install in path

On v0.4.1, constantly prompts for "Akamai CLI is not installed in your PATH, would you like to install it?" even when it is in the PATH. It would be good to also have a way to surpress this check (eg, when "n" is selected or otherwise be able to put a file in ~/.akamai-cli to disable the check).

It would also be good to disable this check entirely if stdin/stdout isn't a tty (ie, if the akamai-cli isn't being used interactively then trying to prompt for anything is problematic.)

Support published apt-get package

It would be helpful for people using puppet or chef to be able to download versions of the akamai cli if it were shipped via apt. Right now it's really tough to get the downloads from github releases and also figuring out how to pin to a specific version and upgrading later.

Readme incorrectly uses `akamai install`

The cli currently uses akamai get to install packages, but the README says akamai install. Seems like a minor issue, but I can see it being a frustration point for new users.

Certificate Error with private Repo

While i try to add a command using CLI get using a private repo, i see the below certificate error, looks like the client is expecting a CA signed Cert.

./akamai get https://../users//repos//
Attempting to fetch command...... [FAIL]
Unable to clone repository: Get https://
.
./users//repos/******/info/refs?service=git-upload-pack: x509: certificate signed by unknown authority

Unable to update the Property if existing property did not have hostnames

HI,

The following scenarios does not seem to be working.
Step 1: Create a property using CLI without hostname.
Step 2: Modify the property with hostname using CLI. This throws an error and does not add the hostname. ( When checked the code, it seems while adding hostname it first tries to retrieve existing set of hostnames and then add into the list. If, there are no existing hostnames: code does not fetch existing hostname: null and hence throws error). If the existing property has a hostname, while updating new hostname via CLI - it works.
PFA the use case.

screen shot 2017-12-07 at 6 07 42 pm

Remove residual files from Docker image

The docker image contains few residual files/folders as shown in screenshot below. They are not huge in size, about 16MB. However, it would be nice if they are removed to keep the image size minimum.

image

Python CLI extensions fail due to incorrect PYTHONPATH

Python CLI extensions that attempt to import packages from the .local package directory are failing with import errors:

$ akamai visitor-prioritization
Traceback (most recent call last):
  File "/Users/atal/.akamai-cli/src/cli-visitor-prioritization/bin/akamai-visitor-prioritization", line 19, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'

Multiple instances of CLI

This isnt an issue. A question/feedback.

Calling akamai get will download and install the command repository to the $HOME/.akamai-cli directory.

What if i want to have multiple separate instances of akamai CLI. As we are using $HOME here, looks like it will be shared across instances. Do you think its better to update/change to a relative path of CLI installed folder?

install of ruby-based plugins fails, but without error

on systems with ruby installed, but no bundler gem, installing of ruby-based cli plugins fails without notifying the user. the plugin appears to install successfully, but then is not usable because all the dependent gems are missing.

this is affecting macOS users. macOS version 10.12.6 (and earlier) include /usr/bin/ruby and /usr/bin/gem but not /usr/bin/bundler or bundler in any default PATH location. the bundler gem is not installed by default.

the issue seems to be that installRuby in package_ruby correctly returns false but then back in installPackageDependencies in command_install, the process does not stop execution if success is false. this is likely affecting other languages as well besides ruby.

akamai install should fail if it detects a Gemfile in the plugin source, but no bundle command installed.

$ akamai --version
akamai version 0.5.1
 $ akamai install rajiv/akamai-cli-certs
Attempting to fetch command from https://github.com/rajiv/akamai-cli-certs.git...... [OK]
Disclaimer: You are installing a third-party package, subject to its own terms and conditions. Akamai makes no warranty or representation with respect to the third-party package.
Installing.... 
Available Commands:

  help
    Displays help information
  list
    Displays available commands
  install (alias: get)
    Fetch and install packages from a Git repository.
  uninstall
    Uninstall package containing <command>
  update
    Update one or more commands. If no command is specified, all commands are updated
  certs (alias: cps)
    Manage Secure CDN certificates

See "akamai help [command]" for details.
$ akamai certs
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- akamai/api/cps (LoadError)
	from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/rmanglan/.akamai-cli/src/akamai-cli-certs/bin/akamai-certs:2:in `<main>'
$ gem list

*** LOCAL GEMS ***

bigdecimal (1.2.0)
CFPropertyList (2.2.8)
io-console (0.4.2)
json (1.7.7)
libxml-ruby (2.6.0)
minitest (4.3.2)
nokogiri (1.5.6)
psych (2.0.0)
rake (0.9.6)
rdoc (4.0.0)
sqlite3 (1.3.7)
test-unit (2.0.0.0)

Error installing Network Experience Analytics

Latest version of akamai, compiled from source (master branch) using go build -o akamai.

Attempting to fetch command from https://github.com/akamai/cli-network-experience-analytics.git.... 
Attempting to fetch command from https://github.com/akamai/cli-network-experience-analytics.git...... [OK]
Installing.... panic: runtime error: index out of range

goroutine 1 [running]:
main.installPython(0xc42001eb40, 0x44, 0xc4200ae400, 0x1, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/Users/travis.smith/Projects/GO/src/github.com/akamai/cli/package_python.go:42 +0x73d
main.installPackageDependencies(0xc42001eb40, 0x44, 0x1562e00, 0x1e)
	/Users/travis.smith/Projects/GO/src/github.com/akamai/cli/command_install.go:129 +0xce1
main.installPackage(0xc420015340, 0x3e, 0x0, 0x0, 0x4)
	/Users/travis.smith/Projects/GO/src/github.com/akamai/cli/command_install.go:99 +0x64d
main.cmdInstall(0xc4200a1080, 0x0, 0xc4200a1080)
	/Users/travis.smith/Projects/GO/src/github.com/akamai/cli/command_install.go:39 +0x145
github.com/urfave/cli.HandleAction(0x14a9500, 0x1574c78, 0xc4200a1080, 0xc420084500, 0x0)
	/Users/travis.smith/Projects/GO/src/github.com/urfave/cli/app.go:490 +0xd2
github.com/urfave/cli.Command.Run(0x15560fa, 0x7, 0x0, 0x0, 0xc42013c370, 0x1, 0x1, 0x0, 0x0, 0x157019d, ...)
	/Users/travis.smith/Projects/GO/src/github.com/urfave/cli/command.go:210 +0xa95
github.com/urfave/cli.(*App).Run(0xc42008f6c0, 0xc4200100f0, 0x3, 0x3, 0x0, 0x0)
	/Users/travis.smith/Projects/GO/src/github.com/urfave/cli/app.go:255 +0x6f8
main.main()
	/Users/travis.smith/Projects/GO/src/github.com/akamai/cli/akamai.go:43 +0xa1```

Add Getting Started Documentation to Docker Container

When the docker container starts the user is dropped into a shell but given no directions on how to proceed. We should add some simple directions to the .bashrc or similar to make it easier to get up and running.

Add the ability to call commands with a package prefix to allow clashing packages to work

If two packages contain the same command, the current behavior is undefined (the first one encountered is executed).

It should be possible to prefix a command with it's package name to explicitly determine which one is run, e.g. if two packages named "property" and "promotional-deployment" both have a "property" command, you would call:

$ akamai property/property
$ akamai promotional-deployment/property

Akamai CLI should error out if the unqualified name resolves to more than one command.

Ensure Proxy Support

Ensure that existing packages support the HTTP_PROXY environment variable, and document that this is requirement for all packages.

Golang's net/http and Python's requests support this by default, I am unsure about Node/JS.

Windows Install Continually Prompts to "Install In Path"

When executing the Windows .exe (akamai-0.3.1-windowsamd64.exe), I am prompted to install the AkamaiCLI to my path. I select a path for install, and the process completes.

On subsequent attempts to run AkamaiCLI, I continue to be prompted to Install to path. I can select "No", and use AkamaiCLI to install and use the Property/Purge modules .

System Info
image

Screenshot

image

install failing with a cryptic message

I installed akamai cli on windows 10. Then issued the following command.

akamai install netstorage

I see the following spew. I am running this on a box that needs proxy credentials to access internet.
Attempting to fetch command from https://github.com/akamai/cli-netstorage.git...... [OK]
Installing...... [OK]
Unable to locate Node.js runtime
Binary command(s) found, would you like to try download and install it? (Y/n): Y
Downloading binary...... [FAIL]
Unable to download binary: Unable to locate Node.js runtime

CLI Update command

In the documentation, the command to update the CLI package is:

akamai upgrade

When I run the CLI and look for help, I get this:

akamai
Usage: 
   akamai [global flags] command [command flags] [arguments...]

Built-In Commands:
   help
   list
   get
   update

And I was able to update using the akamai update command. So maybe the documentation needs to be corrected. Please could you check?

Cannot install appsec: Downloading binary fail

When I try to install appsec, I get the following issue

$ akamai install appsec
Attempting to fetch command from https://github.com/akamai/cli-appsec.git...... [OK]
Downloading binary...... [FAIL]
... [FAIL]
exit status 1

I'm connected to the internet, etc. and akamai install property worked fine.

What's going wrong? How can I get a more verbose log of the install?

"uninstall" command

it would be useful to have a command to remove plugins: akamai uninstall foo

Handle errors in sub-commands

Currently if a sub-command emits a non-zero status, nothing else is output.

$ akamai property create
exit status 1

vs:

$ akamaiProperty create

  error: missing required argument `property'

akamai should proxy the underlying sub-command exactly, outputting all STDOUT/STDERR, allowing for STDIN, and forwarding exit signals.

Authentication issue for private Repo

Unable to fetch private repo in github.

Here is the command line log. username and repo are starred.

./akamai get mr/cli-c**n
Attempting to fetch command...... [FAIL]
Unable to clone repository: authentication required

All python packages dont work.

The packages that use python (cli-firewall, cli-vp, cli-cps) all fail with the same error:

[jenkins@retailbuild01 ~]$ akamai fw
  File "/var/lib/jenkins/.akamai-cli/src/cli-firewall/bin/akamai-firewall", line 192
    **arg,
         ^
SyntaxError: invalid syntax
[jenkins@retailbuild01 ~]$ akamai vp
  File "/var/lib/jenkins/.akamai-cli/src/cli-visitor-prioritization/bin/akamai-visitor-prioritization", line 237
    **arg,
         ^
SyntaxError: invalid syntax
[jenkins@retailbuild01 ~]$ akamai cps
  File "/var/lib/jenkins/.akamai-cli/src/cli-cps/bin/akamai-cps", line 240
    **arg,
         ^
SyntaxError: invalid syntax
[jenkins@retailbuild01 ~]$ akamai ss
  File "/var/lib/jenkins/.akamai-cli/src/cli-firewall/bin/akamai-site-shield", line 180
    **arg,
         ^
SyntaxError: invalid syntax
[jenkins@retailbuild01 ~]$ akamai update
Attempting to update "appsec" command...... [OK]
command "appsec" already up-to-date
Attempting to update "auth" command...... [OK]
command "auth" already up-to-date
Attempting to update "cps" command...... [OK]
command "cps" already up-to-date
Attempting to update "dns" command...... [OK]
command "dns" already up-to-date
Attempting to update "firewall" command...... [OK]
command "firewall" already up-to-date
Attempting to update "site-shield" command...... [OK]
command "site-shield" already up-to-date
Attempting to update "netstorage" command...... [OK]
command "netstorage" already up-to-date
Attempting to update "property" command...... [OK]
command "property" already up-to-date
Attempting to update "purge" command...... [OK]
command "purge" already up-to-date
Attempting to update "firewall" command...... [OK]
command "firewall" already up-to-date
Attempting to update "site-shield" command...... [OK]
command "site-shield" already up-to-date
Attempting to update "visitor-prioritization" command...... [OK]
command "visitor-prioritization" already up-to-date
[jenkins@retailbuild01 ~]$ akamai upgrade
Checking for upgrades...... [OK]
Akamai CLI (v1.0.2) is already up-to-date

Improve the Docker Container

Currently there are several issues with the Docker container:

  • Only cli-property and cli-purge packages are included
  • Use of ENTRYPOINT makes calling akamai directly difficult (you must use: docker run -v $HOME/.edgerc:/root/.edgerc --entrypoint "akamai" akamaiopen/cli # other arguments for the akamai command
  • Currently it's not possible to use docker run followed by one or more calls to docker exec

Ideally we want the experience to be:

$ docker run -ti -v $HOME/.edgerc:/root/.edgerc akamaiopen/cli akamai help

or:

$ docker run -d -v $HOME/.edgerc:/root/.edgerc akamaiopen/cli
$ docker exec akamai help
$ docker exec akamai install foo
$ docker exec akamai foo

Additionally, as noted in #25, we should slim the container down as much as we can.

Error with credentials in Windows

I setup my credentials according to the guide and when I execute:

akamai property retrieve <property name removed on purpose>

I get the error below:

C:\Users\rmardeni\.akamai-cli\src\cli-property\node_modules\edgegrid\src\edgerc.js:69
    throw new Error('An error occurred parsing the .edgerc file. You probably specified an invalid section name.');
    ^

Error: An error occurred parsing the .edgerc file. You probably specified an invalid section name.
    at module.exports (C:\Users\rmardeni\.akamai-cli\src\cli-property\node_modules\edgegrid\src\edgerc.js:69:11)
    at EdgeGrid._setConfigFromObj (C:\Users\rmardeni\.akamai-cli\src\cli-property\node_modules\edgegrid\src\api.js:152:17)
    at new EdgeGrid (C:\Users\rmardeni\.akamai-cli\src\cli-property\node_modules\edgegrid\src\api.js:26:10)
    at new WebSite (C:\Users\rmardeni\.akamai-cli\src\cli-property\src\website.js:64:26)
    at main (C:\Users\rmardeni\.akamai-cli\src\cli-property\bin\akamaiProperty:499:20)
    at Object.<anonymous> (C:\Users\rmardeni\.akamai-cli\src\cli-property\bin\akamaiProperty:609:1)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)

My username in my computer is rmardeni and the credentials were stored in c:\users\rmardeni.edgerc, what is wrong with this?

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.