This package has been deprecated

Author message:

The Amplify Central CLI package has been deprecated in favor of the Axway Central CLI: https://www.npmjs.com/package/@axway/axway-central-cli

@axway/amplify-central-cli

0.18.0 • Public • Published

@axway/amplify-central-cli

Amplify Central CLI package for managing Amplify Central resources and DevOps operations.

WARNING

THIS 'AMPLIFY CENTRAL CLI' PACKAGE IS BEING DEPRECATED. PLEASE UPGRADE TO AND INSTALL THE NEW 'AXWAY CENTRAL CLI' PACKAGE: https://www.npmjs.com/package/@axway/axway-central-cli

TO UNINSTALL THIS 'AMPLIFY CENTRAL CLI' PACKAGE, RUN:

[sudo] axway pm uninstall @axway/amplify-central-cli

For more documentation and examples please visit Amplify Central CLI documentation portal.

Installation

Note: OS support: Mac OS, Linux, Windows 10. Node.js version support: >= 10.13 Terminal shell support: Mac Terminal, Linux Terminal, Windows Command Prompt, Windows PowerShell. Not supported: Cygwin(Windows), Git Bash(Windows).

Note for existing users: The "Amplify CLI" core package has been deprecated in favor of the new "Axway CLI" package. The Amplify Central CLI supports both the old Amplify CLI core package and the new Axway CLI core package; however, for the purposes of this ReadME and the CLI command help text you may encounter, all commands that previously used the "amplify" keyword now use the "axway" keyword, even though both keywords are supported.

Assuming you are familiar with Node.js and npm, you should first install the Axway CLI, which will give you connectivity to the Axway Amplify Platform. Note that you must first have an account on https://platform.axway.com, and be provisioned in Amplify Central:

$ [sudo] npm install -g axway

Use the Axway package manager command to install the Amplify Central CLI:

# To install latest available version:
$ axway pm install @axway/amplify-central-cli
# If you want to install a specific prod version:
$ axway pm install @axway/amplify-central-cli@0.1.9
# or a specific dev version:
$ axway pm install @axway/amplify-central-cli@0.1.8-dev.12
# or a specific tag:
$ axway pm install @axway/amplify-central-cli@dev

Additional Installation Steps On Windows

After successfully installing amplify-central-cli, verify if OpenSSL is installed. OpenSSL is needed to generate public/private key pairs for service account authentication. This is a pre-requisite for the creation of service accounts.

Install OpenSSL if not installed already. You can download and install OpenSSL from here Download OpenSSL

After installing OpenSSL, ensure it is added to your path (C:\Program Files\OpenSSL-Win64\bin) in environment variables.

Verify if OpenSSL is installed and configured correctly

openssl version

Optional configurations

Enabling shell autocompletion

Our CLI provides autocompletion support for Bash or Zsh (Linux or MacOS), which can save you a lot of typing.

  • Zsh

    The completion script for Zsh can be generated with axway central completion --zsh. Sourcing the completion script in your shell enables autocomplete for the CLI.

    # add autocomplete to zsh for the current shell
    source <(axway central completion --zsh)
    # permanently add autocomplete to zsh
    echo "source <(axway central completion --zsh)" >> .zshrc

    If you get an error like complete:13: command not found: compdef, then add the following to the beginning of your ~/.zshrc file:

    autoload -Uz compinit
    compinit
  • Bash

    If you are on a Mac you may need to install the bash-completion script before you begin. To do so run brew install bash-completion

    The completion script for Bash can be generated with axway central completion --bash. Sourcing the completion script in your shell enables autocomplete for the CLI.

    # add autocomplete to bash for the current shell
    source <(axway central completion --bash)
    # permanently add autocomplete to bash
    echo "source <(axway central completion --bash)" >> .bashrc

Getting started

Log in to the Axway Amplify Platform using the following command:

# If using a regular account
axway auth login
# If using a specific client-id
axway auth login --client-id apicentral
# If using a service(DOSA) account
axway auth login --client-id <DOSA Service Account> --secret-file <Private Key>

Log out of the Axway Amplify Platform using the following command:

$ axway auth logout

To see available help, options and examples add -h or --help option on any command:

$ axway auth logout -h

General usage

USAGE: axway central <command> [options]

Manage APIs, services and publish to the Unified Catalog

Axway CENTRAL COMMANDS:
  apply         Update resources from a file
  completion    Output shell completion code
  config        Configure Central CLI settings
  create        Create one or more resources from a file or stdin
  delete        Delete resources
  edit          Edit and update resources by using the default editor
  get           List one or more resources
  proxies       Manage API proxies

