It is tool/api to connect LXCA from command line
What is PyLXCA?
PyLXCA is Python based interface for Lenovo xClarity Administration APIs.
PyLXCA command-line interface (CLI) provides a Python-based library of commands to automate provisioning and resource management from an OpenStack environment, such as Ansible or Puppet.
The Lenovo XClarity Administrator PYLXCA CLI provide an interface to Lenovo XClarity Administrator REST APIs to automate functions such as: * Logging in to Lenovo XClarity Administrator * Managing and unmanaging chassis, servers, storage systems, and top-of-rack switches (endpoints) * Viewing inventory data for endpoints and components * Deploying an operating-system image to one or more servers * Configuring servers through the use of Configuration Patterns * Applying firmware updates to endpoints
To use the PYLXCA command-line interface (CLI), you must install the CLI and start a command session.
Python (including the request and logging modules) is required to use to the PYLXCA CLI. Ensure at the following requirements are met. For more information about Python, see the [Link]www.python.org website.
- Python v2.7.x (Later versions have not been tested.)
- Python requests v2.7.0 or later
- Python logging v0.4.9.6 or later
Complete the following steps to install the PYLXCA CLI.
1. Download the toolkit by clicking Help ( )> Resources from the Lenovo XClarity Administrator title bar, and then clicking Download PYLXCA CLI from the dialog. 2. Unzip the package into a local directory. 3. Run the following command to install the module: easy_install unzip_directorypylxca-1.0-py2.7.egg 4. Start a Python shell session.
Welcome to PyLXCA Shell v1.0 Type “help” at any time for a list of commands. Type “pyshell” at any time to get interactive python shell ————————————————– PyLXCA >>
- Validate that the module was installed correctly by running the following command:
In Python Shell Try to import pylxca module as follows
>>> import pylxca
If python able to import pylxca without any error then it is installed correctly.
PyLXCA command reference is available at http://ralfss30.labs.lenovo.com:8120/help/topic/com.lenovo.lxca.doc/pycli_overview.html
Example to call lxca_cmd pytohn module from python script or Ansible module
from pylxca.pylxca_cmd.lxca_pyshell import * pyshell() con1 = connect(“https://10.241.106.216”,”USERID”,”CME44ibm”,”True”)
Several sample scripts are also available to help you to quickly begin using the PYLXCA command-line interface (CLI) to manage endpoints. The sample scripts are location in the following directory: lib/python2.7/site-packages/pylxca-1.0-py2.7.egg/pylxcatest
Apache Software License (http://www.apache.org/licenses/LICENSE-2.0)
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size pylxca-2.6.0-py2.7.egg (91.5 kB)||File type Egg||Python version 2.7||Upload date||Hashes View|
|Filename, size pylxca-2.6.0-py2-none-any.whl (76.9 kB)||File type Wheel||Python version py2||Upload date||Hashes View|
|Filename, size pylxca-2.6.0-py3.6.egg (89.3 kB)||File type Egg||Python version 3.6||Upload date||Hashes View|
|Filename, size pylxca-2.6.0-py3-none-any.whl (76.9 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size pylxca-2.6.0.tar.gz (392.8 kB)||File type Source||Python version None||Upload date||Hashes View|