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
help [command...] Provides help for a given command.
exit Exits cloudhub-cli
account describe-me Show account details
account describe-business-groups Lists business groups
account describe-business-group <name> Show details of a business group
account switch-business-group <name> Make specified business-group active
account describe-environments Lists environments
account use-environment <name> Make specified environment active
account create-environments [options] <name> Create new environment
account delete-environment <name> Delete an environment
runtime-mgr describe-applications Lists all applications in the environment
runtime-mgr describe-application <name> Show application details
runtime-mgr describe-application-json <name> Show raw application JSON response
runtime-mgr stop-application <name> Stop a running application
runtime-mgr start-application <name> Start an application
runtime-mgr restart-application <name> Restart a running application
runtime-mgr delete-application <name> Delete an application
runtime-mgr deploy-application [options] <name> <zipfile> Deploy a new application
runtime-mgr modify-application [options] <name> [zipfile] Modify an existing application, optionally updating the zip file
runtime-mgr revert-application-runtime <name> Reverts application to its previous runtime
runtime-mgr download-application-logs <name> <directory> Download application logs to specified directory
runtime-mgr tail-application-logs <name> Tail application logs
cloudhub describe-lbs Lists all load balancers in an organization
cloudhub describe-lb <name> Show LB details
cloudhub create-lb [options] <vpc> <name> <certificate> <privateKey> Create a Load balancer
cloudhub delete-lb <name> Delete a Load balancer
cloudhub add-lb-ssl-endpoint [options] <name> <certificate> <privateKey> Add an additional certificate to an existing Load Balancer
cloudhub remove-lb-ssl-endpoint <name> <CN> Delete a certificate
cloudhub set-default-lb-ssl-endpoint [options] <name> <CN> Set the default certificate that the Load Balancer will serve
cloudhub describe-lb-endpoint <name> <CN> Show the Load Balancer configuration for a particular certificate
cloudhub add-lb-whitelist <name> <cidrBlock> Add an IP or range of IPs to the Load Balancer whitelist
cloudhub remove-lb-whitelist <name> <cidrBlock> Remove an IP or range of IPs from the Load Balancer whitelist
cloudhub describe-lb-mappings <name> <CN> Lists the proxy mapping rules for a load balancer
cloudhub add-lb-mapping <name> <CN> <index> <inputUri> <appName> <appUri> Add a proxy mapping rule at the specified index
cloudhub remove-lb-mapping <name> <CN> <index> Remove a proxy mapping rule
cloudhub describe-regions Lists all supported regions
cloudhub describe-runtimes Lists all available runtimes
cloudhub describe-vpcs Lists all VPCs
cloudhub describe-vpc <name> Show VPC details
cloudhub describe-vpc-json <name> Show raw VPC JSON response
cloudhub create-vpc [options] <name> <region> <cidrBlock> [environments...] Create a new VPC
cloudhub delete-vpc <name> Delete an existing VPC
cloudhub modify-vpc-environments [options] <vpc> <action> [environments...] Modifies the VPC association to Runtime Manager environments
cloudhub modify-vpc-business-groups <vpc> <action> <businessGroups...> Share a VPC with a list of Business Groups
cloudhub modify-vpc-dns <vpc> <action> <dns...> Sets the domain names that are resolved using your internal DNS servers
cloudhub modify-vpc-domains <vpc> <action> <domains...> Set the special DNS servers that resolve a list of custom domains
cloudhub describe-firewall-rules <vpc> Show firewall rule for Mule applications in this VPC
cloudhub add-firewall-rule <vpc> <direction> <cidrBlock> <protocol> <fromPort> [toPort] Add a firewall rule for Mule applications in this VPC
cloudhub remove-firewall-rule <vpc> <direction> <index> Remove a firewall rule for Mule applications in this VPC
token Show API access token
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 │
└──────────────────────────────┴──────────────────────────────────────────────────┘