Commands reference:

CONFIG

Configuration is saved on disk to allow you to be able to use them across commands.

axway central config <command> [options]

CONFIG COMMANDS:
  list  View Central CLI settings
  set   Set Central CLI settings

Region configuration

Region configuration identifies the Amplify Central instance whose servers you want to send your requests to. Possible values are US or EU (US is used by default):

# to point CLI to EU region:
axway central config set --region=EU
# to point CLI to US region:
axway central config set --region=US

You can always override current region setting in every command by adding optional --region=<value> flag:

axway central get environments --region=EU

Client id configuration

Note: Only required for DOSA service accounts.

Amplify Central CLI allows you to provide --client-id with every command you run.

axway central get environments --clientId=<DOSA Service Account>

Preferred: save your DevOps account clientId for future operations.

axway central config set --clientId=<DOSA Service Account>
# run commands without --client-id param
axway central get environments

Extensions:

You can set up extensions to the Amplify Central CLI. Extensions can be a npm package, a Javascript file or even an executable. Once set, you would be able to use these extensions as commands from within the Amplify Central CLI.

Tip: You can create extensions using our cli-kit which is the same framework used by Amplify Central CLI.

axway central config set extensions.<name> <path_to_executable>

setting extension example:

# set the name and the path to your extension
axway central config set extensions.my-extension '~/myExtension'
# my-extension can then be used as a command from the Amplify Central CLI
axway central my-extension ...

Proxy configuration:

Note: Please always check Axway CLI docs for the latest proxy configuration instructions.

Amplify Central CLI relies on the Axway CLI configuration for proxy support. To set the proxy URL:

axway config set network.httpProxy http://proxy.int:9090

If the proxy is using a self-signed certificate and you see SSL errors, you can disable the SSL check by setting 'strictSSL' to false:

axway config set network.strictSSL false

Listing config:

You can see all your saved configuration using:

axway central config ls

PROXIES

axway central proxies <command> [options]

PROXIES COMMANDS:
  create
  promote

PROXIES OPTIONS:
  --client-id=<value>  Override your DevOps account client ID
  --json  Show JSON output

proxies: create/update a proxy:

axway central proxies create [options] <proxyDefinition>

CREATE AMPLIFY CENTRAL PROXY ARGUMENTS:
  proxyDefinition  A YAML definition of your proxy

CREATE AMPLIFY CENTRAL PROXY OPTIONS:
  -f,--force  force create a new proxy

PROXIES OPTIONS:
  --client-id=<value>  Override your DevOps account client ID
  --json  Show JSON output

Cli supports multiple versions of proxy definition file. For more details and examples visit our docs portal and stoplight hub.

  • v0
apiVersion: v1
proxy:
  name: 'Musical Instruments'
  basePath: /api/v1
  swagger: 'https://ec062a054a2977120b7e721801edb38ca24dfbb3.cloudapp-enterprise.appcelerator.com/apidoc/swagger.json'
  policy:
    type: api-key
    app: 'Sample App'
  tags: ['musical', 'instruments']
  team:
    name: 'Default Team'
  • v1
apiVersion: v1
version: v1
proxy:
  name: 'Musical Instruments'
  basePath: /api/v1
  swagger: 'https://ec062a054a2977120b7e721801edb38ca24dfbb3.cloudapp-enterprise.appcelerator.com/apidoc/swagger.json'
  policies:
    clientAuth:
      type: api-key
      app: 'Sample App'
    backendAuth:
      type: auth-http-basic
      username: Joe
      password: changeme
    rateLimit:
      perProxy: 5
      perProxyAndApp: 3
  apps:
    - name: 'Second Sample App'
  team:
    name: 'Default Team'

proxies: promote/deploy a proxy:

axway central proxies promote [options] <proxyDefinition>

PROMOTE AMPLIFY CENTRAL PROXY ARGUMENTS:
  proxyDefinition  A YAML definition of your proxy

PROMOTE AMPLIFY CENTRAL PROXY OPTIONS:
  --source=<runtime>  The runtime to promote from
  --target=<runtime>  The runtime to promote to

PROXIES OPTIONS:
  --client-id=<value>  Override your DevOps account client ID
  --json  Show JSON output

proxies examples

# create a proxy
axway central proxies create ./some/folder/proxy.yaml
# promote a proxy
axway central proxies promote ./some/folder/proxy.yaml --target="Test Runtime"

GET

Prints a table of the most important information about the specified resources.

