Skip to main content

A package to automate Proxmox VE tasks

Project description

pveautomate

Proxmox VE api (not fully implemented)

pveautomate

pveautomate.automate

ProxmoxManager Objects

class ProxmoxManager()

__init__

def __init__(proxmox_url,
             proxmox_user,
             proxmox_password,
             node,
             verify_ssl=False)

Initialize the ProxmoxManager with the required parameters.

Arguments:

  • proxmox_url str - The URL of the Proxmox VE server.
  • proxmox_user str - The username to authenticate with.
  • proxmox_password str - The password to authenticate with.
  • node str - The Proxmox VE node to manage.
  • verify_ssl bool - Whether to verify SSL certificates. Defaults to False.

write_vm_data

def write_vm_data()

Write VM data to a CSV file.

This method is usually internal and is used to dump data on range VMs to a CSV file.

read_vm_data

def read_vm_data()

Read VM data from a CSV file.

This method is usually internal and is used to load data on range VMs from a CSV file.

authenticate

def authenticate()

Authenticate with the Proxmox VE host and obtain a ticket and CSRF token.

This method is usually internal and is used to authorize with the PVE host.

Returns:

  • tuple - A tuple containing the ticket and CSRF token.

get_next_vm_id

def get_next_vm_id(ticket)

Get the next available VMID for clone/create operations.

Arguments:

  • ticket str - The authentication ticket.

Returns:

  • int - The next available VMID.

clone_vm

def clone_vm(ticket, csrf_token, template_id, new_name, new_id)

Clone a VM or template to a new VMID and assign a new name.

Arguments:

  • ticket str - The authentication ticket.
  • csrf_token str - The CSRF prevention token.
  • template_id int - The ID of the template to clone.
  • new_name str - The new name for the cloned VM.
  • new_id int - The new VMID for the cloned VM.

Returns:

  • dict - The response data from the clone operation.

assign_admin_vm_permissions

def assign_admin_vm_permissions(ticket, csrf_token, vm_id, user)

Assign admin permissions to a user for a given VMID.

Arguments:

  • ticket str - The authentication ticket.
  • csrf_token str - The CSRF prevention token.
  • vm_id int - The ID of the VM.
  • user str - The user to assign admin permissions to.

set_vm_desc

def set_vm_desc(ticket, csrf_token, vm_id, desc)

Set the description (Notes) of a VMID.

Arguments:

  • ticket str - The authentication ticket.
  • csrf_token str - The CSRF prevention token.
  • vm_id int - The ID of the VM.
  • desc str - The description to set for the VM.

destroy_vm

def destroy_vm(vmid)

Destroy a VM by its ID.

Arguments:

  • vmid int - The ID of the VM to destroy.

destroy_range

def destroy_range()

Destroy all range VMs.

This method is intended for internal use and may not be suitable for a library.

create_win_range

def create_win_range(user=None)

Create three cloned VMs for a given username.

This method is intended for internal use and may not be suitable for a library.

Arguments:

  • user str - The username to assign to the cloned VMs. Defaults to None.

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

pveautomate-0.1.1.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.

pveautomate-0.1.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file pveautomate-0.1.1.tar.gz.

File metadata

  • Download URL: pveautomate-0.1.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for pveautomate-0.1.1.tar.gz
Algorithm Hash digest
SHA256 88819ab2de5f9e4af0fd51df03670e5a97d106a4a5f975e57cc86ddac1ba7e39
MD5 0bc6c40756536af039670b79b9d8ee23
BLAKE2b-256 00bacf52b4893539b57d146a77350e81cb4f520608a20c13d85e46843d22b6fd

See more details on using hashes here.

File details

Details for the file pveautomate-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pveautomate-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for pveautomate-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c65471c970a28280db037fcd7dacc668c8f97a206b5a83bf473ab572ae74ecab
MD5 2e29f86abfa49e9f5f2611a9e16c9f90
BLAKE2b-256 b183f1d3a95315ea55675b02334e6e32a409ef709c62298dacc9c3373d96bf39

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