Difference between revisions of "Using Openstack CLI Client"
Jump to navigation
Jump to search
Line 4: | Line 4: | ||
Openstack CLI client is also installed on <code>linuxlogin.cac.cornell.edu</code>. Simply <code>ssh <user name>@linuxlogin.cac.cornell.edu</code> and enter your CAC account password when prompted. | Openstack CLI client is also installed on <code>linuxlogin.cac.cornell.edu</code>. Simply <code>ssh <user name>@linuxlogin.cac.cornell.edu</code> and enter your CAC account password when prompted. | ||
− | =='''Download | + | =='''Download Openstack RC''' file== |
− | + | # Using your web browser, Go to [https://redcloud.cac.cornell.edu/dashboard/project/api_access/ https://redcloud.cac.cornell.edu/dashboard/project/api_access/ ]. | |
− | + | # Log in using your '''CAC account'''. | |
− | + | # Click on the <code>Openstack RC File</code> menu in the upper right corner and select <code>Openstack RC File (Identity API v3)</code>. | |
+ | # A file named <code><project name>-openrc.sh</code> will be downloaded to your computer. Copy it to the host with Openstack CLI client installed. | ||
+ | |||
+ | ==Usage== | ||
+ | On the host where Openstack CLI client is installed, | ||
+ | |||
+ | * Source the Openstack RC file. Enter your CAC account password when prompted: | ||
+ | -bash-4.2$ '''source <project name>-openrc.sh''' | ||
+ | Please enter your OpenStack Password for project <project name> as user <user name>: | ||
+ | * You should be able to list available images like this: | ||
+ | -bash-4.2$ '''openstack image list''' | ||
+ | +--------------------------------------+----------------------------+--------+ | ||
+ | | ID | Name | Status | | ||
+ | +--------------------------------------+----------------------------+--------+ | ||
+ | | bb0efad8-5d21-46de-ba8b-6522b3328b48 | centos-7.5 | active | | ||
+ | | 9387131a-91ef-4cae-a3b7-da20c586af70 | ubuntu-18.04-LTS | active | | ||
+ | +--------------------------------------+----------------------------+--------+ | ||
+ | * Run <code>openstack command help</code> to get the list of available commands. Use <code>-h</code> option with any command to get detailed syntax help. For example: | ||
+ | -bash-4.2$ openstack image list -h | ||
+ | usage: openstack image list [-h] [-f {csv,json,table,value,yaml}] [-c COLUMN] | ||
+ | [--max-width <integer>] [--fit-width] | ||
+ | [--print-empty] [--noindent] | ||
+ | [--quote {all,minimal,none,nonnumeric}] | ||
+ | [--sort-column SORT_COLUMN] | ||
+ | [--public | --private | --shared] | ||
+ | [--property <key=value>] [--name <name>] | ||
+ | [--status <status>] [--long] | ||
+ | [--sort <key>[:<direction>]] | ||
+ | [--limit <num-images>] [--marker <image>] | ||
+ | |||
+ | List available images | ||
+ | |||
+ | optional arguments: | ||
+ | -h, --help show this help message and exit | ||
+ | --public List only public images | ||
+ | --private List only private images | ||
+ | --shared List only shared images | ||
+ | : | ||
+ | : |
Revision as of 16:16, 4 October 2018
Installation
Openstack CLI client can be installed on any host with python and pip installed. To install Openstack CLI client, run the pip install python-openstackclient
command as root.
Openstack CLI client is also installed on linuxlogin.cac.cornell.edu
. Simply ssh <user name>@linuxlogin.cac.cornell.edu
and enter your CAC account password when prompted.
Download Openstack RC file
- Using your web browser, Go to https://redcloud.cac.cornell.edu/dashboard/project/api_access/ .
- Log in using your CAC account.
- Click on the
Openstack RC File
menu in the upper right corner and selectOpenstack RC File (Identity API v3)
. - A file named
<project name>-openrc.sh
will be downloaded to your computer. Copy it to the host with Openstack CLI client installed.
Usage
On the host where Openstack CLI client is installed,
- Source the Openstack RC file. Enter your CAC account password when prompted:
-bash-4.2$ source <project name>-openrc.sh Please enter your OpenStack Password for project <project name> as user <user name>:
- You should be able to list available images like this:
-bash-4.2$ openstack image list +--------------------------------------+----------------------------+--------+ | ID | Name | Status | +--------------------------------------+----------------------------+--------+ | bb0efad8-5d21-46de-ba8b-6522b3328b48 | centos-7.5 | active | | 9387131a-91ef-4cae-a3b7-da20c586af70 | ubuntu-18.04-LTS | active | +--------------------------------------+----------------------------+--------+
- Run
openstack command help
to get the list of available commands. Use-h
option with any command to get detailed syntax help. For example:
-bash-4.2$ openstack image list -h usage: openstack image list [-h] [-f {csv,json,table,value,yaml}] [-c COLUMN] [--max-width <integer>] [--fit-width] [--print-empty] [--noindent] [--quote {all,minimal,none,nonnumeric}] [--sort-column SORT_COLUMN] [--public | --private | --shared] [--property <key=value>] [--name <name>] [--status <status>] [--long] [--sort <key>[:<direction>]] [--limit <num-images>] [--marker <image>] List available images optional arguments: -h, --help show this help message and exit --public List only public images --private List only private images --shared List only shared images : :