PYTHON-ZUNCLIENT(1)

πŸ“¦
version 5.5.0 Β· 2 versions
, in nixpkgs unstable

πŸ’… PYTHON-ZUNCLIENT β€” the python-zunclient 5.5.0 era ✨

okay bestie so this is the manual for python-zunclient, version 5.5.0 β€” like, the whole thing. buckle up, it's giving "long but iconic" πŸ’–


πŸŽ€ NAME

python-zunclient β€” literally just python-zunclient 5.5.0, that's it, that's the name 🫢


✨ CONTENTS

🧚 Installation Guide

okay so first things first, at the command line:

$ pip install python-zunclient

or, if you've got virtualenvwrapper installed (fancy, love that for you):

$ mkvirtualenv python-zunclient
$ pip install python-zunclient

slay. you're installed πŸ’…

🌸 Contributor's Guide

if you wanna contribute to the development of OpenStack (main character energy fr), you must follow the steps in this page:

<https://docs.openstack.org/infra/manual/developers.html>

and if you already have a good understanding of how the system works and your OpenStack accounts are all set up, you can skip straight to the development workflow section of this documentation to learn how changes to OpenStack should be submitted for review via the Gerrit tool:

<https://docs.openstack.org/infra/manual/developers.html# development-workflow>
πŸ’€ not me having to say this but: pull requests submitted through GitHub will be ignored. like, don't even. nope.

bugs should be filed on Launchpad, not GitHub:

<https://bugs.launchpad.net/python-zunclient>

πŸ¦‹ User Documentation

πŸ‘‘ Zun CLI man page


⭐ SYNOPSIS

so Zun operation uses the zun command, and also supports using the openstack command. two paths, same destiny ✨

zun [options] <command> [command-options]
openstack appcontainer <command> [command-options]

πŸ’œ DESCRIPTION

the zun command line utility interacts with the OpenStack Containers Service (Zun). it's the whole vibe, no cap 🫢

in order to use the CLI, you must provide your OpenStack username, password, project (historically called tenant), and auth endpoint. you can use configuration options --os-username, --os-password, --os-tenant-name or --os-tenant-id, and --os-auth-url or set corresponding environment variables:

export OS_USERNAME=user
export OS_PASSWORD=pass
export OS_PROJECT_NAME=myproject
export OS_AUTH_URL=http://auth.example.com:5000/v3
export OS_USER_DOMAIN_ID=default
export OS_PROJECT_DOMAIN_ID=default

like, pick your fighter β€” flags or env vars, both are valid πŸ’–


🌈 OPTIONS

to get a list of available commands and options run:

zun help

to get usage and options of a command:

zun help <command>

you can also use the openstack command as follows.

to get a list of available commands run:

openstack help appcontainer

to get usage and options of a command:

openstack appcontainer <command> --help

πŸ”₯ EXAMPLES

list all the containers:

zun list

create new container:

zun run --name container01 IMAGE01

describe a specific container:

zun show container01

you can also use the openstack command as follows πŸ‘‡

list all the containers:

openstack appcontainer list

create new container:

openstack appcontainer run --name container01 IMAGE01

describe a specific container:

openstack appcontainer show container01

ate. no crumbs πŸ“


🌸 Command List

🫢 appcontainer action

an appcontainer action specifies the action details for a container. like, the receipts of what happened to your container πŸ“‹

πŸ’… appcontainer action list

list actions on a container β€” show me the lore bestie:

openstack appcontainer action 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]
                                   <container>
  • <container> β€” ID or name of the container to list actions.
  • -h, --help β€” show this help message and exit
  • -f {csv,json,table,value,yaml}, --format {csv,json,table,value,yaml} β€” the output format, defaults to table
  • -c COLUMN, --column COLUMN β€” specify the column(s) to include, can be repeated
  • --sort-column SORT_COLUMN β€” specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated
  • --max-width <integer> β€” Maximum display width, <1 to disable. You can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.
  • --fit-width β€” Fit the table to the display width. Implied if --max-width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable
  • --print-empty β€” Print empty table if there is no data to show.
  • --noindent β€” whether to disable indenting the JSON
  • --quote {all,minimal,none,nonnumeric} β€” when to include quotes, defaults to nonnumeric

