A package to automate Proxmox VE tasks
Project description
pveautomate
Proxmox VE api (not fully implemented)
Usage Docs:
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_urlstr - The URL of the Proxmox VE server.proxmox_userstr - The username to authenticate with.proxmox_passwordstr - The password to authenticate with.nodestr - The Proxmox VE node to manage.verify_sslbool - 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:
ticketstr - 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:
ticketstr - The authentication ticket.csrf_tokenstr - The CSRF prevention token.template_idint - The ID of the template to clone.new_namestr - The new name for the cloned VM.new_idint - 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:
ticketstr - The authentication ticket.csrf_tokenstr - The CSRF prevention token.vm_idint - The ID of the VM.userstr - 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:
ticketstr - The authentication ticket.csrf_tokenstr - The CSRF prevention token.vm_idint - The ID of the VM.descstr - The description to set for the VM.
destroy_vm
def destroy_vm(vmid)
Destroy a VM by its ID.
Arguments:
vmidint - The ID of the VM to destroy.
create_user
def create_user(new_username, new_password, realm)
Create a new user in the given realm
Arguments:
new_usernamestr - The usernamenew_passwordstr - The user's new passwordrealmstr - Which realm the user belongs to (typically 'pve' or 'pam' unless your cluster has external authentication sources configured)
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:
userstr - The username to assign to the cloned VMs. Defaults to None.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pveautomate-0.1.3.tar.gz.
File metadata
- Download URL: pveautomate-0.1.3.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f0881cd04f6e2d6540c9f9230240e71b0c8a22eec80fff9355f049e58fa1b15
|
|
| MD5 |
8163df0451995c2cc7d396dca7f23557
|
|
| BLAKE2b-256 |
4a70ae8462ca3ba4f6cef1768e9bc63d85d8c91246bbfdb471c9c9d136f4ec8f
|
File details
Details for the file pveautomate-0.1.3-py3-none-any.whl.
File metadata
- Download URL: pveautomate-0.1.3-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15472cc0eccd0e97d9db335b54bce4f626cf764dc666e153d0c131b21440a673
|
|
| MD5 |
9aa913a098d2251dcf4b36379abd0dfe
|
|
| BLAKE2b-256 |
5671d5b7a064d1c82571da602150490122ef220c82a495abcaebc240d04e75ec
|