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 Test status (master) Docs status (master) Test coverage (master) 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.25.0.tar.gz (727.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zhmcclient-1.25.0-py3-none-any.whl (355.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zhmcclient-1.25.0.tar.gz
  • Upload date:
  • Size: 727.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zhmcclient-1.25.0.tar.gz
Algorithm Hash digest
SHA256 39e427adec584bf6396b0ec4aec3e9fb6264d6347aaf0f89714f14cffd92391b
MD5 416f87dc8ce52201158a641c6b6ec83e
BLAKE2b-256 6fcf4bf74f392ba7f64fefd6b6066ef0e5d44b38606a44b9fb592356a4bd4be3

See more details on using hashes here.

Provenance

The following attestation bundles were made for zhmcclient-1.25.0.tar.gz:

Publisher: publish.yml on zhmcclient/python-zhmcclient

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zhmcclient-1.25.0-py3-none-any.whl.

File metadata

  • Download URL: zhmcclient-1.25.0-py3-none-any.whl
  • Upload date:
  • Size: 355.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zhmcclient-1.25.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb8910c10a5bedc85d8b242651cae95f2ae9bce51cd0ffa882b0a28c2efccb4f
MD5 bf8a8d464a379a0be5faca5999e0b08c
BLAKE2b-256 c90cfe5ab30e59063d6d0b6c1b5ee03a74e9e98f4dbc8406d85371fd4501832e

See more details on using hashes here.

Provenance

The following attestation bundles were made for zhmcclient-1.25.0-py3-none-any.whl:

Publisher: publish.yml on zhmcclient/python-zhmcclient

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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