πŸ¦‹ appcontainer action show

shows action β€” one (1) specific action, very demure:

openstack appcontainer action show [-h]
                                   [-f {json,shell,table,value,yaml}]
                                   [-c COLUMN] [--max-width <integer>]
                                   [--fit-width] [--print-empty]
                                   [--noindent] [--prefix PREFIX]
                                   <container> <request_id>
  • <container> β€” ID or name of the container to show.
  • <request_id> β€” request ID of action to describe.
  • -f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml} β€” the output format, defaults to table
  • -c COLUMN, --column COLUMN β€” specify the column(s) to include, can be repeated
  • --max-width <integer> β€” Maximum display width, <1 to disable. You can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.
  • --fit-width β€” Fit the table to the display width. Implied if --max-width greater than 0. Set the environment variable CLIFF_FIT_WIDTH =1 to always enable
  • --print-empty β€” Print empty table if there is no data to show.
  • --noindent β€” whether to disable indenting the JSON
  • --prefix PREFIX β€” add a prefix to all variable names

πŸŽ€ appcontainer host

an appcontainer host specifies the compute host for running containers. it's the real estate, the venue, the location tag πŸ“

πŸ’– appcontainer host list

list available hosts:

openstack appcontainer host 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]
                                 [--marker <marker>] [--limit <limit>]
                                 [--sort-key <sort-key>]
                                 [--sort-dir <sort-dir>]
  • -h, --help β€” show this help message and exit
  • --marker <marker> β€” The last host UUID of the previous page; displays list of hosts after "marker".
  • --limit <limit> β€” Maximum number of hosts to return
  • --sort-key <sort-key> β€” Column to sort results by
  • --sort-dir <sort-dir> β€” Direction to sort. "asc" or "desc".
  • -f {csv,json,table,value,yaml}, --format {csv,json,table,value,yaml} β€” the output format, defaults to table
  • -c COLUMN, --column COLUMN β€” specify the column(s) to include, can be repeated
  • --sort-column SORT_COLUMN β€” specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated
  • --max-width <integer> β€” Maximum display width, <1 to disable. You can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.
  • --fit-width β€” Fit the table to the display width. Implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable
  • --print-empty β€” Print empty table if there is no data to show.
  • --noindent β€” whether to disable indenting the JSON
  • --quote {all,minimal,none,nonnumeric} β€” when to include quotes, defaults to nonnumeric

🧚 appcontainer host show

show a host β€” one host, front and center:

openstack appcontainer host show [-h]
                                 [-f {json,shell,table,value,yaml}]
                                 [-c COLUMN] [--max-width <integer>]
                                 [--fit-width] [--print-empty]
                                 [--noindent] [--prefix PREFIX]
                                 <host>
  • <host> β€” ID or name of the host to show.
  • -h, --help β€” show this help message and exit
  • -f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml} β€” the output format, defaults to table
  • -c COLUMN, --column COLUMN β€” specify the column(s) to include, can be repeated
  • --max-width <integer> β€” Maximum display width, <1 to disable. You can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.
  • --fit-width β€” Fit the table to the display width. Implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable
  • --print-empty β€” Print empty table if there is no data to show.
  • --noindent β€” whether to disable indenting the JSON
  • --prefix PREFIX β€” add a prefix to all variable names

🌟 appcontainer image

an appcontainer image specifies the image for a host. the fit check for your host, basically πŸ‘—

πŸ“ appcontainer image list

list available images:

