Skip to main content

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

Whats New

  • Argument Parsing library replaced from optparse to argparse.

  • Support for subcmd under various commands.

  • New commands supported under shell

    osimages managementserver resourcegroups

  • Better Error handling.

Installation

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 v3.10.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.

$lxca_shell

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 >>

  1. Start a Python LXCA Shell in Interactive mode.

    $lxca_shell –api Interactive Python Shell for Lenovo XClarity Administrator v2.4.0 Type “dir()” or “help(lxca command object)” for more information. >>>

  2. 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.

API Reference

PyLXCA command reference is available at

http://ralfss30.labs.lenovo.com:8120/help/topic/com.lenovo.lxca.doc/pycli_overview.html

PyLXCA API Help can be seen from Interactive Python Shell as follows.

$lxca_shell –api Interactive Python Shell for Lenovo XClarity Administrator v4.2.0 Type “dir()” or “help(lxca command object)” for more information. >>> >>> help(connect)

Example

python lxca_shell connect -l https://10.241.106.216 -u USERID –noverify connect -l https://10.241.106.216 -u USERID

Example to call lxca_cmd python module from python script or Ansible module

import pylxca con1 = connect(”https://10.241.106.216”,”USERID”,”Passw0rd”,”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-<version>-py2.7.egg/pylxcatest

License

Apache Software License (http://www.apache.org/licenses/LICENSE-2.0)

Metadata

Release files for pylxca 4.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for pylxca 4.2.0
File Interpreter ABI Platform
pylxca-4.2.0-py3-none-any.whl Python 3 none any Details

Release files / pylxca-4.2.0-py3-none-any.whl

Download URL pylxca-4.2.0-py3-none-any.whl
Size 73.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
386c90e6ff481e900859bad794c9e634292644a6fb46639c89f354e7ccfbca4d
BLAKE2b-256 checksum
How to use checksums
5635cd6abb2a4b1f58a41bde54af9291f99e8696c34d0da1dd6012daa1395d6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

Release history Release notifications | RSS feed

This release

4.2.0 This release

1 release file

4.0.0

2 release files

3.2.0

2 release files

3.0.0

2 release files

2.7.0

3 release files

2.6.0

5 release files

2.5.0

5 release files

2.4.0

5 release files

2.2.1

2 release files

2.2.0

5 release files

2.1.1

3 release files

2.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page