Skip to main content

Python library for MVS/CE automation

Project description

MVS Automation Python Library

This library allows the use of MVS/CE in an automated fashion. This can be used for deploying XMI files, pushing out updates, building software, creating custom MVS deployments.

Using this library requires a recent version of hercules SDL and one of MVS/CE, TK5, or TK4-.

TK5/TK4-: If you're using either TK5 or TK4-, they must be IPL'd before hand. Adding auto IPL of those two flavors will come at a later date.

Example:

Submit JCL and check the results, attach a device and send an operator command::

import sys
from automvs import automation

if len(sys.argv) != 2:
    print("Usage: python go_mvs.py <MVS system> <MVS PATH> username password")
    print(" MVS system: one of MVSCE, TK4- or TK5\n MVS PATH: /path/to/the/system. E.g. /home/test/mvs/tk4-")
    sys.exit(1)

mvs_type = sys.argv[1]
folder = sys.argv[2]
username = sys.argv[3]
password = sys.argv[4]
punch_port = 3505
web_port = 8038
ip = '127.0.0.1'

build = automation(
                    system=mvs_type,
                    system_path=folder,
                    ip = ip,
                    punch_port = punch_port,
                    web_port = web_port,
                    username=username,
                    password=password
                  )

cwd = os.getcwd()

if mvs_type == 'MVSCE'
    build.ipl(clpa=False)

try:
    print("Submitting {}/jcl/upload.jcl".format(cwd))
    with open("{}/jcl/upload.jcl".format(cwd),"r") as jcl:
        build.submit(jcl.read())
    build.wait_for_string("HASP250 UPLOAD   IS PURGED")
    build.check_maxcc("UPLOAD")
    build.send_herc('devinit 170 tape/zdlib1.het')
    build.wait_for_string("IEF238D SMP4P44 - REPLY DEVICE NAME OR 'CANCEL'.")
    build.send_reply('170')
    build.send_oper("$DU")
finally:
    if mvs_type == 'MVSCE'
        build.quit_hercules()

Remote Automation

This library also supports remote automation through the use of a rexx script available at https://github.com/MVS-sysgen/automvs/tree/main/REXX. Example usage of that script:

import sys
from automvs import automation

if len(sys.argv) != 2:
    print("Usage: python go_mvs.py <MVS system> username password")
    print(" MVS system: one of MVSCE, TK4- or TK5\n MVS PATH: /path/to/the/system. E.g. /home/test/mvs/tk4-")
    sys.exit(1)

mvs_type = sys.argv[1]
username = sys.argv[3]
password = sys.argv[4]
punch_port = 3505
ip = '127.0.0.1'
remote_port = 9856

build = automation(
                    system=mvs_type,
                    ip = ip,
                    punch_port = punch_port,
                    username=username,
                    password=password,
                    remote_port = remote_port
                  )

cwd = os.getcwd()

try:
    print("Submitting {}/jcl/upload.jcl".format(cwd))
    with open("{}/jcl/upload.jcl".format(cwd),"r") as jcl:
        build.submit(jcl.read())
    build.wait_for_job("UPLOAD")
    build.check_maxcc("UPLOAD")
    build.send_herc('devinit 170 tape/zdlib1.het')
    build.wait_for_string("IEF238D SMP4P44 - REPLY DEVICE NAME OR 'CANCEL'.")
    build.send_reply('170')
    build.send_oper("$DU")
finally:
    if mvs_type == 'MVSCE'
        build.quit_hercules()

Project details


Download files

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

Source Distribution

automvs-0.2.1.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

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

automvs-0.2.1-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file automvs-0.2.1.tar.gz.

File metadata

  • Download URL: automvs-0.2.1.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for automvs-0.2.1.tar.gz
Algorithm Hash digest
SHA256 65b61b5afb94d07a8858baab52e55482c58eecdf4b5a5907ed15a2557958288a
MD5 d7ee68cc7b7054eec9a5b7398b0f9b3c
BLAKE2b-256 b29a5fe047979c5aba21169d9c7977934e52c61488f87b24e6c13e8ece119424

See more details on using hashes here.

File details

Details for the file automvs-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: automvs-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for automvs-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 949a5e5ef122a1aba3775c04fc92c2bc9677d9fa6b6ec828eae609aa77be0d4b
MD5 62f58adc3da82454d8ebf088b73b1a51
BLAKE2b-256 d4c427ac77093123c18826a2dd16c8e0dd8d2ecfed9a56d357fe28f3dee7358b

See more details on using hashes here.

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