openstack appcontainer 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]
                                  [--marker <marker>] [--limit <limit>]
                                  [--sort-key <sort-key>]
                                  [--sort-dir <sort-dir>]
  • -h, --help β€” show this help message and exit
  • --marker <marker> β€” The last host UUID of the previous page; displays list of hosts after "marker".
  • --limit <limit> β€” Maximum number of hosts to return
  • --sort-key <sort-key> β€” Column to sort results by
  • --sort-dir <sort-dir> β€” Direction to sort. "asc" or "desc".
  • -f {csv,json,table,value,yaml}, --format {csv,json,table,value,yaml} β€” the output format, defaults to table
  • -c COLUMN, --column COLUMN β€” specify the column(s) to include, can be repeated
  • --sort-column SORT_COLUMN β€” specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated
  • --max-width <integer> β€” the max display width, bestie. <1 disables it entirely. You can also set the CLIFF_MAX_TERM_WIDTH environment variable, but ngl the parameter wins β€” it takes precedence. πŸ‘‘
  • --fit-width β€” squishes the table to fit your display width. It's implied if --max- width is greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable it. ✨
  • --print-empty β€” prints an empty table when there's literally no data to show. icon of resilience honestly πŸŽ€
  • --noindent β€” whether to disable indenting the JSON. that's it, that's the whole vibe πŸ¦‹
  • --quote {all,minimal,none,nonnumeric} β€” when to include quotes. defaults to nonnumeric. periodt πŸ’…

appcontainer image show

Describe a specific image. like a lil biography for your image πŸ’–

openstack appcontainer image show [-h]
                                  [-f {json,shell,table,value,yaml}]
                                  [-c COLUMN] [--max-width <integer>]
                                  [--fit-width] [--print-empty]
                                  [--noindent] [--prefix PREFIX]
                                  <uuid>
  • <uuid> β€” UUID of image to describe πŸ”
  • -h, --help β€” show this help message and exit
  • -f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml} β€” the output format, defaults to table
  • -c COLUMN, --column COLUMN β€” specify the column(s) to include, can be repeated
  • --max-width <integer> β€” Maximum display width, <1 to disable. You can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.
  • --fit-width β€” Fit the table to the display width. Implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable
  • --print-empty β€” Print empty table if there is no data to show.
  • --noindent β€” whether to disable indenting the JSON
  • --prefix PREFIX β€” add a prefix to all variable names 🏷️

appcontainer image delete

Delete specified image from a host. bye bestie πŸ‘‹πŸ’€

openstack appcontainer image delete  [-h] <uuid> <host>
  • <uuid> β€” UUID of image to describe
  • <host> β€” Name or UUID of the host
  • -h, --help β€” show this help message and exit

appcontainer image pull

Pull specified image into a host. get that image in there 🫢

openstack appcontainer image pull [-h]
                                  [-f {json,shell,table,value,yaml}]
                                  [-c COLUMN] [--max-width <integer>]
                                  [--fit-width] [--print-empty]
                                  [--noindent] [--prefix PREFIX]
                                  <image> <host>
  • <image> β€” Name of the image
  • <host> β€” Name or UUID of the host
  • -h, --help β€” show this help message and exit
  • -f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml} β€” the output format, defaults to table
  • -c COLUMN, --column COLUMN β€” specify the column(s) to include, can be repeated
  • --max-width <integer> β€” Maximum display width, <1 to disable. You can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.
  • --fit-width β€” Fit the table to the display width. Implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable
  • --print-empty β€” Print empty table if there is no data to show.
  • --noindent β€” whether to disable indenting the JSON
  • --prefix PREFIX β€” add a prefix to all variable names

Search the image repository for images. scavenger hunt but make it cloud β˜οΈπŸ”Ž

