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 Actions 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 partitions on CPCs in DPM mode that are accessible for the user:

#!/usr/bin/env python

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

# Set these variables for your environment:
host = "<IP address or hostname of the HMC>"
userid = "<userid on that HMC>"
password = "<password of that HMC userid>"
verify_cert = False

session = zhmcclient.Session(host, userid, password, verify_cert=verify_cert)
client = zhmcclient.Client(session)
console = client.consoles.console

partitions = console.list_permitted_partitions()
for part in partitions:
    cpc = part.manager.parent
    print("{} {}".format(cpc.name, part.name))

Possible output when running the script:

P000S67B PART1
P000S67B PART2
P0000M96 PART1

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-1.4.1.tar.gz (206.6 kB view details)

Uploaded Source

Built Distribution

zhmcclient-1.4.1-py2.py3-none-any.whl (265.0 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: zhmcclient-1.4.1.tar.gz
  • Upload date:
  • Size: 206.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for zhmcclient-1.4.1.tar.gz
Algorithm Hash digest
SHA256 0dd2b3876b4cbfcc4e1556022b20efbaf9ac7a9f1c18fa6add3c30c469d6ff12
MD5 796b1fcee9715fd6b0de62eba4a6060c
BLAKE2b-256 f6cb96b5501dbb10e79f9b8755a32566bbbc3ac5ac14595fc545eb301e6ef3d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zhmcclient-1.4.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 265.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for zhmcclient-1.4.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 14d07976f15731f543851bf02fbcb3984d225fe6f3e6211b62bc0350e29c564f
MD5 0776b033fb284cc5ece3559462232708
BLAKE2b-256 5b7324bf5f8a94b455d2d687fdf5e47b24aaa7b7ea2b1a716c20738314623a0d

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