If the desired resource type is scoped you will need to specify the scope name by providing -s, --scope <name> flag.

You can query for more than one resource if using comma-separated resources in the command (see the examples).

Querying for multiple resources will display multiple result tables, one result table for each resource you fetch.

To see the list of all available resources on the server run axway central get:

RESOURCE                  SHORT NAMES  RESOURCE KIND                   SCOPED  SCOPE KIND
apiserviceinstances       apisi        APIServiceInstance              true    Environment
apiservicerevisions       apisr        APIServiceRevision              true    Environment
apiservices               apis         APIService                      true    Environment
apispecs                               APISpec                         true    K8SCluster
awsdataplanes             awsdp        AWSDataplane                    true    Environment
awsdiscoveryagents        awsda        AWSDiscoveryAgent               true    Environment
awstraceabilityagents     awsta        AWSTraceabilityAgent            true    Environment
consumerinstances         consumeri    ConsumerInstance                true    Environment
consumersubscriptiondefs  consumersd   ConsumerSubscriptionDefinition  true    Environment
edgedataplanes            edgedp       EdgeDataplane                   true    Environment
edgediscoveryagents       edgeda       EdgeDiscoveryAgent              true    Environment
edgetraceabilityagents    edgeta       EdgeTraceabilityAgent           true    Environment
environments              env          Environment                     false
integrations                           Integration                     false
k8sclusters               k8sc         K8SCluster                      false
k8sresources              k8sr         K8SResource                     true    K8SCluster
meshes                    mesh         Mesh                            false
resourcediscoveries       resourced    ResourceDiscovery               true    K8SCluster
resourcehooks             resourceh    ResourceHook                    true    Integration
secrets                                Secret                          true    Integration
secrets                                Secret                          true    Environment
specdiscoveries           specd        SpecDiscovery                   true    K8SCluster
webhooks                  webh         Webhook                         true    Integration
webhooks                  webh         Webhook                         true    Environment

You can fetch resources by Resource, by Short Name, or by the specific Resource Name. See "get examples" below.

USAGE: axway central get [options] [<args...>]

Display one or many resources.

GET ARGUMENTS:
  args...               Command arguments, run "axway central get" to see the examples

GET OPTIONS:
  --client-id=<value>   Override your DevOps account's client ID
  -o,--output=<value>   Additional output formats. One of: yaml | json
  -s,--scope=<name>     Scope name for scoped resources.

get examples

# get all environments
axway central get envs
# get all environments in yaml format
axway central get environments -o yaml
# get environment by Resource/Common name in json format
axway central get env myenv -o json
# get all webhooks
axway central get webhooks
# get all webhooks by Short Name
axway central get webh
# get all webhooks and apiservices by Short Name
axway central get webh,apis
# get all environments and api services
axway central get envs,apisvc
# get environment and apiservice which matches a Resource/Common Name in a specified scope(scope is required ater -s flag) in json format
axway central get env,apisvc commonname -s env1 -o json

CREATE

USAGE: axway central create <command> [options]

Create one or more resources from a file or stdin

CREATE COMMANDS:
  environment   Create an environment with the specified name
  service-account Create a service account

CREATE OPTIONS:
  --client-id=<value>   Override your DevOps account's client ID
  -f,--file=<path>      Filename to use to create the resource
  -o,--output=<value>   Additional output formats. One of: yaml|json

create: multiple resources from a file

USAGE: axway central create -f <path_to_file>

create: specific resource by name

Note: Only environments are currently available for this command.

USAGE: axway central create environment [options] <name>

Create an environment with the specified name

ENVIRONMENT ARGUMENTS:
  name          Name of new environment

CREATE OPTIONS:
  --client-id=<value>   Override your DevOps account's client ID
  -f,--file=<path>      Filename to use to create the resource
  -o,--output=<value>   Additional output formats. One of: yaml|json

create examples

# create new environment with "newenv" name
axway central create env newenv
# create new environment with "newenv" name and output result in yaml
axway central create environment newenv -o yaml
# create multiple resources from file
axway central create -f ./some/folder/resources.yaml
# create a service account(DOSA)
axway central create service-account

APPLY (create or update)

The resource name must be specified in the file. This resource will be created if it doesn't exist yet.

Note: apply command removes the resourceVersion from metadata of the resource to avoid conflict of resource creation

USAGE: axway central apply [options]

Update resources from a file

APPLY OPTIONS:
  --client-id=<value>   Override your DevOps account's client ID
  -f,--file=<path>      Filename to use to create or update the resources. One of: yaml | json
  -o,--output=<value>   Additional output formats. One of: yaml | json

