LinuxCommandLibrary

ibmcloud-api

Call IBM Cloud APIs directly

TLDR

View the current API endpoint

$ ibmcloud api
copy

Set the API endpoint to cloud.ibm.com
$ ibmcloud api cloud.ibm.com
copy

Set a private API endpoint
$ ibmcloud api private.cloud.ibm.com
copy

Use a VPC connection for a private endpoint
$ ibmcloud api private.cloud.ibm.com --vpc
copy

Bypass SSL validation of HTTP requests
$ ibmcloud api https://cloud.ibm.com --skip-ssl-validation
copy

Remove the API endpoint setting
$ ibmcloud api --unset
copy

SYNOPSIS

ibmcloud api [--set ENDPOINT] [--unset]

PARAMETERS

-h, --help
    Display help for the api command

--set ENDPOINT
    Set the target API endpoint (e.g., --set us-south)

--unset
    Unset (clear) the current target API endpoint

DESCRIPTION

The ibmcloud api command is a key utility in the IBM Cloud Command Line Interface (CLI), used to discover and configure API endpoints for IBM Cloud services across various regions and environments.

It displays a formatted table of available public and private API endpoints, including details like region, provider, and status. The current active endpoint is highlighted with an asterisk (*).

This command is crucial for developers and administrators to target specific geographic regions (e.g., us-south, eu-gb) or specialized endpoints (e.g., staging or dedicated clouds). Setting an endpoint ensures that subsequent CLI commands like ibmcloud resource or ibmcloud service interact with the correct IBM Cloud instance.

Without options, it lists endpoints and the current target. It integrates seamlessly with account targeting via ibmcloud target and login workflows, enabling multi-region management in hybrid cloud setups.

Endpoint availability depends on your IBM Cloud account permissions and global service support.

CAVEATS

Requires IBM Cloud CLI installation and login. Endpoints may change; use 'ibmcloud api' to verify latest list. Not all endpoints support all services.

EXAMPLES

ibmcloud api # List endpoints
ibmcloud api --set eu-de # Set Germany endpoint
ibmcloud api --unset # Clear target

OUTPUT FORMAT

Table columns: Endpoint, Region, Provider, Current(*). Use with | grep for filtering.

HISTORY

Part of IBM Cloud CLI since 2017, evolved from Bluemix CLI (bx api) launched in 2013. Rebranded and enhanced for multi-cloud support in v0.20+.

SEE ALSO

ibmcloud(1), ibmcloud login(1), ibmcloud target(1), ibmcloud region(1)

Copied to clipboard