Anypoint Platform CLI
Display and interact with the Anypoint Platform from the command line. Supports interactive shell and standard CLI modes.
Installation from npm
npm install -g anypoint-cli
Installation from source
git clone https://github.com/mulesoft/anypoint-cli.git
cd anypoint-cli
npm install
node src/app.js
Usage
anypoint-cli [params] [command]
Note: Omitting command
will run anypoint-cli in interactive mode.
Required params:
username, password
Optional params:
organization, environment, host
Parameters are loaded from one of the profiles in ~/.anypoint/credentials
, which has the form
{
"default": {
"username": "",
"password": ""
},
"otherProfile": {
"username": "",
"password": "",
"organization": "",
"environment": "",
"host": ""
}
}
The 'default' profile is used unless ANYPOINT_PROFILE
env variable is set.
Environment variables override credentials file parameters (ANYPOINT_USERNAME, ANYPOINT_PASSWORD, ANYPOINT_ORG, ANYPOINT_ENV
)
Command line parameters override environment variables (--username, --password, --organization, —environment
)
If a 'password' parameter is not included, you will be prompted for one.
Commands
account user describe Show account details
account business-group list Lists business groups
account business-group describe <name> Show details of a business group
account environment list Lists environments
account environment create [options] <name> Create new environment
account environment delete <name> Delete an environment
runtime-mgr alert list Lists all alerts in the environment
runtime-mgr alert-history describe <name> Describe the history of the alarm
runtime-mgr application list Lists all applications in the environment
runtime-mgr application describe <name> Show application details
runtime-mgr application describe-json <name> Show raw application JSON response
runtime-mgr application stop <name> Stop a running application
runtime-mgr application start <name> Start an application
runtime-mgr application restart <name> Restart a running application
runtime-mgr application delete <name> Delete an application
runtime-mgr application deploy [options] <name> <zipfile> Deploy a new application
runtime-mgr application modify [options] <name> [zipfile] Modify an existing application, optionally updating the zip file
runtime-mgr application revert-runtime <name> Reverts application to its previous runtime
runtime-mgr application download-logs <name> <directory> Download application logs to specified directory
runtime-mgr application tail-logs <name> Tail application logs
cloudhub load-balancer list Lists all Load balancers in an organization
cloudhub load-balancer describe <name> Show LB details
cloudhub load-balancer describe-json <name> Show raw LB JSON response
cloudhub load-balancer create [options] <vpc> <name> <certificate> <privateKey> Create a Load balancer
cloudhub load-balancer start <name> Starts a Load balancer
cloudhub load-balancer stop <name> Stops a Load balancer
cloudhub load-balancer delete <name> Delete a Load balancer
cloudhub load-balancer ssl-endpoint add [options] <name> <certificate> <privateKey> Add an additional certificate to an existing
Load balancer
cloudhub load-balancer ssl-endpoint remove <name> <certificateName> Remove a certificate from a Load balancer
cloudhub load-balancer ssl-endpoint set-default [options] <name> <certificateName> Set the default certificate that the Load
balancer will serve
cloudhub load-balancer ssl-endpoint describe <name> <certificateName> Show the Load balancer configuration for a
particular certificate
cloudhub load-balancer whitelist add <name> <cidrBlock> Add an IP or range of IPs to the Load balancer
whitelist
cloudhub load-balancer whitelist remove <name> <cidrBlock> Remove an IP or range of IPs from the Load
balancer whitelist
cloudhub load-balancer mappings describe <name> [certificateName] Lists the proxy mapping rules for a Load
balancer. If no certificateName is given, the
mappings for the default SSL endpoint are shown
cloudhub load-balancer mappings add <name> <index> <inputUri> <appName> <appUri> [certificateName] Add a proxy mapping rule at the specified
indexIf no certificateName is given, the
mappings for the default SSL endpoint are shown
cloudhub load-balancer mappings remove <name> <index> [certificateName] Remove a proxy mapping ruleIf no
certificateName is given, the mappings for the
default SSL endpoint are shown
cloudhub region list Lists all supported regions
cloudhub runtime list Lists all available runtimes
cloudhub vpc list Lists all VPCs
cloudhub vpc describe <name> Show VPC details
cloudhub vpc describe-json <name> Show raw VPC JSON response
cloudhub vpc create [options] <name> <region> <cidrBlock> [environments...] Create a new VPC
cloudhub vpc delete <name> Delete an existing VPC
cloudhub vpc environments add [options] <vpc> [environments...] Modifies the VPC association to Runtime Manager
environments.
cloudhub vpc environments remove [options] <vpc> [environments...] Modifies the VPC association to Runtime Manager
environments.
cloudhub vpc business-groups add <vpc> <businessGroups...> Share a VPC with a list of Business Groups.
cloudhub vpc business-groups remove <vpc> <businessGroups...> Share a VPC with a list of Business Groups.
cloudhub vpc dns-servers set [options] <vpc> Sets the domain names that are resolved using
your internal DNS servers.
cloudhub vpc dns-servers unset <vpc> Clears the list domain names that are resolved
using your internal DNS servers
cloudhub vpc firewall-rules describe <vpc> Show firewall rule for Mule applications in
this VPC
cloudhub vpc firewall-rules add <vpc> <cidrBlock> <protocol> <fromPort> [toPort] Add a firewall rule for Mule applications in
this VPC
cloudhub vpc firewall-rules remove <vpc> <index> Remove a firewall rule for Mule applications in
this VPC
use business-group <name> Switch to specified business group
use environment <name> Switch to specified environment
Example output
> runtime-mgr describe-applications
┌────────────────────────────────────────┬───────────────┬──────────────────┬──────────────────┐
│ Application │ Status │ vCores │ Updated │
├────────────────────────────────────────┼───────────────┼──────────────────┼──────────────────┤
│ jeff-test-2 │ UNDEPLOYED │ 1 vCore * 1 │ 3 days ago │
│ cpu-killer.zip │ │ │ │
├────────────────────────────────────────┼───────────────┼──────────────────┼──────────────────┤
│ jeff-test-4 │ UNDEPLOYED │ 1 vCore * 1 │ 3 days ago │
│ cpu-killer.zip │ │ │ │
├────────────────────────────────────────┼───────────────┼──────────────────┼──────────────────┤
│ jeff-test │ STARTED │ 1 vCore * 2 │ a few seconds a… │
│ case36521-ch-error.zip │ │ │ │
└────────────────────────────────────────┴───────────────┴──────────────────┴──────────────────┘
> runtime-mgr describe-application jeff-test
┌──────────────────────────────┬──────────────────────────────────────────────────┐
│ Domain │ jeff-test.dev.cloudhub.io │
├──────────────────────────────┼──────────────────────────────────────────────────┤
│ Status │ STARTED │
├──────────────────────────────┼──────────────────────────────────────────────────┤
│ Updated │ a few seconds ago │
├──────────────────────────────┼──────────────────────────────────────────────────┤
│ Runtime │ 3.6.2-R44-CI-SNAPSHOT │
├──────────────────────────────┼──────────────────────────────────────────────────┤
│ File name │ case36521-ch-error.zip │
├──────────────────────────────┼──────────────────────────────────────────────────┤
│ Region │ us-east-1 │
├──────────────────────────────┼──────────────────────────────────────────────────┤
│ Persistent queues │ true │
├──────────────────────────────┼──────────────────────────────────────────────────┤
│ Persistent queues encrypted │ false │
├──────────────────────────────┼──────────────────────────────────────────────────┤
│ Static IPs enabled │ false │
├──────────────────────────────┼──────────────────────────────────────────────────┤
│ Workers │ 1 vCore * 2 │
│ │ i-3837858b, STARTED │
│ │ i-a0fd1629, STARTED │
├──────────────────────────────┼──────────────────────────────────────────────────┤
│ Properties │ environment=prod │
└──────────────────────────────┴──────────────────────────────────────────────────┘