Skip to content

Latest commit

 

History

History
153 lines (116 loc) · 8.43 KB

File metadata and controls

153 lines (116 loc) · 8.43 KB

OVHcloud CLI (ovhcloud) Documentation


Overview

ovhcloud is a single, unified command‑line interface for managing the full range of OVHcloud products and account resources directly from your terminal. Whether you need to automate provisioning, perform quick look‑ups, or integrate OVHcloud operations into CI/CD pipelines, ovhcloud offers fine‑grained commands and consistent output formats (table, JSON, YAML, or custom gval expressions).


Quick Start

# Display the top‑level help
ovhcloud --help

# Log in and create API credentials (interactive)
ovhcloud login

# List your VPS instances as JSON
ohvcloud vps list -o json

Check out the authentication page for further information about the authentication means.

You can manage multiple OVHcloud accounts using profiles. Create a profile with ovhcloud login --profile <name>, switch between them with ovhcloud config profile switch <name>, or use --profile <name> on any command.

Generate Shell Completion

# Bash
eval "$(./ovhcloud completion bash)"
# Zsh
eval "$(./ovhcloud completion zsh)"
# Fish
./ovhcloud completion fish | source
# PowerShell
./ovhcloud completion powershell | Out-String | Invoke-Expression

Add the appropriate line to your shell’s startup file (~/.bashrc, ~/.zshrc, etc.) to enable persistent autocompletion.


Global Usage

ovhcloud [command] [flags]

Global Flags

Flag Description
--debug Activate debug mode (logs all HTTP‑request details).
--ignore-errors Ignore errors of API calls made when listing items.
--filter <expr> Filter lists output with a gval expression.
-h, --help Display help for ovhcloud or a specific command.
-o interactive Produce interactive (prompt‑based) output.
-o json Output data in JSON format.
-o yaml Output data in YAML format.
-o <expr> Format output with a gval expression.

Filtering examples

  • Strict string equality: --filter 'name=="something"'
  • String regexp comparison: --filter 'name=~"something"'
  • Number comparison: --filter 'bootId > 1'

Formatting example

  • Extract only one field: -o 'ip'
  • Extract an object: -o '{name: ip}'

Command Reference

Below is the full list of primary sub‑commands available at the time of writing. Each can be explored in depth with ovhcloud <command> --help.

Tip  Use -o json, -o yaml, or -o <format> with a gval expression to integrate ovhcloud into scripts and automation pipelines.


Examples

Task Command
Log in and save credentials ovhcloud login
List VPS instances (tabular) ovhcloud vps list
Fetch details of a single VPS in JSON ovhcloud vps get <service_id> -o json
Reinstall a baremetal interactively ovhcloud baremetal reinstall <id> --editor

Troubleshooting

  • Verbose output — Use --debug to inspect raw API calls and responses.
  • Authentication issues — Run ovhcloud login again to regenerate valid API keys.
  • Rate limits — OVHcloud APIs impose rate limits; plan retries or exponential backoff in scripts.

Further Reading