openstack appcontainer image search [-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]
                                    [--image-driver <image-driver>]
                                    [--exact-match]
                                    <image_name>
  • <image_name> β€” Name of the image
  • -h, --help β€” show this help message and exit
  • --image-driver <image-driver> β€” Name of the image driver
  • --exact-match β€” exact match image name. no fuzzy vibes allowed 🎯
  • -f {csv,json,table,value,yaml}, --format {csv,json,table,value,yaml} β€” the output format, defaults to table
  • -c COLUMN, --column COLUMN β€” specify the column(s) to include, can be repeated
  • --sort-column SORT_COLUMN β€” specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated
  • --max-width <integer> β€” Maximum display width, <1 to disable. You can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.
  • --fit-width β€” Fit the table to the display width. Implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable
  • --print-empty β€” Print empty table if there is no data to show.
  • --noindent β€” whether to disable indenting the JSON
  • --quote {all,minimal,none,nonnumeric} β€” when to include quotes, defaults to nonnumeric

appcontainer service

An appcontainer service specifies the zun services. it's giving org chart for your cloud 🫑


appcontainer service list

Print a list of zun services. lineup reveal ✨

openstack appcontainer service 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]
  • -h, --help β€” show this help message and exit
  • -f {csv,json,table,value,yaml}, --format {csv,json,table,value,yaml} β€” the output format, defaults to table
  • -c COLUMN, --column COLUMN β€” specify the column(s) to include, can be repeated
  • --sort-column SORT_COLUMN β€” specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated
  • --max-width <integer> β€” Maximum display width, <1 to disable. You can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.
  • --fit-width β€” Fit the table to the display width. Implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable
  • --print-empty β€” Print empty table if there is no data to show.
  • --noindent β€” whether to disable indenting the JSON
  • --quote {all,minimal,none,nonnumeric} β€” when to include quotes, defaults to nonnumeric

appcontainer service delete

Delete the Zun binaries/services. unfollowing rn πŸ’”

openstack appcontainer service delete [-h] <host> <binary>
  • <host> β€” Name of host
  • <binary> β€” Name of the binary to delete
  • -h, --help β€” show this help message and exit

appcontainer service forcedown

Force the Zun service to down or up. main character energy, no consent needed 😀

openstack appcontainer service forcedown [-h]
                                         [-f {json,shell,table,value,yaml}]
                                         [-c COLUMN]
                                         [--max-width <integer>]
                                         [--fit-width] [--print-empty]
                                         [--noindent] [--prefix PREFIX]
                                         [--unset]
                                         <host> <binary>
  • <host> β€” Name of host
  • <binary> β€” Name of the binary to forcedown
  • -h, --help β€” show this help message and exit
  • --unset β€” Unset the force state down of service. basically the undo button ↩️
  • -f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml} β€” the output format, defaults to table
  • -c COLUMN, --column COLUMN β€” specify the column(s) to include, can be repeated
  • --max-width <integer> β€” Maximum display width, <1 to disable. You can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.
  • --fit-width β€” Fit the table to the display width. Implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable
  • --print-empty β€” Print empty table if there is no data to show.
  • --noindent β€” whether to disable indenting the JSON
  • --prefix PREFIX β€” add a prefix to all variable names

appcontainer service enable

Enable the Zun service. we're SO back πŸ”₯

openstack appcontainer service enable [-h]
                                      [-f {json,shell,table,value,yaml}]
                                      [-c COLUMN]
                                      [--max-width <integer>]
                                      [--fit-width] [--print-empty]
                                      [--noindent] [--prefix PREFIX]
                                      <host> <binary>
  • <host> β€” Name of host
  • <binary> β€” Name of the binary to enable
  • -h, --help β€” show this help message and exit
  • -f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml} β€” the output format, defaults to table
  • -c COLUMN, --column COLUMN β€” specify the column(s) to include, can be repeated
  • --max-width <integer> β€” Maximum display width, <1 to disable. You can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.
  • --fit-width β€” Fit the table to the display width. Implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable
  • --print-empty β€” Print empty table if there is no data to show.
  • --noindent β€” whether to disable indenting the JSON
  • --prefix PREFIX β€” add a prefix to all variable names

