CLI Manual - HewlettPackard/morpheus-cli GitHub Wiki
morpheus v8.0.10
morpheus - the command line interface for interacting with the Morpheus appliance
morpheus [command] [<args>] [options]
Morpheus CLI
This is a command line interface for managing a Morpheus Appliance.
All communication with the remote appliance is done via the Morpheus API.
Use the command `morpheus remote add` to connect to your Morpheus appliance.
To learn more, visit https://clidocs.morpheusdata.com
To learn more about the Morpheus Appliance, visit https://www.morpheusdata.com
To learn more about the Morpheus API, visit https://apidocs.morpheusdata.com
There are several global options available.
-v, --version Print the version.
--noprofile Do not read and execute the personal initialization script .morpheus_profile
-C, --nocolor Disable ANSI coloring
-V, --debug Print extra output for debugging.
-h, --help Print this help
There are many common options that are supported by a most commands.
-O, --option OPTION Option value in the format -O var="value" (deprecated soon in favor of first class options)
-N, --no-prompt Skip prompts. Use default values for all optional fields.
--payload FILE Payload from a local JSON or YAML file, skip all prompting
--payload-dir DIRECTORY Payload from a local directory containing 1-N JSON or YAML files, skip all prompting
--payload-json JSON Payload JSON, skip all prompting
--payload-yaml YAML Payload YAML, skip all prompting
-j, --json JSON Output
-d, --dry-run Dry Run, print the API request instead of executing it
--curl Dry Run to output API request as a curl command.
--scrub Mask secrets in output, such as the Authorization header. For use with --curl and --dry-run.
-r, --remote REMOTE Remote name. The current remote is used by default.
--remote-url URL Remote url. This allows adhoc requests instead of using a configured remote.
-T, --token TOKEN Access token for authentication with --remote. Saved credentials are used by default.
-U, --username USERNAME Username for authentication.
-P, --password PASSWORD Password for authentication.
-I, --insecure Allow insecure HTTPS communication. i.e. bad SSL certificate.
-H, --header HEADER Additional HTTP header to include with requests.
--timeout SECONDS Timeout for api requests. Default is typically 30 seconds.
-y, --yes Auto Confirm
-q, --quiet No Output, do not print to stdout
The morpheus executable is divided into commands.
Each morpheus command may have 0-N sub-commands that it supports.
Commands generally map to the functionality provided in the Morpheus UI.
You can get help for any morpheus command by using the -h option.
The available commands and their options are documented below.
Usage: morpheus [command] [options]
Commands:
access-token
activity
alias
appliance-settings
approvals
apps
archives
backup-services
backup-settings
backups
benchmark
blueprints
budgets
catalog
catalog-item-types
certificates
clients
clouds
clusters
containers
credential-types
credentials
curl
cypher
datastores
deploy
deployments
deploys
edit-profile
edit-rc
email-templates
environments
execute-schedules
execution-request
file-copy-request
forgot
groups
guidance
guidance-settings
health
hosts
image-builder
instance-types
instances
integrations
invoices
jobs
key-pairs
library-cluster-layouts
library-cluster-packages
library-file-templates
library-forms
library-instance-types
library-layouts
library-node-types
library-operating-systems
library-option-lists
library-option-types
library-scripts
library-spec-templates
library-upgrades
license
load-balancer-monitors
load-balancer-pool-nodes
load-balancer-pools
load-balancer-profiles
load-balancer-types
load-balancer-virtual-servers
load-balancers
log-settings
login
logout
logs
monitor-alerts
monitor-apps
monitor-checks
monitor-contacts
monitor-groups
monitor-incidents
monitor-settings
network-dhcp-relays
network-dhcp-servers
network-domains
network-edge-clusters
network-firewalls
network-floating-ips
network-groups
network-pool-servers
network-pools
network-proxies
network-routers
network-server-groups
network-servers
network-services
network-static-routes
network-transport-zones
networks
passwd
ping
plugins
policies
power-schedules
price-sets
prices
process
projects
provisioning-licenses
provisioning-settings
remote
reports
resource-folders
resource-pool-groups
resource-pools
roles
scale-thresholds
search
security-groups
security-package-types
security-packages
security-scans
service-plans
setup
shell
snapshots
storage-buckets
storage-datastores
storage-server-types
storage-servers
storage-volume-types
storage-volumes
subnets
tasks
tenants
update
usage
user-groups
user-settings
user-sources
users
vdi
vdi-allocations
vdi-apps
vdi-gateways
vdi-pools
version
view
virtual-images
whitelabel-settings
whoami
wiki
workflows
Options:
-e, --exec EXPRESSION Execute the command(s) expression. This is an alternative to passing [command] [options]
--noprofile Do not read and execute the personal initialization script .morpheus_profile
-C, --nocolor Disable ANSI coloring
-B, --benchmark Print benchmark time after the command is finished.
-V, --debug Print extra output for debugging.
-v, --version Print the version.
-h, --help Print this help
For more information, see https://clidocs.morpheusdata.com
See the CLI Docs for the full list of commands and their usage format.
Morpheus has only one environment variable that it uses.
The MORPHEUS_CLI_HOME variable is where morpheus CLI stores its configuration files. This can be set to allow a single system user to maintain many different configurations If the directory does not exist, morpheus will attempt to create it.
The default home directory is $HOME/.morpheus
To see how this works, run the following:
MORPHEUS_CLI_HOME=~/.morpheus_test morpheus shellNow, in your new morpheus shell, you can see that it is a fresh environment. There are no remote appliances configured.
morpheus> remote list
Morpheus Appliances
==================
You have no appliances configured. See the `morpheus remote add` command.
You can use this to create isolated environments (sandboxes), within which to execute your morpheus commands.
export MORPHEUS_CLI_HOME=~/morpheus_test
morpheus remote add demo https://demo-morpheus --insecure
morpheus instances listMorpheus saves the remote appliance information, including api access tokens, to the CLI home directory. These files are saved with file permissions 6000. So, only one system user should be allowed to execute morpheus with that home directory. See Configuration for more information on the files morpheus reads and writes.
Morpheus reads and writes several configuration files within the $MORPHEUS_CLI_HOME directory.
Note: These files are maintained by the program. It is not recommended for you to manipulate them.
The appliances YAML file contains a list of known appliances, keyed by name.
Example:
:qa:
:host: https://qa-morpheus
:production:
:host: https://production-morpheusThe .morpheus/credentials YAML file contains access tokens for each known appliance.
The .morpheus/groups YAML file contains the active group information for each known appliance.
When Morpheus starts, it executes the commands in a couple of dot files.
These scripts are written in morpheus commands, not bash, so they can only execute morpheus commands and aliases.
It looks for $MORPHEUS_CLI_HOME/.morpheus_profile, and reads and executes it (if it exists).
This may be inhibited by using the --noprofile option.
When started as an interactive shell with the morpheus shell command,
Morpheus reads and executes $MORPHEUS_CLI_HOME/.morpheusrc (if it exists). This may be inhibited by using the --norc option.
An example startup script might look like this:
# .morpheusrc
set-prompt "%cyan%username%reset@%magenta%remote %cyanmorpheus> %reset"
version
remote current
echo "Welcome back %username"
echo