Equinix Metal CLI Reference¶
Equinix Metal™ provides an API-driven bare metal platform that combines the automation experience of the cloud with the benefits of physical, bare metal servers.
The Equinix Metal CLI wraps the Equinix Metal Go SDK packngo
, allowing interaction with the Equinix Metal API from a command-line interface.
Installation¶
Installing the binary from the Release¶
You can download the appropriate binary for your system from the Releases page on GitHub. Place it in your desired location, chmod
it and rename it to metal
.
Installing the binary from Source¶
If you have go 1.19 or later installed, you can build and install the latest version with:
go install github.com/equinix/metal-cli/cmd/metal@latest
You can find the installed executable/binary in either $GOPATH/bin
or $HOME/go/bin
folder.
Homebrew¶
If you prefer installing via Homebrew, you can run the following:
brew tap equinix/homebrew-tap
brew install metal-cli
FreeBSD ports¶
The Equinix Metal CLI tools are also available from FreeBSD ports:
sudo pkg install -r FreeBSD sysutils/equinix-metal-cli
Authentication¶
The CLI uses your Equinix Metal API token for authentication. The token can be stored in the $METAL_AUTH_TOKEN
environment variable.
export METAL_AUTH_TOKEN=<your_API_TOKEN>
You can also set up and store authentication and configuration in a JSON or YAML configuration file created by metal init
.
metal init¶
Description
Init will prompt for account settings and store the values as defaults in a configuration file that may be shared with other Equinix Metal tools. This file is typically stored in $HOME/.config/equinix/metal.yaml
. Any Metal CLI command line argument can be specified in the config file. Be careful not to define options that you do not intend to use as defaults. The configuration file written to can be changed with METAL_CONFIG
and --config
.
metal init
Examples
# Example config:
--
token: foo
project-id: 1857dc19-76a5-4589-a9b6-adb729a7d18b
organization-id: 253e9cf1-5b3d-41f5-a4fa-839c130c8c1d
Flags
-h, --help help for init
Flags inherited from parent commands
See Common Flags.
Environment and Completions¶
The Equinix Metal CLI offers commands that will generate environment variables and completions, depending on which shell you are using.
metal env¶
Description
Prints or generates environment variables. Currently emitted variables: METAL_AUTH_TOKEN, METAL_PROJECT_ID, METAL_CONFIG. Use the --project-id flag to set the METAL_PROJECT_ID variable.
metal env [-p <project_id>]
Examples
# Print the current environment variables:
metal env
# Load environment variables in Bash, Zsh:
source <(metal env)
# Load environment variables in Bash 3.2.x:
eval "$(metal env)"
# Load environment variables in Fish:
metal env | source
Flags
-h, --help help for env
-p, --project-id string A project UUID to set as an environment variable.
Flags inherited from parent commands
See Common Flags.
metal completion¶
Description
Generates shell completion scripts for different shells.
metal completion [bash | zsh | fish | powershell]
Examples
# To load completions in Bash:
source <(metal completion bash)
# To load completions in Bash (3.2.x):
eval "$(metal completion bash)"
# To load completions in Bash for each session, on Linux execute once:
metal completion bash > /etc/bash_completion.d/metal-cli
# To load completions in Bash for each session, on Mac execute once:
metal completion bash > /usr/local/etc/bash_completion.d/metal-cli
# To load completions in Zsh:
source <(metal completion zsh)
# To load completions in Zsh for each session, execute once:
metal completion zsh > "${fpath[1]}/_metal-cli"
# To load completions in Fish:
metal completion fish | source
# To load completions in Fish for each session, execute once:
metal completion fish > ~/.config/fish/completions/metal-cli.fish
Flags
-h, --help help for completion
Flags inherited from parent commands
See Common Flags.
Documentation Generation¶
metal docs¶
Description
Generates command markdown documentation in the specified directory. Each command gets a markdown file.
metal docs <destination>
Examples
# Generate documentation in the ./docs directory:
metal docs ./docs
Flags
-h, --help help for docs
Common Flags¶
These flags are available to all commands in the Equinix Metal CLI.
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
metal 2fa¶
Description
Enable or disable two-factor authentication on your user account or receive an OTP token. More information is available at https://metal.equinix.com/developers/docs/accounts/users/#multi-factor-authentication.
Flags
-h, --help help for 2fa
Flags inherited from parent commands
See Common Flags.
metal 2fa disable¶
Description
Disables two-factor authentication. Requires the current OTP code from either SMS or application. If you no longer have access to your two-factor authentication device, please contact support.
metal 2fa disable (-a | -s) --code <OTP_code> [flags]
Examples
# Disable two-factor authentication via SMS
metal 2fa disable -s -c <OTP_code>
# Disable two-factor authentication via APP
metal 2fa disable -a -c <OTP_code>
Flags
-a, --app The OTP code is issued from an application.
-c, --code string The two-factor authentication OTP code.
-h, --help help for disable
-s, --sms The OTP code is issued to you via SMS.
Flags inherited from parent commands
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
metal 2fa enable¶
Description
Enables two-factor authentication on the current user's account. Two-factor auth is available either via SMS or an application. A current OPT code is required, which can be generated by the 2fa receive command.
metal 2fa enable (-s | -a) --code <OTP_code> [flags]
Examples
# Enable two factor authentication via SMS.
metal 2fa enable -s -c <OTP_code>
# Enable two factor authentication via an application.
metal 2fa enable -a -c <OTP_code>
Flags
-a, --app Enables two-factor authentication using an application on the current user's account.
-c, --code string Two-factor authentication code that is provided by a request to the 2fa receive command.
-h, --help help for enable
-s, --sms Enables two-factor authentication using SMS on the current user's account.
Flags inherited from parent commands
See Common Flags.
metal 2fa receive¶
Description
Generates a two-factor authentication token for use in enabling two-factor authentication on the current user's account. In order to use SMS, a phone number must be associated with the account to receive the code. If you are using an app, a URI for the application is returned.
metal 2fa receive (-s | -a) [flags]
Examples
# Issue the token via SMS:
metal 2fa receive -s
# Issue the token via app:
metal 2fa receive -a
Flags
-a, --app Issues an OTP URI for an authentication application.
-h, --help help for receive
-s, --sms Issues SMS OTP token to the phone number associated with the current user account.
Flags inherited from parent commands
See Common Flags.
metal capacity¶
Description
Capacity operations. For more information on capacity in metros, visit https://metal.equinix.com/developers/docs/locations/metros/. For more information on capacity in facilities, visit https://metal.equinix.com/developers/docs/locations/facilities/.
Flags
-h, --help help for capacity
Flags inherited from parent commands
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
metal capacity check¶
Description
Validates if the number of the specified server plan is available in the specified metro or facility. Metro and facility are mutually exclusive. At least one metro (or facility), one plan, and quantity of 1 or more is required.
metal capacity check (-m <metro> | -f <facility>) -P <plan> -q <quantity> [flags]
Examples
# Checks if 10 c3.medium.x86 servers are available in NY or Dallas:
metal capacity check -m ny,da -P c3.medium.x86 -q 10
# Checks if Silicon Valley or Dallas has either 4 c3.medium.x86 or m3.large.x86
metal capacity check -m sv,da -P c3.medium.x86,m3.large.x86 -q 4
Flags
-f, --facilities strings A facility or list of facilities.
-h, --help help for check
-m, --metros strings A metro or list of metros.
-P, --plans strings A plan or list of plans.
-q, --quantity int The number of devices wanted.
Flags inherited from parent commands
See Common Flags.
metal capacity get¶
Description
Returns the capacity of metros or facilities. Filters for metros, facilities, plans are available. Metro flags and facility flags are mutually exclusive. If no flags are included, returns capacity for all plans in all facilities.
metal capacity get [-m | -f] | [--metros <list> | --facilities <list>] [-P <list>] [flags]
Examples
# Returns the capacity of all plans in all facilities:
metal capacity get
# Returns the capacity of the c3.small.x86 in all metros:
metal capacity get -m -P c3.small.x86
# Returns c3.large.arm and c3.medium.x86 capacity in the Silicon Valley, New York, and Dallas metros:
metal capacity get --metros sv,ny,da -P c3.large.arm,c3.medium.x86
Flags
--facilities strings A facility or list of facilities for client-side filtering. Will only return the capacity for the specified facilities. Can not be used with --metros.
-f, --facility Return the capacity for all facilities. Can not be used with -m. (default true)
-h, --help help for get
-m, --metro Return the capacity for all metros. Can not be used with -f.
--metros strings A metro or list of metros for client-side filtering. Will only return the capacity for the specified metros. Can not be used with --facilities.
-P, --plans strings Return only the capacity for the specified plans.
Flags inherited from parent commands
See Common Flags.
metal device¶
Description
Device operations that control server provisioning, metadata, and basic operations.
Flags
-h, --help help for device
Flags inherited from parent commands
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
metal device create¶
Description
Creates a device in the specified project. A plan, hostname, operating system, and either metro or facility is required.
metal device create -p <project_id> (-m <metro> | -f <facility>) -P <plan> -H <hostname> -O <operating_system> [-u <userdata> | --userdata-file <filepath>] [-c <customdata>] [-t <tags>] [-r <hardware_reservation_id>] [-I <ipxe_script_url>] [--always-pxe] [--spot-instance] [--spot-price-max=<max_price>] [flags]
Examples
# Provisions a c3.small.x86 in the Dallas metro running Ubuntu 20.04:
metal device create -p $METAL_PROJECT_ID -P c3.small.x86 -m da -H test-staging-2 -O ubuntu_20_04
# Provisions a c3.medium.x86 in Silicon Valley, running Rocky Linux, from a hardware reservation:
metal device create -p $METAL_PROJECT_ID -P c3.medium.x86 -m sv -H test-rocky -O rocky_8 -r 47161704-1715-4b45-8549-fb3f4b2c32c7
Flags
-a, --always-pxe Sets whether the device always PXE boots on reboot.
-b, --billing-cycle string Billing cycle (default "hourly")
-c, --customdata string Custom data to be included with your device's metadata.
-f, --facility string Code of the facility where the device will be created
-r, --hardware-reservation-id string The UUID of a hardware reservation, if you are provisioning a server from your reserved hardware.
-h, --help help for create
-H, --hostname string Hostname
-I, --ipxe-script-url string The URL of an iPXE script.
-m, --metro string Code of the metro where the device will be created
-O, --operating-system string Operating system name for the device
-P, --plan string Name of the plan
-p, --project-id string The project's UUID. This flag is required, unless specified in the config created by metal init or set as METAL_PROJECT_ID environment variable.
-S, --public-ipv4-subnet-size int Size of the public IPv4 subnet.
-s, --spot-instance Provisions the device as a spot instance.
--spot-price-max float Sets the maximum spot market price for the device: --spot-price-max=1.2
-t, --tags strings Tag or list of tags for the device: --tags="tag1,tag2".
-T, --termination-time string Device termination time: --termination-time="15:04:05"
-u, --userdata string Userdata for device initialization. Can not be used with --userdata-file.
--userdata-file string Path to a userdata file for device initialization. Can not be used with --userdata.
Flags inherited from parent commands
See Common Flags.
metal device delete¶
Description
Deletes the specified device with a confirmation prompt. To skip the confirmation use --force.
metal device delete -i <device_id> [-f] [flags]
Examples
# Deletes the specified device:
metal device delete -i 7ec86e23-8dcf-48ed-bd9b-c25c20958277
>
✔ Are you sure you want to delete device 7ec86e23-8dcf-48ed-bd9b-c25c20958277: y
# Deletes a VLAN, skipping confirmation:
metal device delete -f -i 7ec86e23-8dcf-48ed-bd9b-c25c20958277
Flags
-f, --force Skips confirmation for the device deletion.
-h, --help help for delete
-i, --id string The UUID of the device.
Flags inherited from parent commands
See Common Flags.
metal device get¶
Description
Retrieves a list of devices in the project, or the details of the specified device. Either a project ID or a device ID is required.
metal device get [-p <project_id>] | [-i <device_id>] [flags]
Examples
# Gets the details of the specified device:
metal device get -i 52b60ca7-1ae2-4875-846b-4e4635223471
# Gets a list of devices in the specified project:
metal device get -p 5ad070a5-62e8-4cfe-a0b9-3b79e59f1cfe
Flags
-h, --help help for get
-i, --id string The UUID of a device.
-p, --project-id string The project's UUID. This flag is required, unless specified in the config created by metal init or set as METAL_PROJECT_ID environment variable.
Flags inherited from parent commands
See Common Flags.
metal device reboot¶
Description
Reboots the specified device.
metal device reboot -i <device_id> [flags]
Examples
# Reboots the specified device:
metal device reboot --id 26a9da5f-a0db-41f6-8467-827e144e59a7
Flags
-h, --help help for reboot
-i, --id string The device UUID.
Flags inherited from parent commands
See Common Flags.
metal device reinstall¶
Description
Reinstalls the provided device with the current operating system or a new operating system with optional flags to preserve data or skip disk clean-up. The ID of the device to reinstall is required.
metal device reinstall --id <device-id> [--operating-system <os_slug>] [--deprovision-fast] [--preserve-data] [flags]
Examples
# Reinstalls a device with the current OS:
metal device reinstall -d 50382f72-02b7-4b40-ac8d-253713e1e174
# Reinstalls a device with Ubuntu 22.04 while preserving the data on non-OS disks:
metal device reinstall -d 50382f72-02b7-4b40-ac8d-253713e1e174 -O ubuntu_22_04 --preserve-data
Flags
--deprovision-fast Avoid optional potentially slow clean-up tasks.
-h, --help help for reinstall
-d, --id string ID of device to be reinstalled
-O, --operating-system string Operating system install on the device. If omitted the current OS will be reinstalled.
--preserve-data Avoid wiping data on disks where the OS is *not* being installed.
Flags inherited from parent commands
See Common Flags.
metal device start¶
Description
Starts or powers on a device that is currently stopped or powered off.
metal device start -i <device_id> [flags]
Examples
# Starts the specified device:
metal device start --id 26a9da5f-a0db-41f6-8467-827e144e59a7
Flags
-h, --help help for start
-i, --id string The UUID of the device.
Flags inherited from parent commands
See Common Flags.
metal device stop¶
Description
Stops or powers off a device that is currently started or powered on.
metal device stop -i <device_id> [flags]
Examples
# Stops the specified device:
metal device stop --id [device_UUID]
Flags
-h, --help help for stop
-i, --id string The UUID of the device.
Flags inherited from parent commands
See Common Flags.
metal device update¶
Description
Updates the hostname of a device. Updates or adds a description, tags, userdata, custom data, and iPXE settings for an already provisioned device. Can also lock or unlock future changes to the device.
metal device update -i <device_id> [-H <hostname>] [-d <description>] [--locked <boolean>] [-t <tags>] [-u <userdata>] [-c <customdata>] [-s <ipxe_script_url>] [--always-pxe] [flags]
Examples
# Updates the hostname of a device:
metal device update --id 30c15082-a06e-4c43-bfc3-252616b46eba --hostname renamed-staging04
Flags
-a, --always-pxe Sets the device to always iPXE on reboot.
-c, --customdata string Adds or updates custom data to be included with your device's metadata.
-d, --description string Adds or updates the description for the device.
-h, --help help for update
-H, --hostname string The new hostname of the device.
-i, --id string The UUID of the device.
-s, --ipxe-script-url string Add or update the URL of the iPXE script.
-l, --locked Locks or unlocks the device for future changes.
-t, --tags strings Adds or updates the tags for the device --tags="tag1,tag2".
-u, --userdata string Adds or updates the userdata for the device.
Flags inherited from parent commands
See Common Flags.
metal event¶
Description
Events information for organizations, projects, devices, and the current user.
Flags
-h, --help help for event
Flags inherited from parent commands
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
metal event get¶
Description
Retrieves events for the current user, an organization, a project, a device, or the details of a specific event. The current user's events includes all events in all projects and devices that the user has access to. When using --json or --yaml flags, the --include=relationships flag is implied.
metal event get [-p <project_id>] | [-d <device_id>] | [-i <event_id>] | [-O <organization_id>] [flags]
Examples
# Retrieve all events of a current user:
metal event get
# Retrieve the details of a specific event:
metal event get -i e9a969b3-8911-4667-9d99-57cd3dd4ef6f
# Retrieve all the events of an organization:
metal event get -o c079178c-9557-48f2-9ce7-cfb927b81928
# Retrieve all events of a project:
metal event get -p 1867ee8f-6a11-470a-9505-952d6a324040
# Retrieve all events of a device:
metal event get -d ca614540-fbd4-4dbb-9689-457c6ccc8353
Flags
-d, --device-id string UUID of the device
-h, --help help for get
-i, --id string UUID of the event
-O, --organization-id string UUID of the organization
-p, --project-id string Project ID (METAL_PROJECT_ID)
Flags inherited from parent commands
See Common Flags.
metal facilities¶
Description
Information about specific facilities. Facility-level operations have mostly been replaced by Metros, but remains for backwards-compatibility. Documentation about facilities is available at https://metal.equinix.com/developers/docs/locations/facilities/.
Flags
-h, --help help for facilities
Flags inherited from parent commands
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
metal facilities get¶
Description
Retrieves a list of facilities available to the current user.
metal facilities get [flags]
Examples
# Lists facilities for current user:
metal facilities get
Flags
-h, --help help for get
Flags inherited from parent commands
See Common Flags.
metal gateway¶
Description
A Metal Gateway provides a single IPv4 address as a gateway for a subnet. For more information, visit https://metal.equinix.com/developers/docs/networking/metal-gateway/.
Flags
-h, --help help for gateway
Flags inherited from parent commands
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
metal gateway create¶
Description
Creates a Metal Gateway on the VLAN. Either an IP Reservation ID or a Private Subnet Size must be specified.
metal gateway create -p <project_UUID> --virtual-network <virtual_network_UUID> (--ip-reservation-id <ip_reservation_UUID> | --private-subnet-size <size>) [flags]
Examples
# Creates a Metal Gateway on the VLAN with a given IP Reservation ID:
metal gateway create -p $METAL_PROJECT_ID -v 77e6d57a-d7a4-4816-b451-cf9b043444e2 -r 50052f72-02b7-4b40-ac9d-253713e1e178
# Creates a Metal Gateway on the VLAN with a Private 10.x.x.x/28 subnet:
metal gateway create -p $METAL_PROJECT_ID --virtual-network 77e6d57a-d7a4-4816-b451-cf9b043444e2 --private-subnet-size 16
Flags
-h, --help help for create
-r, --ip-reservation-id string UUID of the Public or VRF IP Reservation to assign.
-s, --private-subnet-size int Size of the private subnet to request (8 for /29)
-p, --project-id string The project's UUID. This flag is required, unless specified in the config created by metal init or set as METAL_PROJECT_ID environment variable.
-v, --virtual-network string UUID of the Virtual Network to assign.
Flags inherited from parent commands
See Common Flags.
metal gateway delete¶
Description
Deletes the specified Gateway with a confirmation prompt. To skip the confirmation use --force.
metal gateway delete -i <metal_gateway_UUID> [-f] [flags]
Examples
# Deletes a Gateway, with confirmation.
metal gateway delete -i 77e6d57a-d7a4-4816-b451-cf9b043444e2
>
✔ Are you sure you want to delete Metal Gateway 77e6d57a-d7a4-4816-b451-cf9b043444e2: y
# Deletes a Gateway, skipping confirmation.
metal gateway delete -f -i 77e6d57a-d7a4-4816-b451-cf9b043444e2
Flags
-f, --force Skips confirmation for the removal of the Metal Gateway.
-h, --help help for delete
-i, --id string UUID of the Gateway.
Flags inherited from parent commands
See Common Flags.
metal gateway get¶
Description
Retrieves a list of all VLANs for the specified project.
metal gateway get -p <project_UUID> [flags]
Examples
# Lists Metal Gateways for project 3b0795ba-ec9a-4a9e-83a7-043e7e11407c:
metal virtual-network get -p 3b0795ba-ec9a-4a9e-83a7-043e7e11407c
Flags
-h, --help help for get
-p, --project-id string The project's UUID. This flag is required, unless specified in the config created by metal init or set as METAL_PROJECT_ID environment variable.
Flags inherited from parent commands
See Common Flags.
metal hardware-reservation¶
Description
Information and operations on Hardware Reservations. Provisioning specific devices from a reservation can be performed with the metal device
command. Documentation is available on https://metal.equinix.com/developers/docs/deploy/reserved/.
Flags
-h, --help help for hardware-reservation
Flags inherited from parent commands
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
metal hardware-reservation get¶
Description
Lists a Project's hardware reservations or the details of a specified hardware reservation. When using --json or --yaml flags, the --include=project,facility,device flag is implied.
metal hardware-reservation get [-p <project_id>] | [-i <hardware_reservation_id>] [flags]
Examples
# Retrieve all hardware reservations of a project:
metal hardware-reservations get -p $METAL_PROJECT_ID
# Retrieve the details of a specific hardware reservation:
metal hardware-reservations get -i 8404b73c-d18f-4190-8c49-20bb17501f88
Flags
-h, --help help for get
-i, --id string The UUID of a hardware reservation.
-p, --project-id string A project's UUID.
Flags inherited from parent commands
See Common Flags.
metal hardware-reservation move¶
Description
Moves a hardware reservation to a specified project. Both the hardware reservation ID and the Project ID for the destination project are required.
metal hardware-reservation move -i <hardware_reservation_id> -p <project_id> [flags]
Examples
# Moves a hardware reservation to the specified Project:
metal hardware-reservation move -i 8404b73c-d18f-4190-8c49-20bb17501f88 -p 278bca90-f6b2-4659-b1a4-1bdffa0d80b7
Flags
-h, --help help for move
-i, --id string The UUID of the hardware reservation.
-p, --project-id string The Project ID of the Project you are moving the hardware reservation to.
Flags inherited from parent commands
See Common Flags.
metal ip¶
Description
IP address and subnet operations, including requesting IPv4 and IPv6 addresses, assigning and removing IPs to servers, and getting information about subnets and their usage. For more information is available on https://metal.equinix.com/developers/docs/networking/ip-addresses/.
Flags
-h, --help help for ip
Flags inherited from parent commands
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
metal ip assign¶
Description
Assigns an IP address and subnet to a specified device. Returns an assignment ID.
metal ip assign -a <IP_address> -d <device_UUID> [flags]
Examples
# Assigns an IP address to a server:
metal ip assign -d 060d1626-2481-475a-9789-c6f4bb927303 -a 198.51.100.3/31
Flags
-a, --address string IP address and CIDR you would like to assign.
-d, --device-id string The UUID of the device.
-h, --help help for assign
Flags inherited from parent commands
See Common Flags.
metal ip available¶
Description
Lists available IP addresses in a specified reservation for the desired subnet size.
metal ip available -r <reservation_UUID> -c <size_of_subnet> [flags]
Examples
# Lists available IP addresses in a reservation for a /31 subnet:
metal ip available --reservation-id da1bb048-ea6e-4911-8ab9-b95635ca127a --cidr 31
Flags
-c, --cidr int The size of the desired subnet in bits.
-h, --help help for available
-r, --reservation-id string The UUID of the IP address reservation.
Flags inherited from parent commands
See Common Flags.
metal ip get¶
Description
Retrieves information about the IP addresses in a project, the IP addresses that are in a specified assignment, or the IP addresses that are in a specified reservation.
metal ip get -p <project_UUID> | -a <assignment_UUID> | -r <reservation_UUID> [flags]
Examples
# Lists all IP addresses in a project:
metal ip get -p bb73aa19-c216-4ce2-a613-e5ca93732722
# Gets information about the IP addresses from an assignment ID:
metal ip get -a bb526d47-8536-483c-b436-116a5fb72235
# Gets the IP addresses from a reservation ID:
metal ip get -r da1bb048-ea6e-4911-8ab9-b95635ca127a
Flags
-a, --assignment-id string UUID of an IP address assignment. When you assign an IP address to a server, it gets an assignment UUID.
-h, --help help for get
-p, --project-id string A Project UUID (METAL_PROJECT_ID).
-r, --reservation-id string UUID of an IP address reservation.
Flags inherited from parent commands
See Common Flags.
metal ip remove¶
Description
Removes an IP address reservation from a project. Any subnets and IP addresses in the reservation will no longer be able to be used by your devices.
metal ip remove -i <reservation_UUID> [flags]
Examples
# Removes an IP address reservation:
metal ip remove --id a9dfc9d5-ba1a-4d11-8cfc-6e30b9630876
Flags
-h, --help help for remove
-i, --id string UUID of the reservation
Flags inherited from parent commands
See Common Flags.
metal ip request¶
Description
Requests either a block of public IPv4 addresses or global IPv4 addresses for your project in a specific metro or facility.
metal ip request -p <project_id> -t <ip_address_type> -q <quantity> (-m <metro> | -f <facility>) [-f <flags>] [-c <comments>] [flags]
Examples
# Requests a block of 4 public IPv4 addresses in Dallas:
metal ip request -p $METAL_PROJECT_ID -t public_ipv4 -q 4 -m da
Flags
-c, --comments string General comments or description.
-f, --facility string Code of the facility where the IP Reservation will be created
-h, --help help for request
-m, --metro string Code of the metro where the IP Reservation will be created
-p, --project-id string The project's UUID. This flag is required, unless specified in the config created by metal init or set as METAL_PROJECT_ID environment variable.
-q, --quantity int Number of IP addresses to reserve.
--tags strings Tag or Tags to add to the reservation, in a comma-separated list.
-t, --type string The type of IP Address, either public_ipv4 or global_ipv4.
Flags inherited from parent commands
See Common Flags.
metal ip unassign¶
Description
Unassigns an subnet and IP address assignment from a device by its assignment ID.
metal ip unassign -i <assignment_UUID> [flags]
Examples
# Unassigns an IP address assignment:
metal ip unassign --id abd8674b-96c4-4271-92f5-2eaf5944c86f
Flags
-h, --help help for unassign
-i, --id string The UUID of the assignment.
Flags inherited from parent commands
See Common Flags.
metal metros¶
Description
Get information on Metro locations. For more information on https://metal.equinix.com/developers/docs/locations/metros/.
Flags
-h, --help help for metros
Flags inherited from parent commands
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
metal metros get¶
Description
Retrieves a list of metros available to the current user.
metal metros get [flags]
Examples
# Lists metros available to the current user:
metal metros get
Flags
-h, --help help for get
Flags inherited from parent commands
See Common Flags.
metal operating-systems¶
Description
Information on available operating systems. For more information on which operating systems Equinix Metal offers, visit https://metal.equinix.com/developers/docs/operating-systems/supported/.
Flags
-h, --help help for operating-systems
Flags inherited from parent commands
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
metal operating-systems get¶
Description
Retrieves a list of operating systems available to the current user. Response includes the operating system's slug, distro, version, and name.
metal operating-systems get [flags]
Examples
# Lists the operating systems available to the current user:
metal operating-systems get
Flags
-h, --help help for get
Flags inherited from parent commands
See Common Flags.
metal organization¶
Description
Information and management of Organization-level settings. Documentation on organizations is in https://metal.equinix.com/developers/docs/accounts/organizations/.
Flags
-h, --help help for organization
Flags inherited from parent commands
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
metal organization create¶
Description
Creates a new organization with the current user as the organization's owner.
metal organization create -n <name> [-d <description>] [-w <website_URL>] [-t <twitter_URL>] [-l <logo_URL>] [flags]
Examples
# Creates a new organization named "it-backend-infra":
metal organization create -n it-backend-infra
# Creates a new organization with name, website, and twitter:
metal organization create -n test-org -w www.metal.equinix.com -t https://twitter.com/equinixmetal
Flags
-d, --description string Description of the organization.
-h, --help help for create
-l, --logo string A Logo image URL.]
-n, --name string Name of the organization.
-t, --twitter string Twitter URL of the organization.
-w, --website string Website URL of the organization.
Flags inherited from parent commands
See Common Flags.
metal organization delete¶
Description
Deletes an organization. You can not delete an organization that contains projects or has outstanding charges. Only organization owners can delete an organization.
metal organization delete -i <organization_UUID> [flags]
Examples
# Deletes an organization, with confirmation:
metal organization delete -i 3bd5bf07-6094-48ad-bd03-d94e8712fdc8
>
✔ Are you sure you want to delete organization 3bd5bf07-6094-48ad-bd03-d94e8712fdc8: y
# Deletes an organization, skipping confirmation:
metal organization delete -i 3bd5bf07-6094-48ad-bd03-d94e8712fdc8 -f
Flags
-f, --force Skips confirmation for the removal of the organization.
-h, --help help for delete
-i, --organization-id string The UUID of the organization.
Flags inherited from parent commands
See Common Flags.
metal organization get¶
Description
Retrieves a list of organizations or the details of the specified organization. Details of an organization are only available to its members.
metal organization get -i <organization_UUID> [flags]
Examples
# Retrieves list of the current user's organizations:
metal organization get
# Retrieves details of an organization:
metal organization get -i 3bd5bf07-6094-48ad-bd03-d94e8712fdc8
Flags
-h, --help help for get
-i, --organization-id string The UUID of an organization.
Flags inherited from parent commands
See Common Flags.
metal organization payment-methods¶
Description
Retrieves a list of payment methods for the specified organization if the current user is a member with the proper role.
metal organization payment-methods -i <organization_UUID> [flags]
Examples
# Lists the payment methods for an organization:
metal organization payment-methods --id 3bd5bf07-6094-48ad-bd03-d94e8712fdc8
Flags
-h, --help help for payment-methods
-i, --id string The UUID of the organization.
Flags inherited from parent commands
See Common Flags.
metal organization update¶
Description
Updates the specified organization. You can update the name, website, Twitter, or logo.
metal organization update -i <organization_UUID> [-n <name>] [-d <description>] [-w <website_URL>] [-t <twitter_URL>] [-l <logo_URL>] [flags]
Examples
# Updates the name of an organization:
metal organization update -i 3bd5bf07-6094-48ad-bd03-d94e8712fdc8 --name test-cluster02
Flags
-d, --description string User-friendly description of the organization.
-h, --help help for update
-i, --id string An organization UUID.
-l, --logo string A logo image URL for the organization.
-n, --name string New name for the organization.
-t, --twitter string A Twitter URL of the organization.
-w, --website string A website URL for the organization.
Flags inherited from parent commands
See Common Flags.
metal plan¶
Description
Information on server plans. For more information on the different Equinix Metal severs, visit https://metal.equinix.com/developers/docs/hardware/standard-servers/.
Flags
-h, --help help for plan
Flags inherited from parent commands
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
metal plan get¶
Description
Retrieves a list of plans available to the current user. Response includes plan UUID, slug, and name.
metal plan get [flags]
Examples
# Lists the plans available to the current user:
metal plans get
Flags
-h, --help help for get
Flags inherited from parent commands
See Common Flags.
metal port¶
Description
Information and operations for converting ports between networking modes and managing VLAN assignments to ports. For more information on the different modes, ports, and VLANs, visit https://metal.equinix.com/developers/docs/layer2-networking/overview/.
Flags
-h, --help help for port
Flags inherited from parent commands
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
metal port convert¶
Description
Converts a list of ports or the details of the specified port. Details of an port are only available to its members.
metal port convert -i <port_UUID> [--bonded] [--bulk] --layer2 [--force] [--public-ipv4] [--public-ipv6] [flags]
Examples
# Converts list of the current user's ports:
metal port convert -i <port_UUID> [--bonded] [--bulk] [--layer2] [--force] [--public-ipv4] [--public-ipv6]
# Converts port to layer-2 unbonded:
metal port convert -i 3bd5bf07-6094-48ad-bd03-d94e8712fdc8 --layer2 --bonded=false
# Converts port to layer-2 bonded:
metal port convert -i 3bd5bf07-6094-48ad-bd03-d94e8712fdc8 --layer2 --bonded
# Converts port to layer-3 bonded with public IPv4 and public IPv6:
metal port convert -i 3bd5bf07-6094-48ad-bd03-d94e8712fdc8 -2=false -b -4 -6
Flags
-b, --bonded Convert to layer-2 bonded.
--bulk Affect both ports in a bond.
-f, --force Force conversion to layer-2 bonded.
-h, --help help for convert
-2, --layer2 Convert to layer-2 unbonded.
-i, --port-id string The UUID of a port.
-4, --public-ipv4 Convert to layer-2 bonded with public IPv4.
-6, --public-ipv6 Convert to layer-2 bonded with public IPv6.
Flags inherited from parent commands
See Common Flags.
metal port get¶
Description
Retrieves the details of the specified port. Details of an port are only available to its members.
metal port get -i <port_UUID> [flags]
Examples
# Retrieves details of a port:
metal port get -i 3bd5bf07-6094-48ad-bd03-d94e8712fdc8
Flags
-h, --help help for get
-i, --port-id string The UUID of a port.
Flags inherited from parent commands
See Common Flags.
metal port vlan¶
Description
Modifies the VLANs of the specified port to the desired state. Existing state can be restated without error.
metal port vlan -i <port_UUID> [--native <vlan>] [--unassign <vlan>]... [--assign <vlan>]... [flags]
Examples
# Assigns VLANs 1234 and 5678 to the port:
metal port vlans -i 3bd5bf07-6094-48ad-bd03-d94e8712fdc8 -a 1234 -a 5678
# Unassigns VXLAN 1234 from the port:
metal port vlans -i 3bd5bf07-6094-48ad-bd03-d94e8712fdc8 -u 1234
# Assigns VXLAN 1234 to the port and makes it the Native VLAN:
metal port vlans -i 3bd5bf07-6094-48ad-bd03-d94e8712fdc8 --native=1234
Flags
-a, --assign strings A VXLAN to assign to the port. May also be used to change a Native VLAN assignment to tagged (non-native).
-h, --help help for vlan
-n, --native string The VXLAN to make assign as the Native VLAN
-i, --port-id string The UUID of a port.
-u, --unassign strings A VXLAN to unassign from a port.
Flags inherited from parent commands
See Common Flags.
metal project¶
Description
Information and management for Projects and Project-level BGP. Documentation on Projects is on https://metal.equinix.com/developers/docs/accounts/projects/, and documentation on BGP is on https://metal.equinix.com/developers/docs/bgp/bgp-on-equinix-metal/.
Flags
-h, --help help for project
Flags inherited from parent commands
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
metal project bgp-config¶
Description
Gets BGP Config for a project.
metal project bgp-config --project-id <project_UUID> [flags]
Examples
# Get BGP config for project 50693ba9-e4e4-4d8a-9eb2-4840b11e9375:
metal project bgp-config --project-id 50693ba9-e4e4-4d8a-9eb2-4840b11e9375
Flags
-h, --help help for bgp-config
-p, --project-id string Project ID (METAL_PROJECT_ID)
Flags inherited from parent commands
See Common Flags.
metal project bgp-enable¶
Description
Enables BGP on a project.
metal project bgp-enable --project-id <project_UUID> --deployment-type <deployment_type> [--asn <asn>] [--md5 <md5_secret>] [--use-case <use_case>] [flags]
Examples
# Enable BGP on project 50693ba9-e4e4-4d8a-9eb2-4840b11e9375:
metal project bgp-enable --project-id 50693ba9-e4e4-4d8a-9eb2-4840b11e9375 --deployment-type local --asn 65000
Flags
--asn int Local ASN (default 65000)
--deployment-type string Deployment type (local, global)
-h, --help help for bgp-enable
--md5 string BGP Password
-p, --project-id string Project ID (METAL_PROJECT_ID)
--use-case string Use case for BGP
Flags inherited from parent commands
See Common Flags.
metal project bgp-sessions¶
Description
Gets BGP Sessions for a project.
metal project bgp-sessions --project-id <project_UUID> [flags]
Examples
# Get BGP Sessions for project 50693ba9-e4e4-4d8a-9eb2-4840b11e9375:
metal project bgp-sessions --project-id 50693ba9-e4e4-4d8a-9eb2-4840b11e9375
Flags
-h, --help help for bgp-sessions
-p, --project-id string Project ID (METAL_PROJECT_ID)
Flags inherited from parent commands
See Common Flags.
metal project create¶
Description
Creates a project with the specified name. If no organization is specified, the project is created in the current user's default organization. If no payment method is specified the organization's default payment method is used.
metal project create -n <project_name> [-O <organization_UUID>] [-m <payment_method_UUID>] [flags]
Examples
# Creates a new project named dev-cluster02:
metal project create --name dev-cluster02
# Creates a new project named dev-cluster03 in the specified organization with a payment method:
metal project create -n dev-cluster03 -O 814b09ca-0d0c-4656-9de0-4ce65c6faf70 -m ab1fbdaa-8b25-4c3e-8360-e283852e3747
Flags
-h, --help help for create
-n, --name string Name of the project
-O, --organization-id string The UUID of the organization.
-m, --payment-method-id string The UUID of the payment method.
Flags inherited from parent commands
See Common Flags.
metal project delete¶
Description
Deletes the specified project with a confirmation prompt. To skip the confirmation use --force. You can't delete a project that has active resources. You have to deprovision all servers and other infrastructure from a project in order to delete it.
metal project delete --id <project_UUID> [--force] [flags]
Examples
# Deletes project 50693ba9-e4e4-4d8a-9eb2-4840b11e9375:
metal project delete -i 50693ba9-e4e4-4d8a-9eb2-4840b11e9375
>
✔ Are you sure you want to delete project 50693ba9-e4e4-4d8a-9eb2-4840b11e9375: y
# Deletes project 50693ba9-e4e4-4d8a-9eb2-4840b11e9375, skipping confirmation:
metal project delete -i 50693ba9-e4e4-4d8a-9eb2-4840b11e9375 -f
Flags
-f, --force Force removal of the project
-h, --help help for delete
-i, --id string The project's UUID. This flag is required, unless specified in the config created by metal init or set as METAL_PROJECT_ID environment variable.
Flags inherited from parent commands
See Common Flags.
metal project get¶
Description
Retrieves all the current user's projects or the details of a specified project. You can specify which project by UUID or name. When using --json
or --yaml
flags, the --include=members
flag is implied.
metal project get [-i <project_UUID> | -n <project_name>] [flags]
Examples
# Retrieve all projects:
metal project get
# Retrieve a specific project by UUID:
metal project get -i 2008f885-1aac-406b-8d99-e6963fd21333
# Retrieve a specific project by name:
metal project get -n dev-cluster03
Flags
-h, --help help for get
-i, --id string The project's UUID, which can be specified in the config created by metal init or set as METAL_PROJECT_ID environment variable.
-n, --project string The name of the project.
Flags inherited from parent commands
See Common Flags.
metal project update¶
Description
Updates the specified project with a new name, a new payment method, or both.
metal project update -i <project_UUID> [-n <name>] [-m <payment_method_UUID>] [flags]
Examples
# Updates the specified project with a new name:
metal project update -i $METAL_PROJECT_ID -n new-prod-cluster05
# Updates the specified project with a new payment method:
metal project update -i $METAL_PROJECT_ID -m e2fcdf91-b6dc-4d6a-97ad-b26a14b66839
Flags
-h, --help help for update
-i, --id string The project's UUID. This flag is required, unless specified in the config created by metal init or set as METAL_PROJECT_ID environment variable.
-n, --name string The new name for the project.
-m, --payment-method-id string The UUID of the new payment method.
Flags inherited from parent commands
See Common Flags.
metal ssh-key¶
Description
SSH key operations for managing SSH keys on user accounts and projects. Keys added to an account or project are added to servers at provision. Documentation is available on https://metal.equinix.com/developers/docs/accounts/ssh-keys/.
Flags
-h, --help help for ssh-key
Flags inherited from parent commands
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
metal ssh-key create¶
Description
Adds an SSH key for the current user's account. The key will then be added to the user's servers at provision time.
metal ssh-key create --key <public_key> --label <label> [flags]
Examples
# Adds a key labled "example-key" to the current user account.
metal ssh-key create --key ssh-rsa AAAAB3N...user@domain.com --label example-key
Flags
-h, --help help for create
-k, --key string User's full SSH public key string.
-l, --label string Name or other user-friendly description of the SSH key.
Flags inherited from parent commands
See Common Flags.
metal ssh-key delete¶
Description
Deletes an SSH key with a confirmation prompt. To skip the confirmation use --force. Does not remove the SSH key from existing servers.
metal ssh-key delete --id <SSH-key_UUID> [--force] [flags]
Examples
# Deletes an SSH key, with confirmation:
metal ssh-key delete -i 5cb96463-88fd-4d68-94ba-2c9505ff265e
>
✔ Are you sure you want to delete SSH Key 5cb96463-88fd-4d68-94ba-2c9505ff265e: y
# Deletes an SSH key, skipping confirmation:
metal ssh-key delete -i 5cb96463-88fd-4d68-94ba-2c9505ff265e -f
Flags
-f, --force Skips confirmation for the deletion of the SSH key.
-h, --help help for delete
-i, --id string The UUID of the SSH key.
Flags inherited from parent commands
See Common Flags.
metal ssh-key get¶
Description
Retrieves a list of SSH keys associated with the current user's account or the details of single SSH key.
metal ssh-key get [-i <SSH-key_UUID>] [-P] [-p <project_id>] [flags]
Examples
# Retrieves the SSH keys of the current user:
metal ssh-key get
# Returns the details of SSH key 5cb96463-88fd-4d68-94ba-2c9505ff265e:
metal ssh-key get --id 5cb96463-88fd-4d68-94ba-2c9505ff265e
# Retrieve all project SSH keys
metal ssh-key get --project-ssh-keys --project-id [project_UUID]
Flags
-h, --help help for get
-i, --id string The UUID of an SSH key.
-p, --project-id string List SSH Keys for the project identified by Project ID (ignored without -P)
-P, --project-ssh-keys List SSH Keys for projects
Flags inherited from parent commands
See Common Flags.
metal ssh-key update¶
Description
Updates an SSH key with either a new public key, a new label, or both.
metal ssh-key update -i <SSH-key_UUID> [-k <public_key>] [-l <label>] [flags]
Examples
# Updates SSH key 5cb96463-88fd-4d68-94ba-2c9505ff265e with a new public key:
metal ssh-key update -i 5cb96463-88fd-4d68-94ba-2c9505ff265e -k AAAAB3N...user@domain.com
# Updates SSH key 5cb96463-88fd-4d68-94ba-2c9505ff265e with a new label:
metal ssh-key update -i 5cb96463-88fd-4d68-94ba-2c9505ff265e -l test-machine-2
Flags
-h, --help help for update
-i, --id string UUID of the SSH key
-k, --key string Public SSH key string
-l, --label string Name of the SSH key
Flags inherited from parent commands
See Common Flags.
metal user¶
Description
Adding users or getting their details. For more information on user and account management, visit https://metal.equinix.com/developers/docs/accounts/users/ in the Equinix Metal documentation.
Flags
-h, --help help for user
Flags inherited from parent commands
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
metal user add¶
Description
Adds a user, by email, to the organization or project specified by the --organization-id or --project-id flag. The user will be assigned the roles specified by the --roles flag.
metal user add --email <email> --roles <roles> [--organization-id <organization_id>] [--project-id <project_id>] [flags]
Examples
# Adds a user to a project with admin role:
metal user add --email user@example.org --roles admin --project-id 3b0795ba-fd0b-4a9e-83a7-063e5e12409d
Flags
--email string Email of the user.
-h, --help help for add
--organization-id string Organization to invite the user to.
-p, --project-id strings Projects to invite the user to with the specified roles.
--roles strings Roles to assign to the user.
Flags inherited from parent commands
See Common Flags.
metal user get¶
Description
Returns either information about the current user or information about a specified user. Specified user information is only available if that user shares a project with the current user.
metal user get [-i <user_UUID>] [flags]
Examples
# Retrieves the current user's information:
metal user get
# Returns information on user 3b0795ba-fd0b-4a9e-83a7-063e5e12409d:
metal user get --i 3b0795ba-fd0b-4a9e-83a7-063e5e12409d
Flags
-h, --help help for get
-i, --id string UUID of the user.
Flags inherited from parent commands
See Common Flags.
metal virtual-network¶
Description
Managing Virtual Networks on a Project. VLAN assignments to a server's ports is available through the ports
command. For more information on how VLANs work in Equinix Metal, visit https://metal.equinix.com/developers/docs/layer2-networking/vlans/.
Flags
-h, --help help for virtual-network
Flags inherited from parent commands
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
metal virtual-network create¶
Description
Creates a VLAN in the specified project. If you are creating a VLAN in a metro, you can optionally specify the VXLAN ID otherwise it is auto-assigned. If you are creating a VLAN in a facility, the VXLAN ID is auto-assigned.
metal virtual-network create -p <project_UUID> [-m <metro_code> -vxlan <vlan> | -f <facility_code>] [-d <description>] [flags]
Examples
# Creates a VLAN with vxlan ID 1999 in the Dallas metro:
metal virtual-network create -p $METAL_PROJECT_ID -m da --vxlan 1999
# Creates a VLAN in the sjc1 facility
metal virtual-network create -p $METAL_PROJECT_ID -f sjc1
Flags
-d, --description string A user-friendly description of the virtual network.
-f, --facility string Code of the facility.
-h, --help help for create
-m, --metro string Code of the metro.
-p, --project-id string The project's UUID. This flag is required, unless specified in the config created by metal init or set as METAL_PROJECT_ID environment variable.
--vxlan int Optional VXLAN ID. Must be between 2 and 3999 and can only be used with --metro.
Flags inherited from parent commands
See Common Flags.
metal virtual-network delete¶
Description
Deletes the specified VLAN with a confirmation prompt. To skip the confirmation use --force. You are not able to delete a VLAN that is attached to any ports.
metal virtual-network delete -i <virtual_network_UUID> [-f] [flags]
Examples
# Deletes a VLAN, with confirmation.
metal virtual-network delete -i 77e6d57a-d7a4-4816-b451-cf9b043444e2
>
✔ Are you sure you want to delete virtual network 77e6d57a-d7a4-4816-b451-cf9b043444e2: y
# Deletes a VLAN, skipping confirmation.
metal virtual-network delete -f -i 77e6d57a-d7a4-4816-b451-cf9b043444e2
Flags
-f, --force Skips confirmation for the removal of the virtual network.
-h, --help help for delete
-i, --id string UUID of the VLAN.
Flags inherited from parent commands
See Common Flags.
metal virtual-network get¶
Description
Retrieves a list of all VLANs for the specified project.
metal virtual-network get -p <project_UUID> [flags]
Examples
# Lists virtual networks for project 3b0795ba-ec9a-4a9e-83a7-043e7e11407c:
metal virtual-network get -p 3b0795ba-ec9a-4a9e-83a7-043e7e11407c
Flags
-h, --help help for get
-p, --project-id string The project's UUID. This flag is required, unless specified in the config created by metal init or set as METAL_PROJECT_ID environment variable.
Flags inherited from parent commands
See Common Flags.