appcontainer service disable

Disable the Zun service. 🚫

openstack appcontainer service disable [-h]
                                      [-f {json,shell,table,value,yaml}]
                                      [-c COLUMN]
                                      [--max-width <integer>]
                                      [--fit-width] [--print-empty]
                                      [--noindent] [--prefix PREFIX]
                                      [--reason <reason>]
                                      <host> <binary>

okay so here's the deal with this one πŸ’… you're telling one specific service on one specific host to take a lil nap. Here's what it wants from you:

  • <host> β€” name of the host πŸ–₯️ like, the actual box
  • <binary> β€” name of the binary to disable, i.e. which service you're benching

✨ the flags, bestie ✨

  • -h, --help β€” shows this help message and dips. classic.
  • --reason <reason> β€” the reason for disabling the service. be honest, put it in writing πŸ“
  • -f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml} β€” the output format, defaults to table πŸŽ€
  • -c COLUMN, --column COLUMN β€” specify the column(s) to include, and yes you can repeat it (spam it, go off) πŸ”
  • --max-width <integer> β€” maximum display width, <1 to disable. you can also use the CLIFF_MAX_TERM_WIDTH environment variable, but heads up β€” the parameter takes precedence πŸ‘€
  • --fit-width β€” fit the table to the display width. it's implied if --max-width is greater than 0. set the environment variable CLIFF_FIT_WIDTH=1 to always enable 🫢
  • --print-empty β€” print empty table if there is no data to show. no data?? still a table. iconic.
  • --noindent β€” whether to disable indenting the JSON πŸͺ„
  • --prefix PREFIX β€” add a prefix to all variable names 🏷️

🐍 Reference

πŸ’« The zunclient Python API

🌸 Usage

first, create a client instance with your credentials. it's giving handshake energy 🀝

>>> from zunclient import client
>>> zun = client.Client(VERSION, auth_url=AUTH_URL, username=USERNAME,
...                     password=PASSWORD, project_name=PROJECT_NAME,
...                     user_domain_name='default',
...                     project_domain_name='default')

here VERSION can be a string or a zunclient.api_versions.APIVersion obj. if you'd rather live that string life, you can use 1 or 1.X (where X is a microversion) ✨

alternatively β€” and yes there's an alt route β€” you can create a client instance using the keystoneauth session API:

>>> from keystoneauth1 import loading
>>> from keystoneauth1 import session
>>> from zunclient import client
>>> loader = loading.get_plugin_loader('password')
>>> auth = loader.load_from_options(auth_url=AUTH_URL,
...                                 username=USERNAME,
...                                 password=PASSWORD,
...                                 project_name=PROJECT_NAME,
...                                 user_domain_name='default',
...                                 project_domain_name='default')
>>> sess = session.Session(auth=auth)
>>> zun = client.Client(VERSION, session=sess)

if you have PROJECT_NAME instead of a PROJECT_ID, use the project_name parameter. same energy β€” if your cloud uses keystone v3 and you have a DOMAIN_NAME or DOMAIN_ID, provide it as user_domain_(name|id) 🫑 and if you're using a PROJECT_NAME also provide the domain information as project_domain_(name|id). lowkey important, don't skip it.

then call methods on its managers:

>>> zun.containers.list()
[<Container {...}>]

>>> zun.containers.run(name="my-container", image='nginx')
<Container {...}>

look at that. containers. slay. πŸ”₯


πŸ‘‘ Author

author name not set 😭 (mysterious main character energy, tbh)

2013, OpenStack Foundation


that's the whole page, bestie β€” no cap, you're now fully fluent in python-zunclient πŸ¦‹

version 5.5.0, dated Jan 02, 1980 (yes really, that's the date on the tin πŸ™ˆ) β€” go forth and containerize, periodt πŸ’…βœ¨

πŸ“¦ where this page comes from