Skip to main content

PyBEN Parallels repository is an easy to use python utility class for Parallels server solution

Project description

PyBenParallels

GitHub License PyPI - Version python suggested version python minimum version platforms

Introduction

PyBEN Parallels repository is an easy to use python utility class for Parallels server solution

Installation

python -m pip install pybenparallels

Use

Cli module activation

Run for a full help printout:

python -m pybenparallels -h

The class can be run on remote location via SSH or Locally by leaving the PARALLELS_HOST empty

  • pybenparallels is the name of the module
  • pprint is a function to print the returned dict nicely in console
  • get_vms is a function to return all vms (or request a specific one)

Example use for LOCAL to get all vms and a specific one:

python -m pybenparallels pprint get_vms 
python -m pybenparallels pprint get_vms vm_name=ventura

Example for REMOTE SERVER use of global variables to get all vms: Use PARALLELS_CLI_EXEC when you need to override the execution line to overcome ssh context restrictions.

set PARALLELS_HOST='1.1.1.1'
set PARALLELS_HOST_USER='root'
set PARALLELS_HOST_PASS='1234'
set PARALLELS_CLI_EXEC='. ~/.zprofile; prlctl'

python -m pybenparallels pprint get_vms

Example for passing variables directly for REMOTE SERVER:

  • pybenparallels is the name of the module
  • get_vms is a function to return all vms (or request a specific one)
python -m pybenparallels host=1.1.1.1 host_user=root host_password=1234 get_vms vm_name=ventura

Python import ProxmoxCls class

from pybenparallels import ParallelsCLI

# For remote server (connection via ssh)
server = ParallelsCLI(host='1.1.1.1', host_user='root', host_password='1234')
server.cli_exec = '. ~/.zprofile; prlctl'  # Sometimes the ssh user does not have the correct python3 in PATH
print(server.get_vms())

# For local use, when you are running on the parallel server
print(ParallelsCLI().get_vms())

Some of the included functions:

  • get_vms: Returns a full list of vms, or list with matching vms by uuid or name
  • run_command: Execute a command on the parallels cli
  • send_vm_command: prlctl exec ...
  • send_vm_command_by_ssh
  • create_vms
  • delete_vm
  • start_vm
  • stop_vm
  • pause_vm
  • resume_vm
  • snapshot handling
  • and more ...

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

pybenparallels-1.1.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

pybenparallels-1.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file pybenparallels-1.1.0.tar.gz.

File metadata

  • Download URL: pybenparallels-1.1.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for pybenparallels-1.1.0.tar.gz
Algorithm Hash digest
SHA256 3a456befa3726fb662dec6c3668c742536af22810523d09c59a1fc283e57f0ef
MD5 d1fa0b4d660c020aedfd21cfb26818cc
BLAKE2b-256 bdb2c1c4fb5084e6e5242135fef9b592e4d06e5b21a0e2a3aee885a08fbfcd77

See more details on using hashes here.

File details

Details for the file pybenparallels-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: pybenparallels-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for pybenparallels-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e3f0417a5513d37d61b819de3814f3ead4d4ed55a1290075f69ed88bc2fe866
MD5 650787781e846ffb0b85b262229e555b
BLAKE2b-256 63865283c20d76e66ead24f3f27b6c0a31e36d010a19e6400e00f9492e1e6bde

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