Skip to main content

A pure Python client library for the z Systems HMC Web Services API.

Project description

zhmcclient - A pure Python client library for the z Systems HMC Web Services API

Version on Pypi Travis test status (master) Appveyor test status (master) Docs build status (latest) Test coverage (master)

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 z Systems 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 z Systems 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)

This example uses the zhmc CLI to list the CPCs managed by an HMC, and shows a possible output:

$ hmc_host="<IP address or hostname of the HMC>"
$ hmc_userid="<userid on that HMC>"
$ zhmc -h $hmc_host -u $hmc_userid cpc list
Enter password (for user <hmc_user> at HMC <hmc_host>): .......
+----------+------------------+
| name     | status           |
|----------+------------------|
| P000S67B | service-required |
+----------+------------------+

Documentation

The zhmcclient documentation is on RTD:

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

Uploaded Source

Built Distribution

zhmcclient-0.12.0-py2.py3-none-any.whl (135.9 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: zhmcclient-0.12.0.tar.gz
  • Upload date:
  • Size: 203.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for zhmcclient-0.12.0.tar.gz
Algorithm Hash digest
SHA256 c85af4b600a532d5f103219eb39e167d52d652360829dd6adc062e5d0dff0a44
MD5 272ed5fef9d71fccd3055781c7614246
BLAKE2b-256 9dc45d103ef01ac03183a84ec2d0c61f4d5e581ca154a379c5b1e8989e3a929e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zhmcclient-0.12.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 71b69f4a7311cd59af0aea95f79a2d7e8b4b517658eaa694d2701c0cbd32f2c1
MD5 6632afbd2218101a1ed44c77b46a69b8
BLAKE2b-256 bb0cf607ce92f554cec36652b2e8404704450ec35c0e3625d2893b001e5aaf40

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