metalctl
metalctl is the command line client to access the metal-api.
Installation
Download locations:
Installation on Linux
curl -LO https://github.com/metal-stack/metalctl/releases/latest/download/metalctl-linux-amd64
chmod +x metalctl-linux-amd64
sudo mv metalctl-linux-amd64 /usr/local/bin/metalctl
Installation on MacOS
For x86 based Macs:
curl -LO https://github.com/metal-stack/metalctl/releases/latest/download/metalctl-darwin-amd64
chmod +x metalctl-darwin-amd64
sudo mv metalctl-darwin-amd64 /usr/local/bin/metalctl
For Apple Silicon (M1) based Macs:
curl -LO https://github.com/metal-stack/metalctl/releases/latest/download/metalctl-darwin-arm64
chmod +x metalctl-darwin-arm64
sudo mv metalctl-darwin-arm64 /usr/local/bin/metalctl
Installation on Windows
curl -LO https://github.com/metal-stack/metalctl/releases/latest/download/metalctl-windows-amd64
copy metalctl-windows-amd64 metalctl.exe
metalctl update
In order to keep your local metalctl
installation up to date, you can update the binary like this:
metalctl update check
latest version:v0.8.3 from:2020-08-13T11:55:14Z
local version:v0.8.2 from:2020-08-12T09:27:39Z
metalctl is not up to date
metalctl update do
# a download with progress bar starts and replaces the binary. If the binary has root permissions please execute
sudo metalctl update do
# instead
Built from project
make
sudo ln -sf $(pwd)/bin/metalctl /usr/local/bin/metalctl
Configuration
Set up auto-completion for metalctl
, e.g. add to your ~/.bashrc
:
source <(metalctl completion bash)
Set up metalctl
config, by first creating the config folder (mkdir -p ~/.metalctl
), then set the values according to your installation in ~/.metalctl/config.yaml
:
---
current: prod
contexts:
prod:
url: https://api.metal-stack.io/metal
issuer_url: https://dex.metal-stack.io/dex
client_id: metal_client
client_secret: 456
hmac: YOUR_HMAC
Optional you can specify issuer_type: generic
if you use other issuers as Dex, e.g. Keycloak (this will request scopes openid,profile,email
):
contexts:
prod:
url: https://api.metal-stack.io/metal
issuer_url: https://keycloak.somedomain.io
issuer_type: generic
client_id: my-client-id
client_secret: my-secret
If you must specify special scopes for your issuer, you can use custom_scopes
:
contexts:
prod:
url: https://api.metal-stack.io/metal
issuer_url: https://keycloak.somedomain.io
custom_scopes: roles,openid,profile,email
client_id: my-client-id
client_secret: my-secret
Available commands
Full documentation is generated out of the cobra command implementation with:
metalctl markdown
generated markdown is here and here
Development
For MacOS users, running the tests might throw an error because tests are utilizing go-mpatch in order to manipulate the time.Now
function. The patch allows testing with fixed timestamps.
Instead, MacOS users can utilize the make test-in-docker
target to execute the tests.
Page Tree
- Contributing
- metalctl
- metalctl
- metalctl audit
- metalctl audit describe
- metalctl audit list
- metalctl completion
- metalctl completion bash
- metalctl completion fish
- metalctl completion powershell
- metalctl completion zsh
- metalctl context
- metalctl context short
- metalctl filesystemlayout
- metalctl filesystemlayout apply
- metalctl filesystemlayout create
- metalctl filesystemlayout delete
- metalctl filesystemlayout describe
- metalctl filesystemlayout edit
- metalctl filesystemlayout list
- metalctl filesystemlayout match
- metalctl filesystemlayout try
- metalctl filesystemlayout update
- metalctl firewall
- metalctl firewall create
- metalctl firewall describe
- metalctl firewall list
- metalctl firewall ssh
- metalctl firmware
- metalctl firmware delete
- metalctl firmware list
- metalctl firmware upload
- metalctl firmware upload bios
- metalctl firmware upload bmc
- metalctl health
- metalctl image
- metalctl image apply
- metalctl image create
- metalctl image delete
- metalctl image describe
- metalctl image edit
- metalctl image list
- metalctl image update
- metalctl login
- metalctl logout
- metalctl machine
- metalctl machine apply
- metalctl machine console
- metalctl machine consolepassword
- metalctl machine create
- metalctl machine delete
- metalctl machine describe
- metalctl machine edit
- metalctl machine identify
- metalctl machine identify off
- metalctl machine identify on
- metalctl machine ipmi
- metalctl machine ipmi events
- metalctl machine issues
- metalctl machine issues list
- metalctl machine list
- metalctl machine lock
- metalctl machine logs
- metalctl machine power
- metalctl machine power bios
- metalctl machine power cycle
- metalctl machine power disk
- metalctl machine power off
- metalctl machine power on
- metalctl machine power pxe
- metalctl machine power reset
- metalctl machine reinstall
- metalctl machine reserve
- metalctl machine update-firmware
- metalctl machine update-firmware bios
- metalctl machine update-firmware bmc
- metalctl machine update
- metalctl markdown
- metalctl network
- metalctl network allocate
- metalctl network apply
- metalctl network create
- metalctl network delete
- metalctl network describe
- metalctl network edit
- metalctl network free
- metalctl network ip
- metalctl network ip apply
- metalctl network ip create
- metalctl network ip delete
- metalctl network ip describe
- metalctl network ip edit
- metalctl network ip issues
- metalctl network ip list
- metalctl network ip update
- metalctl network list
- metalctl network update
- metalctl partition
- metalctl partition apply
- metalctl partition capacity
- metalctl partition create
- metalctl partition delete
- metalctl partition describe
- metalctl partition edit
- metalctl partition list
- metalctl partition update
- metalctl project
- metalctl project apply
- metalctl project create
- metalctl project delete
- metalctl project describe
- metalctl project edit
- metalctl project list
- metalctl project update
- metalctl size
- metalctl size apply
- metalctl size create
- metalctl size delete
- metalctl size describe
- metalctl size edit
- metalctl size imageconstraint
- metalctl size imageconstraint apply
- metalctl size imageconstraint create
- metalctl size imageconstraint delete
- metalctl size imageconstraint describe
- metalctl size imageconstraint edit
- metalctl size imageconstraint list
- metalctl size imageconstraint try
- metalctl size imageconstraint update
- metalctl size list
- metalctl size reservation
- metalctl size reservation apply
- metalctl size reservation create
- metalctl size reservation delete
- metalctl size reservation describe
- metalctl size reservation edit
- metalctl size reservation list
- metalctl size reservation update
- metalctl size reservation usage
- metalctl size suggest
- metalctl size update
- metalctl switch
- metalctl switch connected-machines
- metalctl switch console
- metalctl switch delete
- metalctl switch describe
- metalctl switch detail
- metalctl switch edit
- metalctl switch list
- metalctl switch migrate
- metalctl switch port
- metalctl switch port describe
- metalctl switch port down
- metalctl switch port up
- metalctl switch replace
- metalctl switch ssh
- metalctl switch update
- metalctl tenant
- metalctl tenant apply
- metalctl tenant create
- metalctl tenant delete
- metalctl tenant describe
- metalctl tenant edit
- metalctl tenant list
- metalctl tenant update
- metalctl update
- metalctl update check
- metalctl update do
- metalctl version
- metalctl vpn
- metalctl vpn key
- metalctl whoami