Table of Contents
IBM Cloud CLI commands are used to interact with various IBM Cloud services and manage cloud resources from the command line. In the last blog, we discussed about the history, features, architecture and working of IBM Cloud. Here we will discuss some of the commonly used IBM Cloud CLI Commands.
Commonly used IBM Cloud CLI Commands
Setup and Configuration
Login to IBM Cloud:
ibmcloud login
Login with an API key:
ibmcloud login --apikey <API_KEY>
Set target region:
ibmcloud target -r <region>
View target settings:
ibmcloud target
Account and Resource Management
List organizations:
ibmcloud account orgs
Create a resource group:
ibmcloud resource group-create <group_name>
List resource groups:
ibmcloud resource groups
Target a specific resource group:
ibmcloud target -g <group_name>
Related: IBM Cloud Cheatsheet
Managing Cloud Foundry Applications
View Cloud Foundry applications:
ibmcloud cf apps
Push a new Cloud Foundry application:
ibmcloud cf push <app_name>
Managing Kubernetes Clusters
List Kubernetes clusters:
ibmcloud ks clusters
Create a Kubernetes cluster:
ibmcloud ks cluster create <options>
Get configuration for a cluster:
ibmcloud ks cluster config --cluster <cluster_name>
View worker nodes:
ibmcloud ks workers <cluster_name>
Managing Virtual Servers
List virtual server instances:
ibmcloud sl vs list
Create a new virtual server:
ibmcloud sl vs create <options>
Managing Object Storage
List object storage buckets:
ibmcloud cos buckets
Create an object storage bucket:
ibmcloud cos bucket-create --bucket <bucket_name> --class <storage_class> --region <region>
Upload a file to a bucket:
ibmcloud cos object-put --bucket <bucket_name> --key <file_name> --body <file_path>
Managing Databases
List databases:
ibmcloud resource service-instances --service-name <service_name>
Create a database instance:
ibmcloud resource service-instance-create <instance_name> <service_name> <plan> <location>
Monitoring and Logging
List logging instances:
ibmcloud logging instances
View logs for an instance:
ibmcloud logging logdna view <instance_name> <options>
Help and Documentation
View general help:
ibmcloud help
View help for a specific command:
ibmcloud <command> --help