apply examples

# create multiple resources from file
axway central apply -f ./some/folder/resources.yaml
# create multiple resources from file and output results in YAML format
axway central apply -f ./some/folder/resources.json -o yaml

DELETE

Delete resources type and name or by filename. When deleting the single resource by its name if the desired resource type is scoped you will need to specify the scope name by providing -s, --scope <name> flag. To see the list of all available resources on the server run axway central delete.

USAGE: axway central delete [options] [<args...>]

Delete resources

DELETE ARGUMENTS:
  args...               Command arguments, run "axway central delete" to see the examples

DELETE OPTIONS:
  --client-id=<value>   Override your DevOps account's client ID
  -f,--file=<path>      Filename to use to delete the resource
  -s,--scope=<name>     Scope name for scoped resources.
  --wait                Wait for the resources to be completely deleted

delete examples

# delete environment by name
axway central delete environment newenv
# delete api service by name (a scoped resource)
axway central delete apisvc someapisvc -s newenv
# delete all resources specified in the file
axway central delete -f ./some/folder/resources.yaml

EDIT

USAGE: axway central edit <command> [options]

Edit and update resources by using the default editor

EDIT COMMANDS:
  environment   Edit an environment with the specified name.

EDIT OPTIONS:
  --client-id=<value>   Override your DevOps account's client ID
  -o,--output=<value>   Additional output formats. One of: yaml|json

edit: resource by name

Using "environment" as an example.

USAGE: axway central edit environment [options] <name>

Edit an environment with the specified name.

ENVIRONMENT ARGUMENTS:
  name          Name of the environment

EDIT OPTIONS:
  --client-id=<value>   Override your DevOps account's client ID
  -o,--output=<value>   Additional output formats. One of: yaml|json

edit examples

# delete environment by name
axway central edit environment newenv

INSTALL (axway central / platform resources)

USAGE: axway central install <command> [options] [<args...>]

Install additional platform resources

INSTALL COMMANDS:
  agents                Install API Gateway v7 / Amazon API Gateway / Azure API Gateway / Kubernetes agent.

INSTALL ARGUMENTS:
  args...               Command arguments, run "axway central install" to see the examples

INSTALL OPTIONS:
  --client-id=<value>   Override your DevOps account's client ID
  --region=<value>      Override your region config

install: agents configuration

USAGE: axway central install agents [options]

API Gateway v7 / Amazon API Gateway / Azure API Gateway / Kubernetes

INSTALL OPTIONS:
  --client-id=<value>   Override your DevOps account's client ID
  --region=<value>      Override your region config

install examples

# install agent configuration in interactive mode
axway central install agents

Author

Axway support@axway.com https://axway.com

License

This code is proprietary, closed source software licensed to you by Axway. All Rights Reserved. You may not modify Axway’s code without express written permission of Axway. You are licensed to use and distribute your services developed with the use of this software and dependencies, including distributing reasonable and appropriate portions of the Axway code and dependencies. Except as set forth above, this code MUST not be copied or otherwise redistributed without express written permission of Axway. This module is licensed as part of the Axway Platform and governed under the terms of the Axway license agreement (General Conditions) located here: https://support.axway.com/en/auth/general-conditions; EXCEPT THAT IF YOU RECEIVED A FREE SUBSCRIPTION, LICENSE, OR SUPPORT SUBSCRIPTION FOR THIS CODE, NOTWITHSTANDING THE LANGUAGE OF THE GENERAL CONDITIONS, AXWAY HEREBY DISCLAIMS ALL SUPPORT AND MAINTENANCE OBLIGATIONS, AS WELL AS ALL EXPRESS AND IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO IMPLIED INFRINGEMENT WARRANTIES, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, AND YOU ACCEPT THE PRODUCT AS-IS AND WITH ALL FAULTS, SOLELY AT YOUR OWN RISK. Your right to use this software is strictly limited to the term (if any) of the license or subscription originally granted to you.

Package Sidebar

Install

npm i @axway/amplify-central-cli

Weekly Downloads

2

Version

0.18.0

License

SEE LICENCE IN LICENSE

Unpacked Size

707 kB

Total Files

140

Last publish

Collaborators

  • buildernpmuser
  • nkeranova
  • axway-npm
  • bladedancer
  • ddimonov-axway
  • neon-axway
  • vchauhan
  • mdimitrova
  • pdzhorev
  • axway_alasdair
  • pltod2
  • pbozhkovaxway
  • mbonchev-axway
  • axway-vertex