Skip to main content

ZHMCCLI lib

Project description

linux_workload_execution

[PyPI version]

Overview

linux_workload_execution is a Python package designed to: Takes details like, lpar, ipaddress, script directory and script command as the input, and perform below activities

  1. To call the zhmclient to activate the lpar, Sleep for 10 minutes
  2. ssh to the ipaddress (Linux guest ip address)
  3. download the script file to, local machine, from given source path
  4. upload the dowloaded script file to the dir(/ffdc/u/eATS_automation) on the ssh session
  5. invoke the script command (ex: sh make_loop.sh) on the ssh session
  6. collect the output printed on the ssh session and print it

Installation

You can install the package using pip:

pip install linux_workload_execution

config JSON format

config.json

{
    "host_name": "ip address of host",
    "hmcm_user_name": "user name of HMC",
    "hmcm_pwd": "password of HMC",
    "cpc": "cpc details",
    "lpar": "lpar details",
    "system_host": "ip address of host system",
    "userid": "user id",
    "user_pwd": "user password",
    "ssh_key_path": "SSH_KEY_PATH",
    "script_details": {
        "token": "",
        "name": "example.sh",
        "url": "path to script file",
        "exec_path": "path to execution",
        "local_path": "./"
    }
}

Usage example

main.py
*******
from activation import Activation


activation_obj = Activation(sys.argv[1])
activation_obj.entry_point()

Running the Python code

python main.py config.json

Python package creation

REFERENCE

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

linux_workload_execution-1.0.6.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

linux_workload_execution-1.0.6-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file linux_workload_execution-1.0.6.tar.gz.

File metadata

File hashes

Hashes for linux_workload_execution-1.0.6.tar.gz
Algorithm Hash digest
SHA256 92f47ee5b13db5220ea7a42b1f40a67fdea61b7a8f70d8fff279ce12fbad4c85
MD5 3ad46ab48701a8aa6c66b1f5479337d1
BLAKE2b-256 be33dd0984d32b4739711b5ebb0606d29b4f89bf175aab9cbec8c5180080c42b

See more details on using hashes here.

File details

Details for the file linux_workload_execution-1.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for linux_workload_execution-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 97ac7fca21a2a296691b15de095a72b82d45bff12e37da018fa96fa5d9c77a9c
MD5 65398f68c1cce9f85a4ad810b23cbe28
BLAKE2b-256 629effb1c97ca20871cb5ad21cd1082452133a932df36d5575c32f9b2d3c984e

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