Python-Moganclient Documentation Release
Total Page:16
File Type:pdf, Size:1020Kb
python-moganclient Documentation Release OpenStack Foundation Sep 14, 2017 Contents 1 Installation 3 2 python-moganclient Contributor Documentation5 2.1 Contributing to python-moganclient...................................5 2.2 Testing..................................................6 3 python-moganclient User Documentation7 3.1 OpenStack Client Command-Line Interface (CLI)...........................7 4 Indices and tables 21 i ii python-moganclient Documentation, Release This is a client for OpenStack Mogan API. There’s a Python API (the moganclient modules), and a set of event related commands which are integrated with the OSC CLI tool. Each implements the entire Mogan API. Contents: Contents 1 python-moganclient Documentation, Release 2 Contents CHAPTER 1 Installation At the command line: $ pip install python-moganclient Or, if you have virtualenvwrapper installed: $ mkvirtualenv python-moganclient $ pip install python-moganclient 3 python-moganclient Documentation, Release 4 Chapter 1. Installation CHAPTER 2 python-moganclient Contributor Documentation 2.1 Contributing to python-moganclient If you’re interested in contributing to the python-moganclient project, the following will help get you started. 2.1.1 #openstack-mogan on Freenode IRC Network There is a very active chat channel at irc://freenode.net/#openstack-mogan. This is usually the best place to ask questions and find your way around. IRC stands for Internet Relay Chat and it is a way to chat online in real time. You can ask a question and come back later to read the answer in the log files. Logs for the #openstack-mogan IRC channel are stored at http://eavesdrop.openstack.org/irclogs/%23openstack-mogan/. 2.1.2 Contributor License Agreement In order to contribute to the python-moganclient project, you need to have signed OpenStack’s contributor’s agreement. See also: • https://docs.openstack.org/infra/manual/developers.html • https://wiki.openstack.org/wiki/CLA 2.1.3 LaunchPad Project Most of the tools used for OpenStack depend on a launchpad.net ID for authentication. After signing up for a launch- pad account, join the “openstack” team to have access to the mailing list and receive notifications of important events. See also: • https://launchpad.net • https://launchpad.net/python-moganclient 5 python-moganclient Documentation, Release • https://launchpad.net/~openstack 2.1.4 Project Hosting Details Bug tracker https://launchpad.net/python-moganclient Mailing list (prefix subjects with [mogan] for faster responses) http://lists.openstack.org/cgi-bin/mailman/ listinfo/openstack-dev Code Hosting https://git.openstack.org/cgit/openstack/python-moganclient Code Review https://review.openstack.org/#/q/status:open+project:openstack/python-moganclient,n,z 2.2 Testing 2.2.1 Python Guideline Enforcement All code has to pass the pep8 style guideline to merge into OpenStack, to validate the code against these guidelines you can run: $ tox -e pep8 2.2.2 Unit Testing It is strongly encouraged to run the unit tests locally under one or more test environments prior to submitting a patch. To run all the recommended environments sequentially and pep8 style guideline run: $ tox You can also selectively pick specific test environments by listing your chosen environments after a -e flag: $ tox -e py35,py27,pep8,pypy Note: Tox sets up virtual environment and installs all necessary dependencies. Sharing the environment with devstack testing is not recommended due to conflicting configuration with system dependencies. 6 Chapter 2. python-moganclient Contributor Documentation CHAPTER 3 python-moganclient User Documentation 3.1 OpenStack Client Command-Line Interface (CLI) 3.1.1 Synopsis openstack [options] baremetalcompute <command> [command-options] openstack help baremetalcompute <command> 3.1.2 Description The OpenStack Client plugin interacts with the Bare Metal service through the openstack baremetalcompute command line interface (CLI). To use openstack CLI, the OpenStackClient should be installed: # pip install python-openstackclient To use the CLI, you must provide your OpenStack username, password, project, and auth endpoint. You can use configuration options --os-username, --os-password, --os-project-id (or --os-project-name), and --os-auth-url, or set the corresponding environment variables: $ export OS_USERNAME=user $ export OS_PASSWORD=password $ export OS_PROJECT_NAME=project # or OS_PROJECT_ID $ export OS_PROJECT_DOMAIN_ID=default $ export OS_USER_DOMAIN_ID=default $ export OS_IDENTITY_API_VERSION=3 $ export OS_AUTH_URL=http://auth.example.com:5000/identity This CLI is provided by python-openstackclient and osc-lib projects: • https://git.openstack.org/openstack/python-openstackclient 7 python-moganclient Documentation, Release • https://git.openstack.org/openstack/osc-lib 3.1.3 Getting help To get a list of available (sub)commands and options, run: $ openstack help baremetalcompute To get usage and options of a command, run: $ openstack help baremetalcompute <sub-command> 3.1.4 Examples Get information about the openstack baremetalcompute server create command: $ openstack help baremetalcompute server create Get a list of baremetalcompute flavors: $ openstack baremetalcompute flavor list Boot a Bare metal server: $ openstack baremetalcompute server create --flavor <FLAVOR> --image <IMAGE> --nic ,!net-id=<NETWORK> test Get a list of baremetal nodes aggregates: $ openstack baremetalcompute aggregate list 3.1.5 Command Reference List of released CLI commands available in openstack client. These commands can be referenced by doing openstack help baremetalcompute. Baremetalcompute server baremetalcompute server create Create a new baremetal server openstack baremetalcompute server create --flavor <flavor> --image <image> --nic <net-id=NETWORK, port-id=PORT> [--description <description>] [--availability-zone <zone-name>] [--file <dest-filename=source-filename>] [--user-data <user-data>] 8 Chapter 3. python-moganclient User Documentation python-moganclient Documentation, Release [--key-name <key-name>] [--property <key=value>] [--partition <key=value>] [--min <count>] [--max <count>] [--hint <key=value>] <name> --flavor <flavor> Create server with this flavor (name or ID) --image <image> Create server boot disk from this image (name or ID) --nic <net-id=NETWORK, port-id=PORT> Create a NIC on the server. Specify option multiple times to create multiple NICs. --description <description> Baremetal server description --availability-zone <zone-name> Select an availability zone for the server --file <dest-filename=source-filename> File to inject into image before boot (repeat option to set multiple files) --user-data <user-data> User data file to inject into the server --key-name <key-name> Keypair to inject into this server (optional extension) --property <key=value> Set a property on this server (repeat option to set multiple values) --partition <key=value> Create a partition on the root disk of this server, only root_gb(required), ephemeral_gb, and swap_mb allowed (repeat option to set multiple partitions) --min <count> Minimum number of servers to launch (default=1) --max <count> Maximum number of servers to launch (default=1) --hint <key=value> Hints for the Mogan scheduler (optional extension) name New baremetal server name baremetalcompute server show Display baremetal server details openstack baremetalcompute server show <server> server Baremetal server to display (name or UUID) 3.1. OpenStack Client Command-Line Interface (CLI) 9 python-moganclient Documentation, Release baremetalcompute server list List all baremetal servers openstack baremetalcompute server list[--long][-n][--all-projects] --long List additional fields in output -n, --no-name-lookup Skip flavor and image name lookup. --all-projects Include all projects (admin only) baremetalcompute server delete Delete existing baremetal erver(s) openstack baremetalcompute server delete <server>[<server> ...] server Baremetal server(s) to delete (name or UUID) baremetalcompute server add floating ip Add floating IP address to server openstack baremetalcompute server add floating ip [--fixed-ip-address <ip-address>] <server> <ip-address> --fixed-ip-address <ip-address> Fixed IP address to associate with this floating IP address server Server to receive the floating IP address (name or ID) ip-address Floating IP address to assign to server (IP only) baremetalcompute server add port Add interface to server openstack baremetalcompute server add port (--net-id <net-id> | --port-id <port-id>) <server> --net-id <net-id> Network to link to server --port-id <port-id> Port to link to server 10 Chapter 3. python-moganclient User Documentation python-moganclient Documentation, Release server Server to attach interface for baremetalcompute server lock Lock baremetal server(s). openstack baremetalcompute server lock <server>[<server> ...] server Baremetal server(s) to lock (name or UUID) baremetalcompute server netinfo Display baremetal server’s network info openstack baremetalcompute server netinfo <server> server Baremetal server to display its network information (name or UUID) baremetalcompute server reboot Reboot baremetal server(s). openstack baremetalcompute server reboot <server>[<server> ...] server Baremetal server(s) to reboot (name or UUID) baremetalcompute server remove floating ip Remove floating IP address from server openstack baremetalcompute server remove floating ip <server> <ip-address> server Server to remove the floating IP address from (name or ID) ip-address Floating IP address to remove from server (IP only) baremetalcompute