Skip to main content

A pure Python client library for the IBM Z HMC Web Services API.

Project description

zhmcclient - A pure Python client library for the IBM Z HMC Web Services API

Version on Pypi Travis status Appveyor status ReadTheDocs status Coveralls status CodeClimate status

Overview

The zhmcclient package is a client library written in pure Python that interacts with the Web Services API of the Hardware Management Console (HMC) of IBM Z or LinuxONE machines. The goal of this package is to make the HMC Web Services API easily consumable for Python programmers.

The HMC Web Services API is the access point for any external tools to manage the IBM Z or LinuxONE platform. It supports management of the lifecycle and configuration of various platform resources, such as partitions, CPU, memory, virtual switches, I/O adapters, and more.

The zhmcclient package encapsulates both protocols supported by the HMC Web Services API:

  • REST over HTTPS for request/response-style operations driven by the client. Most of these operations complete synchronously, but some long-running tasks complete asynchronously.

  • JMS (Java Messaging Services) for notifications from the HMC to the client. This can be used to be notified about changes in the system, or about completion of asynchronous tasks started using REST.

Installation

The quick way:

$ pip install zhmcclient

For more details, see the Installation section in the documentation.

Quickstart

The following example code lists the machines (CPCs) managed by an HMC:

#!/usr/bin/env python

import zhmcclient
import requests.packages.urllib3
requests.packages.urllib3.disable_warnings()

# Set these variables for your environment:
hmc_host = "<IP address or hostname of the HMC>"
hmc_userid = "<userid on that HMC>"
hmc_password = "<password of that HMC userid>"

session = zhmcclient.Session(hmc_host, hmc_userid, hmc_password)
client = zhmcclient.Client(session)

cpcs = client.cpcs.list()
for cpc in cpcs:
    print(cpc)

Possible output when running the script:

Cpc(name=P000S67B, object-uri=/api/cpcs/fa1f2466-12df-311a-804c-4ed2cc1d6564, status=service-required)

Documentation and Change Log

For the latest released version on PyPI:

zhmc CLI

Before version 0.18.0 of the zhmcclient package, it contained the zhmc CLI. Starting with zhmcclient version 0.18.0, the zhmc CLI has been moved from this project into the new zhmccli project.

If your project uses the zhmc CLI, and you are upgrading the zhmcclient package from before 0.18.0 to 0.18.0 or later, your project will need to add the zhmccli package to its dependencies.

Contributing

For information on how to contribute to this project, see the Development section in the documentation.

License

The zhmcclient package is licensed under the Apache 2.0 License.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zhmcclient-0.26.2.tar.gz (162.1 kB view details)

Uploaded Source

Built Distribution

zhmcclient-0.26.2-py2.py3-none-any.whl (216.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file zhmcclient-0.26.2.tar.gz.

File metadata

  • Download URL: zhmcclient-0.26.2.tar.gz
  • Upload date:
  • Size: 162.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for zhmcclient-0.26.2.tar.gz
Algorithm Hash digest
SHA256 83477a0e7b8fe1070c19c4609841c06748d77f75f105c52b0a5c5cca27148fc7
MD5 4e94bed40f1369041f5da8c608f5d891
BLAKE2b-256 8ae890963cf7ee8715999e5b5332f1aa8d23d481f568c1b8b3a6a4ab9d39fb13

See more details on using hashes here.

File details

Details for the file zhmcclient-0.26.2-py2.py3-none-any.whl.

File metadata

  • Download URL: zhmcclient-0.26.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 216.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for zhmcclient-0.26.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c44134d3e47d9a4ebe1b67627273929eade805b7be85bc487bb41be5835176b8
MD5 64232f4983e8cf1dba1beba8f73bc6d1
BLAKE2b-256 3eb96d6e0954d31e600ed3d258f5c97a8d17ff297148acc8e0b2b8b1bc4ee1ac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page