Resources
pyvergeos provides resource managers for all VergeOS API endpoints. Each resource follows a consistent CRUD pattern with additional domain-specific methods.
Virtual Machines
Core VM Management
Virtual Machine resource manager.
- class pyvergeos.resources.vms.VM[source]
Bases:
ResourceObjectVirtual Machine resource object.
- property drives: DriveManager
Access drives attached to this VM.
- property nics: NICManager
Access NICs attached to this VM.
- property snapshots: VMSnapshotManager
Access snapshots for this VM.
- property cloudinit_files: VMCloudInitFileManager
Access cloud-init files for this VM.
- set_cloudinit_datasource(datasource)[source]
Set the cloud-init datasource for this VM.
The datasource controls whether VergeOS attaches a virtual CD-ROM with cloud-init files to the VM. This is required for cloud-init files (Linux) or unattend.xml (Windows) to be delivered to the guest.
- Parameters:
datasource (str) – Datasource type. Valid values: - “nocloud” or “NoCloud”: Enable NoCloud datasource - “config_drive_v2” or “ConfigDrive”: Enable Config Drive v2 - “none” or “”: Disable cloud-init datasource
- Return type:
None
Example
>>> vm = client.vms.get(name="my-vm") >>> # Enable cloud-init delivery >>> vm.set_cloudinit_datasource("nocloud") >>> # Create cloud-init files >>> vm.cloudinit_files.create(name="/user-data", contents="...") >>> # Disable cloud-init delivery >>> vm.set_cloudinit_datasource("none")
- property stats: MachineStatsManager
Access performance stats for this VM.
Example
>>> stats = vm.stats.get() >>> print(f"CPU: {stats.total_cpu}%, RAM: {stats.ram_used_mb}MB")
>>> # Get stats history >>> history = vm.stats.history_short(limit=100)
- property machine_status: MachineStatusManager
Access detailed operational status for this VM.
Example
>>> status = vm.machine_status.get() >>> print(f"Status: {status.status}, Node: {status.node_name}")
- property machine_logs: MachineLogManager
Access log entries for this VM.
Example
>>> logs = vm.machine_logs.list(limit=20) >>> errors = vm.machine_logs.list(errors_only=True)
- property devices: DeviceManager
Access devices (GPU, TPM, USB, PCI, SR-IOV) attached to this VM.
- Returns:
DeviceManager scoped to this VM.
Example
>>> # List all devices >>> devices = vm.devices.list()
>>> # List vGPUs only >>> vgpus = vm.devices.list(device_type="node_nvidia_vgpu_devices")
>>> # Attach a vGPU >>> device = vm.devices.create_vgpu( ... resource_group=vgpu_pool.key, ... frame_rate_limit=60, ... )
- power_on(preferred_node=None)[source]
Power on the VM.
- Parameters:
preferred_node (int | None) – Node $key to start VM on.
- Returns:
Self for chaining.
- Raises:
ValueError – If VM is a snapshot.
- Return type:
- migrate(preferred_node=None)[source]
Live migrate VM to another node while keeping it running.
- Parameters:
preferred_node (int | None) – Target node $key. If None, auto-selects based on resource balancing.
- Returns:
Migration task information.
- Return type:
Note
The VM must be running for live migration. Migration progress can be monitored via the VM status field.
- hibernate()[source]
Hibernate the VM to disk.
Saves the VM’s memory state to disk and powers off. The VM can be resumed later by powering it on, which will restore the memory state.
- restore(snapshot, preserve_macs=False, name=None)[source]
Restore VM from a snapshot.
- Parameters:
- Returns:
Restore task information.
- Return type:
Warning
If name is not provided, this will overwrite the current VM. The VM should be powered off before restoring.
- hotplug_drive(name, size, interface='virtio-scsi', media='disk', tier=1)[source]
Hot-add a drive to a running VM.
- Parameters:
- Returns:
Hotplug task information.
- Return type:
Note
The VM must be running and have allow_hotplug enabled.
- hotplug_nic(name, network, interface='virtio')[source]
Hot-add a NIC to a running VM.
- Parameters:
- Returns:
Hotplug task information.
- Return type:
Note
The VM must be running and have allow_hotplug enabled.
- tag(tag_key)[source]
Add a tag to this VM.
- Parameters:
tag_key (int) – Tag $key to add.
- Return type:
None
Example
>>> # Get a tag by name and add it >>> tag = client.tags.get(name="Production", category_name="Environment") >>> vm.tag(tag.key)
- untag(tag_key)[source]
Remove a tag from this VM.
- Parameters:
tag_key (int) – Tag $key to remove.
- Return type:
None
Example
>>> vm.untag(tag.key)
- get_tags()[source]
Get all tags assigned to this VM.
- Returns:
List of tag info dictionaries with tag_key, tag_name, category_name.
- Return type:
Example
>>> for tag_info in vm.get_tags(): ... print(f"{tag_info['category_name']}: {tag_info['tag_name']}")
- favorite()[source]
Add this VM to the current user’s favorites.
Example
>>> vm = client.vms.get(name="web-server") >>> vm.favorite()
- Return type:
None
- unfavorite()[source]
Remove this VM from the current user’s favorites.
Example
>>> vm = client.vms.get(name="web-server") >>> vm.unfavorite()
- Return type:
None
- is_favorite()[source]
Check if this VM is in the current user’s favorites.
- Returns:
True if the VM is a favorite, False otherwise.
- Return type:
- class pyvergeos.resources.vms.VMManager[source]
Bases:
ResourceManager[VM]Manager for Virtual Machine operations.
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, include_snapshots=False, **filter_kwargs)[source]
List VMs with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (defaults to rich field set).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
include_snapshots (bool) – Include VM snapshots (default False).
**filter_kwargs (Any) – Shorthand filter arguments.
- Returns:
List of VM objects.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a single VM by key or name.
- Parameters:
- Returns:
VM object.
- Raises:
NotFoundError – If VM not found.
ValueError – If neither key nor name provided.
- Return type:
- create(name, ram=1024, cpu_cores=1, description='', os_family='linux', machine_type='pc-q35-10.0', cloudinit_datasource=None, cloud_init=None, **kwargs)[source]
Create a new VM.
- Parameters:
name (str) – VM name (required).
ram (int) – RAM in MB (default 1024). Will be rounded UP to nearest 256MB.
cpu_cores (int) – Number of CPU cores (default 1).
description (str) – VM description.
os_family (str) – OS family (linux, windows, freebsd, other).
machine_type (str) – QEMU machine type.
cloudinit_datasource (str | None) – Cloud-init datasource type. Valid values are “ConfigDrive” (Config Drive v2), “NoCloud”, or None (disabled, default). Automatically set to “ConfigDrive” if cloud_init files are provided.
cloud_init (str | dict[str, str] | list[dict[str, Any]] | None) – Cloud-init file configuration for VM provisioning. Can be a string (content for /user-data), a dict mapping file names to contents (e.g., {“/user-data”: “…”, “/meta-data”: “…”}), or a list of file specs with full control. When provided, cloudinit_datasource defaults to “ConfigDrive” if not set.
**kwargs (Any) – Additional VM properties.
- Returns:
Created VM object.
- Return type:
Example
>>> # Simple user-data string (auto-enables ConfigDrive) >>> vm = client.vms.create( ... name="web-server", ... cloud_init="#cloud-config\npackages:\n - nginx" ... ) >>> >>> # Multiple files as dict >>> vm = client.vms.create( ... name="web-server", ... cloud_init={ ... "/user-data": "#cloud-config\npackages:\n - nginx", ... "/meta-data": "instance-id: web-1\nlocal-hostname: web-server" ... } ... ) >>> >>> # Full control with render options >>> vm = client.vms.create( ... name="web-server", ... cloud_init=[ ... {"name": "/user-data", "contents": "...", "render": "Jinja2"}, ... {"name": "/meta-data", "contents": "..."} ... ] ... ) >>> >>> # Enable cloud-init datasource without files (files added later) >>> vm = client.vms.create( ... name="web-server", ... cloudinit_datasource="ConfigDrive" ... )
VM Drives
VM Drive resource manager.
- class pyvergeos.resources.drives.Drive[source]
Bases:
ResourceObjectVM Drive resource object.
- class pyvergeos.resources.drives.DriveManager[source]
Bases:
ResourceManager[Drive]Manager for VM Drive operations.
This manager is accessed through a VM object’s drives property.
- __init__(client, vm)[source]
- Parameters:
client (VergeClient)
vm (VM)
- Return type:
None
- get(key=None, *, name=None, fields=None)[source]
Get a drive by key or name.
- Parameters:
- Returns:
Drive object.
- Raises:
NotFoundError – If drive not found.
ValueError – If neither key nor name provided.
- Return type:
- create(size_gb=None, name=None, interface='virtio-scsi', media='disk', tier=None, description='', readonly=False, enabled=True, media_source=None)[source]
Create a new drive for this VM.
- Parameters:
size_gb (int | None) – Disk size in GB (required for disk media).
name (str | None) – Drive name (optional, auto-generated if not provided).
interface (str) – Drive interface type (virtio-scsi, nvme, ahci, ide, etc.).
media (str) – Media type (disk, cdrom, efidisk).
tier (int | None) – Preferred storage tier (1-5).
description (str) – Drive description.
readonly (bool) – Make drive read-only.
enabled (bool) – Enable drive (default True).
media_source (int | str | None) – File key (int) or name (str) for CD-ROM media source. Used to attach ISO or other media files.
- Returns:
Created Drive object.
- Raises:
ValueError – If size_gb not provided for disk media.
ValueError – If media_source file not found (when passed as string).
- Return type:
- delete(key)[source]
Delete a drive.
- Parameters:
key (int) – Drive $key (ID).
- Return type:
None
Note
VM should typically be powered off before removing drives.
- import_drive(file_key=None, file_name=None, name=None, interface='virtio-scsi', tier=None, preserve_drive_format=False, enabled=True)[source]
Import a disk image file as a new drive.
Creates a new drive by importing from a disk image file (VMDK, QCOW2, VHD, VHDX, OVA, OVF, etc.). The file must already be uploaded to the VergeOS media catalog.
This is the recommended way to import VMs from OVA/OVF/VMDK files: 1. Create a new VM with client.vms.create() 2. Import the disk(s) with vm.drives.import_drive()
- Parameters:
file_key (int | None) – The $key (ID) of the disk image file to import.
file_name (str | None) – The name of the disk image file to import. One of file_key or file_name is required.
name (str | None) – Name for the new drive. If not specified, auto-generated.
interface (str) – Drive interface type. Default is ‘virtio-scsi’. Valid values: virtio, ide, ahci, nvme, virtio-scsi, virtio-scsi-dedicated.
tier (int | None) – Preferred storage tier (1-5).
preserve_drive_format (bool) – Keep the original drive format instead of converting to raw. Default is False.
enabled (bool) – Enable the drive. Default is True.
- Returns:
Created Drive object.
- Raises:
ValueError – If neither file_key nor file_name is provided.
ValueError – If file not found (when looking up by name).
- Return type:
Example
>>> # Import a QCOW2 disk image >>> vm = client.vms.get(name="NewServer") >>> drive = vm.drives.import_drive( ... file_name="debian-12-generic-amd64.qcow2", ... interface="virtio-scsi", ... tier=1, ... )
>>> # Import from an OVA file's disk >>> vm = client.vms.create(name="ImportedVM", cpu_cores=2, ram=4096) >>> drive = vm.drives.import_drive(file_name="server-disk.vmdk")
Note
Supported import formats: VMDK, QCOW2, VHD, VHDX, VDI, RAW, OVA, OVF. The import process converts the disk to VergeOS format unless preserve_drive_format is True.
VM NICs
VM NIC resource manager.
- class pyvergeos.resources.nics.NIC[source]
Bases:
ResourceObjectVM NIC resource object.
- class pyvergeos.resources.nics.NICManager[source]
Bases:
ResourceManager[NIC]Manager for VM NIC operations.
This manager is accessed through a VM object’s nics property.
- __init__(client, vm)[source]
- Parameters:
client (VergeClient)
vm (VM)
- Return type:
None
- get(key=None, *, name=None, fields=None)[source]
Get a NIC by key or name.
- Parameters:
- Returns:
NIC object.
- Raises:
NotFoundError – If NIC not found.
ValueError – If neither key nor name provided.
- Return type:
- create(network=None, name=None, interface='virtio', mac_address=None, ip_address=None, description='', enabled=True)[source]
Create a new NIC for this VM.
- Parameters:
network (int | str | None) – Network key (int) or name (str) to connect to.
name (str | None) – NIC name (optional, auto-generated if not provided).
interface (str) – NIC interface type (virtio, e1000, e1000e, etc.).
mac_address (str | None) – MAC address (format: xx:xx:xx:xx:xx:xx).
ip_address (str | None) – Static IP address.
description (str) – NIC description.
enabled (bool) – Enable NIC (default True).
- Returns:
Created NIC object.
- Return type:
VM Snapshots
VM Snapshot resource manager.
- class pyvergeos.resources.snapshots.VMSnapshot[source]
Bases:
ResourceObjectVM Snapshot resource object.
- class pyvergeos.resources.snapshots.VMSnapshotManager[source]
Bases:
ResourceManager[VMSnapshot]Manager for VM Snapshot operations.
This manager is accessed through a VM object’s snapshots property.
- __init__(client, vm)[source]
- Parameters:
client (VergeClient)
vm (VM)
- Return type:
None
- get(key=None, *, name=None, fields=None)[source]
Get a snapshot by key or name.
- Parameters:
- Returns:
VMSnapshot object.
- Raises:
NotFoundError – If snapshot not found.
ValueError – If neither key nor name provided.
- Return type:
- create(name=None, retention=86400, quiesce=False, description='')[source]
Create a new snapshot for this VM.
- Parameters:
- Returns:
Created snapshot information.
- Return type:
- delete(key)[source]
Delete a snapshot.
- Parameters:
key (int) – Snapshot $key (ID).
- Return type:
None
VM Import/Export
Import VMs from various formats (VMDK, QCOW2, OVA, OVF) and export VMs to NAS volumes.
VM import resources for importing VMs from files.
- class pyvergeos.resources.vm_imports.VmImport[source]
Bases:
ResourceObjectVM import resource object.
Represents a VM import operation for importing VMs from files (VMDK, QCOW2, OVA, OVF) or other sources.
Note
Import keys are 40-character hex strings, not integers like most other VergeOS resources.
- key
The import unique identifier ($key) - 40-char hex string.
- id
The import ID (same as $key).
- name
VM name for the imported VM.
- vm
Created VM key (after import completes).
- uuid
UUID from the source VM.
- file
Source file key from media catalog.
- volume
Source NAS volume key.
- volume_path
Path within the source volume.
- status
Import status (initializing, importing, complete, aborted, error, warning).
- status_info
Detailed status information.
- importing
Whether import is in progress.
- aborted
Whether import was aborted.
- preserve_macs
Whether to preserve MAC addresses from source.
- preserve_drive_format
Whether to preserve original drive format.
- preferred_tier
Preferred storage tier (1-5).
- timestamp
Creation timestamp.
- modified
Last modified timestamp.
- property key: str
Resource primary key ($key) - 40-character hex string.
- Raises:
ValueError – If resource has no $key (not yet persisted).
- property logs: VmImportLogManager
Get a log manager for this import’s logs.
- Returns:
VmImportLogManager scoped to this import.
Example
>>> # Browse import logs >>> for log in vm_import.logs.list(): ... print(f"{log.level}: {log.text}")
- class pyvergeos.resources.vm_imports.VmImportLog[source]
Bases:
ResourceObjectVM import log entry resource object.
Represents a log entry for a VM import operation.
- key
The log entry key ($key).
- vm_import
Parent import key.
- level
Log level (message, warning, error, critical, debug, summary).
- text
Log message text.
- timestamp
Log entry timestamp.
- user
User who initiated the action.
- class pyvergeos.resources.vm_imports.VmImportManager[source]
Bases:
ResourceManager[VmImport]Manager for VM import operations.
VM imports allow importing VMs from files (VMDK, QCOW2, OVA, OVF) or from NAS volumes.
Example
>>> # List all imports >>> for imp in client.vm_imports.list(): ... print(f"{imp.name}: {imp.status}")
>>> # Get a specific import >>> imp = client.vm_imports.get(key="abc123...")
>>> # Create an import from a file >>> imp = client.vm_imports.create( ... name="imported-vm", ... file=123, # file key from media catalog ... preferred_tier="1" ... )
>>> # Start the import >>> imp.start()
>>> # Monitor import logs >>> for log in imp.logs.list(): ... print(f"{log.level}: {log.text}")
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, status=None, **filter_kwargs)[source]
List VM imports with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
status (str | None) – Filter by status (initializing, importing, complete, aborted, error).
**filter_kwargs (Any) – Shorthand filter arguments (name, etc.).
- Returns:
List of VmImport objects.
- Return type:
Example
>>> # List all imports >>> imports = client.vm_imports.list()
>>> # List active imports >>> active = client.vm_imports.list(status="importing")
>>> # List completed imports >>> done = client.vm_imports.list(status="complete")
- get(key=None, *, name=None, fields=None)[source]
Get a single VM import by key or name.
- Parameters:
- Returns:
VmImport object.
- Raises:
NotFoundError – If import not found.
ValueError – If no identifier provided.
- Return type:
Example
>>> # Get by key >>> imp = client.vm_imports.get("8f73f8bcc9c9f1aaba32f733bfc295acaf548554")
>>> # Get by name >>> imp = client.vm_imports.get(name="imported-vm")
- create(name, *, file=None, volume=None, volume_path=None, shared_object=None, preserve_macs=True, preserve_drive_format=False, preferred_tier=None, no_optical_drives=False, override_drive_interface=None, override_nic_interface=None, cleanup_on_delete=False, importing=False)[source]
Create a new VM import.
- Parameters:
name (str) – Name for the imported VM.
file (int | None) – Source file key from media catalog (for file imports).
volume (str | None) – Source NAS volume key (for volume imports).
volume_path (str | None) – Path within the source volume.
shared_object (int | None) – Shared object key (for tenant imports).
preserve_macs (bool) – Preserve MAC addresses from source (default True).
preserve_drive_format (bool) – Preserve original drive format instead of converting to optimized .raw format (default False).
preferred_tier (str | None) – Preferred storage tier (1-5).
no_optical_drives (bool) – Do not create optical drives (default False).
override_drive_interface (str | None) – Override drive interface type.
override_nic_interface (str | None) – Override NIC interface type.
cleanup_on_delete (bool) – Clean up import file path on delete.
importing (bool) – Auto-start the import immediately after creation (default False).
- Returns:
Created VmImport object.
- Raises:
ValueError – If no source (file, volume, or shared_object) provided.
- Return type:
Example
>>> # Import from media catalog file (auto-start) >>> imp = client.vm_imports.create( ... name="imported-vm", ... file=123, ... preferred_tier="1", ... importing=True ... )
>>> # Import from NAS volume (two-step: create then start) >>> imp = client.vm_imports.create( ... name="imported-vm", ... volume="abc123...", ... volume_path="/exports/vm.vmdk" ... ) >>> imp.start()
- update(key, *, name=None, vm=None, preserve_macs=None, preserve_drive_format=None, preferred_tier=None, no_optical_drives=None, override_drive_interface=None, override_nic_interface=None)[source]
Update a VM import.
- Parameters:
key (str) – Import $key (40-character hex string).
name (str | None) – New VM name.
vm (int | None) – Associated VM key.
preserve_macs (bool | None) – Preserve MAC addresses.
preserve_drive_format (bool | None) – Preserve original drive format.
preferred_tier (str | None) – Preferred storage tier (1-5).
no_optical_drives (bool | None) – Do not create optical drives.
override_drive_interface (str | None) – Override drive interface type.
override_nic_interface (str | None) – Override NIC interface type.
- Returns:
Updated VmImport object.
- Return type:
- delete(key)[source]
Delete a VM import.
- Parameters:
key (str) – Import $key (40-character hex string).
- Return type:
None
Example
>>> client.vm_imports.delete(imp.key)
- start_import(key)[source]
Start a VM import operation.
This initiates the actual import process for an import that has been created but not yet started.
- Parameters:
key (str) – Import $key (40-character hex string).
- Returns:
Task information dict or None.
- Return type:
Example
>>> result = client.vm_imports.start_import(imp.key) >>> if result and "task" in result: ... client.tasks.wait(result["task"])
- abort_import(key)[source]
Abort a VM import operation.
This stops an in-progress import.
- Parameters:
key (str) – Import $key (40-character hex string).
- Returns:
Task information dict or None.
- Return type:
Example
>>> client.vm_imports.abort_import(imp.key)
- logs(key)[source]
Get a log manager for a specific import.
- Parameters:
key (str) – Import $key (40-character hex string).
- Returns:
VmImportLogManager for the import.
- Return type:
Example
>>> # List logs for an import >>> for log in client.vm_imports.logs(imp.key).list(): ... print(f"{log.level}: {log.text}")
- class pyvergeos.resources.vm_imports.VmImportLogManager[source]
Bases:
ResourceManager[VmImportLog]Manager for VM import log operations.
This manager provides access to log entries for VM imports. It can be used either standalone or scoped to a specific import.
Example
>>> # List all import logs (standalone) >>> for log in client.vm_import_logs.list(): ... print(f"{log.level}: {log.text}")
>>> # List logs for a specific import >>> for log in client.vm_imports.logs(imp.key).list(): ... print(f"{log.level}: {log.text}")
>>> # Get only errors >>> errors = client.vm_imports.logs(imp.key).list(level="error")
- __init__(client, *, import_key=None)[source]
- Parameters:
client (VergeClient)
import_key (str | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, level=None, vm_import=None, **filter_kwargs)[source]
List VM import logs with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
level (str | None) – Filter by log level (message, warning, error, critical, debug).
vm_import (str | None) – Filter by import key. Ignored if manager is scoped.
**filter_kwargs (Any) – Shorthand filter arguments.
- Returns:
List of VmImportLog objects.
- Return type:
Example
>>> # List all logs >>> logs = client.vm_import_logs.list()
>>> # List errors only >>> errors = client.vm_import_logs.list(level="error")
>>> # List logs for a specific import >>> logs = client.vm_imports.logs(imp.key).list()
- get(key=None, *, fields=None)[source]
Get a single VM import log entry by key.
- Parameters:
- Returns:
VmImportLog object.
- Raises:
NotFoundError – If log entry not found.
ValueError – If key not provided.
- Return type:
Example
>>> log = client.vm_import_logs.get(1)
- list_errors()[source]
List only error and critical log entries.
- Returns:
List of error VmImportLog objects.
- Return type:
Example
>>> errors = client.vm_imports.logs(imp.key).list_errors()
Volume VM export resources for exporting VMs to NAS volumes.
- class pyvergeos.resources.volume_vm_exports.VolumeVmExport[source]
Bases:
ResourceObjectVolume VM export resource object.
Represents a VM export configuration for a NAS volume. VM exports allow exporting VMs to NAS volumes for backup/migration.
- key
The export unique identifier ($key).
- volume
Parent NAS volume key.
- name
Volume name (derived from volume).
- quiesced
Whether exports are quiesced.
- status
Export status (idle, building, error, cleaning).
- status_info
Detailed status information.
- create_current
Whether to create ‘current’ folder with latest export.
- max_exports
Maximum exports to store (1-100).
- property stats: VolumeVmExportStatManager
Get a stats manager for this export’s statistics.
- Returns:
VolumeVmExportStatManager scoped to this export.
Example
>>> # Browse export stats >>> for stat in export.stats.list(): ... print(f"{stat.file_name}: {stat.virtual_machines} VMs")
- class pyvergeos.resources.volume_vm_exports.VolumeVmExportStat[source]
Bases:
ResourceObjectVolume VM export statistics resource object.
Represents statistics for a completed VM export.
- key
The stat entry key ($key).
- volume_vm_exports
Parent export key.
- duration
Export duration in seconds.
- virtual_machines
Number of VMs exported.
- export_success
Number of successful exports.
- errors
Number of errors.
- quiesced
Whether the export was quiesced.
- size_bytes
Total size in bytes.
- file_name
Export folder name.
- timestamp
Export timestamp.
- class pyvergeos.resources.volume_vm_exports.VolumeVmExportManager[source]
Bases:
ResourceManager[VolumeVmExport]Manager for volume VM export operations.
Volume VM exports allow exporting VMs to NAS volumes for backup and migration purposes.
Example
>>> # List all exports >>> for exp in client.volume_vm_exports.list(): ... print(f"{exp.name}: {exp.status}")
>>> # Get export for a volume >>> exp = client.volume_vm_exports.get(volume=123)
>>> # Start an export >>> exp.start(name="backup-2024")
>>> # View export stats >>> for stat in exp.stats.list(): ... print(f"{stat.file_name}: {stat.size_gb}GB")
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, status=None, volume=None, **filter_kwargs)[source]
List volume VM exports with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
status (str | None) – Filter by status (idle, building, error, cleaning).
volume (int | None) – Filter by volume key.
**filter_kwargs (Any) – Shorthand filter arguments.
- Returns:
List of VolumeVmExport objects.
- Return type:
Example
>>> # List all exports >>> exports = client.volume_vm_exports.list()
>>> # List active exports >>> active = client.volume_vm_exports.list(status="building")
- get(key=None, *, volume=None, fields=None)[source]
Get a single volume VM export by key or volume.
- Parameters:
- Returns:
VolumeVmExport object.
- Raises:
NotFoundError – If export not found.
ValueError – If no identifier provided.
- Return type:
Example
>>> # Get by key >>> exp = client.volume_vm_exports.get(key=1)
>>> # Get by volume >>> exp = client.volume_vm_exports.get(volume=123)
- create(volume, *, quiesced=True, create_current=True, max_exports=3)[source]
Create a new volume VM export configuration.
- Parameters:
- Returns:
Created VolumeVmExport object.
- Return type:
Example
>>> exp = client.volume_vm_exports.create( ... volume=123, ... max_exports=5, ... quiesced=True ... )
- update(key, *, quiesced=None, create_current=None, max_exports=None)[source]
Update a volume VM export configuration.
- Parameters:
- Returns:
Updated VolumeVmExport object.
- Return type:
- delete(key)[source]
Delete a volume VM export configuration.
- Parameters:
key (int) – Export $key (row ID).
- Return type:
None
Example
>>> client.volume_vm_exports.delete(1)
- start_export(key, name=None, vms=None)[source]
Start a VM export operation.
- Parameters:
- Returns:
Action result dict or None.
- Return type:
Example
>>> result = client.volume_vm_exports.start_export(1, name="backup-2024")
- stop_export(key)[source]
Stop an in-progress VM export operation.
- Parameters:
key (int) – Export $key (row ID).
- Returns:
Action result dict or None.
- Return type:
Example
>>> client.volume_vm_exports.stop_export(1)
- cleanup_exports(key)[source]
Clean up old export folders.
- Parameters:
key (int) – Export $key (row ID).
- Returns:
Action result dict or None.
- Return type:
Example
>>> client.volume_vm_exports.cleanup_exports(1)
- class pyvergeos.resources.volume_vm_exports.VolumeVmExportStatManager[source]
Bases:
ResourceManager[VolumeVmExportStat]Manager for volume VM export statistics.
This manager provides access to export statistics. It can be used either standalone or scoped to a specific export.
Example
>>> # List all export stats (standalone) >>> for stat in client.volume_vm_export_stats.list(): ... print(f"{stat.file_name}: {stat.size_gb}GB")
>>> # List stats for a specific export >>> for stat in client.volume_vm_exports.stats(1).list(): ... print(f"{stat.file_name}: {stat.virtual_machines} VMs")
- __init__(client, *, export_key=None)[source]
- Parameters:
client (VergeClient)
export_key (int | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, volume_vm_exports=None, **filter_kwargs)[source]
List volume VM export statistics with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
volume_vm_exports (int | None) – Filter by export key. Ignored if manager is scoped.
**filter_kwargs (Any) – Shorthand filter arguments.
- Returns:
List of VolumeVmExportStat objects.
- Return type:
Example
>>> # List all stats >>> stats = client.volume_vm_export_stats.list()
>>> # List stats for a specific export >>> stats = client.volume_vm_exports.stats(1).list()
- get(key=None, *, fields=None)[source]
Get a single VM export stat by key.
- Parameters:
- Returns:
VolumeVmExportStat object.
- Raises:
NotFoundError – If stat not found.
ValueError – If key not provided.
- Return type:
Example
>>> stat = client.volume_vm_export_stats.get(1)
Machine Stats & Monitoring
Real-time and historical performance metrics for VMs and nodes.
Machine Stats & Monitoring resource managers.
This module provides access to machine performance metrics, status, and logs. A “machine” in VergeOS represents both VMs and physical nodes.
Example
>>> # Access VM stats
>>> vm = client.vms.get(name="web-server")
>>> stats = vm.stats.get()
>>> print(f"CPU: {stats.total_cpu}%, RAM: {stats.ram_used_mb}MB")
>>> # Access stats history
>>> history = vm.stats.history_short()
>>> for point in history:
... print(f"{point.timestamp}: CPU {point.total_cpu}%")
>>> # Access machine status
>>> status = vm.machine_status.get()
>>> print(f"Status: {status.status}, Node: {status.node_name}")
>>> # Access machine logs
>>> logs = vm.machine_logs.list(level="error")
>>> for log in logs:
... print(f"[{log.level}] {log.text}")
- class pyvergeos.resources.machine_stats.MachineStats[source]
Bases:
ResourceObjectMachine statistics resource object.
Provides current performance metrics for a machine (VM or node).
- class pyvergeos.resources.machine_stats.MachineStatsHistory[source]
Bases:
ResourceObjectMachine statistics history record.
Represents a single time point in the stats history.
- class pyvergeos.resources.machine_stats.MachineStatsManager[source]
Bases:
ResourceManager[MachineStats]Manager for machine statistics.
Provides access to current and historical performance metrics. Scoped to a specific machine.
Example
>>> # Get current stats >>> stats = manager.get() >>> print(f"CPU: {stats.total_cpu}%")
>>> # Get short-term history (high resolution) >>> history = manager.history_short(limit=100)
>>> # Get long-term history (lower resolution, longer retention) >>> history = manager.history_long(limit=1000)
- __init__(client, machine_key)[source]
- Parameters:
client (VergeClient)
machine_key (int)
- Return type:
None
- get(fields=None)[source]
Get current machine statistics.
- Parameters:
- Returns:
MachineStats object.
- Raises:
NotFoundError – If stats not found for this machine.
- Return type:
- history_short(limit=None, offset=None, since=None, until=None, fields=None)[source]
Get short-term stats history (high resolution).
- Parameters:
- Returns:
List of MachineStatsHistory objects, sorted by timestamp descending.
- Return type:
- history_long(limit=None, offset=None, since=None, until=None, fields=None)[source]
Get long-term stats history (lower resolution, longer retention).
- Parameters:
- Returns:
List of MachineStatsHistory objects, sorted by timestamp descending.
- Return type:
- class pyvergeos.resources.machine_stats.MachineStatus[source]
Bases:
ResourceObjectMachine status resource object.
Provides operational status for a machine (VM or node).
- class pyvergeos.resources.machine_stats.MachineStatusManager[source]
Bases:
ResourceManager[MachineStatus]Manager for machine status.
Provides access to operational status for a machine. Scoped to a specific machine.
Example
>>> status = manager.get() >>> print(f"Status: {status.status}") >>> if status.is_running: ... print(f"Running on node: {status.node_name}")
- __init__(client, machine_key)[source]
- Parameters:
client (VergeClient)
machine_key (int)
- Return type:
None
- get(fields=None)[source]
Get machine status.
- Parameters:
- Returns:
MachineStatus object.
- Raises:
NotFoundError – If status not found for this machine.
- Return type:
- class pyvergeos.resources.machine_stats.MachineLog[source]
Bases:
ResourceObjectMachine log entry resource object.
- class pyvergeos.resources.machine_stats.MachineLogManager[source]
Bases:
ResourceManager[MachineLog]Manager for machine logs.
Provides access to log entries for a machine. Scoped to a specific machine.
Example
>>> # Get recent logs >>> logs = manager.list(limit=20)
>>> # Get errors only >>> errors = manager.list(level="error")
>>> # Get logs since a specific time >>> logs = manager.list(since=datetime.now() - timedelta(hours=1))
- __init__(client, machine_key)[source]
- Parameters:
client (VergeClient)
machine_key (int)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, level=None, errors_only=False, warnings_only=False, since=None, until=None, **filter_kwargs)[source]
List machine log entries.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
level (Literal['audit', 'message', 'warning', 'error', 'critical', 'summary', 'debug'] | None) – Filter by log level.
errors_only (bool) – Only return error and critical logs.
warnings_only (bool) – Only return warning logs.
since (datetime | int | None) – Return logs after this time (datetime or epoch microseconds).
until (datetime | int | None) – Return logs before this time (datetime or epoch microseconds).
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of MachineLog objects, sorted by timestamp descending.
- Return type:
- get(key=None, *, fields=None)[source]
Get a specific log entry by key.
- Parameters:
- Returns:
MachineLog object.
- Raises:
NotFoundError – If log entry not found.
ValueError – If key not provided.
- Return type:
Networks
Core Network Management
Virtual Network resource manager.
- class pyvergeos.resources.networks.Network[source]
Bases:
ResourceObjectVirtual Network resource object.
- reset(apply_rules=True)
Restart the network.
- property rules: NetworkRuleManager
Access firewall rules for this network.
- Returns:
NetworkRuleManager for this network.
Examples
List all rules:
rules = network.rules.list()
Create a rule:
rule = network.rules.create( name="Allow HTTPS", direction="incoming", action="accept", protocol="tcp", destination_ports="443" )
- property aliases: NetworkAliasManager
Access IP aliases for this network.
- Returns:
NetworkAliasManager for this network.
Examples
List all aliases:
aliases = network.aliases.list()
Create an alias:
alias = network.aliases.create( ip="10.0.0.100", name="webserver", description="Main web server" )
Get alias by IP:
alias = network.aliases.get(ip="10.0.0.100")
- property hosts: NetworkHostManager
Access DHCP/DNS host overrides for this network.
- Returns:
NetworkHostManager for this network.
Examples
List all host overrides:
hosts = network.hosts.list()
Create a host override:
host = network.hosts.create( hostname="server01", ip="10.0.0.50" )
Get host by hostname:
host = network.hosts.get(hostname="server01")
Note
Host override changes require DNS apply to take effect.
- property dns_zones: DNSZoneManager
Access DNS zones for this network.
- Returns:
DNSZoneManager for this network.
Examples
List all DNS zones:
zones = network.dns_zones.list()
Get a zone by domain:
zone = network.dns_zones.get(domain="example.com")
List records in a zone:
records = zone.records.list()
Create a DNS record:
record = zone.records.create( host="www", record_type="A", value="10.0.0.100" )
Note
DNS zones are typically created through the VergeOS UI. DNS changes require DNS apply on the network to take effect.
- property dns_views: DNSViewManager
Access DNS views for this network.
- Returns:
DNSViewManager for this network.
Examples
List all DNS views:
views = network.dns_views.list()
Get a view by name:
view = network.dns_views.get(name="internal")
Create a view:
view = network.dns_views.create(name="internal")
Create a zone through a view:
zone = view.zones.create(domain="example.com")
Note
DNS changes require DNS apply on the network to take effect.
- property ipsec: IPSecConnectionManager
Access IPSec VPN connections for this network.
- Returns:
IPSecConnectionManager for this network.
Examples
List all IPSec connections:
connections = network.ipsec.list()
Get a connection by name:
conn = network.ipsec.get(name="Site-B")
Create a connection:
conn = network.ipsec.create( name="Site-B", remote_gateway="203.0.113.1", pre_shared_key="MySecretKey123" )
Access Phase 2 policies:
policies = conn.policies.list()
Create a Phase 2 policy:
policy = conn.policies.create( name="LAN-to-LAN", local_network="10.0.0.0/24", remote_network="192.168.1.0/24" )
Note
IPSec configuration changes may require applying firewall rules on the network for changes to take effect.
- property wireguard: WireGuardManager
Access WireGuard VPN interfaces for this network.
- Returns:
WireGuardManager for this network.
Examples
List all WireGuard interfaces:
interfaces = network.wireguard.list()
Get an interface by name:
wg = network.wireguard.get(name="wg0")
Create an interface:
wg = network.wireguard.create( name="wg0", ip_address="10.100.0.1/24", listen_port=51820 )
Access peers:
peers = wg.peers.list()
Create a peer:
peer = wg.peers.create( name="remote-office", peer_ip="10.100.0.2", public_key="abc123...", allowed_ips="192.168.1.0/24" )
Get peer configuration:
config = peer.get_config()
Note
WireGuard configuration changes may require applying firewall rules on the network for changes to take effect.
- property routing: NetworkRoutingManager
Access routing protocols (BGP, OSPF, EIGRP) for this network.
- Returns:
NetworkRoutingManager for this network.
Examples
Configure BGP:
# Create a BGP router bgp = network.routing.bgp_routers.create(asn=65000) # Add a neighbor bgp.commands.create( command="neighbor", params="192.168.1.1 remote-as 65001" )
Configure OSPF:
# Set router ID network.routing.ospf_commands.create( command="router-id", params="1.1.1.1" ) # Add network to area 0 network.routing.ospf_commands.create( command="network", params="10.0.0.0/24 area 0" )
Configure EIGRP:
# Create an EIGRP router eigrp = network.routing.eigrp_routers.create(asn=100) # Add network eigrp.commands.create( command="network", params="10.0.0.0/24" )
Note
Routing configuration changes require restarting the network for changes to take effect.
- property proxy: VnetProxyManager
Access proxy configuration for this network.
The proxy service enables multi-tenant access through a single IP address using FQDN-based routing. Each tenant is assigned a unique hostname that routes to their UI through the proxy.
- Returns:
VnetProxyManager for this network.
Examples
Check if proxy is configured:
if network.proxy.exists(): proxy = network.proxy.get() print(f"Proxy listening on {proxy.listen_address}")
Enable proxy on a network:
proxy = network.proxy.create( listen_address="0.0.0.0", default_self=True )
Add a tenant mapping:
mapping = proxy.tenants.create( tenant=tenant_key, fqdn="tenant1.example.com" )
List all tenant mappings:
for mapping in proxy.tenants.list(): print(f"{mapping.fqdn} -> {mapping.tenant_name}")
Note
Proxy is typically used on external networks to allow multiple tenants to share a single public IP address. After adding/modifying tenant mappings, the tenant may need to have proxy applied via the tenant dashboard.
- property stats: NetworkMonitorStatsManager
Access network monitoring statistics for this network.
Provides network quality metrics including packet loss, latency, and overall connection health for monitoring and troubleshooting.
- Returns:
NetworkMonitorStatsManager for this network.
Examples
Get current stats:
stats = network.stats.get() print(f"Quality: {stats.quality}%") print(f"Latency: {stats.latency_avg_ms}ms") if stats.has_issues: print("Warning: Network quality issues detected!")
Get recent history:
history = network.stats.history_short(limit=60) for point in history: print(f"{point.timestamp}: {point.quality}% quality")
Get long-term trends:
from datetime import datetime, timedelta since = datetime.now() - timedelta(days=7) history = network.stats.history_long(since=since)
Note
Statistics are collected by VergeOS network monitoring and may not be available for newly created networks until they have been running for some time.
- property ipsec_connections: IPSecActiveConnectionManager
Access active IPSec VPN connections for this network.
Provides real-time status of currently established IPSec tunnels, including connection details and tunnel parameters.
- Returns:
IPSecActiveConnectionManager for this network.
Examples
List active connections:
for conn in network.ipsec_connections.list(): print(f"{conn.connection}: {conn.local} <-> {conn.remote}") print(f" Local Network: {conn.local_network}") print(f" Remote Network: {conn.remote_network}") print(f" Protocol: {conn.protocol}")
Check connection count:
count = network.ipsec_connections.count() print(f"Active IPSec tunnels: {count}")
Note
This provides real-time connection status, not configuration. For IPSec configuration management, use network.ipsec instead. Connections are dynamically computed and not stored in the database.
- diagnostics(diagnostic_type='all')[source]
Get network diagnostic information.
Returns DHCP leases and/or address table entries for this network.
- Parameters:
diagnostic_type (Literal['dhcp_leases', 'addresses', 'all']) – Type of diagnostics to retrieve: - “dhcp_leases”: Only DHCP lease information (dynamic addresses) - “addresses”: All address table entries - “all”: Both DHCP leases and addresses (default)
- Returns:
network_key: Network key
network_name: Network name
is_running: Whether network is running
dhcp_enabled: Whether DHCP is enabled
dhcp_leases: List of DHCP leases (if requested)
dhcp_lease_count: Number of DHCP leases
addresses: List of all addresses (if requested)
address_count: Number of addresses
- Return type:
Dictionary containing
Examples
Get all diagnostics:
diag = network.diagnostics() print(f"DHCP Leases: {diag['dhcp_lease_count']}") for lease in diag['dhcp_leases']: print(f" {lease['ip']} -> {lease['hostname']}")
Get only DHCP leases:
diag = network.diagnostics(diagnostic_type="dhcp_leases")
Get only address table:
diag = network.diagnostics(diagnostic_type="addresses")
- statistics(include_history=False, history_limit=60)[source]
Get network traffic statistics.
Returns current traffic statistics and optionally historical data.
- Parameters:
- Returns:
network_key: Network key
network_name: Network name
is_running: Whether network is running
tx_bytes_per_sec: Transmit rate in bytes/second
rx_bytes_per_sec: Receive rate in bytes/second
tx_packets_per_sec: Transmit packets/second
rx_packets_per_sec: Receive packets/second
tx_bytes_total: Total bytes transmitted
rx_bytes_total: Total bytes received
tx_total_formatted: Human-readable total transmitted
rx_total_formatted: Human-readable total received
dmz_tx_bytes_per_sec: DMZ transmit rate (if applicable)
dmz_rx_bytes_per_sec: DMZ receive rate (if applicable)
… (similar DMZ stats)
history: List of historical stats (if requested)
- Return type:
Dictionary containing
Examples
Get current statistics:
stats = network.statistics() print(f"TX: {stats['tx_total_formatted']}") print(f"RX: {stats['rx_total_formatted']}")
Get statistics with history:
stats = network.statistics(include_history=True) for entry in stats.get('history', []): print(f"{entry['timestamp']}: {entry['quality']}% quality")
Note
Statistics are only available for running networks.
- class pyvergeos.resources.networks.NetworkManager[source]
Bases:
ResourceManager[Network]Manager for Virtual Network operations.
Provides CRUD operations and power management for virtual networks.
Examples
List all networks:
networks = client.networks.list()
Get a network by name:
external = client.networks.get(name="External")
Create an internal network:
net = client.networks.create( name="Dev-Network", network_address="10.10.10.0/24", ip_address="10.10.10.1", dhcp_enabled=True, dhcp_start="10.10.10.100", dhcp_stop="10.10.10.200" )
Power operations:
net.power_on() net.restart() net.power_off()
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List networks with optional filtering.
By default, requests common fields including running status. Override with the fields parameter for custom field selection.
- Parameters:
- Returns:
List of Network objects.
- Return type:
- create(name, network_type='internal', network_address=None, ip_address=None, gateway=None, dhcp_enabled=False, dhcp_start=None, dhcp_stop=None, dns='simple', dns_servers=None, domain=None, mtu=None, layer2_type='vxlan', layer2_id=None, interface_network=None, on_power_loss='last_state', description='', **kwargs)[source]
Create a new virtual network.
- Parameters:
name (str) – Network name.
network_type (str) – Network type (internal, external, dmz).
network_address (str | None) – CIDR notation (e.g., “192.168.1.0/24”).
ip_address (str | None) – Router IP address within the network.
gateway (str | None) – Default gateway IP (for DHCP clients).
dhcp_enabled (bool) – Enable DHCP server.
dhcp_start (str | None) – DHCP range start IP.
dhcp_stop (str | None) – DHCP range end IP.
dns (str) – DNS mode (disabled, simple, bind, network).
dns_servers (list[str] | None) – List of DNS server IPs for DHCP.
domain (str | None) – Domain name for the network.
mtu (int | None) – MTU size (1000-65536).
layer2_type (str) – Layer 2 type (vlan, vxlan, none).
layer2_id (int | None) – VLAN or VXLAN ID.
interface_network (int | None) – Key of interface (uplink) network.
on_power_loss (str) – Behavior on power restore (power_on, last_state, leave_off).
description (str) – Network description.
**kwargs (Any) – Additional network properties.
- Returns:
Created network object.
- Return type:
- diagnostics(key, diagnostic_type='all')[source]
Get network diagnostic information.
Returns DHCP leases and/or address table entries for a network.
- Parameters:
- Returns:
Dictionary containing diagnostic information.
- Return type:
Examples
Get all diagnostics:
diag = client.networks.diagnostics(network_key) print(f"DHCP Leases: {diag['dhcp_lease_count']}")
Get via network object:
network = client.networks.get(name="Internal") diag = network.diagnostics()
- statistics(key, include_history=False, history_limit=60)[source]
Get network traffic statistics.
Returns current traffic statistics and optionally historical data.
- Parameters:
- Returns:
Dictionary containing traffic statistics.
- Return type:
Examples
Get current statistics:
stats = client.networks.statistics(network_key) print(f"TX: {stats['tx_total_formatted']}")
Get via network object:
network = client.networks.get(name="External") stats = network.statistics(include_history=True)
Note
Statistics are only available for running networks.
Firewall Rules
Network firewall rule resource manager.
- class pyvergeos.resources.rules.NetworkRule[source]
Bases:
ResourceObjectNetwork firewall rule resource object.
- class pyvergeos.resources.rules.NetworkRuleManager[source]
Bases:
ResourceManager[NetworkRule]Manager for Network firewall rule operations.
This manager is accessed through a Network object’s rules property.
Examples
List all rules for a network:
rules = network.rules.list()
List only incoming rules:
incoming = network.rules.list(direction="incoming")
Create a new accept rule:
rule = network.rules.create( name="Allow HTTPS", direction="incoming", action="accept", protocol="tcp", destination_ports="443" )
Create a NAT rule:
rule = network.rules.create( name="NAT to Web Server", direction="incoming", action="translate", protocol="tcp", destination_ports="80,443", target_ip="192.168.1.10" )
Delete a rule:
network.rules.delete(rule.key)
- __init__(client, network)[source]
- Parameters:
client (VergeClient)
network (Network)
- Return type:
None
- list(filter=None, fields=None, direction=None, action=None, protocol=None, enabled=None, **kwargs)[source]
List firewall rules for this network.
- Parameters:
filter (str | None) – Additional OData filter string.
direction (Literal['incoming', 'outgoing'] | None) – Filter by direction (incoming/outgoing).
action (Literal['accept', 'drop', 'reject', 'translate', 'route'] | None) – Filter by action (accept/drop/reject/translate/route).
protocol (Literal['tcp', 'udp', 'tcpudp', 'icmp', 'any'] | None) – Filter by protocol (tcp/udp/tcpudp/icmp/any).
enabled (bool | None) – Filter by enabled status.
**kwargs (Any) – Additional filter arguments.
- Returns:
List of NetworkRule objects sorted by order.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a rule by key or name.
- Parameters:
- Returns:
NetworkRule object.
- Raises:
NotFoundError – If rule not found.
ValueError – If neither key nor name provided.
- Return type:
- create(name, direction='incoming', action='accept', protocol='any', interface='auto', source_ip=None, source_ports=None, destination_ip=None, destination_ports=None, target_ip=None, target_ports=None, enabled=True, log=False, statistics=False, pin=None, order=None, description='')[source]
Create a new firewall rule.
- Parameters:
name (str) – Rule name (must be unique within the network).
direction (Literal['incoming', 'outgoing']) – Traffic direction (incoming or outgoing).
action (Literal['accept', 'drop', 'reject', 'translate', 'route']) – Action to take (accept, drop, reject, translate, route).
protocol (Literal['tcp', 'udp', 'tcpudp', 'icmp', 'any']) – Protocol to match (tcp, udp, tcpudp, icmp, any).
interface (Literal['auto', 'router', 'dmz', 'wireguard', 'any']) – Interface for the rule (auto, router, dmz, wireguard, any).
source_ip (str | None) – Source IP filter (IP, CIDR, or special value like “vnetself”).
source_ports (str | None) – Source ports (e.g., “80”, “1024-65535”, “80,443”).
destination_ip (str | None) – Destination IP filter.
destination_ports (str | None) – Destination ports.
target_ip (str | None) – Target IP for translate/route actions.
target_ports (str | None) – Target ports for port translation.
enabled (bool) – Enable the rule (default True).
log (bool) – Enable logging for this rule.
statistics (bool) – Enable statistics tracking.
pin (Literal['top', 'bottom'] | None) – Pin position (“top” or “bottom”).
order (int | None) – Specific order position (alternative to pin).
description (str) – Rule description.
- Returns:
Created NetworkRule object.
- Raises:
ValidationError – If a rule with this name already exists.
- Return type:
- update(key, **kwargs)[source]
Update a firewall rule.
- Parameters:
key (int) – Rule $key (ID).
**kwargs (Any) – Fields to update. Common fields: - name: New rule name - direction: incoming/outgoing - action: accept/drop/reject/translate/route - protocol: tcp/udp/tcpudp/icmp/any - source_ip, source_ports: Source filters - destination_ip, destination_ports: Destination filters - target_ip, target_ports: Target for translate/route - enabled: Enable/disable rule - log: Enable/disable logging - statistics: Enable/disable statistics
- Returns:
Updated NetworkRule object.
- Raises:
ValidationError – If trying to modify a system rule.
- Return type:
- delete(key)[source]
Delete a firewall rule.
- Parameters:
key (int) – Rule $key (ID).
- Raises:
ValidationError – If trying to delete a system rule.
- Return type:
None
Note
Rule changes are not active until network.apply_rules() is called.
DNS
DNS Zone and Record resource managers.
- class pyvergeos.resources.dns.DNSRecord[source]
Bases:
ResourceObjectDNS Record resource object.
- class pyvergeos.resources.dns.DNSRecordManager[source]
Bases:
ResourceManager[DNSRecord]Manager for DNS Record operations.
This manager is accessed through a DNSZone object’s records property.
Examples
List all records in a zone:
records = zone.records.list()
Get an A record by host:
record = zone.records.get(host="www")
Create an A record:
record = zone.records.create( host="www", record_type="A", value="10.0.0.100" )
Create an MX record:
record = zone.records.create( host="", # root domain record_type="MX", value="mail.example.com", mx_preference=10 )
Delete a record:
zone.records.delete(record.key)
- __init__(client, zone)[source]
- Parameters:
client (VergeClient)
zone (DNSZone)
- Return type:
None
- list(filter=None, fields=None, host=None, record_type=None, **kwargs)[source]
List DNS records in this zone.
- Parameters:
- Returns:
List of DNSRecord objects sorted by order.
- Return type:
- get(key=None, *, host=None, record_type=None, fields=None)[source]
Get a DNS record by key, host, or type.
- Parameters:
- Returns:
DNSRecord object.
- Raises:
NotFoundError – If record not found.
ValueError – If no identifier provided.
- Return type:
- create(record_type, value, host='', ttl=None, mx_preference=0, weight=0, port=0, description=None)[source]
Create a new DNS record.
- Parameters:
record_type (Literal['A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SRV', 'TXT', 'CAA']) – Record type (A, AAAA, CNAME, MX, NS, PTR, SRV, TXT, CAA).
value (str) – Record value (IP address, hostname, or text).
host (str) – Hostname for the record (empty string for root domain).
ttl (str | None) – Time-to-live for the record (e.g., “1h”, “30m”, “1d”).
mx_preference (int) – Preference value for MX records (lower = higher priority).
weight (int) – Weight for SRV records.
port (int) – Port for SRV records.
description (str | None) – Optional description for the record.
- Returns:
Created DNSRecord object.
- Return type:
Note
DNS changes require DNS apply on the network to take effect.
- class pyvergeos.resources.dns.DNSZone[source]
Bases:
ResourceObjectDNS Zone resource object.
- property records: DNSRecordManager
Access DNS records for this zone.
- Returns:
DNSRecordManager for this zone.
Examples
List all records:
records = zone.records.list()
Create an A record:
record = zone.records.create( host="www", record_type="A", value="10.0.0.100" )
- class pyvergeos.resources.dns.DNSZoneManager[source]
Bases:
ResourceManager[DNSZone]Manager for DNS Zone operations.
This manager can be accessed through a Network object’s dns_zones property (read-only listing) or through a DNSView object’s zones property (full CRUD).
Examples
List all zones for a network:
zones = network.dns_zones.list()
Get a zone by domain:
zone = network.dns_zones.get(domain="example.com")
Create a zone through a view:
view = network.dns_views.get(name="default") zone = view.zones.create(domain="example.com")
List records in a zone:
records = zone.records.list()
Create a record:
record = zone.records.create( host="www", record_type="A", value="10.0.0.100" )
- __init__(client, network=None, view=None)[source]
- Parameters:
client (VergeClient)
network (Network | None)
view (DNSView | None)
- Return type:
None
- list(filter=None, fields=None, domain=None, zone_type=None, include_records=False, **kwargs)[source]
List DNS zones for this network or view.
- Parameters:
filter (str | None) – Additional OData filter string.
domain (str | None) – Filter by exact domain name.
zone_type (Literal['master', 'slave', 'redirect', 'forward', 'static-stub', 'stub'] | None) – Filter by zone type.
include_records (bool) – Include records in each zone (not yet implemented).
**kwargs (Any) – Additional filter arguments.
- Returns:
List of DNSZone objects sorted by domain.
- Return type:
- get(key=None, *, domain=None, fields=None)[source]
Get a DNS zone by key or domain.
- Parameters:
- Returns:
DNSZone object.
- Raises:
NotFoundError – If zone not found.
ValueError – If no identifier provided.
- Return type:
- create(domain, zone_type='master', nameserver='', email='', default_ttl='1h', notify='yes', allow_notify='none;', allow_transfer='none;', masters='', refresh_interval='3h', retry_interval='30m', expiry_period='3w', negative_ttl='10m', forwarders='', **kwargs)[source]
Create a new DNS zone.
This method is only available when the manager is scoped to a view (accessed via
view.zones). Usenetwork.dns_viewsto get a view first.- Parameters:
domain (str) – Domain name for the zone (required).
zone_type (Literal['master', 'slave', 'redirect', 'forward', 'static-stub', 'stub']) – Zone type (default “master”).
nameserver (str) – Primary nameserver FQDN.
email (str) – Zone administrator email.
default_ttl (str) – Default TTL for records (e.g., “1h”, “30m”, “1d”).
notify (str) – Notify setting (“yes”, “no”, “explicit”).
allow_notify (str) – IP networks allowed to send NOTIFY.
allow_transfer (str) – Networks allowed zone transfers.
masters (str) – Master server(s) for secondary zones.
refresh_interval (str) – SOA refresh interval (default “3h”).
retry_interval (str) – SOA retry interval (default “30m”).
expiry_period (str) – SOA expiry period (default “3w”).
negative_ttl (str) – Negative cache TTL (default “10m”).
forwarders (str) – Forwarder servers (semicolon-delimited).
**kwargs (Any) – Additional zone properties.
- Returns:
Created DNSZone object.
- Raises:
ValueError – If manager is not scoped to a view.
- Return type:
Note
DNS changes require DNS apply on the network to take effect.
IP Aliases
Network IP alias resource manager.
- class pyvergeos.resources.aliases.NetworkAlias[source]
Bases:
ResourceObjectNetwork IP alias resource object.
IP aliases can be referenced in firewall rules using alias:name syntax.
- class pyvergeos.resources.aliases.NetworkAliasManager[source]
Bases:
ResourceManager[NetworkAlias]Manager for Network IP alias operations.
This manager is accessed through a Network object’s aliases property. IP aliases are used in firewall rules to reference groups of IP addresses.
Examples
List all aliases for a network:
aliases = network.aliases.list()
Get an alias by IP:
alias = network.aliases.get(ip="10.0.0.100")
Create a new IP alias:
alias = network.aliases.create( ip="10.0.0.100", name="webserver", description="Main web server" )
Delete an alias:
network.aliases.delete(alias.key)
- __init__(client, network)[source]
- Parameters:
client (VergeClient)
network (Network)
- Return type:
None
- list(filter=None, fields=None, ip=None, hostname=None, **kwargs)[source]
List IP aliases for this network.
- Parameters:
- Returns:
List of NetworkAlias objects sorted by IP.
- Return type:
- get(key=None, *, ip=None, hostname=None, name=None, fields=None)[source]
Get an alias by key, IP address, or hostname.
- Parameters:
- Returns:
NetworkAlias object.
- Raises:
NotFoundError – If alias not found.
ValueError – If no identifier provided.
- Return type:
- create(ip, name, description='')[source]
Create a new IP alias.
- Parameters:
- Returns:
Created NetworkAlias object.
- Raises:
ValidationError – If an alias with this IP already exists.
- Return type:
DHCP Hosts
Network DHCP/DNS host override resource manager.
- class pyvergeos.resources.hosts.NetworkHost[source]
Bases:
ResourceObjectNetwork DHCP/DNS host override resource object.
Host overrides map hostnames to IP addresses for DHCP and DNS resolution.
- class pyvergeos.resources.hosts.NetworkHostManager[source]
Bases:
ResourceManager[NetworkHost]Manager for Network DHCP/DNS host override operations.
This manager is accessed through a Network object’s hosts property. Host overrides provide static DNS entries and DHCP hostname assignment.
Examples
List all hosts for a network:
hosts = network.hosts.list()
Get a host by hostname:
host = network.hosts.get(hostname="server01")
Create a new host override:
host = network.hosts.create( hostname="server01", ip="10.0.0.50", host_type="host" )
Update a host override:
network.hosts.update(host.key, ip="10.0.0.51")
Delete a host override:
network.hosts.delete(host.key)
- __init__(client, network)[source]
- Parameters:
client (VergeClient)
network (Network)
- Return type:
None
- list(filter=None, fields=None, hostname=None, ip=None, host_type=None, **kwargs)[source]
List DHCP/DNS host overrides for this network.
- Parameters:
- Returns:
List of NetworkHost objects sorted by hostname.
- Return type:
- get(key=None, *, hostname=None, ip=None, fields=None)[source]
Get a host override by key, hostname, or IP address.
- Parameters:
- Returns:
NetworkHost object.
- Raises:
NotFoundError – If host not found.
ValueError – If no identifier provided.
- Return type:
- create(hostname, ip, host_type='host')[source]
Create a new DHCP/DNS host override.
- Parameters:
- Returns:
Created NetworkHost object.
- Raises:
ValidationError – If a host with this hostname already exists.
- Return type:
Note
Host override changes require DNS apply to take effect.
- update(key, *, hostname=None, ip=None, host_type=None)[source]
Update an existing host override.
- Parameters:
- Returns:
Updated NetworkHost object.
- Raises:
NotFoundError – If host not found.
ValueError – If no update fields provided.
- Return type:
Note
Host override changes require DNS apply to take effect.
Network Statistics
Network performance monitoring and topology discovery.
Network Stats & Monitoring resource managers.
This module provides access to network performance metrics, dashboard, and VPN connection tracking for monitoring and troubleshooting.
Example
>>> # Access network monitor stats
>>> network = client.networks.get(name="External")
>>> stats = network.stats.get()
>>> print(f"Quality: {stats.quality}%, Latency: {stats.latency_avg_ms}ms")
>>> # Access stats history
>>> history = network.stats.history_short(limit=100)
>>> for point in history:
... print(f"{point.timestamp}: Quality {point.quality}%")
>>> # Access network dashboard
>>> dashboard = client.network_dashboard.get()
>>> print(f"Online: {dashboard.vnets_online}/{dashboard.vnets_count}")
>>> # Access active IPSec connections
>>> for conn in network.ipsec_connections.list():
... print(f"{conn.local} <-> {conn.remote}: {conn.protocol}")
>>> # Access WireGuard peer status
>>> for wg in network.wireguard.list():
... for status in wg.peer_status.list():
... print(f"{status.peer_key}: TX {status.tx_bytes_formatted}")
- class pyvergeos.resources.network_stats.NetworkMonitorStats[source]
Bases:
ResourceObjectNetwork monitor statistics resource object.
Provides current network quality and performance metrics from the most recent monitoring sample.
- class pyvergeos.resources.network_stats.NetworkMonitorStatsHistory[source]
Bases:
ResourceObjectNetwork monitor statistics history record.
Represents a single time point in the network monitoring history.
- class pyvergeos.resources.network_stats.NetworkMonitorStatsManager[source]
Bases:
ResourceManager[NetworkMonitorStats]Manager for network monitor statistics.
Provides access to current and historical network quality metrics. Scoped to a specific network.
Example
>>> # Get current stats (most recent sample) >>> stats = manager.get() >>> print(f"Quality: {stats.quality}%")
>>> # Get short-term history (high resolution) >>> history = manager.history_short(limit=100)
>>> # Get long-term history (aggregated, longer retention) >>> history = manager.history_long(limit=1000)
- __init__(client, network)[source]
- Parameters:
client (VergeClient)
network (Network)
- Return type:
None
- get(fields=None)[source]
Get the most recent network monitor statistics.
- Parameters:
- Returns:
NetworkMonitorStats object with latest metrics.
- Raises:
NotFoundError – If no stats found for this network.
- Return type:
- history_short(limit=None, offset=None, since=None, until=None, fields=None)[source]
Get short-term stats history (high resolution).
Short-term history provides granular data points for recent monitoring, typically stored for hours to a few days.
- Parameters:
- Returns:
List of NetworkMonitorStatsHistory objects, sorted by timestamp descending.
- Return type:
- history_long(limit=None, offset=None, since=None, until=None, fields=None)[source]
Get long-term stats history (aggregated, longer retention).
Long-term history provides aggregated data points (averages, peaks, sums) over longer periods, typically stored for weeks to months.
- Parameters:
- Returns:
List of NetworkMonitorStatsHistory objects, sorted by timestamp descending.
- Return type:
- class pyvergeos.resources.network_stats.NetworkDashboard[source]
Bases:
ResourceObjectNetwork dashboard with aggregated metrics.
Provides a high-level overview of network status, counts by type and state, and top resource consumers for monitoring and capacity planning.
- class pyvergeos.resources.network_stats.NetworkDashboardManager[source]
Bases:
ResourceManager[NetworkDashboard]Manager for network dashboard.
Provides aggregated network metrics and status counts for monitoring.
Example
>>> dashboard = client.network_dashboard.get() >>> print(f"Online: {dashboard.vnets_online}/{dashboard.vnets_count}") >>> print(f"Errors: {dashboard.vnets_error}") >>> if dashboard.has_errors: ... print("WARNING: Networks in error state!")
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- class pyvergeos.resources.network_stats.IPSecActiveConnection[source]
Bases:
ResourceObjectActive IPSec VPN connection (non-persistent/computed).
Represents a currently established IPSec tunnel with connection details. This data is computed from strongSwan status and is not stored in the database.
- class pyvergeos.resources.network_stats.IPSecActiveConnectionManager[source]
Bases:
ResourceManager[IPSecActiveConnection]Manager for active IPSec connections.
Provides access to currently established IPSec VPN tunnels. This is a read-only, non-persistent view of active connection state. Scoped to a specific network.
Example
>>> # List all active IPSec connections >>> for conn in network.ipsec_connections.list(): ... print(f"{conn.local} <-> {conn.remote}") ... print(f" Protocol: {conn.protocol}") ... print(f" Local Network: {conn.local_network}") ... print(f" Remote Network: {conn.remote_network}")
- __init__(client, network)[source]
- Parameters:
client (VergeClient)
network (Network)
- Return type:
None
- class pyvergeos.resources.network_stats.WireGuardPeerStatus[source]
Bases:
ResourceObjectWireGuard peer connection status.
Provides real-time status information for a WireGuard peer including handshake time and transfer statistics.
- class pyvergeos.resources.network_stats.WireGuardPeerStatusManager[source]
Bases:
ResourceManager[WireGuardPeerStatus]Manager for WireGuard peer status.
Provides access to real-time connection status for WireGuard peers. Scoped to a specific WireGuard interface.
Example
>>> # List peer status for a WireGuard interface >>> for wg in network.wireguard.list(): ... for status in wg.peer_status.list(): ... if status.is_connected: ... print(f"Peer {status.peer_key}: {status.tx_bytes_formatted} TX")
- __init__(client, wireguard)[source]
- Parameters:
client (VergeClient)
wireguard (WireGuardInterface)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List peer status for this WireGuard interface.
- Parameters:
- Returns:
List of WireGuardPeerStatus objects.
- Return type:
- get_for_peer(peer_key)[source]
Get status for a specific peer.
- Parameters:
peer_key (int) – Peer $key (ID).
- Returns:
WireGuardPeerStatus object.
- Raises:
NotFoundError – If status not found for this peer.
- Return type:
Routing Protocols
BGP, OSPF, and EIGRP configuration for enterprise deployments.
Network routing protocol resource managers (BGP, OSPF, EIGRP).
- class pyvergeos.resources.routing.BGPRouterCommand[source]
Bases:
ResourceObjectBGP router command object.
Commands configure BGP router behavior including neighbors, networks, redistribution, and protocol settings.
- class pyvergeos.resources.routing.BGPRouterCommandManager[source]
Bases:
ResourceManager[BGPRouterCommand]Manager for BGP router commands.
Commands configure the BGP router including neighbors, networks, redistribution, and other protocol settings.
Examples
List commands for a router:
commands = router.commands.list()
Add a neighbor:
router.commands.create( command="neighbor", params="192.168.1.1 remote-as 65001" )
Add a network advertisement:
router.commands.create( command="network", params="10.0.0.0/24" )
- __init__(client, router)[source]
- Parameters:
client (VergeClient)
router (BGPRouter)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List commands for this BGP router.
- Parameters:
- Returns:
List of BGPRouterCommand objects.
- Return type:
- get(key=None, *, fields=None)[source]
Get a single command by key.
- Parameters:
- Returns:
BGPRouterCommand object.
- Raises:
NotFoundError – If command not found.
ValueError – If key not provided.
- Return type:
- create(command, params, *, enabled=True, negate=False)[source]
Create a new BGP router command.
- Parameters:
command (Literal['aggregate-address', 'bgp', 'bmp', 'coalesce-time', 'distance', 'maximum-paths', 'neighbor', 'network', 'read-quanta', 'redistribute', 'segment-routing', 'table-map', 'timers', 'update-delay', 'vnc', 'vrf-policy', 'write-quanta']) – Command type (neighbor, network, redistribute, etc.).
params (str) – Command parameters.
enabled (bool) – Whether the command is enabled.
negate (bool) – Whether to negate the command (no prefix).
- Returns:
Created BGPRouterCommand object.
- Return type:
Examples
Add a BGP neighbor:
cmd = router.commands.create( command="neighbor", params="192.168.1.1 remote-as 65001" )
Advertise a network:
cmd = router.commands.create( command="network", params="10.0.0.0/24" )
Redistribute connected routes:
cmd = router.commands.create( command="redistribute", params="connected" )
- class pyvergeos.resources.routing.BGPRouter[source]
Bases:
ResourceObjectBGP router object.
A BGP router defines an autonomous system number (ASN) and contains commands for configuring neighbors, networks, and other BGP settings.
- property commands: BGPRouterCommandManager
Access commands for this BGP router.
- Returns:
BGPRouterCommandManager for this router.
Examples
List commands:
commands = router.commands.list()
Add a neighbor:
router.commands.create( command="neighbor", params="192.168.1.1 remote-as 65001" )
- class pyvergeos.resources.routing.BGPRouterManager[source]
Bases:
ResourceManager[BGPRouter]Manager for BGP routers.
BGP routers define the local autonomous system and contain configuration for BGP neighbors, networks, and policies.
Examples
List BGP routers:
routers = network.routing.bgp_routers.list()
Create a BGP router:
router = network.routing.bgp_routers.create(asn=65000)
Add a neighbor to the router:
router.commands.create( command="neighbor", params="192.168.1.1 remote-as 65001" )
- __init__(client, routing_manager)[source]
- Parameters:
client (VergeClient)
routing_manager (NetworkRoutingManager)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List BGP routers for this network.
- Parameters:
- Returns:
List of BGPRouter objects.
- Return type:
- get(key=None, *, asn=None, fields=None)[source]
Get a single BGP router by key or ASN.
- Parameters:
- Returns:
BGPRouter object.
- Raises:
NotFoundError – If router not found.
ValueError – If neither key nor asn provided.
- Return type:
- create(asn)[source]
Create a new BGP router.
- Parameters:
asn (int) – Autonomous System Number (1-4294967295).
- Returns:
Created BGPRouter object.
- Return type:
Examples
Create a BGP router:
router = network.routing.bgp_routers.create(asn=65000)
- class pyvergeos.resources.routing.BGPInterfaceCommand[source]
Bases:
ResourceObjectBGP interface command object.
- class pyvergeos.resources.routing.BGPInterfaceCommandManager[source]
Bases:
ResourceManager[BGPInterfaceCommand]Manager for BGP interface commands.
Commands configure the BGP interface including IP settings, OSPF parameters, and link detection.
Examples
List commands:
commands = interface.commands.list()
Add OSPF cost:
interface.commands.create( command="ospf", params="cost 10" )
- __init__(client, interface)[source]
- Parameters:
client (VergeClient)
interface (BGPInterface)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List commands for this interface.
- Parameters:
- Returns:
List of BGPInterfaceCommand objects.
- Return type:
- get(key=None, *, fields=None)[source]
Get a single command by key.
- Parameters:
- Returns:
BGPInterfaceCommand object.
- Raises:
NotFoundError – If command not found.
ValueError – If key not provided.
- Return type:
- create(command, params)[source]
Create a new interface command.
- Parameters:
- Returns:
Created BGPInterfaceCommand object.
- Return type:
Examples
Set OSPF cost:
cmd = interface.commands.create( command="ospf", params="cost 10" )
- class pyvergeos.resources.routing.BGPInterface[source]
Bases:
ResourceObjectBGP interface object.
A BGP interface creates a Layer 2/3 connection for routing protocols. It creates an associated virtual network and NIC automatically.
- property commands: BGPInterfaceCommandManager
Access commands for this interface.
- Returns:
BGPInterfaceCommandManager for this interface.
Examples
List commands:
commands = interface.commands.list()
Add OSPF cost:
interface.commands.create( command="ospf", params="cost 10" )
- class pyvergeos.resources.routing.BGPInterfaceManager[source]
Bases:
ResourceManager[BGPInterface]Manager for BGP interfaces.
BGP interfaces create Layer 2/3 connections for routing protocols. Each interface automatically creates an associated virtual network and NIC.
Examples
List interfaces:
interfaces = network.routing.bgp_interfaces.list()
Create an interface:
interface = network.routing.bgp_interfaces.create( name="bgp-peer-1", ip_address="10.255.0.1", network="10.255.0.0/30", interface_network=external_net.key, layer2_id=100 )
- __init__(client, routing_manager)[source]
- Parameters:
client (VergeClient)
routing_manager (NetworkRoutingManager)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List BGP interfaces for this network.
- Parameters:
- Returns:
List of BGPInterface objects.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a single BGP interface by key or name.
- Parameters:
- Returns:
BGPInterface object.
- Raises:
NotFoundError – If interface not found.
ValueError – If neither key nor name provided.
- Return type:
- create(name, ip_address, network, interface_network, *, layer2_type='vlan', layer2_id=None, mtu=9000, description='')[source]
Create a new BGP interface.
- Parameters:
name (str) – Interface name.
ip_address (str) – IP address for this interface.
network (str) – Network address in CIDR notation (e.g., “10.255.0.0/30”).
interface_network (int) – Key of the interface (uplink) network.
layer2_type (Literal['vlan', 'none']) – Layer 2 type (vlan or none).
layer2_id (int | None) – VLAN ID (required if layer2_type is vlan).
mtu (int) – MTU size (1000-65536, default 9000).
description (str) – Interface description.
- Returns:
Created BGPInterface object.
- Return type:
Examples
Create a BGP peering interface:
interface = network.routing.bgp_interfaces.create( name="bgp-peer-isp", ip_address="198.51.100.2", network="198.51.100.0/30", interface_network=external_net.key, layer2_type="vlan", layer2_id=100 )
- class pyvergeos.resources.routing.BGPRouteMapCommand[source]
Bases:
ResourceObjectBGP route map command object.
- class pyvergeos.resources.routing.BGPRouteMapCommandManager[source]
Bases:
ResourceManager[BGPRouteMapCommand]Manager for BGP route map commands.
Commands define match conditions and set actions for route maps.
Examples
List commands:
commands = routemap.commands.list()
Add a match condition:
routemap.commands.create( command="match", params="ip address prefix-list MY-PREFIX" )
Add a set action:
routemap.commands.create( command="set", params="local-preference 200" )
- __init__(client, routemap)[source]
- Parameters:
client (VergeClient)
routemap (BGPRouteMap)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List commands for this route map.
- Parameters:
- Returns:
List of BGPRouteMapCommand objects.
- Return type:
- get(key=None, *, fields=None)[source]
Get a single command by key.
- Parameters:
- Returns:
BGPRouteMapCommand object.
- Raises:
NotFoundError – If command not found.
ValueError – If key not provided.
- Return type:
- create(command, params)[source]
Create a new route map command.
- Parameters:
- Returns:
Created BGPRouteMapCommand object.
- Return type:
Examples
Add a match condition:
cmd = routemap.commands.create( command="match", params="ip address prefix-list MY-PREFIX" )
Add a set action:
cmd = routemap.commands.create( command="set", params="local-preference 200" )
- class pyvergeos.resources.routing.BGPRouteMap[source]
Bases:
ResourceObjectBGP route map object.
Route maps are used to filter and modify BGP routes. Each route map entry has a tag, sequence number, and permit/deny action.
- property commands: BGPRouteMapCommandManager
Access commands for this route map.
- Returns:
BGPRouteMapCommandManager for this route map.
Examples
List commands:
commands = routemap.commands.list()
Add a match condition:
routemap.commands.create( command="match", params="ip address prefix-list MY-PREFIX" )
- class pyvergeos.resources.routing.BGPRouteMapManager[source]
Bases:
ResourceManager[BGPRouteMap]Manager for BGP route maps.
Route maps filter and modify BGP routes. Multiple entries with the same tag form a route map; entries are evaluated by sequence number.
Examples
List route maps:
routemaps = network.routing.bgp_route_maps.list()
Create a route map entry:
routemap = network.routing.bgp_route_maps.create( tag="IMPORT-FROM-ISP", sequence=10, permit=True )
Add match/set commands:
routemap.commands.create(command="match", params="as-path 1") routemap.commands.create(command="set", params="local-preference 200")
- __init__(client, routing_manager)[source]
- Parameters:
client (VergeClient)
routing_manager (NetworkRoutingManager)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List route maps for this network.
- Parameters:
- Returns:
List of BGPRouteMap objects.
- Return type:
- get(key=None, *, tag=None, sequence=None, fields=None)[source]
Get a single route map by key or tag+sequence.
- Parameters:
- Returns:
BGPRouteMap object.
- Raises:
NotFoundError – If route map not found.
ValueError – If invalid parameters.
- Return type:
- create(tag, sequence, *, permit=True)[source]
Create a new route map entry.
- Parameters:
- Returns:
Created BGPRouteMap object.
- Return type:
Examples
Create a permit entry:
routemap = network.routing.bgp_route_maps.create( tag="IMPORT-FROM-ISP", sequence=10, permit=True )
Create a deny entry:
routemap = network.routing.bgp_route_maps.create( tag="BLOCK-PRIVATE", sequence=10, permit=False )
- class pyvergeos.resources.routing.BGPIPCommand[source]
Bases:
ResourceObjectBGP IP command object.
IP commands configure prefix lists, AS path lists, community lists, and other IP-level BGP settings.
- class pyvergeos.resources.routing.BGPIPCommandManager[source]
Bases:
ResourceManager[BGPIPCommand]Manager for BGP IP commands.
IP commands configure prefix lists, AS path access lists, community lists, and other IP-level BGP configuration.
Examples
List IP commands:
commands = network.routing.bgp_ip_commands.list()
Create a prefix list:
network.routing.bgp_ip_commands.create( command="prefix-list", params="MY-PREFIXES seq 10 permit 10.0.0.0/8 le 24" )
Create an AS path access list:
network.routing.bgp_ip_commands.create( command="as-path", params="access-list 1 permit ^65001$" )
- __init__(client, routing_manager)[source]
- Parameters:
client (VergeClient)
routing_manager (NetworkRoutingManager)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List IP commands for this network.
- Parameters:
- Returns:
List of BGPIPCommand objects.
- Return type:
- get(key=None, *, fields=None)[source]
Get a single IP command by key.
- Parameters:
- Returns:
BGPIPCommand object.
- Raises:
NotFoundError – If command not found.
ValueError – If key not provided.
- Return type:
- create(command, params)[source]
Create a new IP command.
- Parameters:
- Returns:
Created BGPIPCommand object.
- Return type:
Examples
Create a prefix list:
cmd = network.routing.bgp_ip_commands.create( command="prefix-list", params="MY-PREFIXES seq 10 permit 10.0.0.0/8 le 24" )
Create an AS path access list:
cmd = network.routing.bgp_ip_commands.create( command="as-path", params="access-list 1 permit ^65001$" )
Create a community list:
cmd = network.routing.bgp_ip_commands.create( command="community-list", params="standard COMMUNITY-1 permit 65000:100" )
- class pyvergeos.resources.routing.OSPFCommand[source]
Bases:
ResourceObjectOSPF command object.
OSPF commands configure the OSPF routing protocol including areas, networks, redistribution, and timers.
- class pyvergeos.resources.routing.OSPFCommandManager[source]
Bases:
ResourceManager[OSPFCommand]Manager for OSPF commands.
OSPF commands configure the OSPF routing protocol including areas, networks, redistribution, router ID, and timers.
Examples
List OSPF commands:
commands = network.routing.ospf_commands.list()
Set router ID:
network.routing.ospf_commands.create( command="router-id", params="1.1.1.1" )
Add network to OSPF:
network.routing.ospf_commands.create( command="network", params="10.0.0.0/24 area 0" )
Configure an area:
network.routing.ospf_commands.create( command="area", params="0 authentication message-digest" )
- __init__(client, routing_manager)[source]
- Parameters:
client (VergeClient)
routing_manager (NetworkRoutingManager)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List OSPF commands for this network.
- Parameters:
- Returns:
List of OSPFCommand objects.
- Return type:
- get(key=None, *, fields=None)[source]
Get a single OSPF command by key.
- Parameters:
- Returns:
OSPFCommand object.
- Raises:
NotFoundError – If command not found.
ValueError – If key not provided.
- Return type:
- create(command, params)[source]
Create a new OSPF command.
- Parameters:
command (Literal['advanced', 'area', 'auto-cost', 'capability', 'default-information', 'default-metric', 'distance', 'distribute-list', 'log-adjacency-changes', 'max-metric', 'mpls-te', 'neighbor', 'network', 'no', 'ospf', 'passive-interface', 'redistribute', 'router-id', 'timers']) – Command type (area, network, redistribute, etc.).
params (str) – Command parameters.
- Returns:
Created OSPFCommand object.
- Return type:
Examples
Set router ID:
cmd = network.routing.ospf_commands.create( command="router-id", params="1.1.1.1" )
Add network to OSPF area 0:
cmd = network.routing.ospf_commands.create( command="network", params="10.0.0.0/24 area 0" )
Configure area authentication:
cmd = network.routing.ospf_commands.create( command="area", params="0 authentication message-digest" )
Redistribute BGP routes:
cmd = network.routing.ospf_commands.create( command="redistribute", params="bgp metric 100" )
Set passive interface:
cmd = network.routing.ospf_commands.create( command="passive-interface", params="default" )
- class pyvergeos.resources.routing.EIGRPRouterCommand[source]
Bases:
ResourceObjectEIGRP router command object.
- class pyvergeos.resources.routing.EIGRPRouterCommandManager[source]
Bases:
ResourceManager[EIGRPRouterCommand]Manager for EIGRP router commands.
Commands configure EIGRP router behavior including networks, redistribution, metrics, and neighbors.
Examples
List commands:
commands = router.commands.list()
Add a network:
router.commands.create( command="network", params="10.0.0.0/24" )
Redistribute OSPF:
router.commands.create( command="redistribute", params="ospf" )
- __init__(client, router)[source]
- Parameters:
client (VergeClient)
router (EIGRPRouter)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List commands for this EIGRP router.
- Parameters:
- Returns:
List of EIGRPRouterCommand objects.
- Return type:
- get(key=None, *, fields=None)[source]
Get a single command by key.
- Parameters:
- Returns:
EIGRPRouterCommand object.
- Raises:
NotFoundError – If command not found.
ValueError – If key not provided.
- Return type:
- create(command, params, *, enabled=True, negate=False)[source]
Create a new EIGRP router command.
- Parameters:
command (Literal['eigrp', 'coalesce-time', 'maximum-paths', 'metric', 'neighbor', 'network', 'passive-interface', 'redistribute', 'timers', 'variance']) – Command type (network, redistribute, metric, etc.).
params (str) – Command parameters.
enabled (bool) – Whether the command is enabled.
negate (bool) – Whether to negate the command (no prefix).
- Returns:
Created EIGRPRouterCommand object.
- Return type:
Examples
Add a network:
cmd = router.commands.create( command="network", params="10.0.0.0/24" )
Redistribute OSPF:
cmd = router.commands.create( command="redistribute", params="ospf" )
Set variance:
cmd = router.commands.create( command="variance", params="2" )
- class pyvergeos.resources.routing.EIGRPRouter[source]
Bases:
ResourceObjectEIGRP router object.
An EIGRP router defines an autonomous system number (ASN) and contains commands for configuring networks, redistribution, and other settings.
- property commands: EIGRPRouterCommandManager
Access commands for this EIGRP router.
- Returns:
EIGRPRouterCommandManager for this router.
Examples
List commands:
commands = router.commands.list()
Add a network:
router.commands.create( command="network", params="10.0.0.0/24" )
- class pyvergeos.resources.routing.EIGRPRouterManager[source]
Bases:
ResourceManager[EIGRPRouter]Manager for EIGRP routers.
EIGRP (Enhanced Interior Gateway Routing Protocol) is a Cisco-developed routing protocol. EIGRP routers define the AS number and contain configuration for networks, redistribution, and metrics.
Examples
List EIGRP routers:
routers = network.routing.eigrp_routers.list()
Create an EIGRP router:
router = network.routing.eigrp_routers.create(asn=100)
Add a network:
router.commands.create( command="network", params="10.0.0.0/24" )
- __init__(client, routing_manager)[source]
- Parameters:
client (VergeClient)
routing_manager (NetworkRoutingManager)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List EIGRP routers for this network.
- Parameters:
- Returns:
List of EIGRPRouter objects.
- Return type:
- get(key=None, *, asn=None, fields=None)[source]
Get a single EIGRP router by key or ASN.
- Parameters:
- Returns:
EIGRPRouter object.
- Raises:
NotFoundError – If router not found.
ValueError – If neither key nor asn provided.
- Return type:
- create(asn)[source]
Create a new EIGRP router.
- Parameters:
asn (int) – Autonomous System Number (1-65535).
- Returns:
Created EIGRPRouter object.
- Return type:
Examples
Create an EIGRP router:
router = network.routing.eigrp_routers.create(asn=100)
- class pyvergeos.resources.routing.NetworkRoutingManager[source]
Bases:
objectManager for network routing protocols (BGP, OSPF, EIGRP).
This is the main entry point for configuring dynamic routing protocols on a VergeOS virtual network.
Examples
Access routing configuration:
routing = network.routing
Configure BGP:
# Create a BGP router bgp = routing.bgp_routers.create(asn=65000) # Add a neighbor bgp.commands.create( command="neighbor", params="192.168.1.1 remote-as 65001" ) # Advertise networks bgp.commands.create( command="network", params="10.0.0.0/24" )
Configure OSPF:
# Set router ID routing.ospf_commands.create( command="router-id", params="1.1.1.1" ) # Add network to area 0 routing.ospf_commands.create( command="network", params="10.0.0.0/24 area 0" )
Configure EIGRP:
# Create an EIGRP router eigrp = routing.eigrp_routers.create(asn=100) # Add network eigrp.commands.create( command="network", params="10.0.0.0/24" )
Note
Routing configuration changes require restarting the network for changes to take effect.
- __init__(client, network)[source]
- Parameters:
client (VergeClient)
network (Network)
- Return type:
None
- property bgp_routers: BGPRouterManager
Access BGP routers for this network.
- Returns:
BGPRouterManager for this network.
Examples
List BGP routers:
routers = network.routing.bgp_routers.list()
Create a router:
router = network.routing.bgp_routers.create(asn=65000)
- property bgp_interfaces: BGPInterfaceManager
Access BGP interfaces for this network.
- Returns:
BGPInterfaceManager for this network.
Examples
List interfaces:
interfaces = network.routing.bgp_interfaces.list()
Create an interface:
interface = network.routing.bgp_interfaces.create( name="peer-1", ip_address="10.255.0.1", network="10.255.0.0/30", interface_network=external.key )
- property bgp_route_maps: BGPRouteMapManager
Access BGP route maps for this network.
- Returns:
BGPRouteMapManager for this network.
Examples
List route maps:
maps = network.routing.bgp_route_maps.list()
Create a route map:
rmap = network.routing.bgp_route_maps.create( tag="IMPORT", sequence=10, permit=True )
- property bgp_ip_commands: BGPIPCommandManager
Access BGP IP commands (prefix-lists, as-path lists, etc.).
- Returns:
BGPIPCommandManager for this network.
Examples
Create a prefix list:
network.routing.bgp_ip_commands.create( command="prefix-list", params="MY-PREFIX seq 10 permit 10.0.0.0/8 le 24" )
- property ospf_commands: OSPFCommandManager
Access OSPF commands for this network.
- Returns:
OSPFCommandManager for this network.
Examples
Set router ID:
network.routing.ospf_commands.create( command="router-id", params="1.1.1.1" )
Add network to OSPF:
network.routing.ospf_commands.create( command="network", params="10.0.0.0/24 area 0" )
- property eigrp_routers: EIGRPRouterManager
Access EIGRP routers for this network.
- Returns:
EIGRPRouterManager for this network.
Examples
List EIGRP routers:
routers = network.routing.eigrp_routers.list()
Create a router:
router = network.routing.eigrp_routers.create(asn=100)
- property is_configured: bool
Check if routing is configured for this network.
- Returns:
True if a vnet_bgp record exists for this network.
- delete_config()[source]
Delete all routing configuration for this network.
This removes the vnet_bgp record and all associated resources (BGP routers, interfaces, route maps, OSPF commands, EIGRP routers).
Warning
This is a destructive operation that removes all routing configuration for the network.
- Return type:
None
IPSec VPN
IPSec VPN resource managers.
- class pyvergeos.resources.ipsec.IPSecConnection[source]
Bases:
ResourceObjectIPSec Phase 1 (IKE) connection object.
- property policies: IPSecPolicyManager
Access Phase 2 policies for this connection.
- Returns:
IPSecPolicyManager for this connection.
Examples
List all policies:
policies = connection.policies.list()
Create a policy:
policy = connection.policies.create( name="LAN-to-LAN", local_network="10.0.0.0/24", remote_network="192.168.1.0/24" )
- class pyvergeos.resources.ipsec.IPSecPolicy[source]
Bases:
ResourceObjectIPSec Phase 2 policy (traffic selector) object.
- class pyvergeos.resources.ipsec.IPSecConnectionManager[source]
Bases:
ResourceManager[IPSecConnection]Manager for IPSec Phase 1 (IKE) connections.
IPSec connections define the IKE security association including remote gateway, authentication, and encryption settings.
This is a sub-resource manager that operates on a specific network.
Examples
List connections on a network:
connections = network.ipsec.list()
Get a connection by name:
conn = network.ipsec.get(name="Site-B")
Create a connection:
conn = network.ipsec.create( name="Site-B", remote_gateway="203.0.113.1", pre_shared_key="MySecretKey123" )
Access Phase 2 policies:
policies = conn.policies.list()
- __init__(client, network)[source]
- Parameters:
client (VergeClient)
network (Network)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List IPSec connections on this network.
- Parameters:
- Returns:
List of IPSecConnection objects.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a single IPSec connection by key or name.
- Parameters:
- Returns:
IPSecConnection object.
- Raises:
NotFoundError – If connection not found.
ValueError – If neither key nor name provided.
- Return type:
- create(name, remote_gateway, pre_shared_key, *, key_exchange='auto', encryption='aes256-sha256-modp2048', ike_lifetime=10800, connection_mode='on_demand', negotiation='main', identifier=None, peer_identifier=None, dpd_action='restart', dpd_delay=30, dpd_failures=5, force_udp_encap=False, mobike=False, split_connections=False, keying_tries=3, rekey=True, reauth=True, margin_time=540, description='', enabled=True)[source]
Create a new IPSec connection.
- Parameters:
name (str) – Unique name for the connection.
remote_gateway (str) – IP address or hostname of the remote VPN gateway.
pre_shared_key (str) – Pre-shared key for authentication.
key_exchange (Literal['auto', 'ikev1', 'ikev2']) – IKE version (auto, ikev1, ikev2).
encryption (str) – IKE encryption algorithms (e.g., “aes256-sha256-modp2048”).
ike_lifetime (int) – Lifetime of the IKE SA in seconds (60-86400).
connection_mode (Literal['responder_only', 'on_demand', 'start']) – Connection behavior (responder_only, on_demand, start).
negotiation (Literal['main', 'aggressive']) – IKEv1 negotiation mode (main, aggressive).
identifier (str | None) – Local identifier (defaults to local IP).
peer_identifier (str | None) – Remote peer identifier (defaults to remote gateway).
dpd_action (Literal['disabled', 'clear', 'hold', 'restart']) – Dead Peer Detection action (disabled, clear, hold, restart).
dpd_delay (int) – DPD delay in seconds (0-3600).
dpd_failures (int) – Number of DPD failures before action (IKEv1 only).
force_udp_encap (bool) – Force UDP encapsulation even without NAT.
mobike (bool) – Enable IKEv2 MOBIKE protocol for mobility.
split_connections (bool) – Split connection entries with multiple Phase 2 configs.
keying_tries (int) – Number of keying attempts (0 = unlimited).
rekey (bool) – Whether to renegotiate on expiry.
reauth (bool) – Whether to reauthenticate on rekey (IKEv2).
margin_time (int) – Time before expiry to start renegotiation.
description (str) – Connection description.
enabled (bool) – Whether the connection is enabled.
- Returns:
Created IPSecConnection object.
- Return type:
Examples
Basic connection:
conn = network.ipsec.create( name="Site-B", remote_gateway="203.0.113.1", pre_shared_key="MySecretKey123" )
IKEv2 with custom encryption:
conn = network.ipsec.create( name="Azure-VPN", remote_gateway="azure-vpn.eastus.cloudapp.net", pre_shared_key="ComplexKey!@#", key_exchange="ikev2", encryption="aes256gcm16-sha384-modp2048", connection_mode="start" )
- update(key, **kwargs)[source]
Update an existing IPSec connection.
- Parameters:
key (int) – Connection $key (ID).
**kwargs (Any) – Attributes to update. Supports: - name: New name - remote_gateway: New remote gateway - pre_shared_key: New PSK - key_exchange: New IKE version - encryption: New encryption algorithms - ike_lifetime: New IKE SA lifetime - connection_mode: New connection behavior - negotiation: New negotiation mode - identifier: New local identifier - peer_identifier: New remote identifier - dpd_action: New DPD action - dpd_delay: New DPD delay - dpd_failures: New DPD failure count - force_udp_encap: Enable/disable forced UDP encap - mobike: Enable/disable MOBIKE - split_connections: Enable/disable split connections - keying_tries: New keying tries - rekey: Enable/disable rekey - reauth: Enable/disable reauth - margin_time: New margin time - description: New description - enabled: Enable/disable connection
- Returns:
Updated IPSecConnection object.
- Return type:
- class pyvergeos.resources.ipsec.IPSecPolicyManager[source]
Bases:
ResourceManager[IPSecPolicy]Manager for IPSec Phase 2 policies (traffic selectors).
Phase 2 policies define which traffic should be encrypted through the IPSec tunnel. They specify local and remote networks.
This is a sub-resource manager that operates on a specific connection.
Examples
List policies for a connection:
policies = connection.policies.list()
Create a policy:
policy = connection.policies.create( name="LAN-to-LAN", local_network="10.0.0.0/24", remote_network="192.168.1.0/24" )
Delete a policy:
connection.policies.delete(policy.key)
- __init__(client, connection)[source]
- Parameters:
client (VergeClient)
connection (IPSecConnection)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List Phase 2 policies for this connection.
- Parameters:
- Returns:
List of IPSecPolicy objects.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a single Phase 2 policy by key or name.
- Parameters:
- Returns:
IPSecPolicy object.
- Raises:
NotFoundError – If policy not found.
ValueError – If neither key nor name provided.
- Return type:
- create(name, local_network, remote_network=None, *, mode='tunnel', protocol='esp', ciphers='aes128-sha256-modp2048,aes128gcm128-sha256-modp2048', lifetime=3600, description='', enabled=True)[source]
Create a new Phase 2 policy.
- Parameters:
name (str) – Unique name for the policy.
local_network (str) – Local network/subnet in CIDR notation (e.g., “10.0.0.0/24”).
remote_network (str | None) – Remote network/subnet in CIDR notation.
mode (Literal['tunnel', 'transport']) – IPSec mode (tunnel or transport).
protocol (Literal['esp', 'ah']) – Security protocol (esp for encrypted, ah for auth only).
ciphers (str) – Phase 2 cipher suites.
lifetime (int) – SA lifetime in seconds (60-86400).
description (str) – Policy description.
enabled (bool) – Whether the policy is enabled.
- Returns:
Created IPSecPolicy object.
- Return type:
Examples
Basic LAN-to-LAN policy:
policy = connection.policies.create( name="LAN-to-LAN", local_network="10.0.0.0/24", remote_network="192.168.1.0/24" )
All traffic through tunnel:
policy = connection.policies.create( name="All-Traffic", local_network="0.0.0.0/0", remote_network="0.0.0.0/0" )
- update(key, **kwargs)[source]
Update an existing Phase 2 policy.
- Parameters:
key (int) – Policy $key (ID).
**kwargs (Any) – Attributes to update. Supports: - name: New name - local_network: New local network - remote_network: New remote network - mode: New mode (tunnel/transport) - protocol: New protocol (esp/ah) - ciphers: New cipher suites - lifetime: New lifetime - description: New description - enabled: Enable/disable policy
- Returns:
Updated IPSecPolicy object.
- Return type:
WireGuard VPN
WireGuard VPN resource managers.
- class pyvergeos.resources.wireguard.WireGuardInterface[source]
Bases:
ResourceObjectWireGuard VPN interface object.
- property peers: WireGuardPeerManager
Access peers for this WireGuard interface.
- Returns:
WireGuardPeerManager for this interface.
Examples
List all peers:
peers = interface.peers.list()
Create a peer:
peer = interface.peers.create( name="remote-office", peer_ip="10.100.0.2", public_key="abc123...", allowed_ips="192.168.1.0/24" )
- property peer_status: WireGuardPeerStatusManager
Access real-time peer status for this WireGuard interface.
Provides connection status including last handshake time and transfer statistics for all peers.
- Returns:
WireGuardPeerStatusManager for this interface.
Examples
List peer status:
for status in wg.peer_status.list(): if status.is_connected: print(f"Peer {status.peer_key} connected") print(f" TX: {status.tx_bytes_formatted}") print(f" RX: {status.rx_bytes_formatted}") else: print(f"Peer {status.peer_key} disconnected")
Get status for specific peer:
status = wg.peer_status.get_for_peer(peer.key) print(f"Last handshake: {status.last_handshake}")
- class pyvergeos.resources.wireguard.WireGuardPeer[source]
Bases:
ResourceObjectWireGuard VPN peer object.
Check if a preshared key is configured.
- get_config()[source]
Get the WireGuard configuration for this peer.
Returns the WireGuard config file content that can be used by the remote peer to connect to this tunnel.
- Returns:
WireGuard configuration file content as string.
- Raises:
ValueError – If configuration cannot be retrieved.
- Return type:
Examples
Get and save peer config:
config = peer.get_config() with open("wg0.conf", "w") as f: f.write(config)
- class pyvergeos.resources.wireguard.WireGuardManager[source]
Bases:
ResourceManager[WireGuardInterface]Manager for WireGuard VPN interfaces.
WireGuard interfaces define the local VPN tunnel endpoint including IP address, listen port, and cryptographic keys.
This is a sub-resource manager that operates on a specific network.
Examples
List interfaces on a network:
interfaces = network.wireguard.list()
Get an interface by name:
wg = network.wireguard.get(name="wg0")
Create an interface:
wg = network.wireguard.create( name="wg0", ip_address="10.100.0.1/24", listen_port=51820 )
Access peers:
peers = wg.peers.list()
- __init__(client, network)[source]
- Parameters:
client (VergeClient)
network (Network)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List WireGuard interfaces on this network.
- Parameters:
- Returns:
List of WireGuardInterface objects.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a single WireGuard interface by key or name.
- Parameters:
- Returns:
WireGuardInterface object.
- Raises:
NotFoundError – If interface not found.
ValueError – If neither key nor name provided.
- Return type:
- create(name, ip_address, *, listen_port=51820, mtu=0, endpoint_ip=None, description='', enabled=True)[source]
Create a new WireGuard interface.
- Parameters:
name (str) – Unique name for the interface.
ip_address (str) – Tunnel IP address in CIDR notation (e.g., “10.100.0.1/24”).
listen_port (int) – UDP port to listen on (default: 51820).
mtu (int) – MTU for the interface (0 = auto, default).
endpoint_ip (str | None) – Public IP for peer configurations (auto-detected if not set).
description (str) – Interface description.
enabled (bool) – Whether the interface is enabled.
- Returns:
Created WireGuardInterface object.
- Return type:
Examples
Basic interface:
wg = network.wireguard.create( name="wg0", ip_address="10.100.0.1/24" )
Interface with custom port:
wg = network.wireguard.create( name="wg-remote", ip_address="10.100.0.1/24", listen_port=51821, endpoint_ip="203.0.113.50" )
- class pyvergeos.resources.wireguard.WireGuardPeerManager[source]
Bases:
ResourceManager[WireGuardPeer]Manager for WireGuard VPN peers.
Peers define remote endpoints that can connect to the WireGuard tunnel.
This is a sub-resource manager that operates on a specific WireGuard interface.
Examples
List peers for an interface:
peers = interface.peers.list()
Create a site-to-site peer:
peer = interface.peers.create( name="remote-office", peer_ip="10.100.0.2", public_key="abc123...", allowed_ips="192.168.1.0/24" )
Create a remote user peer:
peer = interface.peers.create( name="laptop", peer_ip="10.100.0.10", public_key="xyz789...", allowed_ips="10.100.0.10/32", firewall_config="remote_user", keepalive=25 )
Get peer configuration:
config = peer.get_config()
- __init__(client, interface)[source]
- Parameters:
client (VergeClient)
interface (WireGuardInterface)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List peers for this WireGuard interface.
- Parameters:
- Returns:
List of WireGuardPeer objects.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a single peer by key or name.
- Parameters:
- Returns:
WireGuardPeer object.
- Raises:
NotFoundError – If peer not found.
ValueError – If neither key nor name provided.
- Return type:
- create(name, peer_ip, public_key, allowed_ips, *, endpoint=None, port=51820, preshared_key=None, keepalive=0, firewall_config='site_to_site', description='', enabled=True)[source]
Create a new WireGuard peer.
- Parameters:
name (str) – Unique name for the peer.
peer_ip (str) – Tunnel IP address for the peer (e.g., “10.100.0.2”).
public_key (str) – Public key of the remote peer (base64 encoded).
allowed_ips (str) – Comma-separated allowed IP ranges (e.g., “192.168.1.0/24”).
endpoint (str | None) – Remote peer IP/hostname (empty for roaming clients).
port (int) – Remote peer port (default: 51820).
preshared_key (str | None) – Optional preshared key for post-quantum resistance.
keepalive (int) – Keepalive interval in seconds (0 = disabled).
firewall_config (Literal['site_to_site', 'remote_user', 'none']) – Firewall rule configuration: - “site_to_site”: Create routes and accept rules for allowed IPs - “remote_user”: Same as site-to-site plus SNAT for outbound traffic - “none”: Don’t create any firewall rules
description (str) – Peer description.
enabled (bool) – Whether the peer is enabled.
- Returns:
Created WireGuardPeer object.
- Return type:
Examples
Site-to-site peer:
peer = interface.peers.create( name="remote-office", peer_ip="10.100.0.2", public_key="abc123...", allowed_ips="192.168.1.0/24", endpoint="vpn.remote-office.com" )
Remote user (roaming client):
peer = interface.peers.create( name="laptop", peer_ip="10.100.0.10", public_key="xyz789...", allowed_ips="10.100.0.10/32", firewall_config="remote_user", keepalive=25 )
- update(key, **kwargs)[source]
Update an existing WireGuard peer.
- Parameters:
key (int) – Peer $key (ID).
**kwargs (Any) – Attributes to update. Supports: - name: New name - peer_ip: New peer tunnel IP - public_key: New public key - allowed_ips: New allowed IPs - endpoint: New endpoint - port: New port - preshared_key: New preshared key - keepalive: New keepalive interval - firewall_config: New firewall configuration - description: New description - enabled: Enable/disable peer
- Returns:
Updated WireGuardPeer object.
- Return type:
- delete(key)[source]
Delete a WireGuard peer.
- Parameters:
key (int) – Peer $key (ID).
- Return type:
None
- get_config(key)[source]
Get the WireGuard configuration for a peer.
Retrieves the WireGuard config file content that can be used by the remote peer to connect to this tunnel.
- Parameters:
key (int) – Peer $key (ID).
- Returns:
WireGuard configuration file content as string.
- Raises:
NotFoundError – If peer not found.
ValueError – If configuration cannot be retrieved.
- Return type:
Examples
Get and save peer config:
config = interface.peers.get_config(peer.key) with open("wg0.conf", "w") as f: f.write(config)
Note
Configuration is only available for peers that were created with the autogenerate_peer option enabled in the VergeOS UI.
Tenant Proxy
Reverse proxy for multi-tenant FQDN-based access.
Network proxy resource managers for multi-tenant FQDN-based access.
- class pyvergeos.resources.vnet_proxy.VnetProxyTenant[source]
Bases:
ResourceObjectTenant FQDN mapping for proxy service.
Maps a tenant to an FQDN for access through the network’s proxy service. Multiple tenants can share a single IP address by using different FQDNs.
- refresh()[source]
Refresh this tenant mapping from the API.
- Returns:
Updated VnetProxyTenant instance.
- Return type:
- class pyvergeos.resources.vnet_proxy.VnetProxyTenantManager[source]
Bases:
ResourceManager[VnetProxyTenant]Manager for proxy tenant FQDN mappings.
Scoped to a specific proxy configuration. Access via VnetProxy.tenants.
Examples
List all tenant mappings:
tenants = proxy.tenants.list()
Get a specific mapping:
mapping = proxy.tenants.get(key=1) mapping = proxy.tenants.get(fqdn="tenant1.example.com")
Create a new mapping:
mapping = proxy.tenants.create( tenant=tenant_key, fqdn="tenant1.example.com" )
Delete a mapping:
proxy.tenants.delete(key=1)
- __init__(client, proxy)[source]
Initialize the proxy tenant manager.
- Parameters:
client (VergeClient) – VergeClient instance.
proxy (VnetProxy) – Parent VnetProxy object.
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List proxy tenant mappings.
- Parameters:
- Returns:
List of VnetProxyTenant objects.
- Return type:
- get(key=None, *, fqdn=None, tenant=None, fields=None)[source]
Get a proxy tenant mapping by key, FQDN, or tenant.
- Parameters:
- Returns:
VnetProxyTenant object.
- Raises:
NotFoundError – If mapping not found.
ValueError – If no lookup parameter provided.
- Return type:
- create(tenant, fqdn, **kwargs)[source]
Create a new proxy tenant mapping.
Maps a tenant to an FQDN for access through this proxy service.
- Parameters:
- Returns:
Created VnetProxyTenant object.
- Return type:
Examples
Create a tenant mapping:
mapping = proxy.tenants.create( tenant=5, fqdn="tenant1.example.com" )
- class pyvergeos.resources.vnet_proxy.VnetProxy[source]
Bases:
ResourceObjectNetwork proxy configuration.
Enables multi-tenant access through a single IP address using FQDN mapping. Each tenant is assigned a unique FQDN that routes to their UI through the proxy service.
- property listen_address: str
Get the proxy listen address.
- Returns:
Listen address (default “0.0.0.0” for all addresses).
- property default_self: bool
Check if proxy defaults to self when no tenant matches.
When True, requests with no matching FQDN will show this system’s UI.
- property tenants: VnetProxyTenantManager
Access tenant FQDN mappings for this proxy.
- Returns:
VnetProxyTenantManager for this proxy.
Examples
List all tenant mappings:
for mapping in proxy.tenants.list(): print(f"{mapping.fqdn} -> Tenant {mapping.tenant_name}")
Create a new mapping:
mapping = proxy.tenants.create( tenant=tenant_key, fqdn="newtenant.example.com" )
- refresh()[source]
Refresh this proxy configuration from the API.
- Returns:
Updated VnetProxy instance.
- Return type:
- class pyvergeos.resources.vnet_proxy.VnetProxyManager[source]
Bases:
ResourceManager[VnetProxy]Manager for network proxy configuration.
Scoped to a specific network. Access via Network.proxy.
The proxy service allows multiple tenants to share a single external IP address by using FQDN-based routing. Each tenant is assigned a unique hostname that routes to their UI through the proxy.
Examples
Get proxy configuration for a network:
proxy = network.proxy.get() print(f"Listen address: {proxy.listen_address}")
Create/enable proxy on a network:
proxy = network.proxy.create( listen_address="0.0.0.0", default_self=True )
List tenant mappings:
for mapping in proxy.tenants.list(): print(f"{mapping.fqdn} -> {mapping.tenant_name}")
Add a tenant mapping:
mapping = proxy.tenants.create( tenant=tenant_key, fqdn="tenant1.example.com" )
Note
Only one proxy configuration can exist per network. The proxy service is typically used on external networks.
- __init__(client, network)[source]
Initialize the proxy manager.
- Parameters:
client (VergeClient) – VergeClient instance.
network (Network) – Parent Network object.
- Return type:
None
- exists()[source]
Check if proxy is configured for this network.
- Returns:
True if proxy configuration exists.
- Return type:
- get(key=None, *, fields=None)[source]
Get the proxy configuration for this network.
- Parameters:
- Returns:
VnetProxy object.
- Raises:
NotFoundError – If proxy not configured for this network.
- Return type:
- create(listen_address='0.0.0.0', default_self=True, **kwargs)[source]
Create/enable proxy configuration for this network.
- Parameters:
- Returns:
Created VnetProxy object.
- Return type:
Note
Only one proxy configuration can exist per network. Creating a proxy when one already exists will raise an error.
Examples
Enable proxy with defaults:
proxy = network.proxy.create()
Enable proxy with custom listen address:
proxy = network.proxy.create(listen_address="192.168.1.1")
- delete(key=None)[source]
Delete proxy configuration for this network.
- Parameters:
key (int | None) – Proxy $key (ID). If not provided, deletes the proxy for this network.
- Return type:
None
Note
This will also delete all associated tenant mappings.
- get_or_create(listen_address='0.0.0.0', default_self=True, **kwargs)[source]
Get existing proxy or create new one.
Convenience method that returns existing proxy configuration or creates a new one with the provided settings.
- Parameters:
- Returns:
VnetProxy object (existing or newly created).
- Return type:
Examples
Ensure proxy is configured:
proxy = network.proxy.get_or_create()
Tenants
Tenant Management
Tenant resource manager.
- class pyvergeos.resources.tenant_manager.Tenant[source]
Bases:
ResourceObjectTenant resource object.
- power_on(preferred_node=None)[source]
Power on the tenant.
- Parameters:
preferred_node (int | None) – Node $key to start tenant on.
- Returns:
Self for chaining.
- Raises:
ValueError – If tenant is a snapshot.
- Return type:
- power_off()[source]
Power off the tenant gracefully.
- Returns:
Self for chaining.
- Raises:
ValueError – If tenant is a snapshot.
- Return type:
- reset()[source]
Reset the tenant (hard reboot).
- Returns:
Self for chaining.
- Raises:
ValueError – If tenant is a snapshot.
- Return type:
- clone(name=None, no_network=False, no_storage=False, no_nodes=False)[source]
Clone this tenant.
- Parameters:
- Returns:
Clone task information.
- Raises:
ValueError – If tenant is a snapshot.
- Return type:
- property snapshots: TenantSnapshotManager
Get the snapshot manager for this tenant.
- Returns:
TenantSnapshotManager for managing tenant snapshots.
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> snapshots = tenant.snapshots.list() >>> tenant.snapshots.create("pre-upgrade")
- property storage: TenantStorageManager
Get the storage manager for this tenant.
- Returns:
TenantStorageManager for managing tenant storage allocations.
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> # List storage allocations >>> for alloc in tenant.storage.list(): ... print(f"{alloc.tier_name}: {alloc.provisioned_gb} GB") >>> # Add storage from Tier 1 >>> tenant.storage.create(tier=1, provisioned_gb=100)
- property nodes: TenantNodeManager
Get the node manager for this tenant.
- Returns:
TenantNodeManager for managing tenant compute nodes.
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> # List nodes >>> for node in tenant.nodes.list(): ... print(f"{node.name}: {node.cpu_cores} cores, {node.ram_gb} GB") >>> # Add a node with 4 cores and 16 GB RAM >>> tenant.nodes.create(cpu_cores=4, ram_gb=16, cluster=1)
- property network_blocks: TenantNetworkBlockManager
Get the network block manager for this tenant.
- Returns:
TenantNetworkBlockManager for managing tenant network blocks.
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> # List network blocks >>> for block in tenant.network_blocks.list(): ... print(f"{block.cidr} on {block.network_name}") >>> # Assign a network block >>> tenant.network_blocks.create(network=1, cidr="192.168.100.0/24")
- property external_ips: TenantExternalIPManager
Get the external IP manager for this tenant.
- Returns:
TenantExternalIPManager for managing tenant external IPs.
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> # List external IPs >>> for ip in tenant.external_ips.list(): ... print(f"{ip.ip_address} on {ip.network_name}") >>> # Assign an external IP >>> tenant.external_ips.create(network=1, ip="192.168.1.100")
- property l2_networks: TenantLayer2Manager
Get the Layer 2 network manager for this tenant.
- Returns:
TenantLayer2Manager for managing tenant Layer 2 networks.
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> # List Layer 2 networks >>> for l2 in tenant.l2_networks.list(): ... print(f"{l2.network_name}: {l2.is_enabled}") >>> # Assign a Layer 2 network >>> tenant.l2_networks.create(network_name="VLAN100")
Get shared objects for this tenant.
Returns a list of shared objects (VMs) shared with this tenant.
- Returns:
List of SharedObject objects.
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> for obj in tenant.shared_objects: ... print(f"{obj.name}: {obj.object_type}")
- property stats: TenantStatsManager
Get the stats manager for this tenant.
- Returns:
TenantStatsManager for accessing tenant metrics and history.
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> # Get current stats >>> stats = tenant.stats.get() >>> print(f"RAM: {stats.ram_used_mb}MB") >>> # Get stats history for billing/capacity planning >>> history = tenant.stats.history_short(limit=100) >>> for point in history: ... print(f"{point.timestamp}: CPU {point.total_cpu}%")
- property logs: TenantLogManager
Get the log manager for this tenant.
- Returns:
TenantLogManager for accessing tenant-specific logs.
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> # Get recent logs >>> logs = tenant.logs.list(limit=20) >>> # Get errors only >>> errors = tenant.logs.list(errors_only=True) >>> for log in errors: ... print(f"[{log.level}] {log.text}")
- set_ui_ip(ip, network_name='External')[source]
Set the UI IP address for this tenant.
Creates a virtual IP address on the specified network that allows external access to the tenant’s UI. This is the proper way to assign a tenant UI address.
- Parameters:
- Returns:
Created vnet_address response.
- Raises:
ValueError – If tenant is a snapshot.
NotFoundError – If the network is not found.
- Return type:
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> tenant.set_ui_ip("192.168.10.79")
- send_file(file_key)[source]
Send a file to this tenant.
Shares a file from the parent vSAN with the tenant. This allows tenants to access specific files (ISOs, disk images, etc.) within their own Files section. The process is near-instant as it uses a branch command rather than copying the file.
- Parameters:
file_key (int) – The $key of the file to share with the tenant.
- Returns:
Action response, or None if no response body.
- Raises:
ValueError – If tenant is a snapshot.
- Return type:
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> # Get the file to share >>> file = client.files.get(name="ubuntu-22.04.iso") >>> tenant.send_file(file.key)
- create_crash_cart(name=None)[source]
Deploy a Crash Cart VM for emergency access to this tenant.
Deploys a Crash Cart VM that provides emergency UI access to a tenant. This is useful when normal tenant access is unavailable. The Crash Cart VM connects to the tenant’s internal network and provides a web-based console for troubleshooting.
- Parameters:
name (str | None) – The name for the Crash Cart VM. Defaults to “Crash Cart - {tenant_name}”.
- Returns:
Recipe deployment response, or None if no response body.
- Raises:
ValueError – If tenant is a snapshot.
NotFoundError – If the Crash Cart recipe is not available.
- Return type:
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> tenant.create_crash_cart() >>> # Access the crash cart VM console >>> vm = client.vms.get(name="Crash Cart - my-tenant")
- delete_crash_cart(name=None)[source]
Remove a Crash Cart VM deployed for this tenant.
Removes the Crash Cart VM that was deployed for emergency tenant access. The VM must be stopped before removal. This should be called after troubleshooting is complete.
- Parameters:
name (str | None) – The name of the Crash Cart VM to remove. Defaults to “Crash Cart - {tenant_name}”.
- Raises:
ValueError – If tenant is a snapshot.
NotFoundError – If the Crash Cart VM is not found.
APIError – If the VM is still running or cannot be deleted.
- Return type:
None
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> # Stop the crash cart first >>> vm = client.vms.get(name="Crash Cart - my-tenant") >>> vm.power_off() >>> # Wait for it to stop, then delete >>> tenant.delete_crash_cart()
- enable_isolation()[source]
Enable network isolation mode for this tenant.
Enables isolation mode which disables the tenant’s network connectivity. This is useful for security purposes or when performing maintenance that requires network isolation.
- Returns:
Self for chaining.
- Raises:
ValueError – If tenant is a snapshot or already isolated.
- Return type:
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> tenant.enable_isolation() >>> # Tenant network is now disabled
- disable_isolation()[source]
Disable network isolation mode for this tenant.
Disables isolation mode which restores the tenant’s network connectivity. Use this after troubleshooting or security investigation is complete.
- Returns:
Self for chaining.
- Raises:
ValueError – If tenant is a snapshot or not isolated.
- Return type:
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> tenant.disable_isolation() >>> # Tenant network is now enabled
- connect(username, password, verify_ssl=None, timeout=30)[source]
Connect to the tenant’s VergeOS context.
Creates a new VergeClient connected to the tenant’s environment, allowing you to execute commands within the tenant’s context. The tenant must be running to connect.
- Parameters:
- Returns:
A new VergeClient connected to the tenant.
- Raises:
ValueError – If tenant is a snapshot or not running.
ValueError – If tenant has no UI address configured.
VergeConnectionError – If connection to tenant fails.
AuthenticationError – If tenant credentials are invalid.
- Return type:
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> tenant.power_on() >>> # Wait for tenant to start... >>> tenant_client = tenant.connect( ... username="admin", ... password="tenant-password" ... ) >>> # Now use tenant_client to manage resources within the tenant >>> tenant_vms = tenant_client.vms.list() >>> tenant_client.disconnect()
- class pyvergeos.resources.tenant_manager.TenantManager[source]
Bases:
ResourceManager[Tenant]Manager for Tenant operations.
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, include_snapshots=False, **filter_kwargs)[source]
List tenants with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (defaults to rich field set).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
include_snapshots (bool) – Include tenant snapshots (default False).
**filter_kwargs (Any) – Shorthand filter arguments.
- Returns:
List of Tenant objects.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a single tenant by key or name.
- Parameters:
- Returns:
Tenant object.
- Raises:
NotFoundError – If tenant not found.
ValueError – If neither key nor name provided.
- Return type:
- create(name, password=None, description='', url=None, note=None, expose_cloud_snapshots=True, allow_branding=False, require_password_change=False, **kwargs)[source]
Create a new tenant.
The tenant is created in a stopped state by default.
- Parameters:
name (str) – Tenant name (required, 1-120 characters).
password (str | None) – Password for the auto-created admin user. If not specified, a random password is generated.
description (str) – Tenant description.
url (str | None) – URL associated with the tenant.
note (str | None) – Note for the tenant.
expose_cloud_snapshots (bool) – Allow tenant to request cloud snapshots (default True).
allow_branding (bool) – Allow tenant to customize branding (default False).
require_password_change (bool) – Require password change on first login (default False).
**kwargs (Any) – Additional tenant properties.
- Returns:
Created Tenant object.
- Return type:
- update(key, **kwargs)[source]
Update an existing tenant.
- Parameters:
key (int) – Tenant $key (ID).
**kwargs (Any) – Attributes to update. Supported fields include: - name: New name for the tenant - description: Tenant description - url: URL associated with the tenant - note: Note for the tenant - expose_cloud_snapshots: Allow cloud snapshots - allow_branding: Allow branding customization
- Returns:
Updated Tenant object.
- Return type:
- clone(key, name=None, no_network=False, no_storage=False, no_nodes=False)[source]
Clone a tenant.
- Parameters:
key (int) – Tenant $key (ID) of the source tenant.
name (str | None) – Name for the clone. If not provided, a default name is generated.
no_network (bool) – Do not clone the network configuration.
no_storage (bool) – Do not clone the storage configuration.
no_nodes (bool) – Do not clone the nodes (VMs).
- Returns:
Clone task information.
- Return type:
- snapshots(tenant_key)[source]
Get the snapshot manager for a specific tenant.
- Parameters:
tenant_key (int) – Tenant $key (ID).
- Returns:
TenantSnapshotManager for managing tenant snapshots.
- Return type:
Example
>>> # Access snapshot manager directly by tenant key >>> snapshot_manager = client.tenants.snapshots(123) >>> snapshots = snapshot_manager.list()
- storage(tenant_key)[source]
Get the storage manager for a specific tenant.
- Parameters:
tenant_key (int) – Tenant $key (ID).
- Returns:
TenantStorageManager for managing tenant storage allocations.
- Return type:
Example
>>> # Access storage manager directly by tenant key >>> storage_manager = client.tenants.storage(123) >>> allocations = storage_manager.list()
- nodes(tenant_key)[source]
Get the node manager for a specific tenant.
- Parameters:
tenant_key (int) – Tenant $key (ID).
- Returns:
TenantNodeManager for managing tenant compute nodes.
- Return type:
Example
>>> # Access node manager directly by tenant key >>> node_manager = client.tenants.nodes(123) >>> nodes = node_manager.list()
- network_blocks(tenant_key)[source]
Get the network block manager for a specific tenant.
- Parameters:
tenant_key (int) – Tenant $key (ID).
- Returns:
TenantNetworkBlockManager for managing tenant network blocks.
- Return type:
Example
>>> # Access network block manager directly by tenant key >>> block_manager = client.tenants.network_blocks(123) >>> blocks = block_manager.list()
- external_ips(tenant_key)[source]
Get the external IP manager for a specific tenant.
- Parameters:
tenant_key (int) – Tenant $key (ID).
- Returns:
TenantExternalIPManager for managing tenant external IPs.
- Return type:
Example
>>> # Access external IP manager directly by tenant key >>> ip_manager = client.tenants.external_ips(123) >>> ips = ip_manager.list()
- l2_networks(tenant_key)[source]
Get the Layer 2 network manager for a specific tenant.
- Parameters:
tenant_key (int) – Tenant $key (ID).
- Returns:
TenantLayer2Manager for managing tenant Layer 2 networks.
- Return type:
Example
>>> # Access Layer 2 network manager directly by tenant key >>> l2_manager = client.tenants.l2_networks(123) >>> l2_networks = l2_manager.list()
- connect_context(key=None, *, name=None, username, password, verify_ssl=None, timeout=30)[source]
Connect to a tenant’s VergeOS context.
Creates a new VergeClient connected to the tenant’s environment, allowing you to execute commands within the tenant’s context. The tenant must be running to connect.
- Parameters:
key (int | None) – Tenant $key (ID).
name (str | None) – Tenant name (alternative to key).
username (str) – Username for authenticating to the tenant.
password (str) – Password for authenticating to the tenant.
verify_ssl (bool | None) – Whether to verify SSL certificates. If None, inherits from the parent client.
timeout (int) – Connection timeout in seconds.
- Returns:
A new VergeClient connected to the tenant.
- Raises:
NotFoundError – If tenant not found.
ValueError – If tenant is a snapshot or not running.
ValueError – If tenant has no UI address configured.
VergeConnectionError – If connection to tenant fails.
AuthenticationError – If tenant credentials are invalid.
- Return type:
Example
>>> # Connect to tenant by name >>> tenant_client = client.tenants.connect_context( ... name="my-tenant", ... username="admin", ... password="tenant-password" ... ) >>> # Now use tenant_client to manage resources within the tenant >>> tenant_vms = tenant_client.vms.list() >>> tenant_client.disconnect()
>>> # Or connect by key >>> tenant_client = client.tenants.connect_context( ... key=123, ... username="admin", ... password="tenant-password" ... )
Get shared objects for a specific tenant.
- Parameters:
tenant_key (int) – Tenant $key (ID).
- Returns:
List of SharedObject objects shared with the tenant.
- Return type:
Example
>>> shared = client.tenants.shared_objects(123) >>> for obj in shared: ... print(f"{obj.name}: {obj.object_type}")
- send_file(key, file_key)[source]
Send a file to a tenant.
Shares a file from the parent vSAN with the tenant. This allows tenants to access specific files (ISOs, disk images, etc.) within their own Files section. The process is near-instant as it uses a branch command rather than copying the file.
- Parameters:
- Returns:
Action response, or None if no response body.
- Return type:
Example
>>> file = client.files.get(name="ubuntu-22.04.iso") >>> client.tenants.send_file(123, file.key)
- create_crash_cart(key, name=None)[source]
Deploy a Crash Cart VM for emergency access to a tenant.
Deploys a Crash Cart VM that provides emergency UI access to a tenant. This is useful when normal tenant access is unavailable. The Crash Cart VM connects to the tenant’s internal network and provides a web-based console for troubleshooting.
- Parameters:
- Returns:
Recipe deployment response, or None if no response body.
- Raises:
NotFoundError – If the Crash Cart recipe is not available.
- Return type:
Example
>>> client.tenants.create_crash_cart(123) >>> # Or with a custom name >>> client.tenants.create_crash_cart(123, name="Emergency Access VM")
- delete_crash_cart(key, name=None)[source]
Remove a Crash Cart VM deployed for a tenant.
Removes the Crash Cart VM that was deployed for emergency tenant access. The VM must be stopped before removal. This should be called after troubleshooting is complete.
- Parameters:
- Raises:
NotFoundError – If the Crash Cart VM is not found.
APIError – If the VM is still running or cannot be deleted.
- Return type:
None
Example
>>> client.tenants.delete_crash_cart(123)
- enable_isolation(key)[source]
Enable network isolation mode for a tenant.
Enables isolation mode which disables the tenant’s network connectivity. This is useful for security purposes or when performing maintenance that requires network isolation.
- Parameters:
key (int) – Tenant $key (ID).
- Returns:
Action response, or None if no response body.
- Return type:
Example
>>> client.tenants.enable_isolation(123)
- disable_isolation(key)[source]
Disable network isolation mode for a tenant.
Disables isolation mode which restores the tenant’s network connectivity. Use this after troubleshooting or security investigation is complete.
- Parameters:
key (int) – Tenant $key (ID).
- Returns:
Action response, or None if no response body.
- Return type:
Example
>>> client.tenants.disable_isolation(123)
Tenant Stats & Monitoring
Resource utilization and activity logging for tenants.
Tenant Stats & Monitoring resource managers.
This module provides access to tenant performance metrics, status, logs, and dashboard information for monitoring and billing/chargeback purposes.
Example
>>> # Access tenant stats
>>> tenant = client.tenants.get(name="customer-a")
>>> stats = tenant.stats.get()
>>> print(f"RAM: {stats.ram_used_mb}MB")
>>> # Access stats history for billing/capacity planning
>>> history = tenant.stats.history_short(limit=100)
>>> for point in history:
... print(f"{point.timestamp}: CPU {point.total_cpu}%, RAM {point.ram_used_mb}MB")
>>> # Access tenant-specific logs
>>> logs = tenant.logs.list(level="error")
>>> for log in logs:
... print(f"[{log.level}] {log.text}")
>>> # Access dashboard summary
>>> dashboard = client.tenant_dashboard.get()
>>> print(f"Online: {dashboard.tenants_online}/{dashboard.tenants_count}")
- class pyvergeos.resources.tenant_stats.TenantStats[source]
Bases:
ResourceObjectTenant statistics resource object.
Provides current performance metrics for a tenant.
- class pyvergeos.resources.tenant_stats.TenantStatsHistory[source]
Bases:
ResourceObjectTenant statistics history record.
Represents a single time point in the stats history with comprehensive resource utilization metrics for billing and capacity planning.
- get_tier_stats(tier)[source]
Get stats for a specific storage tier.
- Parameters:
tier (int) – Tier number (0-5).
- Returns:
Dict with provisioned, used, allocated, and pct values.
- Raises:
ValueError – If tier is not 0-5.
- Return type:
- class pyvergeos.resources.tenant_stats.TenantStatsManager[source]
Bases:
ResourceManager[TenantStats]Manager for tenant statistics.
Provides access to current and historical performance metrics for a tenant. Scoped to a specific tenant.
Example
>>> # Get current stats >>> stats = manager.get() >>> print(f"RAM: {stats.ram_used_mb}MB")
>>> # Get short-term history (high resolution) >>> history = manager.history_short(limit=100)
>>> # Get long-term history (lower resolution, longer retention) >>> history = manager.history_long(limit=1000)
- __init__(client, tenant)[source]
- Parameters:
client (VergeClient)
tenant (Tenant)
- Return type:
None
- get(fields=None)[source]
Get current tenant statistics.
- Parameters:
- Returns:
TenantStats object.
- Raises:
NotFoundError – If stats not found for this tenant.
- Return type:
- history_short(limit=None, offset=None, since=None, until=None, fields=None)[source]
Get short-term stats history (high resolution).
- Parameters:
- Returns:
List of TenantStatsHistory objects, sorted by timestamp descending.
- Return type:
- history_long(limit=None, offset=None, since=None, until=None, fields=None)[source]
Get long-term stats history (lower resolution, longer retention).
- Parameters:
- Returns:
List of TenantStatsHistory objects, sorted by timestamp descending.
- Return type:
- class pyvergeos.resources.tenant_stats.TenantLog[source]
Bases:
ResourceObjectTenant log entry resource object.
- class pyvergeos.resources.tenant_stats.TenantLogManager[source]
Bases:
ResourceManager[TenantLog]Manager for tenant logs.
Provides access to log entries for a tenant. Scoped to a specific tenant.
Example
>>> # Get recent logs >>> logs = manager.list(limit=20)
>>> # Get errors only >>> errors = manager.list(level="error")
>>> # Get logs since a specific time >>> logs = manager.list(since=datetime.now() - timedelta(hours=1))
- __init__(client, tenant)[source]
- Parameters:
client (VergeClient)
tenant (Tenant)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, level=None, errors_only=False, warnings_only=False, since=None, until=None, **filter_kwargs)[source]
List tenant log entries.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
level (Literal['audit', 'message', 'warning', 'error', 'critical', 'summary', 'debug'] | None) – Filter by log level.
errors_only (bool) – Only return error and critical logs.
warnings_only (bool) – Only return warning logs.
since (datetime | int | None) – Return logs after this time (datetime or epoch microseconds).
until (datetime | int | None) – Return logs before this time (datetime or epoch microseconds).
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of TenantLog objects, sorted by timestamp descending.
- Return type:
- get(key=None, *, fields=None)[source]
Get a specific log entry by key.
- Parameters:
- Returns:
TenantLog object.
- Raises:
NotFoundError – If log entry not found.
ValueError – If key not provided.
- Return type:
- class pyvergeos.resources.tenant_stats.TenantDashboard[source]
Bases:
ResourceObjectTenant dashboard with aggregated metrics.
Provides a high-level overview of tenant status and resource utilization across all tenants in the system.
- class pyvergeos.resources.tenant_stats.TenantDashboardManager[source]
Bases:
ResourceManager[TenantDashboard]Manager for tenant dashboard.
Provides aggregated tenant metrics and status counts.
Example
>>> dashboard = client.tenant_dashboard.get() >>> print(f"Online: {dashboard.tenants_online}/{dashboard.tenants_count}") >>> print(f"Errors: {dashboard.tenants_error}")
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
Tenant Storage
Tenant storage allocation resource manager.
- class pyvergeos.resources.tenant_storage.TenantStorage[source]
Bases:
ResourceObjectTenant Storage allocation resource object.
Represents a storage tier allocation for a tenant. Each tenant can have allocations from different storage tiers. Values are in bytes but convenience properties provide GB conversions.
- class pyvergeos.resources.tenant_storage.TenantStorageManager[source]
Bases:
ResourceManager[TenantStorage]Manager for Tenant Storage allocation operations.
This manager handles storage tier allocations for tenants. Each tenant can have storage allocated from one or more storage tiers.
This manager is accessed through a Tenant object’s storage property or via client.tenants.storage(tenant_key).
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> # List all storage allocations >>> for alloc in tenant.storage.list(): ... print(f"{alloc.tier_name}: {alloc.provisioned_gb} GB") >>> # Add storage from Tier 1 >>> tenant.storage.create(tier=1, provisioned_gb=100) >>> # Update allocation >>> tenant.storage.update_by_tier(1, provisioned_gb=200)
- __init__(client, tenant)[source]
- Parameters:
client (VergeClient)
tenant (Tenant)
- Return type:
None
- list(filter=None, fields=None, tier=None, **kwargs)[source]
List storage allocations for this tenant.
- get(key=None, *, tier=None, fields=None)[source]
Get a storage allocation by key or tier number.
- Parameters:
- Returns:
TenantStorage object.
- Raises:
NotFoundError – If allocation not found.
ValueError – If neither key nor tier provided.
- Return type:
- create(tier, provisioned_gb=None, provisioned_bytes=None)[source]
Create a new storage allocation for this tenant.
- Parameters:
- Returns:
Created TenantStorage object.
- Raises:
ValueError – If tenant is a snapshot, tier is invalid, or no size specified.
ConflictError – If an allocation for this tier already exists.
- Return type:
- update(key, **kwargs)[source]
Update a storage allocation.
- Parameters:
- Returns:
Updated TenantStorage object.
- Return type:
- update_by_tier(tier, provisioned_gb=None, provisioned_bytes=None)[source]
Update a storage allocation by tier number.
- Parameters:
- Returns:
Updated TenantStorage object.
- Raises:
NotFoundError – If no allocation exists for this tier.
ValueError – If no size specified.
- Return type:
- delete(key)[source]
Delete a storage allocation.
- Parameters:
key (int) – Storage allocation $key (ID).
- Return type:
None
Warning
Removing a storage allocation with data may cause data loss. Ensure the allocation is empty before removal.
- delete_by_tier(tier)[source]
Delete a storage allocation by tier number.
- Parameters:
tier (int) – Tier number (1-5).
- Raises:
NotFoundError – If no allocation exists for this tier.
- Return type:
None
Warning
Removing a storage allocation with data may cause data loss. Ensure the allocation is empty before removal.
Tenant Network Blocks
Tenant network block resource manager.
- class pyvergeos.resources.tenant_network_blocks.TenantNetworkBlock[source]
Bases:
ResourceObjectTenant Network Block resource object.
Represents a CIDR network block assigned to a tenant from a parent network. These blocks allow tenants to have entire subnets routed to them.
- class pyvergeos.resources.tenant_network_blocks.TenantNetworkBlockManager[source]
Bases:
ResourceManager[TenantNetworkBlock]Manager for Tenant Network Block operations.
This manager handles CIDR network blocks assigned to tenants. Network blocks allow routing entire subnets from a parent network to a tenant.
This manager is accessed through a Tenant object’s network_blocks property or via client.tenants.network_blocks(tenant_key).
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> # List network blocks >>> for block in tenant.network_blocks.list(): ... print(f"{block.cidr} on {block.network_name}") >>> # Assign a network block >>> tenant.network_blocks.create(network=1, cidr="192.168.100.0/24")
- __init__(client, tenant)[source]
- Parameters:
client (VergeClient)
tenant (Tenant)
- Return type:
None
- list(filter=None, fields=None, cidr=None, **kwargs)[source]
List network blocks assigned to this tenant.
- get(key=None, *, cidr=None, fields=None)[source]
Get a network block by key or CIDR.
- Parameters:
- Returns:
TenantNetworkBlock object.
- Raises:
NotFoundError – If network block not found.
ValueError – If neither key nor cidr provided.
- Return type:
- create(cidr, network=None, network_name=None, description='')[source]
Assign a network block to this tenant.
- Parameters:
- Returns:
Created TenantNetworkBlock object.
- Raises:
ValueError – If tenant is a snapshot or neither network nor network_name provided.
NotFoundError – If network not found.
ConflictError – If CIDR already exists or overlaps.
- Return type:
- delete(key)[source]
Remove a network block assignment.
- Parameters:
key (int) – Network block $key (ID).
- Return type:
None
Warning
Removing a network block may disrupt connectivity for services using addresses in that range. Firewall rules referencing the block must be removed first.
- delete_by_cidr(cidr)[source]
Remove a network block by CIDR.
- Parameters:
cidr (str) – CIDR notation of the block to remove.
- Raises:
NotFoundError – If no block with this CIDR exists.
- Return type:
None
Tenant External IPs
Tenant external IP resource manager.
- class pyvergeos.resources.tenant_external_ips.TenantExternalIP[source]
Bases:
ResourceObjectTenant External IP resource object.
Represents a virtual IP address assigned to a tenant from a parent network. These external IPs can be used for NAT rules, services, or other networking purposes within the tenant’s environment.
- class pyvergeos.resources.tenant_external_ips.TenantExternalIPManager[source]
Bases:
ResourceManager[TenantExternalIP]Manager for Tenant External IP operations.
This manager handles virtual IP addresses assigned to tenants. External IPs allow tenants to have public or routable addresses from a parent network that can be used for NAT rules, services, or external connectivity.
This manager is accessed through a Tenant object’s external_ips property or via client.tenants.external_ips(tenant_key).
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> # List external IPs >>> for ip in tenant.external_ips.list(): ... print(f"{ip.ip_address} on {ip.network_name}") >>> # Assign an external IP >>> tenant.external_ips.create(network=1, ip="192.168.1.100")
- __init__(client, tenant)[source]
- Parameters:
client (VergeClient)
tenant (Tenant)
- Return type:
None
- list(filter=None, fields=None, ip=None, **kwargs)[source]
List external IPs assigned to this tenant.
- get(key=None, *, ip=None, fields=None)[source]
Get an external IP by key or IP address.
- Parameters:
- Returns:
TenantExternalIP object.
- Raises:
NotFoundError – If external IP not found.
ValueError – If neither key nor ip provided.
- Return type:
- create(ip, network=None, network_name=None, hostname=None, description='')[source]
Assign an external IP to this tenant.
- Parameters:
- Returns:
Created TenantExternalIP object.
- Raises:
ValueError – If tenant is a snapshot or neither network nor network_name provided.
NotFoundError – If network not found.
ConflictError – If IP already exists.
- Return type:
- delete(key)[source]
Remove an external IP assignment.
- Parameters:
key (int) – IP address $key (ID).
- Return type:
None
Warning
Removing an external IP may disrupt connectivity for services using that address. Firewall rules referencing the IP must be removed first.
- delete_by_ip(ip)[source]
Remove an external IP by IP address.
- Parameters:
ip (str) – IP address to remove.
- Raises:
NotFoundError – If no IP with this address exists.
- Return type:
None
Tenant Snapshots
Tenant snapshot resource manager.
- class pyvergeos.resources.tenant_snapshots.TenantSnapshot[source]
Bases:
ResourceObjectTenant Snapshot resource object.
- class pyvergeos.resources.tenant_snapshots.TenantSnapshotManager[source]
Bases:
ResourceManager[TenantSnapshot]Manager for Tenant Snapshot operations.
This manager is accessed through a Tenant object’s snapshots property or via client.tenants.snapshots(tenant_key).
- __init__(client, tenant)[source]
- Parameters:
client (VergeClient)
tenant (Tenant)
- Return type:
None
- get(key=None, *, name=None, fields=None)[source]
Get a snapshot by key or name.
- Parameters:
- Returns:
TenantSnapshot object.
- Raises:
NotFoundError – If snapshot not found.
ValueError – If neither key nor name provided.
- Return type:
- create(name, description='', expires_in_days=0, expires_at=None)[source]
Create a new snapshot for this tenant.
- Parameters:
- Returns:
Created TenantSnapshot object.
- Raises:
ValueError – If tenant is a snapshot.
ConflictError – If a snapshot with this name already exists.
- Return type:
- delete(key)[source]
Delete a snapshot.
- Parameters:
key (int) – Snapshot $key (ID).
- Return type:
None
- restore(key)[source]
Restore the tenant to a snapshot.
The tenant must be powered off before restoration. WARNING: All changes made after the snapshot was created will be lost.
- Parameters:
key (int) – Snapshot $key (ID).
- Returns:
Restore task information.
- Raises:
ValueError – If tenant is running.
- Return type:
Tenant Layer 2 Networks
Tenant Layer 2 network resource manager.
- class pyvergeos.resources.tenant_layer2.TenantLayer2Network[source]
Bases:
ResourceObjectTenant Layer 2 Network resource object.
Represents a Layer 2 network assignment that provides bridged connectivity between a parent network and a tenant. Layer 2 networks allow tenants direct access to parent network segments.
- enable()[source]
Enable this Layer 2 network assignment.
- Returns:
Updated TenantLayer2Network object.
- Return type:
- class pyvergeos.resources.tenant_layer2.TenantLayer2Manager[source]
Bases:
ResourceManager[TenantLayer2Network]Manager for Tenant Layer 2 Network operations.
This manager handles Layer 2 network assignments for tenants. Layer 2 networks provide bridged connectivity between parent and tenant networks, allowing tenants direct access to parent network segments.
Only certain network types can be assigned: internal, external, bgp, vpn, or bridged physical networks. A maximum of 28 Layer 2 networks can be assigned per tenant.
This manager is accessed through a Tenant object’s l2_networks property or via client.tenants.l2_networks(tenant_key).
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> # List Layer 2 networks >>> for l2 in tenant.l2_networks.list(): ... print(f"{l2.network_name}: {l2.is_enabled}") >>> # Assign a Layer 2 network >>> tenant.l2_networks.create(network_name="VLAN100")
- __init__(client, tenant)[source]
- Parameters:
client (VergeClient)
tenant (Tenant)
- Return type:
None
- get(key=None, *, network_name=None, fields=None)[source]
Get a Layer 2 network by key or network name.
- Parameters:
- Returns:
TenantLayer2Network object.
- Raises:
NotFoundError – If Layer 2 network not found.
ValueError – If neither key nor network_name provided.
- Return type:
- create(network=None, network_name=None, enabled=True)[source]
Assign a Layer 2 network to this tenant.
Only certain network types can be assigned as Layer 2 networks: internal, external, bgp, vpn, or bridged physical networks. A maximum of 28 Layer 2 networks can be assigned per tenant.
- Parameters:
- Returns:
Created TenantLayer2Network object.
- Raises:
ValueError – If tenant is a snapshot or neither network nor network_name provided.
NotFoundError – If network not found.
ConflictError – If network already assigned or max limit reached.
- Return type:
- update(key, enabled)[source]
Update a Layer 2 network assignment.
Only the enabled status can be modified. To change the network assignment, remove and recreate it.
- Parameters:
- Returns:
Updated TenantLayer2Network object.
- Return type:
- delete(key)[source]
Remove a Layer 2 network assignment.
- Parameters:
key (int) – Layer 2 network assignment $key (ID).
- Return type:
None
Warning
Removing a Layer 2 network disconnects the bridged connectivity between the parent and tenant networks. This may affect tenant workloads using that network segment.
- delete_by_network(network_name)[source]
Remove a Layer 2 network assignment by network name.
- Parameters:
network_name (str) – Name of the network to remove.
- Raises:
NotFoundError – If no assignment with this network exists.
- Return type:
None
Tenant Nodes
Tenant node (compute resource) allocation manager.
- class pyvergeos.resources.tenant_nodes.TenantNode[source]
Bases:
ResourceObjectTenant Node resource object.
Represents a virtual node allocated to a tenant. Each tenant can have one or more nodes providing CPU and RAM resources.
- class pyvergeos.resources.tenant_nodes.TenantNodeManager[source]
Bases:
ResourceManager[TenantNode]Manager for Tenant Node operations.
This manager handles compute node allocations for tenants. Each tenant can have one or more virtual nodes with CPU and RAM resources.
This manager is accessed through a Tenant object’s nodes property or via client.tenants.nodes(tenant_key).
Example
>>> tenant = client.tenants.get(name="my-tenant") >>> # List all nodes >>> for node in tenant.nodes.list(): ... print(f"{node.name}: {node.cpu_cores} cores, {node.ram_gb} GB") >>> # Add a node with 4 cores and 16 GB RAM >>> tenant.nodes.create(cpu_cores=4, ram_gb=16, cluster=1)
- __init__(client, tenant)[source]
- Parameters:
client (VergeClient)
tenant (Tenant)
- Return type:
None
- get(key=None, *, name=None, fields=None)[source]
Get a node by key or name.
- Parameters:
- Returns:
TenantNode object.
- Raises:
NotFoundError – If node not found.
ValueError – If neither key nor name provided.
- Return type:
- create(cpu_cores=4, ram_mb=None, ram_gb=None, cluster=1, preferred_node=None, name=None, description='')[source]
Create a new node for this tenant.
- Parameters:
cpu_cores (int) – Number of CPU cores (default: 4).
ram_mb (int | None) – RAM allocation in MB (use this or ram_gb).
ram_gb (int | None) – RAM allocation in GB (default: 16 GB if neither specified).
cluster (int) – Cluster key to run the node on (default: 1).
preferred_node (int | None) – Preferred physical node key.
name (str | None) – Node name (auto-generated if not specified).
description (str) – Node description.
- Returns:
Created TenantNode object.
- Raises:
ValueError – If tenant is a snapshot or invalid parameters.
- Return type:
Storage
NAS Services
NAS service management resources.
- class pyvergeos.resources.nas_services.NASService[source]
Bases:
ResourceObjectNAS service resource object.
Represents a NAS service VM that manages volumes and file shares.
- key
The NAS service unique identifier ($key).
- name
NAS service name.
- vm
The underlying VM key.
- max_imports
Maximum simultaneous import jobs.
- max_syncs
Maximum simultaneous sync jobs.
- disable_swap
Whether swap is disabled.
- read_ahead_kb_default
Read-ahead buffer size in KB.
- cifs
CIFS settings key.
- nfs
NFS settings key.
- property antivirus: NasServiceAntivirusManager
Get antivirus configuration manager for this NAS service.
- Returns:
NasServiceAntivirusManager scoped to this service.
Note
NAS service requires 8GB+ RAM for antivirus support.
Example
>>> # Get service antivirus config >>> svc_av = nas.antivirus.get()
>>> # Update settings >>> svc_av = nas.antivirus.update( ... key=svc_av.key, ... max_recursion=20 ... )
- class pyvergeos.resources.nas_services.CIFSSettings[source]
Bases:
ResourceObjectCIFS/SMB settings resource object.
Represents CIFS/SMB configuration for a NAS service.
- key
The CIFS settings unique identifier ($key).
- service
The parent NAS service key.
- workgroup
NetBIOS workgroup name.
- realm
Kerberos realm for AD.
- server_type
Server role (default, MEMBER, BDC, PDC).
- map_to_guest
How invalid users/passwords are handled.
- server_min_protocol
Minimum SMB protocol version.
- extended_acl_support
Whether extended ACLs are enabled.
- ad_status
Active Directory join status.
- class pyvergeos.resources.nas_services.NFSSettings[source]
Bases:
ResourceObjectNFS settings resource object.
Represents NFS configuration for a NAS service.
- key
The NFS settings unique identifier ($key).
- service
The parent NAS service key.
- enable_nfsv4
Whether NFSv4 is enabled.
- allowed_hosts
List of allowed hosts/networks.
- allow_all
Whether all hosts are allowed.
- squash
User/group squashing mode.
- data_access
Read-only or read-write.
- anonuid
Anonymous user ID.
- anongid
Anonymous group ID.
- class pyvergeos.resources.nas_services.NASServiceManager[source]
Bases:
ResourceManager[NASService]Manager for NAS service operations.
NAS services are specialized VMs that manage NAS volumes and file shares (CIFS/SMB and NFS).
Example
>>> # List all NAS services >>> for service in client.nas_services.list(): ... print(f"{service.name}: {service.volume_count} volumes")
>>> # Get a specific NAS service >>> nas = client.nas_services.get(name="NAS01")
>>> # Get CIFS settings >>> cifs = client.nas_services.get_cifs_settings(nas.key) >>> print(f"Workgroup: {cifs.workgroup}")
>>> # Update NFS settings >>> client.nas_services.set_nfs_settings(nas.key, enable_nfsv4=True)
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, status=None, **filter_kwargs)[source]
List NAS services with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
status (str | None) – Filter by VM status (running, stopped, etc.).
**filter_kwargs (Any) – Shorthand filter arguments (name, etc.).
- Returns:
List of NASService objects.
- Return type:
Example
>>> # List all NAS services >>> services = client.nas_services.list()
>>> # List running services only >>> running = client.nas_services.list(status="running")
>>> # Filter by name >>> nas01 = client.nas_services.list(name="NAS01")
- list_running()[source]
List all running NAS services.
- Returns:
List of running NASService objects.
- Return type:
- list_stopped()[source]
List all stopped NAS services.
- Returns:
List of stopped NASService objects.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a single NAS service by key or name.
- Parameters:
- Returns:
NASService object.
- Raises:
NotFoundError – If NAS service not found.
ValueError – If neither key nor name provided.
- Return type:
Example
>>> # Get by key >>> service = client.nas_services.get(1)
>>> # Get by name >>> service = client.nas_services.get(name="NAS01")
- create(name, *, hostname=None, network=None, cores=4, memory_gb=8, auto_update=False)[source]
Create a new NAS service by deploying the Services recipe.
- Parameters:
name (str) – Name for the new NAS service.
hostname (str | None) – Hostname for the NAS VM (defaults to name with invalid chars removed).
network (int | str | None) – Network to connect to (key or name). Defaults to ‘Internal’.
cores (int) – Number of CPU cores (default: 4).
memory_gb (int) – Amount of RAM in GB (default: 8).
auto_update (bool) – Enable auto-update on power off.
- Returns:
Created NASService object.
- Raises:
ValueError – If Services recipe not found or NAS service already exists.
- Return type:
Example
>>> # Create with defaults >>> nas = client.nas_services.create("NAS01")
>>> # Create with custom settings >>> nas = client.nas_services.create( ... "FileServer", ... network="Internal", ... cores=8, ... memory_gb=16 ... )
- update(key, *, description=None, cpu_cores=None, memory_gb=None, max_imports=None, max_syncs=None, disable_swap=None, read_ahead_kb=None)[source]
Update NAS service settings.
Updates both the underlying VM settings (CPU, RAM, description) and NAS-specific settings (max_imports, max_syncs, etc.).
- Parameters:
key (int) – NAS service $key (ID).
description (str | None) – New description.
cpu_cores (int | None) – Number of CPU cores (requires restart).
memory_gb (int | None) – Amount of RAM in GB (requires restart).
max_imports (int | None) – Maximum simultaneous import jobs (1-10).
max_syncs (int | None) – Maximum simultaneous sync jobs (1-10).
disable_swap (bool | None) – Disable swap on the NAS service.
read_ahead_kb (int | None) – Read-ahead buffer size (0=auto, 64, 128, 256, 512, 1024, 2048, 4096).
- Returns:
Updated NASService object.
- Return type:
Example
>>> # Update NAS settings >>> client.nas_services.update(1, max_imports=5, max_syncs=3)
>>> # Update VM resources (requires restart) >>> client.nas_services.update(1, cpu_cores=8, memory_gb=16)
- delete(key, *, force=False)[source]
Delete a NAS service.
The NAS service VM must be stopped before deletion. If the service has volumes, they must be removed first unless force=True.
- Parameters:
- Raises:
ValueError – If service is running or has volumes without force.
- Return type:
None
Example
>>> # Delete a stopped NAS service >>> client.nas_services.delete(1)
>>> # Force delete (removes all volumes and data) >>> client.nas_services.delete(1, force=True)
- power_on(key)[source]
Power on a NAS service.
- Parameters:
key (int) – NAS service $key (ID).
- Returns:
Task information dict or None.
- Return type:
Example
>>> client.nas_services.power_on(1)
- power_off(key, *, force=False)[source]
Power off a NAS service.
- Parameters:
- Returns:
Task information dict or None.
- Return type:
Example
>>> # Graceful shutdown >>> client.nas_services.power_off(1)
>>> # Force power off >>> client.nas_services.power_off(1, force=True)
- restart(key)[source]
Restart a NAS service.
- Parameters:
key (int) – NAS service $key (ID).
- Returns:
Task information dict or None.
- Return type:
Example
>>> client.nas_services.restart(1)
- get_cifs_settings(key)[source]
Get CIFS/SMB settings for a NAS service.
- Parameters:
key (int) – NAS service $key (ID).
- Returns:
CIFSSettings object.
- Raises:
NotFoundError – If CIFS settings not found.
- Return type:
Example
>>> cifs = client.nas_services.get_cifs_settings(1) >>> print(f"Workgroup: {cifs.workgroup}") >>> print(f"Min Protocol: {cifs.server_min_protocol}")
- set_cifs_settings(key, *, workgroup=None, min_protocol=None, guest_mapping=None, extended_acl_support=None)[source]
Update CIFS/SMB settings for a NAS service.
- Parameters:
key (int) – NAS service $key (ID).
workgroup (str | None) – NetBIOS workgroup name.
min_protocol (str | None) – Minimum SMB protocol version. Valid values: none, SMB2, SMB2_02, SMB2_10, SMB3, SMB3_00, SMB3_02, SMB3_11
guest_mapping (str | None) – How to handle invalid users/passwords. Valid values: never, bad user, bad password, bad uid
extended_acl_support (bool | None) – Enable extended ACL support.
- Returns:
Updated CIFSSettings object.
- Return type:
Example
>>> # Set minimum protocol to SMB3 >>> client.nas_services.set_cifs_settings(1, min_protocol="SMB3")
>>> # Update workgroup >>> client.nas_services.set_cifs_settings(1, workgroup="MYWORKGROUP")
- get_nfs_settings(key)[source]
Get NFS settings for a NAS service.
- Parameters:
key (int) – NAS service $key (ID).
- Returns:
NFSSettings object.
- Raises:
NotFoundError – If NFS settings not found.
- Return type:
Example
>>> nfs = client.nas_services.get_nfs_settings(1) >>> print(f"NFSv4 Enabled: {nfs.enable_nfsv4}") >>> print(f"Allowed Hosts: {nfs.allowed_hosts}")
- set_nfs_settings(key, *, enable_nfsv4=None, allowed_hosts=None, allow_all=None, squash=None, data_access=None, anon_uid=None, anon_gid=None, no_acl=None, insecure=None, async_mode=None)[source]
Update NFS settings for a NAS service.
- Parameters:
key (int) – NAS service $key (ID).
enable_nfsv4 (bool | None) – Enable NFSv4 protocol support.
allowed_hosts (str | None) – Comma-separated list of allowed hosts/networks.
allow_all (bool | None) – Allow all hosts to access NFS exports.
squash (str | None) – User/group squashing mode. Valid values: root_squash, all_squash, no_root_squash
data_access (str | None) – Read-only or read-write access. Valid values: ro, rw
anon_uid (int | None) – Anonymous user ID for squashed users.
anon_gid (int | None) – Anonymous group ID for squashed users.
no_acl (bool | None) – Disable ACL support for NFS exports.
insecure (bool | None) – Allow connections from non-privileged ports.
async_mode (bool | None) – Enable async mode for better performance.
- Returns:
Updated NFSSettings object.
- Return type:
Example
>>> # Enable NFSv4 >>> client.nas_services.set_nfs_settings(1, enable_nfsv4=True)
>>> # Set allowed hosts >>> client.nas_services.set_nfs_settings( ... 1, allowed_hosts="192.168.1.0/24,10.0.0.0/8" ... )
NAS Volumes
NAS volume and snapshot resources.
- class pyvergeos.resources.nas_volumes.NASVolume[source]
Bases:
ResourceObjectNAS volume resource object.
Represents a NAS volume (virtual filesystem) managed by a NAS service.
Note
Volume keys are 40-character hex strings, not integers like most other VergeOS resources.
- key
The volume unique identifier ($key) - 40-char hex string.
- id
The volume ID (same as $key).
- name
Volume name.
- description
Volume description.
- enabled
Whether the volume is enabled.
- max_size
Maximum size in bytes.
- preferred_tier
Preferred storage tier (1-5).
- fs_type
Filesystem type (ext4, cifs, nfs, ybfs, verge_vm_export).
- read_only
Whether the volume is read-only.
- discard
Whether discard is enabled for deleted files.
- owner_user
Volume directory owner user.
- owner_group
Volume directory owner group.
- encrypt
Whether the volume is encrypted.
- automount_snapshots
Whether snapshots are auto-mounted.
- is_snapshot
Whether this is a snapshot volume.
- service
Parent NAS service key.
- snapshot_profile
Associated snapshot profile key.
- created
Creation timestamp.
- modified
Last modified timestamp.
- property key: str
Resource primary key ($key) - 40-character hex string.
- Raises:
ValueError – If resource has no $key (not yet persisted).
- property files: NASVolumeFileManager
Get a file manager for browsing this volume’s files.
- Returns:
NASVolumeFileManager scoped to this volume.
Example
>>> # Browse volume files >>> for f in volume.files.list(): ... print(f"{f.name}: {f.size_display}")
>>> # Browse a subdirectory >>> for f in volume.files.list("/documents"): ... print(f.name)
- property antivirus: VolumeAntivirusManager
Get antivirus manager for this volume.
- Returns:
VolumeAntivirusManager scoped to this volume.
Example
>>> # Get antivirus configuration >>> av = volume.antivirus.get()
>>> # Enable and start scan >>> av.enable() >>> av.start_scan()
>>> # Check status >>> status = av.get_status() >>> print(f"Status: {status.status}")
- class pyvergeos.resources.nas_volumes.NASVolumeSnapshot[source]
Bases:
ResourceObjectNAS volume snapshot resource object.
Represents a point-in-time snapshot of a NAS volume.
- key
The snapshot unique identifier ($key).
- name
Snapshot name.
- description
Snapshot description.
- volume
Parent volume key.
- snap_volume
Mounted snapshot volume key (if mounted).
- created
Creation timestamp.
- expires
Expiration timestamp (0 for never expires).
- expires_type
Expiration type (never, date).
- enabled
Whether the snapshot is enabled.
- created_manually
Whether created manually.
- quiesce
Whether I/O was quiesced during creation.
- class pyvergeos.resources.nas_volumes.NASVolumeManager[source]
Bases:
ResourceManager[NASVolume]Manager for NAS volume operations.
NAS volumes are virtual filesystems that can be shared via CIFS/SMB or NFS.
Example
>>> # List all volumes >>> for volume in client.nas_volumes.list(): ... print(f"{volume.name}: {volume.max_size_gb}GB")
>>> # Get a specific volume >>> vol = client.nas_volumes.get(name="FileShare")
>>> # Create a volume >>> vol = client.nas_volumes.create( ... name="DataShare", ... service=1, ... size_gb=500, ... tier=1 ... )
>>> # Create a snapshot >>> snap = vol.snapshots.create("pre-update")
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, enabled=None, fs_type=None, service=None, **filter_kwargs)[source]
List NAS volumes with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
enabled (bool | None) – Filter by enabled state.
fs_type (str | None) – Filter by filesystem type (ext4, cifs, nfs, ybfs, verge_vm_export).
service (int | str | None) – Filter by NAS service (key or name).
**filter_kwargs (Any) – Shorthand filter arguments (name, etc.).
- Returns:
List of NASVolume objects.
- Return type:
Example
>>> # List all volumes >>> volumes = client.nas_volumes.list()
>>> # List enabled volumes only >>> enabled = client.nas_volumes.list(enabled=True)
>>> # Filter by filesystem type >>> ext4_vols = client.nas_volumes.list(fs_type="ext4")
>>> # Filter by NAS service >>> nas01_vols = client.nas_volumes.list(service="NAS01")
- get(key=None, *, name=None, fields=None)[source]
Get a single NAS volume by key or name.
- Parameters:
- Returns:
NASVolume object.
- Raises:
NotFoundError – If volume not found.
ValueError – If no identifier provided.
- Return type:
Example
>>> # Get by key >>> vol = client.nas_volumes.get("8f73f8bcc9c9f1aaba32f733bfc295acaf548554")
>>> # Get by name >>> vol = client.nas_volumes.get(name="FileShare")
- create(name, service, size_gb, *, tier=None, description=None, read_only=False, discard=True, owner_user=None, owner_group=None, snapshot_profile=None, enabled=True)[source]
Create a new NAS volume.
- Parameters:
name (str) – Volume name (alphanumeric with underscores/hyphens only).
service (int | str) – NAS service (key or name) to create the volume on.
size_gb (int) – Maximum size in gigabytes (1-524288).
tier (int | None) – Preferred storage tier (1-5).
description (str | None) – Volume description.
read_only (bool) – Create as read-only volume.
discard (bool) – Enable automatic discard of deleted files (default True).
owner_user (str | None) – Volume directory owner user.
owner_group (str | None) – Volume directory owner group.
snapshot_profile (int | None) – Snapshot profile key.
enabled (bool) – Enable the volume (default True).
- Returns:
Created NASVolume object.
- Raises:
ValueError – If NAS service not found.
- Return type:
Example
>>> # Create a basic volume >>> vol = client.nas_volumes.create("FileShare", "NAS01", 500)
>>> # Create with options >>> vol = client.nas_volumes.create( ... "Archive", ... service="NAS01", ... size_gb=2000, ... tier=3, ... description="Archive storage" ... )
- update(key, *, description=None, size_gb=None, tier=None, enabled=None, read_only=None, discard=None, owner_user=None, owner_group=None, snapshot_profile=None, automount_snapshots=None)[source]
Update a NAS volume.
- Parameters:
key (str) – Volume $key (40-character hex string).
description (str | None) – New description.
size_gb (int | None) – New maximum size in gigabytes.
tier (int | None) – New preferred storage tier (1-5).
enabled (bool | None) – Enable or disable the volume.
read_only (bool | None) – Set read-only or read-write.
discard (bool | None) – Enable or disable automatic discard.
owner_user (str | None) – New owner user.
owner_group (str | None) – New owner group.
snapshot_profile (int | None) – New snapshot profile key (or None to remove).
automount_snapshots (bool | None) – Enable or disable auto-mount of snapshots.
- Returns:
Updated NASVolume object.
- Return type:
Example
>>> # Increase size >>> client.nas_volumes.update(vol.key, size_gb=1000)
>>> # Change tier >>> client.nas_volumes.update(vol.key, tier=3)
>>> # Disable volume >>> client.nas_volumes.update(vol.key, enabled=False)
- delete(key)[source]
Delete a NAS volume.
This operation is destructive and cannot be undone. All data on the volume will be permanently deleted.
- Parameters:
key (str) – Volume $key (40-character hex string).
- Raises:
NotFoundError – If volume not found.
- Return type:
None
Example
>>> client.nas_volumes.delete(vol.key)
- enable(key)[source]
Enable a NAS volume.
- Parameters:
key (str) – Volume $key (40-character hex string).
- Returns:
Updated NASVolume object.
- Return type:
Example
>>> client.nas_volumes.enable(vol.key)
- disable(key)[source]
Disable a NAS volume.
- Parameters:
key (str) – Volume $key (40-character hex string).
- Returns:
Updated NASVolume object.
- Return type:
Example
>>> client.nas_volumes.disable(vol.key)
- reset(key)[source]
Reset a NAS volume.
Resets the volume, which can help recover from error states.
- Parameters:
key (str) – Volume $key (40-character hex string).
- Returns:
Task information dict or None.
- Return type:
Example
>>> client.nas_volumes.reset(vol.key)
- snapshots(key)[source]
Get a snapshot manager for a specific volume.
- Parameters:
key (str) – Volume $key (40-character hex string).
- Returns:
NASVolumeSnapshotManager for the volume.
- Return type:
Example
>>> # List snapshots for a volume >>> for snap in client.nas_volumes.snapshots(vol.key).list(): ... print(snap.name)
>>> # Create a snapshot >>> snap = client.nas_volumes.snapshots(vol.key).create("pre-update")
- files(key, *, name=None)[source]
Get a file manager for browsing a volume’s files.
- Parameters:
- Returns:
NASVolumeFileManager for browsing the volume.
- Return type:
Example
>>> # Browse root directory >>> for f in client.nas_volumes.files(vol.key).list(): ... print(f"{f.name}: {f.size_display}")
>>> # Browse a subdirectory >>> files = client.nas_volumes.files(vol.key).list("/documents")
>>> # Get a specific file >>> file = client.nas_volumes.files(vol.key).get("/report.pdf")
- class pyvergeos.resources.nas_volumes.NASVolumeSnapshotManager[source]
Bases:
ResourceManager[NASVolumeSnapshot]Manager for NAS volume snapshot operations.
This manager can be used either standalone or scoped to a specific volume.
Example
>>> # List all snapshots (standalone) >>> for snap in client.nas_volume_snapshots.list(): ... print(f"{snap.name} ({snap.volume_name})")
>>> # List snapshots for a specific volume >>> for snap in client.nas_volumes.snapshots(vol.key).list(): ... print(snap.name)
>>> # Create a snapshot >>> snap = client.nas_volumes.snapshots(vol.key).create("pre-update")
- __init__(client, *, volume_key=None)[source]
- Parameters:
client (VergeClient)
volume_key (str | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, volume=None, **filter_kwargs)[source]
List volume snapshots with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
volume (str | None) – Filter by volume (key or name). Ignored if manager is scoped.
**filter_kwargs (Any) – Shorthand filter arguments (name, etc.).
- Returns:
List of NASVolumeSnapshot objects.
- Return type:
Example
>>> # List all snapshots >>> snapshots = client.nas_volume_snapshots.list()
>>> # List snapshots for a specific volume by name >>> snapshots = client.nas_volume_snapshots.list(volume="FileShare")
>>> # List snapshots by name pattern >>> snapshots = client.nas_volume_snapshots.list(name="Daily-*")
- get(key=None, *, name=None, fields=None)[source]
Get a single volume snapshot by key or name.
- Parameters:
- Returns:
NASVolumeSnapshot object.
- Raises:
NotFoundError – If snapshot not found.
ValueError – If no identifier provided.
- Return type:
Example
>>> # Get by key >>> snap = client.nas_volume_snapshots.get(1)
>>> # Get by name (scoped to volume) >>> snap = client.nas_volumes.snapshots(1).get(name="pre-update")
- create(name, *, volume=None, description=None, expires_days=3, never_expires=False, quiesce=False)[source]
Create a new volume snapshot.
- Parameters:
name (str) – Snapshot name.
volume (str | None) – Volume key (40-char hex string, required if manager is not scoped).
description (str | None) – Snapshot description.
expires_days (int) – Days until expiration (default 3).
never_expires (bool) – If True, snapshot never expires.
quiesce (bool) – If True, freeze I/O during snapshot for consistency.
- Returns:
Created NASVolumeSnapshot object.
- Raises:
ValueError – If volume not specified and manager not scoped.
- Return type:
Example
>>> # Create with scoped manager >>> snap = client.nas_volumes.snapshots(vol.key).create("pre-update")
>>> # Create with standalone manager >>> snap = client.nas_volume_snapshots.create("backup", volume=vol.key)
>>> # Create a permanent quiesced snapshot >>> snap = client.nas_volumes.snapshots(vol.key).create( ... "before-migration", ... never_expires=True, ... quiesce=True ... )
NAS Volume Browser
NAS volume file browser resources.
- class pyvergeos.resources.nas_volume_browser.NASVolumeFile[source]
-
NAS volume file/directory entry.
Represents a file or directory within a NAS volume. This is a read-only data object returned by the volume browser.
- name
File or directory name.
- type
Entry type (‘file’ or ‘directory’).
- size
Size in bytes.
- date
Modification timestamp (Unix).
- n_name
Normalized name (lowercase).
- class pyvergeos.resources.nas_volume_browser.NASVolumeFileManager[source]
Bases:
objectManager for browsing NAS volume files.
This manager provides methods to browse files and directories within a NAS volume. It uses the asynchronous volume_browser API.
Note
The NAS service VM must be running to browse volumes. The volume must be mounted (enabled).
Example
>>> # Browse root directory >>> files = client.nas_volumes.files(vol.key).list() >>> for f in files: ... print(f"{f.name}: {f.size_display}")
>>> # Browse a subdirectory >>> files = client.nas_volumes.files(vol.key).list("/documents")
>>> # Get a specific file >>> file = client.nas_volumes.files(vol.key).get("/documents/report.pdf")
- __init__(client, *, volume_key, volume_name=None)[source]
Initialize the file manager.
- Parameters:
client (VergeClient) – VergeClient instance.
volume_key (str) – Volume key (40-character hex string).
volume_name (str | None) – Optional volume name for display purposes.
- Return type:
None
- list(path='/', *, limit=1000, offset=None, extensions='', sort='', timeout=30)[source]
List files and directories at the specified path.
- Parameters:
path (str) – Directory path to list. Use “/” for root.
limit (int) – Maximum number of entries to return (default 1000).
offset (int | None) – Pagination offset.
extensions (str) – Filter by file extensions (comma-separated).
sort (str) – Sort field.
timeout (int) – Maximum seconds to wait for results (default 30).
- Returns:
List of NASVolumeFile objects.
- Raises:
APIError – If the browse operation fails.
VergeTimeoutError – If the operation times out.
- Return type:
Example
>>> # List root directory >>> files = client.nas_volumes.files(vol.key).list()
>>> # List a subdirectory >>> files = client.nas_volumes.files(vol.key).list("/documents")
>>> # Filter by extension >>> pdfs = client.nas_volumes.files(vol.key).list("/documents", extensions="pdf")
- get(path, *, timeout=30)[source]
Get information about a specific file or directory.
- Parameters:
- Returns:
NASVolumeFile object.
- Raises:
NotFoundError – If the file/directory is not found.
APIError – If the browse operation fails.
- Return type:
Example
>>> file = client.nas_volumes.files(vol.key).get("/documents/report.pdf") >>> print(f"{file.name}: {file.size_display}")
NAS Volume Syncs
NAS volume sync resources.
- class pyvergeos.resources.nas_volume_syncs.NASVolumeSync[source]
Bases:
ResourceObjectNAS volume sync resource object.
Represents a volume synchronization job that copies data between NAS volumes.
- key
The sync job unique identifier ($key).
- id
The sync job ID (same as key).
- name
Sync job name.
- description
Sync job description.
- enabled
Whether the sync is enabled.
- service
Parent NAS service key.
- source_volume
Source volume key.
- source_path
Starting directory in source volume.
- destination_volume
Destination volume key.
- destination_path
Destination directory path.
- include
File/directory patterns to include.
- exclude
File/directory patterns to exclude.
- sync_method
Sync method (rsync or ysync).
- destination_delete
How to handle deleted files.
- workers
Number of simultaneous workers.
- preserve_ACLs
Preserve access control lists.
- preserve_permissions
Preserve file permissions.
- preserve_owner
Preserve file owner.
- preserve_groups
Preserve file groups.
- preserve_mod_time
Preserve modification time.
- preserve_xattrs
Preserve extended attributes.
- copy_symlinks
Copy symbolic links.
- fsfreeze
Freeze filesystem before snapshot.
- status
Current sync status.
- syncing
Whether sync is currently running.
- files_transferred
Number of files transferred.
- bytes_transferred
Number of bytes transferred.
- transfer_rate
Current transfer rate.
- sync_errors
Number of sync errors.
- start_time
Sync start time.
- stop_time
Sync stop time.
- created
Creation timestamp.
- modified
Last modified timestamp.
- property key: str
Resource primary key ($key).
Note
Volume sync keys are typically strings.
- Raises:
ValueError – If resource has no $key (not yet persisted).
- refresh()[source]
Refresh resource data from API.
- Returns:
Updated NASVolumeSync object.
- Return type:
- class pyvergeos.resources.nas_volume_syncs.NASVolumeSyncManager[source]
Bases:
ResourceManager[NASVolumeSync]Manager for NAS volume sync operations.
Volume syncs copy data between NAS volumes on a schedule or on-demand.
Example
>>> # List all volume syncs >>> for sync in client.volume_syncs.list(): ... print(f"{sync.name}: {sync.status_display}")
>>> # Get a specific sync >>> sync = client.volume_syncs.get(name="DailyBackup")
>>> # Create a sync job >>> sync = client.volume_syncs.create( ... name="DailyBackup", ... service=1, ... source_volume="8f73...", ... destination_volume="9a84...", ... )
>>> # Start a sync >>> client.volume_syncs.start(sync.key)
>>> # Stop a running sync >>> client.volume_syncs.stop(sync.key)
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, service=None, enabled=None, **filter_kwargs)[source]
List volume sync jobs with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
service (int | str | None) – Filter by NAS service (key or name).
enabled (bool | None) – Filter by enabled state.
**filter_kwargs (Any) – Shorthand filter arguments (name, etc.).
- Returns:
List of NASVolumeSync objects.
- Return type:
Example
>>> # List all syncs >>> syncs = client.volume_syncs.list()
>>> # List syncs for a specific NAS service >>> syncs = client.volume_syncs.list(service="NAS01")
>>> # List enabled syncs only >>> syncs = client.volume_syncs.list(enabled=True)
>>> # Filter by name >>> syncs = client.volume_syncs.list(name="DailyBackup")
- get(key=None, *, name=None, service=None, fields=None)[source]
Get a single volume sync by key or name.
- Parameters:
- Returns:
NASVolumeSync object.
- Raises:
NotFoundError – If sync not found.
ValueError – If no identifier provided.
- Return type:
Example
>>> # Get by key >>> sync = client.volume_syncs.get("abc123")
>>> # Get by name >>> sync = client.volume_syncs.get(name="DailyBackup")
>>> # Get by name within specific NAS service >>> sync = client.volume_syncs.get(name="DailyBackup", service="NAS01")
- create(name, service, source_volume, destination_volume, *, source_path=None, destination_path=None, description=None, include=None, exclude=None, sync_method='ysync', destination_delete='never', workers=4, preserve_acls=True, preserve_permissions=True, preserve_owner=True, preserve_groups=True, preserve_mod_time=True, preserve_xattrs=True, copy_symlinks=True, freeze_filesystem=False, enabled=True)[source]
Create a new volume sync job.
- Parameters:
name (str) – Name for the sync job.
service (int | str) – NAS service (key or name) to create the sync on.
source_volume (str) – Source volume key (40-char hex string).
destination_volume (str) – Destination volume key (40-char hex string).
source_path (str | None) – Starting directory in source volume.
destination_path (str | None) – Destination directory path.
description (str | None) – Sync job description.
include (list[str] | None) – List of file/directory patterns to include.
exclude (list[str] | None) – List of file/directory patterns to exclude.
sync_method (str) – Sync method - “rsync” or “ysync” (default: “ysync”).
destination_delete (str) – How to handle deleted files. Valid values: “never”, “delete”, “delete-before”, “delete-during”, “delete-delay”, “delete-after”
workers (int) – Number of simultaneous workers (1-128, default: 4).
preserve_acls (bool) – Preserve access control lists (default: True).
preserve_permissions (bool) – Preserve file permissions (default: True).
preserve_owner (bool) – Preserve file owner (default: True).
preserve_groups (bool) – Preserve file groups (default: True).
preserve_mod_time (bool) – Preserve modification time (default: True).
preserve_xattrs (bool) – Preserve extended attributes (default: True).
copy_symlinks (bool) – Copy symbolic links (default: True).
freeze_filesystem (bool) – Freeze filesystem before snapshot (default: False).
enabled (bool) – Enable the sync job (default: True).
- Returns:
Created NASVolumeSync object.
- Raises:
ValueError – If NAS service not found.
- Return type:
Example
>>> # Create a basic sync job >>> sync = client.volume_syncs.create( ... name="DailyBackup", ... service="NAS01", ... source_volume="8f73f8bcc9c9f1aaba32f733bfc295acaf548554", ... destination_volume="9a84e7add1d2c3b4a5e6f7890123456789abcdef", ... )
>>> # Create with options >>> sync = client.volume_syncs.create( ... name="SelectiveSync", ... service=1, ... source_volume=source_vol.key, ... destination_volume=dest_vol.key, ... include=["*.docx", "*.xlsx"], ... exclude=["temp/*"], ... workers=8, ... )
- update(key, *, description=None, source_path=None, destination_path=None, include=None, exclude=None, sync_method=None, destination_delete=None, workers=None, preserve_acls=None, preserve_permissions=None, preserve_owner=None, preserve_groups=None, preserve_mod_time=None, preserve_xattrs=None, copy_symlinks=None, freeze_filesystem=None, enabled=None)[source]
Update a volume sync job.
- Parameters:
key (str) – Sync job key (ID).
description (str | None) – New description.
source_path (str | None) – New source path.
destination_path (str | None) – New destination path.
sync_method (str | None) – New sync method (“rsync” or “ysync”).
destination_delete (str | None) – New delete mode.
workers (int | None) – New number of workers (1-128).
preserve_acls (bool | None) – Preserve access control lists.
preserve_permissions (bool | None) – Preserve file permissions.
preserve_owner (bool | None) – Preserve file owner.
preserve_groups (bool | None) – Preserve file groups.
preserve_mod_time (bool | None) – Preserve modification time.
preserve_xattrs (bool | None) – Preserve extended attributes.
copy_symlinks (bool | None) – Copy symbolic links.
freeze_filesystem (bool | None) – Freeze filesystem before snapshot.
enabled (bool | None) – Enable or disable the sync job.
- Returns:
Updated NASVolumeSync object.
- Return type:
Example
>>> # Update workers >>> client.volume_syncs.update(sync.key, workers=8)
>>> # Disable a sync >>> client.volume_syncs.update(sync.key, enabled=False)
- delete(key)[source]
Delete a volume sync job.
This operation cannot be undone. Running syncs should be stopped first.
- Parameters:
key (str) – Sync job key (ID).
- Return type:
None
Example
>>> client.volume_syncs.delete(sync.key)
- enable(key)[source]
Enable a volume sync job.
- Parameters:
key (str) – Sync job key (ID).
- Returns:
Updated NASVolumeSync object.
- Return type:
Example
>>> client.volume_syncs.enable(sync.key)
- disable(key)[source]
Disable a volume sync job.
- Parameters:
key (str) – Sync job key (ID).
- Returns:
Updated NASVolumeSync object.
- Return type:
Example
>>> client.volume_syncs.disable(sync.key)
CIFS Shares
NAS CIFS/SMB share resources.
Bases:
ResourceObjectNAS CIFS/SMB share resource object.
Represents a CIFS (SMB) file share on a NAS volume.
Note
Share keys are 40-character hex strings, not integers like most other VergeOS resources.
The share unique identifier ($key) - 40-char hex string.
The share ID (same as $key).
Share name.
Share description.
Parent volume key.
Parent volume name.
Path within the volume being shared.
Short comment (visible to clients).
Whether the share is enabled.
Whether the share is visible in network browsing.
Whether the share is read-only.
Whether guest access is allowed.
Only guest connections are permitted.
All file operations performed as this user.
Default primary group for connecting users.
List of users allowed to connect.
List of groups allowed to connect.
List of users with admin privileges.
List of groups with admin privileges.
List of allowed hosts.
List of denied hosts.
Whether shadow copy (Previous Versions) is enabled.
Creation timestamp.
Last modified timestamp.
- property key: str
Resource primary key ($key) - 40-character hex string.
- Raises:
ValueError – If resource has no $key (not yet persisted).
Refresh resource data from API.
- Returns:
Updated NASCIFSShare object.
- Return type:
Save changes to resource.
- Parameters:
**kwargs (Any) – Fields to update.
- Returns:
Updated NASCIFSShare object.
- Return type:
Delete this share.
- Return type:
None
Check if the share is enabled.
Check if the share is read-only.
Check if guest access is allowed.
Bases:
ResourceManager[NASCIFSShare]Manager for NAS CIFS/SMB share operations.
CIFS shares provide Windows-compatible file sharing (SMB protocol).
Example
>>> # List all CIFS shares >>> for share in client.cifs_shares.list(): ... print(f"{share.name} on {share.volume_name}")
>>> # Get shares for a specific volume >>> shares = client.cifs_shares.list(volume="FileShare")
>>> # Create a share >>> share = client.cifs_shares.create( ... name="shared", ... volume="FileShare", ... guest_ok=True ... )
- Parameters:
client (VergeClient)
- Return type:
None
List CIFS shares with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
enabled (bool | None) – Filter by enabled state.
**filter_kwargs (Any) – Shorthand filter arguments (name, etc.).
- Returns:
List of NASCIFSShare objects.
- Return type:
Example
>>> # List all CIFS shares >>> shares = client.cifs_shares.list()
>>> # List shares on a specific volume >>> shares = client.cifs_shares.list(volume="FileShare")
>>> # List enabled shares only >>> shares = client.cifs_shares.list(enabled=True)
Get a single CIFS share by key or name.
- Parameters:
- Returns:
NASCIFSShare object.
- Raises:
NotFoundError – If share not found.
ValueError – If no identifier provided.
- Return type:
Example
>>> # Get by key >>> share = client.cifs_shares.get("abc123...")
>>> # Get by name on a volume >>> share = client.cifs_shares.get(name="shared", volume="FileShare")
Create a new CIFS share.
- Parameters:
name (str) – Share name (alphanumeric with underscores/hyphens).
volume (str | int) – Volume key or name to create the share on.
share_path (str | None) – Path within the volume to share (empty = entire volume).
description (str | None) – Share description.
comment (str | None) – Short comment visible to clients.
browseable (bool) – Make visible in network browsing (default True).
read_only (bool) – Create as read-only share.
guest_ok (bool) – Allow guest access.
guest_only (bool) – Only allow guest connections.
force_user (str | None) – All operations performed as this user.
force_group (str | None) – Default primary group for connecting users.
valid_users (list[str] | None) – List of usernames allowed to connect.
valid_groups (list[str] | None) – List of group names allowed to connect.
admin_users (list[str] | None) – List of users with admin privileges.
admin_groups (list[str] | None) – List of groups with admin privileges.
allowed_hosts (list[str] | None) – List of allowed hosts (IPs, hostnames, subnets).
shadow_copy (bool) – Enable Previous Versions support.
enabled (bool) – Enable the share (default True).
- Returns:
Created NASCIFSShare object.
- Raises:
ValueError – If volume not found.
- Return type:
Example
>>> # Create a basic share >>> share = client.cifs_shares.create("shared", "FileShare")
>>> # Create with guest access >>> share = client.cifs_shares.create( ... "public", "FileShare", ... share_path="/public", ... guest_ok=True ... )
>>> # Create with restricted access >>> share = client.cifs_shares.create( ... "secure", "FileShare", ... valid_users=["admin", "manager"] ... )
Update a CIFS share.
- Parameters:
key (str) – Share $key (40-character hex string).
description (str | None) – New description.
comment (str | None) – New comment.
enabled (bool | None) – Enable or disable the share.
browseable (bool | None) – Show or hide in network browsing.
read_only (bool | None) – Set read-only or read-write.
guest_ok (bool | None) – Allow or disallow guest access.
guest_only (bool | None) – Restrict to guest-only access.
force_user (str | None) – Set force user (empty string to clear).
force_group (str | None) – Set force group (empty string to clear).
valid_users (list[str] | None) – Set valid users (empty list to clear).
valid_groups (list[str] | None) – Set valid groups (empty list to clear).
admin_users (list[str] | None) – Set admin users (empty list to clear).
admin_groups (list[str] | None) – Set admin groups (empty list to clear).
allowed_hosts (list[str] | None) – Set allowed hosts (empty list to clear).
denied_hosts (list[str] | None) – Set denied hosts (empty list to clear).
shadow_copy (bool | None) – Enable or disable shadow copy.
- Returns:
Updated NASCIFSShare object.
- Return type:
Example
>>> # Make share read-only >>> client.cifs_shares.update(share.key, read_only=True)
>>> # Update access controls >>> client.cifs_shares.update( ... share.key, ... valid_users=["admin", "manager", "backup"] ... )
Delete a CIFS share.
This removes the share but does not delete the underlying data on the volume.
- Parameters:
key (str) – Share $key (40-character hex string).
- Return type:
None
Example
>>> client.cifs_shares.delete(share.key)
Enable a CIFS share.
- Parameters:
key (str) – Share $key (40-character hex string).
- Returns:
Updated NASCIFSShare object.
- Return type:
Disable a CIFS share.
- Parameters:
key (str) – Share $key (40-character hex string).
- Returns:
Updated NASCIFSShare object.
- Return type:
NFS Shares
NAS NFS share resources.
Bases:
ResourceObjectNAS NFS share resource object.
Represents an NFS file share on a NAS volume.
Note
Share keys are 40-character hex strings, not integers like most other VergeOS resources.
The share unique identifier ($key) - 40-char hex string.
The share ID (same as $key).
Share name.
Share description.
Parent volume key.
Parent volume name.
Path within the volume being shared.
Comma-delimited list of allowed hosts.
Whether all hosts are allowed.
Read-only (ro) or read-write (rw).
User/group squashing mode.
Filesystem ID for the export.
User ID for anonymous/squashed users.
Group ID for anonymous/squashed users.
Whether ACLs are disabled.
Whether non-privileged ports are allowed.
Whether async mode is enabled.
Whether the share is enabled.
Creation timestamp.
Last modified timestamp.
- property key: str
Resource primary key ($key) - 40-character hex string.
- Raises:
ValueError – If resource has no $key (not yet persisted).
Refresh resource data from API.
- Returns:
Updated NASNFSShare object.
- Return type:
Save changes to resource.
- Parameters:
**kwargs (Any) – Fields to update.
- Returns:
Updated NASNFSShare object.
- Return type:
Delete this share.
- Return type:
None
Check if the share is enabled.
Check if the share is read-only.
Check if all hosts are allowed.
Get human-readable squash mode.
Get human-readable data access mode.
Bases:
ResourceManager[NASNFSShare]Manager for NAS NFS share operations.
NFS shares provide Unix/Linux-compatible file sharing.
Example
>>> # List all NFS shares >>> for share in client.nfs_shares.list(): ... print(f"{share.name} on {share.volume_name}")
>>> # Get shares for a specific volume >>> shares = client.nfs_shares.list(volume="FileShare")
>>> # Create a share >>> share = client.nfs_shares.create( ... name="exports", ... volume="FileShare", ... allowed_hosts="192.168.1.0/24" ... )
- Parameters:
client (VergeClient)
- Return type:
None
List NFS shares with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
enabled (bool | None) – Filter by enabled state.
**filter_kwargs (Any) – Shorthand filter arguments (name, etc.).
- Returns:
List of NASNFSShare objects.
- Return type:
Example
>>> # List all NFS shares >>> shares = client.nfs_shares.list()
>>> # List shares on a specific volume >>> shares = client.nfs_shares.list(volume="FileShare")
>>> # List enabled shares only >>> shares = client.nfs_shares.list(enabled=True)
Get a single NFS share by key or name.
- Parameters:
- Returns:
NASNFSShare object.
- Raises:
NotFoundError – If share not found.
ValueError – If no identifier provided.
- Return type:
Example
>>> # Get by key >>> share = client.nfs_shares.get("abc123...")
>>> # Get by name on a volume >>> share = client.nfs_shares.get(name="exports", volume="FileShare")
Create a new NFS share.
- Parameters:
name (str) – Share name (alphanumeric with underscores/hyphens).
volume (str | int) – Volume key or name to create the share on.
share_path (str | None) – Path within the volume to share (empty = entire volume).
description (str | None) – Share description.
allowed_hosts (str | None) – Comma-delimited list of allowed hosts (FQDNs, IPs, networks, NIS netgroups). Required unless allow_all is True.
allow_all (bool) – Allow connections from any host.
data_access (str) – Data access mode - “ro” (read-only) or “rw” (read-write).
squash (str) – User/group squashing - “root_squash”, “all_squash”, “no_root_squash”.
anonymous_uid (str | None) – User ID for anonymous/squashed users (default 65534).
anonymous_gid (str | None) – Group ID for anonymous/squashed users (default 65534).
async_mode (bool) – Enable async mode for better performance (risk of data loss).
insecure (bool) – Allow connections from non-privileged ports.
no_acl (bool) – Disable access control lists.
filesystem_id (str | None) – Filesystem ID for the export (must be unique per volume).
enabled (bool) – Enable the share (default True).
- Returns:
Created NASNFSShare object.
- Raises:
ValueError – If volume not found or if neither allowed_hosts nor allow_all is specified.
- Return type:
Example
>>> # Create a share for a subnet >>> share = client.nfs_shares.create( ... "exports", "FileShare", ... allowed_hosts="192.168.1.0/24" ... )
>>> # Create a read-write share for specific hosts >>> share = client.nfs_shares.create( ... "data", "FileShare", ... allowed_hosts="10.0.0.5,10.0.0.6", ... data_access="rw", ... squash="no_root_squash" ... )
>>> # Create a share accessible from anywhere >>> share = client.nfs_shares.create( ... "public", "FileShare", ... allow_all=True, ... data_access="ro" ... )
Update an NFS share.
- Parameters:
key (str) – Share $key (40-character hex string).
description (str | None) – New description.
allowed_hosts (str | None) – New allowed hosts list.
allow_all (bool | None) – Allow all hosts.
data_access (str | None) – Data access mode - “ro” or “rw”.
squash (str | None) – Squash mode - “root_squash”, “all_squash”, “no_root_squash”.
anonymous_uid (str | None) – Anonymous user ID.
anonymous_gid (str | None) – Anonymous group ID.
async_mode (bool | None) – Enable or disable async mode.
insecure (bool | None) – Allow or disallow non-privileged ports.
no_acl (bool | None) – Enable or disable ACL support.
filesystem_id (str | None) – New filesystem ID.
enabled (bool | None) – Enable or disable the share.
- Returns:
Updated NASNFSShare object.
- Return type:
Example
>>> # Change to read-write >>> client.nfs_shares.update(share.key, data_access="rw")
>>> # Update allowed hosts >>> client.nfs_shares.update( ... share.key, ... allowed_hosts="192.168.1.0/24,10.0.0.0/8" ... )
Delete an NFS share.
This removes the share but does not delete the underlying data on the volume.
- Parameters:
key (str) – Share $key (40-character hex string).
- Return type:
None
Example
>>> client.nfs_shares.delete(share.key)
Enable an NFS share.
- Parameters:
key (str) – Share $key (40-character hex string).
- Returns:
Updated NASNFSShare object.
- Return type:
Disable an NFS share.
- Parameters:
key (str) – Share $key (40-character hex string).
- Returns:
Updated NASNFSShare object.
- Return type:
NAS Users
NAS local user resources.
- class pyvergeos.resources.nas_users.NASUser[source]
Bases:
ResourceObjectNAS local user resource object.
Represents a local user account on a NAS service for CIFS/SMB authentication. Local users are used when not using Active Directory integration.
Note
User keys are 40-character hex strings, not integers like most other VergeOS resources.
- key
The user unique identifier ($key) - 40-char hex string.
- name
Username.
- displayname
Display name.
- description
User description.
- enabled
Whether the account is enabled.
- service_key
Parent NAS service key.
- service_name
Parent NAS service name.
Home share key.
Home share name.
- home_drive
Home drive letter (e.g., “H”).
- status
Account status (online=Enabled, offline=Disabled, error=Error).
- status_info
Additional status information.
- user_sid
Windows SID.
- group_sid
Group SID.
- user_id
Unix UID.
- group_id
Unix GID.
- created
Creation timestamp.
- property key: str
Resource primary key ($key) - 40-character hex string.
- Raises:
ValueError – If resource has no $key (not yet persisted).
- class pyvergeos.resources.nas_users.NASUserManager[source]
Bases:
ResourceManager[NASUser]Manager for NAS local user operations.
NAS local users are used for CIFS/SMB authentication when not using Active Directory integration.
Example
>>> # List all users on a NAS service >>> for user in client.nas_users.list(service=1): ... print(f"{user.name}: {'Enabled' if user.is_enabled else 'Disabled'}")
>>> # Create a user >>> user = client.nas_users.create( ... service=1, ... name="backup", ... password="SecurePass123!" ... )
>>> # Enable/disable users >>> client.nas_users.disable(user.key) >>> client.nas_users.enable(user.key)
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, service=None, enabled=None, **filter_kwargs)[source]
List NAS local users with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
service (int | str | None) – Filter by NAS service (key or name).
enabled (bool | None) – Filter by enabled state.
**filter_kwargs (Any) – Shorthand filter arguments (name, etc.).
- Returns:
List of NASUser objects.
- Return type:
Example
>>> # List all users for a NAS service >>> users = client.nas_users.list(service=1)
>>> # List enabled users only >>> users = client.nas_users.list(service=1, enabled=True)
>>> # List by name pattern >>> users = client.nas_users.list(service=1, name="backup")
- get(key=None, *, name=None, service=None, fields=None)[source]
Get a single NAS user by key or name.
- Parameters:
- Returns:
NASUser object.
- Raises:
NotFoundError – If user not found.
ValueError – If no identifier provided or name without service.
- Return type:
Example
>>> # Get by key >>> user = client.nas_users.get("abc123...")
>>> # Get by name on a service >>> user = client.nas_users.get(name="backup", service=1)
- create(service, name, password, *, displayname=None, description=None, home_share=None, home_drive=None, enabled=True)[source]
Create a new NAS local user.
- Parameters:
name (str) – Username (1-32 chars, starts with letter, alphanumeric/underscore/hyphen).
password (str) – User password.
displayname (str | None) – Display name for the user.
description (str | None) – User description.
home_share (str | int | None) – Home share key or name (CIFS share on this NAS service).
home_drive (str | None) – Home drive letter (single letter A-Z, e.g., “H”).
enabled (bool) – Enable the user account (default True).
- Returns:
Created NASUser object.
- Raises:
ValueError – If service not found.
- Return type:
Example
>>> # Create a basic user >>> user = client.nas_users.create( ... service=1, ... name="backup", ... password="SecurePass123!" ... )
>>> # Create with home share >>> user = client.nas_users.create( ... service=1, ... name="admin", ... password="AdminPass!", ... displayname="Administrator", ... home_share="AdminDocs", ... home_drive="H" ... )
- update(key, *, password=None, displayname=None, description=None, home_share=None, home_drive=None, enabled=None)[source]
Update a NAS user.
- Parameters:
key (str) – User $key (40-character hex string).
password (str | None) – New password.
displayname (str | None) – New display name.
description (str | None) – New description.
home_share (str | int | None) – New home share key or name (empty string to clear).
home_drive (str | None) – New home drive letter (empty string to clear).
enabled (bool | None) – Enable or disable the user.
- Returns:
Updated NASUser object.
- Return type:
Example
>>> # Change password >>> client.nas_users.update(user.key, password="NewPass123!")
>>> # Update display name >>> client.nas_users.update(user.key, displayname="Backup User")
>>> # Disable user >>> client.nas_users.update(user.key, enabled=False)
- delete(key)[source]
Delete a NAS user.
This permanently removes the user account.
- Parameters:
key (str) – User $key (40-character hex string).
- Return type:
None
Example
>>> client.nas_users.delete(user.key)
Storage Tiers
Storage tier management for VergeOS vSAN.
- class pyvergeos.resources.storage_tiers.StorageTier[source]
Bases:
ResourceObjectRepresents a storage tier in the VergeOS vSAN.
Storage tiers represent different performance levels of storage. Tier 1 is typically the fastest (SSD/NVMe), while higher tiers may be slower but offer more capacity.
- class pyvergeos.resources.storage_tiers.StorageTierManager[source]
Bases:
ResourceManager[StorageTier]Manages storage tier information in VergeOS.
Storage tiers represent different levels of storage performance in the vSAN. Each tier has its own capacity, usage statistics, and I/O metrics.
Example
>>> # List all storage tiers >>> for tier in client.storage_tiers.list(): ... print(f"Tier {tier.tier}: {tier.used_percent}% used")
>>> # Get a specific tier >>> tier1 = client.storage_tiers.get(tier=1) >>> print(f"Free: {tier1.free_gb} GB")
>>> # Check tiers with high usage >>> high_usage = [t for t in client.storage_tiers.list() if t.used_percent > 80]
- list(filter=None, fields=None, include_stats=True, **filter_kwargs)[source]
List all storage tiers.
- Parameters:
- Returns:
List of StorageTier objects.
- Return type:
Example
>>> tiers = client.storage_tiers.list() >>> for tier in tiers: ... print(f"Tier {tier.tier}: {tier.used_percent}% used, " ... f"{tier.read_ops} IOPS read, {tier.write_ops} IOPS write")
- get(key=None, *, tier=None, fields=None)[source]
Get a storage tier by key or tier number.
- Parameters:
- Returns:
StorageTier object.
- Raises:
NotFoundError – If tier not found.
ValueError – If neither key nor tier provided.
- Return type:
Example
>>> tier1 = client.storage_tiers.get(tier=1) >>> print(f"Tier 1 has {tier1.free_gb} GB free")
Recipes & Catalogs
VM Recipes
Automated VM provisioning templates.
VM Recipe resources for VergeOS provisioning system.
VM recipes are customizable templates for deploying virtual machines. They consist of a golden image (base VM) and configurable options via questions that allow users to customize each deployment.
- Key concepts:
Recipe: A template based on a golden image VM, stored in a catalog
Instance: A VM created from a recipe (remains linked until detached)
Questions: Configuration inputs grouped into sections
Sections: Logical groups like “Virtual Machine”, “Network”, “Drives”
- Common question variable names:
YB_CPU_CORES: Number of CPU cores
YB_RAM: RAM amount in MB
YB_HOSTNAME: VM hostname
YB_IP_ADDR_TYPE: IP type (dhcp/static)
YB_NIC_ETH0: Network selection for eth0
YB_DRIVE_OS_SIZE: OS disk size in bytes
YB_USER: Username for guest OS
YB_PASSWORD: Password for guest OS
OS_DL_URL: Cloud image download URL (for cloud-init images)
- Question types:
string, number, boolean, password, list, hidden
ram, cluster, network, disk_size, row_selection, text_area
database_create, database_edit, database_find (for API automation)
Example
>>> # List available recipes
>>> for recipe in client.vm_recipes.list(downloaded=True):
... print(f"{recipe.name} (v{recipe.version})")
>>> # Deploy a recipe
>>> recipe = client.vm_recipes.get(name="Ubuntu Server 22.04")
>>> instance = recipe.deploy("my-ubuntu", answers={
... "YB_CPU_CORES": 4,
... "YB_RAM": 8192,
... "YB_HOSTNAME": "my-ubuntu-server",
... "YB_IP_ADDR_TYPE": "dhcp",
... })
- class pyvergeos.resources.vm_recipes.VmRecipe[source]
Bases:
ResourceObjectVM Recipe resource object.
Represents a VM recipe template that can be deployed to create new VMs.
Note
Recipe keys are 40-character hex strings, not integers like most other VergeOS resources.
- key
The recipe unique identifier ($key) - 40-char hex string.
- id
The recipe ID (same as $key).
- name
Recipe name.
- description
Recipe description.
- version
Recipe version string.
- build
Recipe build number.
- icon
Bootstrap icon name for UI display.
- catalog
Parent catalog key.
- status
Recipe status row key.
- downloaded
Whether the recipe has been downloaded.
- update_available
Whether an update is available.
- needs_republish
Whether the recipe needs republishing.
- vm
Associated VM key (for local recipes).
- vm_snapshot
Associated VM snapshot key.
- creator
Username who created the recipe.
- property key: str
Resource primary key ($key) - 40-character hex string.
- Raises:
ValueError – If resource has no $key (not yet persisted).
- property instances: VmRecipeInstanceManager
Get an instance manager scoped to this recipe.
- Returns:
VmRecipeInstanceManager for this recipe.
- property logs: VmRecipeLogManager
Get a log manager scoped to this recipe.
- Returns:
VmRecipeLogManager for this recipe.
- class pyvergeos.resources.vm_recipes.VmRecipeInstance[source]
Bases:
ResourceObjectVM Recipe instance resource object.
Represents a deployed instance of a VM recipe.
- key
Instance $key (integer row ID).
- recipe
Recipe key that this instance was deployed from.
- vm
VM key that was created.
- name
Instance/VM name.
- version
Recipe version when deployed.
- build
Recipe build when deployed.
- answers
Recipe question answers used.
- auto_update
Whether auto-update is enabled.
- created
Creation timestamp.
- modified
Last modified timestamp.
- class pyvergeos.resources.vm_recipes.VmRecipeLog[source]
Bases:
ResourceObjectVM Recipe log entry resource object.
Represents a log entry from recipe operations.
- key
Log entry $key (integer row ID).
- vm_recipe
Recipe key.
- level
Log level (message, warning, error, critical, etc.).
- text
Log message text.
- timestamp
Log timestamp (microseconds).
- user
User who triggered the log.
- class pyvergeos.resources.vm_recipes.VmRecipeManager[source]
Bases:
ResourceManager[VmRecipe]Manager for VM recipe operations.
VM recipes are templates for automated VM provisioning.
Example
>>> # List all recipes >>> for recipe in client.vm_recipes.list(): ... print(f"{recipe.name}: {recipe.version}")
>>> # Get a specific recipe >>> recipe = client.vm_recipes.get(name="Ubuntu Server")
>>> # Deploy a recipe >>> instance = recipe.deploy("my-ubuntu", answers={"ram": 4096})
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, catalog=None, downloaded=None, **filter_kwargs)[source]
List VM recipes with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
catalog (str | int | None) – Filter by catalog (key or name).
downloaded (bool | None) – Filter by downloaded state.
**filter_kwargs (Any) – Shorthand filter arguments (name, etc.).
- Returns:
List of VmRecipe objects.
- Return type:
Example
>>> # List all recipes >>> recipes = client.vm_recipes.list()
>>> # List downloaded recipes only >>> downloaded = client.vm_recipes.list(downloaded=True)
>>> # Filter by name >>> ubuntu = client.vm_recipes.list(name="Ubuntu*")
- get(key=None, *, name=None, fields=None)[source]
Get a single VM recipe by key or name.
- Parameters:
- Returns:
VmRecipe object.
- Raises:
NotFoundError – If recipe not found.
ValueError – If no identifier provided.
- Return type:
Example
>>> # Get by key >>> recipe = client.vm_recipes.get("8f73f8bcc9c9f1aaba32f733bfc295acaf548554")
>>> # Get by name >>> recipe = client.vm_recipes.get(name="Ubuntu Server")
- update(key, *, name=None, description=None, icon=None, version=None)[source]
Update a VM recipe.
- Parameters:
- Returns:
Updated VmRecipe object.
- Return type:
Example
>>> client.vm_recipes.update(recipe.key, description="Updated description")
- delete(key)[source]
Delete a VM recipe.
This operation is destructive and cannot be undone.
- Parameters:
key (str) – Recipe $key (40-character hex string).
- Raises:
NotFoundError – If recipe not found.
- Return type:
None
Example
>>> client.vm_recipes.delete(recipe.key)
- download(key)[source]
Download a recipe from the catalog repository.
- Parameters:
key (str) – Recipe $key (40-character hex string).
- Returns:
Task information dict or None.
- Return type:
Example
>>> client.vm_recipes.download(recipe.key)
- deploy(key, name, *, answers=None, auto_update=False)[source]
Deploy a recipe to create a new VM.
- Parameters:
- Returns:
Created VmRecipeInstance object.
- Return type:
Example
>>> instance = client.vm_recipes.deploy( ... recipe.key, ... "my-vm", ... answers={"ram": 4096, "cpu_cores": 2} ... )
- instances(key)[source]
Get an instance manager scoped to a specific recipe.
- Parameters:
key (str) – Recipe $key (40-character hex string).
- Returns:
VmRecipeInstanceManager for the recipe.
- Return type:
- class pyvergeos.resources.vm_recipes.VmRecipeInstanceManager[source]
Bases:
ResourceManager[VmRecipeInstance]Manager for VM recipe instance operations.
Recipe instances represent deployed VMs created from recipes.
Example
>>> # List all instances >>> for inst in client.vm_recipe_instances.list(): ... print(f"{inst.name}: {inst.version}")
>>> # List instances for a specific recipe >>> for inst in client.vm_recipes.get(name="Ubuntu").instances.list(): ... print(inst.name)
- __init__(client, *, recipe_key=None)[source]
- Parameters:
client (VergeClient)
recipe_key (str | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, recipe=None, **filter_kwargs)[source]
List recipe instances with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
recipe (str | None) – Filter by recipe key. Ignored if manager is scoped.
**filter_kwargs (Any) – Shorthand filter arguments (name, etc.).
- Returns:
List of VmRecipeInstance objects.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a single recipe instance by key or name.
- Parameters:
- Returns:
VmRecipeInstance object.
- Raises:
NotFoundError – If instance not found.
ValueError – If no identifier provided.
- Return type:
- create(recipe, name, *, answers=None, auto_update=False)[source]
Create a new recipe instance (deploy a recipe).
- Parameters:
- Returns:
Created VmRecipeInstance object.
- Return type:
Example
>>> instance = client.vm_recipe_instances.create( ... recipe="8f73f8bcc9c9...", ... name="my-vm", ... answers={"ram": 4096} ... )
- class pyvergeos.resources.vm_recipes.VmRecipeLogManager[source]
Bases:
ResourceManager[VmRecipeLog]Manager for VM recipe log operations.
Example
>>> # List all recipe logs >>> for log in client.vm_recipe_logs.list(): ... print(f"{log.level}: {log.text}")
>>> # List logs for a specific recipe >>> for log in client.vm_recipes.get(name="Ubuntu").logs.list(): ... print(f"{log.level}: {log.text}")
- __init__(client, *, recipe_key=None)[source]
- Parameters:
client (VergeClient)
recipe_key (str | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, vm_recipe=None, level=None, **filter_kwargs)[source]
List recipe logs with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
vm_recipe (str | None) – Filter by recipe key. Ignored if manager is scoped.
level (str | None) – Filter by log level.
**filter_kwargs (Any) – Shorthand filter arguments.
- Returns:
List of VmRecipeLog objects.
- Return type:
- get(key=None, *, fields=None)[source]
Get a single log entry by key.
- Parameters:
- Returns:
VmRecipeLog object.
- Raises:
NotFoundError – If log entry not found.
ValueError – If key not provided.
- Return type:
- list_errors(limit=None)[source]
List error and critical log entries.
- Parameters:
limit (int | None) – Maximum number of results.
- Returns:
List of error/critical log entries.
- Return type:
Tenant Recipes
Automated tenant provisioning templates.
Tenant Recipe resources for VergeOS provisioning system.
Tenant recipes enable automated deployment of complete virtual data centers. A tenant recipe includes everything needed to spawn a functional tenant instance: tenant settings, networking configuration, VMs, and automation for tasks like creating passwords, establishing hostnames, registering DNS entries, etc.
- Key concepts:
Recipe: A template based on a powered-off tenant, stored in a catalog
Instance: A tenant created from a recipe (remains linked until detached)
Questions: Configuration inputs for customizing each tenant deployment
Sections: Logical groups organizing questions on the deployment form
- Benefits:
Rapid deployment of entire tenants with consistent configurations
Golden images for compliance and standardization
Reduced manual setup time and human error
Customizable via questions for tenant-specific settings
- Database Context:
Tenant recipe questions can interact with either the parent system database or the newly-created tenant’s database using the database_context field. This enables powerful automation like creating users, registering DNS, etc.
Example
>>> # List available tenant recipes
>>> for recipe in client.tenant_recipes.list(downloaded=True):
... print(f"{recipe.name} (v{recipe.version})")
>>> # Deploy a tenant recipe
>>> recipe = client.tenant_recipes.get(name="30-Day Trial (POC)")
>>> instance = recipe.deploy("customer-tenant", answers={
... "TENANT_NAME": "Acme Corp",
... "ADMIN_USER": "admin",
... "ADMIN_PASSWORD": "secure-password",
... })
- class pyvergeos.resources.tenant_recipes.TenantRecipe[source]
Bases:
ResourceObjectTenant Recipe resource object.
Represents a tenant recipe template that can be deployed to create new tenants.
Note
Recipe keys are 40-character hex strings, not integers like most other VergeOS resources.
- key
The recipe unique identifier ($key) - 40-char hex string.
- id
The recipe ID (same as $key).
- name
Recipe name.
- description
Recipe description.
- version
Recipe version string.
- build
Recipe build number.
- icon
Bootstrap icon name for UI display.
- catalog
Parent catalog key.
- status
Recipe status row key.
- downloaded
Whether the recipe has been downloaded.
- update_available
Whether an update is available.
- needs_republish
Whether the recipe needs republishing.
- tenant
Associated tenant key (for local recipes).
- tenant_snapshot
Associated tenant snapshot key.
- preserve_certs
Whether to preserve SSL certificates during deployment.
- creator
Username who created the recipe.
- property key: str
Resource primary key ($key) - 40-character hex string.
- Raises:
ValueError – If resource has no $key (not yet persisted).
- refresh()[source]
Refresh resource data from API.
- Returns:
Updated TenantRecipe object.
- Return type:
- save(**kwargs)[source]
Save changes to resource.
- Parameters:
**kwargs (Any) – Fields to update.
- Returns:
Updated TenantRecipe object.
- Return type:
- property instances: TenantRecipeInstanceManager
Get an instance manager scoped to this recipe.
- Returns:
TenantRecipeInstanceManager for this recipe.
- property logs: TenantRecipeLogManager
Get a log manager scoped to this recipe.
- Returns:
TenantRecipeLogManager for this recipe.
- class pyvergeos.resources.tenant_recipes.TenantRecipeInstance[source]
Bases:
ResourceObjectTenant Recipe instance resource object.
Represents a deployed instance of a tenant recipe.
- key
Instance $key (integer row ID).
- recipe
Recipe key that this instance was deployed from.
- tenant
Tenant key that was created.
- name
Instance/tenant name.
- version
Recipe version when deployed.
- build
Recipe build when deployed.
- answers
Recipe question answers used.
- created
Creation timestamp.
- modified
Last modified timestamp.
- class pyvergeos.resources.tenant_recipes.TenantRecipeLog[source]
Bases:
ResourceObjectTenant Recipe log entry resource object.
Represents a log entry from recipe operations.
- key
Log entry $key (integer row ID).
- tenant_recipe
Recipe key.
- level
Log level (message, warning, error, critical, etc.).
- text
Log message text.
- timestamp
Log timestamp (microseconds).
- user
User who triggered the log.
- class pyvergeos.resources.tenant_recipes.TenantRecipeManager[source]
Bases:
ResourceManager[TenantRecipe]Manager for tenant recipe operations.
Tenant recipes are templates for automated tenant provisioning.
Example
>>> # List all recipes >>> for recipe in client.tenant_recipes.list(): ... print(f"{recipe.name}: {recipe.version}")
>>> # Get a specific recipe >>> recipe = client.tenant_recipes.get(name="Standard Tenant")
>>> # Deploy a recipe >>> instance = recipe.deploy("my-tenant", answers={"storage_gb": 500})
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, catalog=None, downloaded=None, **filter_kwargs)[source]
List tenant recipes with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
catalog (str | int | None) – Filter by catalog (key or name).
downloaded (bool | None) – Filter by downloaded state.
**filter_kwargs (Any) – Shorthand filter arguments (name, etc.).
- Returns:
List of TenantRecipe objects.
- Return type:
Example
>>> # List all recipes >>> recipes = client.tenant_recipes.list()
>>> # List downloaded recipes only >>> downloaded = client.tenant_recipes.list(downloaded=True)
>>> # Filter by name >>> standard = client.tenant_recipes.list(name="Standard*")
- get(key=None, *, name=None, fields=None)[source]
Get a single tenant recipe by key or name.
- Parameters:
- Returns:
TenantRecipe object.
- Raises:
NotFoundError – If recipe not found.
ValueError – If no identifier provided.
- Return type:
Example
>>> # Get by key >>> recipe = client.tenant_recipes.get("8f73f8bcc9c9f1aaba32f733bfc295acaf548554")
>>> # Get by name >>> recipe = client.tenant_recipes.get(name="Standard Tenant")
- update(key, *, name=None, description=None, icon=None, version=None, preserve_certs=None)[source]
Update a tenant recipe.
- Parameters:
- Returns:
Updated TenantRecipe object.
- Return type:
Example
>>> client.tenant_recipes.update(recipe.key, description="Updated description")
- delete(key)[source]
Delete a tenant recipe.
This operation is destructive and cannot be undone.
- Parameters:
key (str) – Recipe $key (40-character hex string).
- Raises:
NotFoundError – If recipe not found.
- Return type:
None
Example
>>> client.tenant_recipes.delete(recipe.key)
- download(key)[source]
Download a recipe from the catalog repository.
- Parameters:
key (str) – Recipe $key (40-character hex string).
- Returns:
Task information dict or None.
- Return type:
Example
>>> client.tenant_recipes.download(recipe.key)
- deploy(key, name, *, answers=None)[source]
Deploy a recipe to create a new tenant.
- Parameters:
- Returns:
Created TenantRecipeInstance object.
- Return type:
Example
>>> instance = client.tenant_recipes.deploy( ... recipe.key, ... "my-tenant", ... answers={"storage_gb": 500, "cpu_cores": 4} ... )
- instances(key)[source]
Get an instance manager scoped to a specific recipe.
- Parameters:
key (str) – Recipe $key (40-character hex string).
- Returns:
TenantRecipeInstanceManager for the recipe.
- Return type:
- class pyvergeos.resources.tenant_recipes.TenantRecipeInstanceManager[source]
Bases:
ResourceManager[TenantRecipeInstance]Manager for tenant recipe instance operations.
Recipe instances represent deployed tenants created from recipes.
Example
>>> # List all instances >>> for inst in client.tenant_recipe_instances.list(): ... print(f"{inst.name}: {inst.version}")
>>> # List instances for a specific recipe >>> for inst in client.tenant_recipes.get(name="Standard").instances.list(): ... print(inst.name)
- __init__(client, *, recipe_key=None)[source]
- Parameters:
client (VergeClient)
recipe_key (str | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, recipe=None, **filter_kwargs)[source]
List recipe instances with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
recipe (str | None) – Filter by recipe key. Ignored if manager is scoped.
**filter_kwargs (Any) – Shorthand filter arguments (name, etc.).
- Returns:
List of TenantRecipeInstance objects.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a single recipe instance by key or name.
- Parameters:
- Returns:
TenantRecipeInstance object.
- Raises:
NotFoundError – If instance not found.
ValueError – If no identifier provided.
- Return type:
- create(recipe, name, *, answers=None)[source]
Create a new recipe instance (deploy a recipe).
- Parameters:
- Returns:
Created TenantRecipeInstance object.
- Return type:
Example
>>> instance = client.tenant_recipe_instances.create( ... recipe="8f73f8bcc9c9...", ... name="my-tenant", ... answers={"storage_gb": 500} ... )
- class pyvergeos.resources.tenant_recipes.TenantRecipeLogManager[source]
Bases:
ResourceManager[TenantRecipeLog]Manager for tenant recipe log operations.
Example
>>> # List all recipe logs >>> for log in client.tenant_recipe_logs.list(): ... print(f"{log.level}: {log.text}")
>>> # List logs for a specific recipe >>> for log in client.tenant_recipes.get(name="Standard").logs.list(): ... print(f"{log.level}: {log.text}")
- __init__(client, *, recipe_key=None)[source]
- Parameters:
client (VergeClient)
recipe_key (str | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, tenant_recipe=None, level=None, **filter_kwargs)[source]
List recipe logs with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
tenant_recipe (str | None) – Filter by recipe key. Ignored if manager is scoped.
level (str | None) – Filter by log level.
**filter_kwargs (Any) – Shorthand filter arguments.
- Returns:
List of TenantRecipeLog objects.
- Return type:
- get(key=None, *, fields=None)[source]
Get a single log entry by key.
- Parameters:
- Returns:
TenantRecipeLog object.
- Raises:
NotFoundError – If log entry not found.
ValueError – If key not provided.
- Return type:
- list_errors(limit=None)[source]
List error and critical log entries.
- Parameters:
limit (int | None) – Maximum number of results.
- Returns:
List of error/critical log entries.
- Return type:
Recipe Components
Questions and sections used in recipes.
Recipe Questions and Sections shared between VM and Tenant recipes.
Recipe questions define the configuration options presented to users when deploying a recipe. Questions are organized into sections that group related options together.
- Question Types:
- User Input Types:
string: Free-form text input
number: Numeric value (supports min/max)
boolean: Checkbox (true/false)
password: Masked text with confirmation
list: Dropdown selection from predefined options
text_area: Multi-line text input
hidden: Not shown on form (for internal values)
- VergeOS-Specific Types:
ram: RAM selector with unit conversion
disk_size: Disk size selector
cluster: Cluster selection dropdown
network: Network selection dropdown
row_selection: Database row picker
- Database Automation Types:
database_create: Create a database record
database_edit: Modify a database record
database_find: Look up database values
- Common Sections:
“Virtual Machine”: Core VM settings (CPU, RAM, hostname)
“Network”: Network and IP configuration
“Drives”: Storage/disk settings
“Static IP Configuration”: Manual IP settings
“User Configuration”: Guest OS user accounts
“$database”: Database automation (hidden from users)
- Variable Naming Convention:
Question names serve as variable names in recipe scripts. Common prefixes: - YB_* : VergeOS built-in variables (YB_RAM, YB_CPU_CORES, etc.) - SELECT_* : Selection/boolean options - Custom names for recipe-specific variables
Example
>>> # List questions for a recipe
>>> recipe = client.vm_recipes.get(name="Ubuntu Server")
>>> questions = client.recipe_questions.list(
... recipe_ref=f"vm_recipes/{recipe.key}"
... )
>>> for q in questions:
... print(f"{q.name}: {q.question_type} - {q.get('display')}")
>>> # Get sections for a recipe
>>> sections = client.recipe_sections.list(
... recipe_ref=f"vm_recipes/{recipe.key}"
... )
>>> for s in sections:
... print(f"{s.name}: {s.get('description', 'No description')}")
- class pyvergeos.resources.recipe_common.RecipeQuestion[source]
Bases:
ResourceObjectRecipe question resource object.
Represents a configuration question for a recipe. Questions are used to gather input during recipe deployment.
- key
Question $key (integer row ID).
- recipe
Recipe reference (e.g., “vm_recipes/{id}” or “tenant_recipes/{id}”).
- section
Section key this question belongs to.
- name
Question variable name (used in recipe scripts).
- display
Display label for the question.
- hint
Placeholder text shown in input field.
- help
Tooltip text shown on hover.
- note
Note text displayed below the field.
- type
Question type (string, bool, num, password, list, etc.).
- default
Default value for the question.
- required
Whether the question is required.
- enabled
Whether the question is enabled.
- readonly
Whether the question is read-only after creation.
- orderid
Display order within the section.
Check if this is a hidden question.
- class pyvergeos.resources.recipe_common.RecipeSection[source]
Bases:
ResourceObjectRecipe section resource object.
Represents a section that groups related questions in a recipe form.
- key
Section $key (integer row ID).
- recipe
Recipe reference (e.g., “vm_recipes/{id}” or “tenant_recipes/{id}”).
- name
Section name.
- description
Section description.
- orderid
Display order.
- class pyvergeos.resources.recipe_common.RecipeQuestionManager[source]
Bases:
ResourceManager[RecipeQuestion]Manager for recipe question operations.
Recipe questions define the configuration options available when deploying a recipe. Questions are organized into sections.
Example
>>> # List all questions for a VM recipe >>> questions = client.recipe_questions.list( ... recipe_ref="vm_recipes/8f73f8bcc9c9..." ... ) >>> for q in questions: ... print(f"{q.name}: {q.question_type} (required={q.is_required})")
>>> # List questions for a specific section >>> questions = client.recipe_questions.list(section=123)
- __init__(client, *, recipe_ref=None, section_key=None)[source]
- Parameters:
client (VergeClient)
recipe_ref (str | None)
section_key (int | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, recipe_ref=None, section=None, enabled=None, **filter_kwargs)[source]
List recipe questions with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
recipe_ref (str | None) – Filter by recipe reference (e.g., “vm_recipes/{id}”).
section (int | None) – Filter by section key.
enabled (bool | None) – Filter by enabled state.
**filter_kwargs (Any) – Shorthand filter arguments (name, type, etc.).
- Returns:
List of RecipeQuestion objects.
- Return type:
Example
>>> # List all questions for a VM recipe >>> questions = client.recipe_questions.list( ... recipe_ref="vm_recipes/8f73f8bcc9c9..." ... )
>>> # List enabled questions only >>> enabled = client.recipe_questions.list(enabled=True)
- get(key=None, *, name=None, fields=None)[source]
Get a single recipe question by key or name.
- Parameters:
- Returns:
RecipeQuestion object.
- Raises:
NotFoundError – If question not found.
ValueError – If no identifier provided.
- Return type:
- create(name, recipe_ref, section, question_type, *, display=None, hint=None, help_text=None, note=None, default=None, required=False, enabled=True, readonly=False, min_value=None, max_value=None, regex=None, list_options=None, table=None, fields=None, db_filter=None, database_context=None, hide_none=False, conditions=None, on_change=None, postprocess_string=None, dont_store=False)[source]
Create a new recipe question.
- Parameters:
name (str) – Variable name for the question (alphanumeric with underscores).
recipe_ref (str) – Recipe reference (e.g., “vm_recipes/{id}”).
section (int) – Section key to add the question to.
question_type (str) – Question type (string, bool, num, password, list, etc.).
display (str | None) – Display label.
hint (str | None) – Placeholder text.
help_text (str | None) – Tooltip text.
note (str | None) – Note text below field.
default (str | None) – Default value.
required (bool) – Whether the question is required.
enabled (bool) – Whether the question is enabled.
readonly (bool) – Whether the question is read-only after creation.
min_value (int | None) – Minimum value (for numeric types).
max_value (int | None) – Maximum value (for numeric types).
regex (str | None) – Validation regex.
list_options (dict[str, str] | None) – Options for list type (key: value dict).
table (str | None) – Database table for row selection type.
fields (str | None) – Database fields for row selection.
db_filter (str | None) – Database filter for row selection.
database_context (str | None) – Database context (local or tenant).
hide_none (bool) – Hide the “None” option in lists.
conditions (dict[str, Any] | None) – Conditional visibility rules.
postprocess_string (str | None) – Post-processing type.
dont_store (bool) – Don’t store the answer in the database.
- Returns:
Created RecipeQuestion object.
- Return type:
Example
>>> question = client.recipe_questions.create( ... name="vm_ram", ... recipe_ref="vm_recipes/8f73f8bcc9c9...", ... section=123, ... question_type="ram", ... display="RAM", ... default="4096", ... required=True ... )
- update(key, *, display=None, hint=None, help_text=None, note=None, default=None, required=None, enabled=None, readonly=None, min_value=None, max_value=None, orderid=None)[source]
Update a recipe question.
- Parameters:
key (int) – Question $key (row ID).
display (str | None) – New display label.
hint (str | None) – New placeholder text.
help_text (str | None) – New tooltip text.
note (str | None) – New note text.
default (str | None) – New default value.
required (bool | None) – Set required state.
enabled (bool | None) – Set enabled state.
readonly (bool | None) – Set readonly state.
min_value (int | None) – New minimum value.
max_value (int | None) – New maximum value.
orderid (int | None) – New display order.
- Returns:
Updated RecipeQuestion object.
- Return type:
- class pyvergeos.resources.recipe_common.RecipeSectionManager[source]
Bases:
ResourceManager[RecipeSection]Manager for recipe section operations.
Recipe sections organize questions into logical groups.
Example
>>> # List all sections for a VM recipe >>> sections = client.recipe_sections.list( ... recipe_ref="vm_recipes/8f73f8bcc9c9..." ... ) >>> for s in sections: ... print(f"{s.name}: {s.description}")
>>> # Create a new section >>> section = client.recipe_sections.create( ... name="Network Settings", ... recipe_ref="vm_recipes/8f73f8bcc9c9...", ... description="Network configuration options" ... )
- __init__(client, *, recipe_ref=None)[source]
- Parameters:
client (VergeClient)
recipe_ref (str | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, recipe_ref=None, **filter_kwargs)[source]
List recipe sections with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
recipe_ref (str | None) – Filter by recipe reference (e.g., “vm_recipes/{id}”).
**filter_kwargs (Any) – Shorthand filter arguments (name, etc.).
- Returns:
List of RecipeSection objects.
- Return type:
Example
>>> # List all sections for a VM recipe >>> sections = client.recipe_sections.list( ... recipe_ref="vm_recipes/8f73f8bcc9c9..." ... )
- get(key=None, *, name=None, fields=None)[source]
Get a single recipe section by key or name.
- Parameters:
- Returns:
RecipeSection object.
- Raises:
NotFoundError – If section not found.
ValueError – If no identifier provided.
- Return type:
- create(name, recipe_ref, *, description=None)[source]
Create a new recipe section.
- Parameters:
- Returns:
Created RecipeSection object.
- Return type:
Example
>>> section = client.recipe_sections.create( ... name="Network Settings", ... recipe_ref="vm_recipes/8f73f8bcc9c9...", ... description="Network configuration options" ... )
- update(key, *, name=None, description=None, orderid=None)[source]
Update a recipe section.
- Parameters:
- Returns:
Updated RecipeSection object.
- Return type:
- delete(key)[source]
Delete a recipe section.
Note: This will also delete all questions in the section.
- Parameters:
key (int) – Section $key (row ID).
- Return type:
None
Catalogs
Recipe catalog and repository management.
Catalog management resources for VergeOS recipe repositories.
Catalogs organize recipes (VM and tenant templates) into logical groups. Catalog repositories define where catalogs are sourced from - local, remote, or from the Verge.io marketplace.
- Key concepts:
Repository: A source of catalogs (local, remote, git, Verge.io marketplace)
Catalog: A collection of related recipes within a repository
Status: Current state of a repository (online, refreshing, error, etc.)
- Repository types:
local: Locally created catalogs and recipes
provider: Service provider catalogs (inherited from parent)
remote: Remote HTTP/HTTPS URL
remote-git: Remote Git repository
yottabyte: Verge.io official marketplace
Example
>>> # List all catalog repositories
>>> for repo in client.catalog_repositories.list():
... print(f"{repo.name} ({repo.type}): {repo.status_info}")
>>> # Get repository with catalogs
>>> repo = client.catalog_repositories.get(name="Verge.io Recipes")
>>> for catalog in repo.catalogs.list():
... print(f" {catalog.name}: {catalog.description}")
>>> # Refresh a repository to get latest recipes
>>> repo.refresh_catalogs()
>>> # View repository logs
>>> for log in repo.logs.list(limit=10):
... print(f"{log.level}: {log.text}")
- class pyvergeos.resources.catalogs.CatalogRepositoryStatus[source]
Bases:
ResourceObjectCatalog repository status resource object.
Represents the current operational status of a catalog repository.
- key
Status $key (row ID).
- repository
Parent repository key.
- status
Current status (online, refreshing, downloading, etc.).
- state
State indicator (online, offline, warning, error).
- info
Additional status information text.
- last_update
Timestamp of last status change.
- class pyvergeos.resources.catalogs.CatalogRepositoryStatusManager[source]
Bases:
ResourceManager[CatalogRepositoryStatus]Manager for catalog repository status operations.
Status objects are read-only and automatically created for each repository.
Example
>>> # Get status for all repositories >>> for status in client.catalog_repository_status.list(): ... print(f"{status.repository_key}: {status.status}")
>>> # Get status for a specific repository >>> status = client.catalog_repository_status.get_for_repository(1)
- __init__(client, *, repository_key=None)[source]
- Parameters:
client (VergeClient)
repository_key (int | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, repository=None, **filter_kwargs)[source]
List repository status records with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
repository (int | None) – Filter by repository key. Ignored if manager is scoped.
**filter_kwargs (Any) – Shorthand filter arguments.
- Returns:
List of CatalogRepositoryStatus objects.
- Return type:
- get(key=None, *, fields=None)[source]
Get a single status record by key.
- Parameters:
- Returns:
CatalogRepositoryStatus object.
- Raises:
NotFoundError – If status not found.
ValueError – If key not provided.
- Return type:
- get_for_repository(repository_key)[source]
Get status for a specific repository.
- Parameters:
repository_key (int) – Repository $key.
- Returns:
CatalogRepositoryStatus object.
- Raises:
NotFoundError – If status not found.
- Return type:
- class pyvergeos.resources.catalogs.CatalogRepositoryLog[source]
Bases:
ResourceObjectCatalog repository log entry resource object.
Represents a log entry from repository operations.
- key
Log entry $key (row ID).
- catalog_repository
Repository key.
- level
Log level (message, warning, error, critical, etc.).
- text
Log message text.
- timestamp
Log timestamp (microseconds).
- user
User who triggered the log.
- class pyvergeos.resources.catalogs.CatalogRepositoryLogManager[source]
Bases:
ResourceManager[CatalogRepositoryLog]Manager for catalog repository log operations.
Example
>>> # List all repository logs >>> for log in client.catalog_repository_logs.list(): ... print(f"{log.level}: {log.text}")
>>> # List logs for a specific repository >>> for log in repo.logs.list(): ... print(f"{log.level}: {log.text}")
- __init__(client, *, repository_key=None)[source]
- Parameters:
client (VergeClient)
repository_key (int | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, catalog_repository=None, level=None, **filter_kwargs)[source]
List repository logs with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
catalog_repository (int | None) – Filter by repository key. Ignored if scoped.
level (str | None) – Filter by log level.
**filter_kwargs (Any) – Shorthand filter arguments.
- Returns:
List of CatalogRepositoryLog objects.
- Return type:
- get(key=None, *, fields=None)[source]
Get a single log entry by key.
- Parameters:
- Returns:
CatalogRepositoryLog object.
- Raises:
NotFoundError – If log entry not found.
ValueError – If key not provided.
- Return type:
- list_errors(limit=None)[source]
List error and critical log entries.
- Parameters:
limit (int | None) – Maximum number of results.
- Returns:
List of error/critical log entries.
- Return type:
- class pyvergeos.resources.catalogs.CatalogLog[source]
Bases:
ResourceObjectCatalog log entry resource object.
Represents a log entry from catalog operations.
- key
Log entry $key (row ID).
- catalog
Catalog key (40-char hex string).
- level
Log level (message, warning, error, critical, etc.).
- text
Log message text.
- timestamp
Log timestamp (microseconds).
- user
User who triggered the log.
- class pyvergeos.resources.catalogs.CatalogLogManager[source]
Bases:
ResourceManager[CatalogLog]Manager for catalog log operations.
Example
>>> # List all catalog logs >>> for log in client.catalog_logs.list(): ... print(f"{log.level}: {log.text}")
>>> # List logs for a specific catalog >>> for log in catalog.logs.list(): ... print(f"{log.level}: {log.text}")
- __init__(client, *, catalog_key=None)[source]
- Parameters:
client (VergeClient)
catalog_key (str | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, catalog=None, level=None, **filter_kwargs)[source]
List catalog logs with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
catalog (str | None) – Filter by catalog key. Ignored if manager is scoped.
level (str | None) – Filter by log level.
**filter_kwargs (Any) – Shorthand filter arguments.
- Returns:
List of CatalogLog objects.
- Return type:
- get(key=None, *, fields=None)[source]
Get a single log entry by key.
- Parameters:
- Returns:
CatalogLog object.
- Raises:
NotFoundError – If log entry not found.
ValueError – If key not provided.
- Return type:
- list_errors(limit=None)[source]
List error and critical log entries.
- Parameters:
limit (int | None) – Maximum number of results.
- Returns:
List of error/critical log entries.
- Return type:
- class pyvergeos.resources.catalogs.Catalog[source]
Bases:
ResourceObjectCatalog resource object.
Represents a catalog containing recipes.
Note
Catalog keys are 40-character hex strings, not integers like most other VergeOS resources.
- key
The catalog unique identifier ($key) - 40-char hex string.
- id
The catalog ID (same as $key).
- repository
Parent repository key.
- name
Catalog name.
- description
Catalog description.
- publishing_scope
Scope (private, global, tenant, none).
- enabled
Whether the catalog is enabled.
- created
Creation timestamp.
- property key: str
Resource primary key ($key) - 40-character hex string.
- Raises:
ValueError – If resource has no $key (not yet persisted).
- property logs: CatalogLogManager
Get a log manager scoped to this catalog.
- Returns:
CatalogLogManager for this catalog.
- class pyvergeos.resources.catalogs.CatalogManager[source]
Bases:
ResourceManager[Catalog]Manager for catalog operations.
Catalogs organize recipes into logical groups within repositories.
Example
>>> # List all catalogs >>> for catalog in client.catalogs.list(): ... print(f"{catalog.name}: {catalog.description}")
>>> # List catalogs in a specific repository >>> for catalog in client.catalogs.list(repository=1): ... print(f"{catalog.name}")
>>> # Get a specific catalog >>> catalog = client.catalogs.get(name="VergeOS Recipes")
- __init__(client, *, repository_key=None)[source]
- Parameters:
client (VergeClient)
repository_key (int | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, repository=None, enabled=None, **filter_kwargs)[source]
List catalogs with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
repository (int | None) – Filter by repository key. Ignored if manager is scoped.
enabled (bool | None) – Filter by enabled state.
**filter_kwargs (Any) – Shorthand filter arguments (name, etc.).
- Returns:
List of Catalog objects.
- Return type:
Example
>>> # List all catalogs >>> catalogs = client.catalogs.list()
>>> # List enabled catalogs only >>> catalogs = client.catalogs.list(enabled=True)
>>> # Filter by name >>> catalogs = client.catalogs.list(name="VergeOS*")
- get(key=None, *, name=None, fields=None)[source]
Get a single catalog by key or name.
- Parameters:
- Returns:
Catalog object.
- Raises:
NotFoundError – If catalog not found.
ValueError – If no identifier provided.
- Return type:
Example
>>> # Get by key >>> catalog = client.catalogs.get("8f73f8bcc9c9f1aaba32f733bfc295acaf548554")
>>> # Get by name >>> catalog = client.catalogs.get(name="VergeOS Recipes")
- create(name, *, repository, description=None, publishing_scope='private', enabled=True)[source]
Create a new catalog.
- Parameters:
- Returns:
Created Catalog object.
- Return type:
Example
>>> catalog = client.catalogs.create( ... name="My Recipes", ... repository=1, ... description="Custom VM recipes", ... publishing_scope="private" ... )
- update(key, *, name=None, description=None, publishing_scope=None, enabled=None)[source]
Update a catalog.
- Parameters:
- Returns:
Updated Catalog object.
- Return type:
Example
>>> client.catalogs.update(catalog.key, description="Updated description")
- delete(key)[source]
Delete a catalog.
This operation is destructive and cannot be undone. All recipes in the catalog will be deleted.
- Parameters:
key (str) – Catalog $key (40-character hex string).
- Raises:
NotFoundError – If catalog not found.
- Return type:
None
Example
>>> client.catalogs.delete(catalog.key)
- class pyvergeos.resources.catalogs.CatalogRepository[source]
Bases:
ResourceObjectCatalog repository resource object.
Represents a source of catalogs and recipes.
- key
Repository $key (row ID).
- name
Repository name.
- description
Repository description.
- type
Repository type (local, provider, remote, remote-git, yottabyte).
- url
URL for remote repositories.
- user
Username for authentication.
- allow_insecure
Allow insecure SSL certificates.
- auto_refresh
Automatically refresh repository.
- max_tier
Maximum storage tier for downloaded recipes.
- override_default_scope
Override default publishing scope.
- enabled
Whether the repository is enabled.
- last_refreshed
Timestamp of last refresh.
- property status_info: str | None
Get the current status from the status object.
Note: This may require fetching status separately for full details.
- property status: CatalogRepositoryStatusManager
Get a status manager scoped to this repository.
- Returns:
CatalogRepositoryStatusManager for this repository.
- property catalogs: CatalogManager
Get a catalog manager scoped to this repository.
- Returns:
CatalogManager for this repository.
- property logs: CatalogRepositoryLogManager
Get a log manager scoped to this repository.
- Returns:
CatalogRepositoryLogManager for this repository.
- class pyvergeos.resources.catalogs.CatalogRepositoryManager[source]
Bases:
ResourceManager[CatalogRepository]Manager for catalog repository operations.
Catalog repositories define where catalogs and recipes are sourced from.
Example
>>> # List all repositories >>> for repo in client.catalog_repositories.list(): ... print(f"{repo.name} ({repo.type})")
>>> # Get the local repository >>> local = client.catalog_repositories.get(name="Local")
>>> # Get the Verge.io marketplace >>> marketplace = client.catalog_repositories.get(name="Verge.io Recipes")
>>> # Refresh a repository >>> repo.refresh()
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, type=None, enabled=None, **filter_kwargs)[source]
List repositories with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
type (str | None) – Filter by repository type.
enabled (bool | None) – Filter by enabled state.
**filter_kwargs (Any) – Shorthand filter arguments (name, etc.).
- Returns:
List of CatalogRepository objects.
- Return type:
Example
>>> # List all repositories >>> repos = client.catalog_repositories.list()
>>> # List enabled repositories only >>> repos = client.catalog_repositories.list(enabled=True)
>>> # List remote repositories >>> repos = client.catalog_repositories.list(type="remote")
- get(key=None, *, name=None, fields=None)[source]
Get a single repository by key or name.
- Parameters:
- Returns:
CatalogRepository object.
- Raises:
NotFoundError – If repository not found.
ValueError – If no identifier provided.
- Return type:
Example
>>> # Get by key >>> repo = client.catalog_repositories.get(1)
>>> # Get by name >>> repo = client.catalog_repositories.get(name="Local")
- create(name, *, type='local', description=None, url=None, user=None, password=None, allow_insecure=False, auto_refresh=True, max_tier='1', override_default_scope='none', enabled=True)[source]
Create a new catalog repository.
- Parameters:
name (str) – Repository name.
type (str) – Repository type (local, remote, remote-git, yottabyte).
description (str | None) – Repository description.
url (str | None) – URL for remote repositories.
user (str | None) – Username for authentication.
password (str | None) – Password for authentication.
allow_insecure (bool) – Allow insecure SSL certificates.
auto_refresh (bool) – Automatically refresh repository.
max_tier (str) – Maximum storage tier for downloads (1-5).
override_default_scope (str) – Override default publishing scope.
enabled (bool) – Whether the repository is enabled.
- Returns:
Created CatalogRepository object.
- Return type:
Example
>>> # Create a local repository >>> repo = client.catalog_repositories.create( ... name="My Recipes", ... type="local", ... description="Custom local recipes" ... )
>>> # Create a remote repository >>> repo = client.catalog_repositories.create( ... name="Partner Recipes", ... type="remote", ... url="https://recipes.example.com/api/v4", ... user="api-user", ... password="api-key" ... )
- update(key, *, name=None, description=None, url=None, user=None, password=None, allow_insecure=None, auto_refresh=None, max_tier=None, override_default_scope=None, enabled=None)[source]
Update a catalog repository.
- Parameters:
key (int) – Repository $key (row ID).
name (str | None) – New name.
description (str | None) – New description.
url (str | None) – New URL.
user (str | None) – New username.
password (str | None) – New password.
allow_insecure (bool | None) – Allow insecure SSL certificates.
auto_refresh (bool | None) – Automatically refresh repository.
max_tier (str | None) – Maximum storage tier.
override_default_scope (str | None) – Override default scope.
enabled (bool | None) – Enable or disable.
- Returns:
Updated CatalogRepository object.
- Return type:
Example
>>> client.catalog_repositories.update( ... repo.key, ... description="Updated description", ... auto_refresh=False ... )
- delete(key)[source]
Delete a catalog repository.
This operation is destructive and cannot be undone. All catalogs and recipes in the repository will be deleted.
Note: The default “Local” repository (key=1) cannot be deleted.
- Parameters:
key (int) – Repository $key (row ID).
- Raises:
NotFoundError – If repository not found.
APIError – If repository cannot be deleted.
- Return type:
None
Example
>>> client.catalog_repositories.delete(repo.key)
- refresh(key)[source]
Refresh a repository to fetch latest catalogs/recipes.
This triggers a refresh operation that connects to the remote source and downloads any new or updated catalogs and recipes.
- Parameters:
key (int) – Repository $key (row ID).
- Returns:
Task information dict or None.
- Return type:
Example
>>> result = client.catalog_repositories.refresh(repo.key)
- get_status(key)[source]
Get the current status for a repository.
- Parameters:
key (int) – Repository $key (row ID).
- Returns:
CatalogRepositoryStatus object.
- Return type:
- catalogs(key)[source]
Get a catalog manager scoped to a specific repository.
- Parameters:
key (int) – Repository $key (row ID).
- Returns:
CatalogManager for the repository.
- Return type:
Task Scheduling
Tasks
Task management and waiting.
Task resource manager with wait functionality and scheduling support.
The VergeOS Task Engine enables automated operations triggered either by specific events or scheduled times. Tasks define the action to perform (e.g., power off a VM, send a notification, take a snapshot).
- Task Engine Components:
Tasks: Define the action to perform on a target object
Schedules: Specify when and how often a task should run
Events: Define conditions that trigger a task (e.g., user login)
Schedule Triggers: Link tasks to schedules
Event Triggers: Link tasks to events
- Event-Based Examples:
Power on a VM when a designated user logs into VergeOS
Send email notification when a system update completes
Use a webhook to notify an external system when sync errors occur
- Schedule-Based Examples:
Check for system updates every Saturday at 5:00 PM
Power off a tenant on a specific date
Run backup tasks daily at 2 AM
Example
>>> # List all tasks
>>> for task in client.tasks.list():
... print(f"{task.name}: {task.status}")
>>> # Create a task to power on VMs with a specific tag
>>> task = client.tasks.create(
... name="Power On Dev VMs",
... owner=vm.key,
... action="poweron",
... description="Power on development VMs when user logs in",
... )
>>> # Link task to a schedule (e.g., Fridays at 6 PM)
>>> trigger = client.task_schedule_triggers.create(
... task=task.key,
... schedule=friday_schedule.key,
... )
>>> # Execute a task manually
>>> task.execute()
>>> task.wait(timeout=300)
- class pyvergeos.resources.tasks.Task[source]
Bases:
ResourceObjectTask resource object.
Represents a scheduled or running task in VergeOS.
- Properties:
name: Task name. description: Task description. status: Task status (‘idle’ or ‘running’). is_complete: True if task is complete (idle). is_running: True if task is currently running. is_enabled: True if task is enabled. has_error: True if task has an error status. progress: Task progress percentage (0-100). action: The action type this task performs. action_display: Human-readable action description. owner_key: Key of the owner object. owner_display: Display name of the owner. creator_key: Key of the user who created the task. creator_display: Display name of the creator. last_run: Timestamp of last run. delete_after_run: Whether task deletes itself after running. task_id: Unique task identifier (40-char hex string).
- property triggers: TaskScheduleTriggerManager
Get trigger manager scoped to this task.
- Returns:
TaskScheduleTriggerManager for this task’s triggers.
Example
>>> for trigger in task.triggers.list(): ... print(f"Schedule: {trigger.schedule_display}")
- property events: TaskEventManager
Get event manager scoped to this task.
- Returns:
TaskEventManager for this task’s events.
Example
>>> for event in task.events.list(): ... print(f"Event: {event.event_name_display}")
- wait(timeout=300, poll_interval=2, raise_on_error=True)[source]
Wait for this task to complete.
- Parameters:
- Returns:
Completed Task object.
- Raises:
TaskTimeoutError – If timeout exceeded.
TaskError – If task fails and raise_on_error=True.
- Return type:
- class pyvergeos.resources.tasks.TaskManager[source]
Bases:
ResourceManager[Task]Manager for Task operations with wait functionality.
Tasks in VergeOS represent scheduled automation operations. They can be scheduled to run at specific times or triggered by events. Tasks can also be run manually.
Example
>>> # List all tasks >>> tasks = client.tasks.list() >>> for task in tasks: ... print(f"{task.name}: {task.status}")
>>> # List running tasks >>> running = client.tasks.list_running()
>>> # Wait for a task to complete >>> task = client.tasks.wait(task_key, timeout=300)
>>> # Enable/disable a task >>> client.tasks.enable(task_key) >>> client.tasks.disable(task_key)
>>> # Execute a task manually >>> task = client.tasks.execute(task_key)
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, status=None, running=None, enabled=None, name=None, **filter_kwargs)[source]
List tasks with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
status (str | None) – Filter by status (‘running’ or ‘idle’).
running (bool | None) – If True, filter for running tasks only.
enabled (bool | None) – Filter by enabled state.
name (str | None) – Filter by name (supports partial match with ‘ct’ operator).
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of Task objects.
- Return type:
Example
>>> # All tasks >>> tasks = client.tasks.list()
>>> # Running tasks only >>> running = client.tasks.list(running=True)
>>> # Disabled tasks >>> disabled = client.tasks.list(enabled=False)
>>> # Tasks by name pattern >>> backup_tasks = client.tasks.list(name="Backup")
- get(key=None, *, name=None, fields=None)[source]
Get a task by key or name.
- Parameters:
- Returns:
Task object.
- Raises:
NotFoundError – If task not found.
ValueError – If neither key nor name provided.
- Return type:
- wait(key, timeout=300, poll_interval=2, raise_on_error=True)[source]
Wait for a task to complete.
Polls the task status until it becomes idle or an error occurs.
- Parameters:
- Returns:
Completed Task object.
- Raises:
TaskTimeoutError – If timeout exceeded.
TaskError – If task fails and raise_on_error=True.
- Return type:
Example
>>> # Wait for task with 5 minute timeout >>> task = client.tasks.wait(task_key, timeout=300)
>>> # Wait indefinitely >>> task = client.tasks.wait(task_key, timeout=0)
>>> # Don't raise on error, handle manually >>> task = client.tasks.wait(task_key, raise_on_error=False) >>> if task.has_error: ... print(f"Task failed: {task.get('error')}")
- enable(key)[source]
Enable a task.
Enables a previously disabled task so it can run according to its schedule or event triggers.
Example
>>> task = client.tasks.enable(task_key) >>> print(task.is_enabled) # True
- disable(key)[source]
Disable a task.
Disables a task to prevent it from running. If the task is currently running, it will complete but won’t run again until re-enabled.
Example
>>> task = client.tasks.disable(task_key) >>> print(task.is_enabled) # False
- execute(key, **params)[source]
Execute a task immediately.
Triggers a task to run now, regardless of its schedule.
- Parameters:
- Returns:
Updated Task object.
- Return type:
Example
>>> # Run a backup task immediately >>> task = client.tasks.execute(backup_task_key) >>> task.wait() # Wait for completion
- cancel(key)[source]
Cancel a running task.
Attempts to cancel a task that is currently running.
Note
Not all tasks support cancellation. Some tasks may complete their current operation before stopping.
- create(name, owner, action, *, table, description=None, enabled=True, delete_after_run=False, settings_args=None)[source]
Create a new task.
- Parameters:
name (str) – Task name (required).
owner (int) – Owner resource $key (required).
action (str) – Action type to perform (required).
table (str) – Owner table name (required, e.g.
"vms"). Combined with owner to form the"table/key"reference.description (str | None) – Task description.
enabled (bool) – Whether task is enabled (default True).
delete_after_run (bool) – Delete task after execution (default False).
settings_args (dict[str, Any] | None) – Task settings arguments (JSON).
- Returns:
Created Task object.
- Return type:
Example
>>> # Create a snapshot task for a VM >>> task = client.tasks.create( ... name="Daily Snapshot", ... owner=vm.key, ... action="snapshot", ... table="vms", ... description="Daily snapshot of production VM", ... )
>>> # Create a one-time task that deletes itself >>> task = client.tasks.create( ... name="One-time Backup", ... owner=vm.key, ... action="snapshot", ... table="vms", ... delete_after_run=True, ... )
- update(key, *, name=None, description=None, enabled=None, delete_after_run=None, settings_args=None)[source]
Update an existing task.
- Parameters:
- Returns:
Updated Task object.
- Return type:
Example
>>> task = client.tasks.update( ... task.key, ... description="Updated description", ... enabled=False, ... )
- delete(key)[source]
Delete a task.
Removes the task and its associated triggers and events.
- Parameters:
key (int) – Task $key (ID).
- Return type:
None
Example
>>> client.tasks.delete(task.key)
- triggers(key)[source]
Get trigger manager scoped to a specific task.
- Parameters:
key (int) – Task $key (ID).
- Returns:
TaskScheduleTriggerManager for the task.
- Return type:
Example
>>> for trigger in client.tasks.triggers(task.key).list(): ... print(f"Schedule: {trigger.schedule_display}")
- events(key)[source]
Get event manager scoped to a specific task.
- Parameters:
key (int) – Task $key (ID).
- Returns:
TaskEventManager for the task.
- Return type:
Example
>>> for event in client.tasks.events(task.key).list(): ... print(f"Event: {event.event_name_display}")
- list_by_owner(owner_key, fields=None, limit=None)[source]
List tasks for a specific owner resource.
Task Schedules
Cron-style schedule definitions.
Task schedule resource manager for VergeOS scheduling system.
Task schedules specify when and how often tasks should run (e.g., daily, weekly, monthly). Schedules are reusable - you can create a schedule once and apply it to multiple tasks for consistent configuration management.
- Supported repeat intervals:
minute: Run every N minutes
hour: Run every N hours
day: Run every N days
week: Run every N weeks (with day-of-week options)
month: Run every N months (with day-of-month options)
year: Run every N years
never: Does not repeat (run once)
- Schedule-Based Task Examples:
Check for and download system updates every Saturday at 5:00 PM
Power off a tenant on a specific date
Disable a user account 30 days after creation
Example
>>> # Create a schedule that runs every hour
>>> schedule = client.task_schedules.create(
... name="Hourly Backup",
... repeat_every="hour",
... repeat_iteration=1,
... )
>>> # Create a schedule for Fridays at 6:00 PM (64800 seconds from midnight)
>>> schedule = client.task_schedules.create(
... name="Friday EOB",
... repeat_every="week",
... start_time_of_day=64800, # 18:00 (6 PM)
... monday=False,
... tuesday=False,
... wednesday=False,
... thursday=False,
... friday=True,
... saturday=False,
... sunday=False,
... )
>>> # Create a weekday-only schedule
>>> schedule = client.task_schedules.create(
... name="Weekday Reports",
... repeat_every="day",
... saturday=False,
... sunday=False,
... )
- class pyvergeos.resources.task_schedules.TaskSchedule[source]
Bases:
ResourceObjectTask schedule resource object.
Represents a schedule definition for task automation.
- Properties:
name: Schedule name. description: Schedule description. is_enabled: Whether the schedule is enabled. repeat_every: Repeat interval (minute, hour, day, week, month, year, never). repeat_iteration: Number of intervals between executions. start_date: Start date in YYYY-MM-DD format. end_date: Expiration date in YYYY-MM-DD HH:MM:SS format. start_time_of_day: Start time in seconds from midnight. end_time_of_day: End time in seconds from midnight. day_of_month: Day of month setting for monthly schedules. monday-sunday: Boolean flags for weekly schedules. task_key: Bound task key (if schedule is task-specific). is_system_created: Whether created by system. creator_key: Key of the user who created the schedule.
- property triggers: TaskScheduleTriggerManager
Get trigger manager scoped to this schedule.
- Returns:
TaskScheduleTriggerManager for this schedule.
- class pyvergeos.resources.task_schedules.TaskScheduleManager[source]
Bases:
ResourceManager[TaskSchedule]Manager for task schedule operations.
Task schedules define when and how often tasks should run.
Example
>>> # List all schedules >>> for schedule in client.task_schedules.list(): ... print(f"{schedule.name}: {schedule.repeat_every_display}")
>>> # Create a daily schedule >>> schedule = client.task_schedules.create( ... name="Daily Backup", ... repeat_every="day", ... start_time_of_day=7200, # 2 AM ... )
>>> # Enable/disable >>> schedule.disable() >>> schedule.enable()
>>> # Get upcoming execution times >>> times = schedule.get_schedule(max_results=10)
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, enabled=None, repeat_every=None, name=None, **filter_kwargs)[source]
List task schedules with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
enabled (bool | None) – Filter by enabled state.
repeat_every (str | None) – Filter by repeat interval.
name (str | None) – Filter by name.
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of TaskSchedule objects.
- Return type:
Example
>>> # All schedules >>> schedules = client.task_schedules.list()
>>> # Enabled daily schedules >>> daily = client.task_schedules.list(enabled=True, repeat_every="day")
>>> # Schedules by name pattern >>> backups = client.task_schedules.list(name="Backup*")
- get(key=None, *, name=None, fields=None)[source]
Get a task schedule by key or name.
- Parameters:
- Returns:
TaskSchedule object.
- Raises:
NotFoundError – If schedule not found.
ValueError – If neither key nor name provided.
- Return type:
- create(name, *, description=None, enabled=True, repeat_every='hour', repeat_iteration=1, start_date=None, end_date=None, start_time_of_day=0, end_time_of_day=86400, day_of_month='start_date', monday=True, tuesday=True, wednesday=True, thursday=True, friday=True, saturday=True, sunday=True, task=None)[source]
Create a new task schedule.
- Parameters:
name (str) – Schedule name (required).
description (str | None) – Schedule description.
enabled (bool) – Whether schedule is enabled (default True).
repeat_every (str) – Repeat interval (minute, hour, day, week, month, year, never).
repeat_iteration (int) – Number of intervals between executions (default 1).
start_date (str | None) – Start date in YYYY-MM-DD format.
end_date (str | None) – Expiration date in YYYY-MM-DD HH:MM:SS format.
start_time_of_day (int) – Start time in seconds from midnight (0-86400).
end_time_of_day (int) – End time in seconds from midnight (0-86400).
day_of_month (str) – Day of month for monthly schedules (first, last, 15th, start_date).
monday-sunday – Boolean flags for weekly schedules.
task (int | None) – Bind to specific task key.
monday (bool)
tuesday (bool)
wednesday (bool)
thursday (bool)
friday (bool)
saturday (bool)
sunday (bool)
- Returns:
Created TaskSchedule object.
- Return type:
Example
>>> # Hourly schedule >>> schedule = client.task_schedules.create( ... name="Hourly Check", ... repeat_every="hour", ... repeat_iteration=1, ... )
>>> # Daily at 2 AM (7200 seconds from midnight) >>> schedule = client.task_schedules.create( ... name="Nightly Backup", ... repeat_every="day", ... start_time_of_day=7200, ... )
>>> # Weekly on weekdays only >>> schedule = client.task_schedules.create( ... name="Weekday Report", ... repeat_every="week", ... saturday=False, ... sunday=False, ... )
- update(key, *, name=None, description=None, enabled=None, repeat_every=None, repeat_iteration=None, start_date=None, end_date=None, start_time_of_day=None, end_time_of_day=None, day_of_month=None, monday=None, tuesday=None, wednesday=None, thursday=None, friday=None, saturday=None, sunday=None)[source]
Update an existing task schedule.
- Parameters:
key (int) – Schedule $key (ID).
name (str | None) – New name.
description (str | None) – New description.
enabled (bool | None) – Enable/disable.
repeat_every (str | None) – New repeat interval.
repeat_iteration (int | None) – New iteration count.
start_date (str | None) – New start date.
end_date (str | None) – New expiration date.
start_time_of_day (int | None) – New start time.
end_time_of_day (int | None) – New end time.
day_of_month (str | None) – New day of month setting.
monday-sunday – Day flags.
monday (bool | None)
tuesday (bool | None)
wednesday (bool | None)
thursday (bool | None)
friday (bool | None)
saturday (bool | None)
sunday (bool | None)
- Returns:
Updated TaskSchedule object.
- Return type:
- delete(key)[source]
Delete a task schedule.
Note
Schedules with active triggers cannot be deleted.
- Parameters:
key (int) – Schedule $key (ID).
- Raises:
ConflictError – If schedule has active triggers.
- Return type:
None
- enable(key)[source]
Enable a task schedule.
- Parameters:
key (int) – Schedule $key (ID).
- Returns:
Updated TaskSchedule object.
- Return type:
- disable(key)[source]
Disable a task schedule.
- Parameters:
key (int) – Schedule $key (ID).
- Returns:
Updated TaskSchedule object.
- Return type:
- get_schedule(key, max_results=100, start_time=None, end_time=None)[source]
Get upcoming scheduled execution times for a schedule.
- Parameters:
- Returns:
List of scheduled execution time dicts.
- Return type:
Example
>>> # Get next 10 scheduled times >>> times = client.task_schedules.get_schedule(schedule.key, max_results=10) >>> for t in times: ... print(t)
- list_enabled(fields=None, limit=None)[source]
List enabled schedules.
- Parameters:
- Returns:
List of enabled TaskSchedule objects.
- Return type:
- list_disabled(fields=None, limit=None)[source]
List disabled schedules.
- Parameters:
- Returns:
List of disabled TaskSchedule objects.
- Return type:
Task Schedule Triggers
Task schedule trigger resource manager for VergeOS scheduling system.
Task schedule triggers link tasks to schedules. When a schedule’s trigger time arrives, all tasks linked via triggers are executed.
Example
>>> # Get a task and schedule
>>> task = client.tasks.get(name="Backup Task")
>>> schedule = client.task_schedules.get(name="Nightly")
>>> # Create a trigger to link them
>>> trigger = client.task_schedule_triggers.create(
... task=task.key,
... schedule=schedule.key,
... )
>>> # List all triggers for a schedule
>>> for trigger in schedule.triggers.list():
... print(f"Task: {trigger.task_display}")
- class pyvergeos.resources.task_schedule_triggers.TaskScheduleTrigger[source]
Bases:
ResourceObjectTask schedule trigger resource object.
Represents a link between a task and a schedule.
- Properties:
task_key: The linked task’s $key. task_display: Display name of the linked task. schedule_key: The linked schedule’s $key. schedule_display: Display name of the linked schedule. schedule_enabled: Whether the linked schedule is enabled. trigger: Timer value for the trigger.
- class pyvergeos.resources.task_schedule_triggers.TaskScheduleTriggerManager[source]
Bases:
ResourceManager[TaskScheduleTrigger]Manager for task schedule trigger operations.
Task schedule triggers link tasks to schedules for execution.
Example
>>> # List all triggers >>> for trigger in client.task_schedule_triggers.list(): ... print(f"{trigger.task_display} -> {trigger.schedule_display}")
>>> # Create a trigger >>> trigger = client.task_schedule_triggers.create( ... task=task_key, ... schedule=schedule_key, ... )
>>> # List triggers for a specific task >>> triggers = client.task_schedule_triggers.list(task=task_key)
>>> # List triggers for a specific schedule >>> triggers = client.task_schedule_triggers.list(schedule=schedule_key)
- __init__(client, *, task_key=None, schedule_key=None)[source]
Initialize the trigger manager.
- Parameters:
client (VergeClient) – VergeClient instance.
task_key (int | None) – Optional task key to scope the manager.
schedule_key (int | None) – Optional schedule key to scope the manager.
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, task=None, schedule=None, **filter_kwargs)[source]
List task schedule triggers with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
task (int | None) – Filter by task key. Ignored if manager is scoped to a task.
schedule (int | None) – Filter by schedule key. Ignored if manager is scoped to a schedule.
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of TaskScheduleTrigger objects.
- Return type:
Example
>>> # All triggers >>> triggers = client.task_schedule_triggers.list()
>>> # Triggers for a specific task >>> triggers = client.task_schedule_triggers.list(task=task_key)
>>> # Triggers for a specific schedule >>> triggers = client.task_schedule_triggers.list(schedule=schedule_key)
- get(key=None, *, fields=None)[source]
Get a task schedule trigger by key.
- Parameters:
- Returns:
TaskScheduleTrigger object.
- Raises:
NotFoundError – If trigger not found.
ValueError – If key not provided.
- Return type:
- create(task, schedule)[source]
Create a task schedule trigger.
Links a task to a schedule so it runs when the schedule fires.
- Parameters:
- Returns:
Created TaskScheduleTrigger object.
- Return type:
Example
>>> trigger = client.task_schedule_triggers.create( ... task=backup_task.key, ... schedule=nightly_schedule.key, ... )
- delete(key)[source]
Delete a task schedule trigger.
Removes the link between a task and schedule.
- Parameters:
key (int) – Trigger $key (ID).
- Return type:
None
- trigger(key)[source]
Trigger execution immediately.
Fires the trigger, causing the linked task to execute.
Task Events
Event definitions for task triggers.
Task event resource manager for VergeOS event-driven automation.
Task events (event triggers) link tasks to system events, enabling event-driven automation. When a specific event occurs on a resource, tasks linked via task events are automatically executed.
Event triggers allow tasks to run in response to specific system occurrences. A single task can be triggered by multiple distinct events, enabling you to consolidate logic and reuse task definitions across scenarios.
- Event-Based Task Examples:
Power on a VM when a designated user logs into VergeOS
Power off VMs when the user logs out
Send an email notification when a system update completes
Use a webhook to notify Slack when a sync error is detected
- Event Configuration:
Type: The object class (e.g., users, virtual machines, tenants, alarms)
Event: The event type (e.g., login, logout, poweron, error)
Object Instance: A specific resource, or use tags to match multiple
Filter Settings: For logs/alarms, filter by severity or log type
Example
>>> # List all task events
>>> for event in client.task_events.list():
... print(f"{event.event_name_display} -> {event.task_display}")
>>> # Get events linked to a specific task
>>> task = client.tasks.get(name="Power On Dev VMs")
>>> for event in task.events.list():
... print(f"Triggered by: {event.event_name_display}")
>>> # Create event trigger for user login
>>> event = client.task_events.create(
... task=task.key,
... owner=user.key,
... event="login",
... table="users",
... )
>>> # Manually trigger an event for testing
>>> event.trigger_now(context={"custom": "data"})
- class pyvergeos.resources.task_events.TaskEvent[source]
Bases:
ResourceObjectTask event resource object.
Represents a link between a task and a system event.
- Properties:
owner_key: The owner resource $key. owner_table: The owner resource table name. event: Event identifier. event_name: Human-readable event name. task_key: Linked task $key. task_display: Linked task display name. filters: Event filter conditions (JSON). context: Event context data (JSON). trigger: Timer value for the event trigger.
- class pyvergeos.resources.task_events.TaskEventManager[source]
Bases:
ResourceManager[TaskEvent]Manager for task event operations.
Task events enable event-driven automation by linking tasks to system events.
Example
>>> # List all task events >>> for event in client.task_events.list(): ... print(f"{event.event_name_display}: {event.task_display}")
>>> # List events for a specific task >>> events = client.task_events.list(task=task_key)
>>> # List events for a specific owner >>> events = client.task_events.list(owner=vm_key)
>>> # Manually trigger an event >>> client.task_events.trigger(event_key, context={"key": "value"})
- __init__(client, *, task_key=None, owner_key=None)[source]
Initialize the event manager.
- Parameters:
client (VergeClient) – VergeClient instance.
task_key (int | None) – Optional task key to scope the manager.
owner_key (int | None) – Optional owner resource key to scope the manager.
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, task=None, owner=None, table=None, event=None, **filter_kwargs)[source]
List task events with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
task (int | None) – Filter by task key. Ignored if manager is scoped to a task.
owner (int | None) – Filter by owner resource key. Ignored if manager is scoped.
table (str | None) – Filter by owner table name.
event (str | None) – Filter by event identifier.
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of TaskEvent objects.
- Return type:
Example
>>> # All events >>> events = client.task_events.list()
>>> # Events for a specific task >>> events = client.task_events.list(task=task_key)
>>> # Events for VMs only >>> events = client.task_events.list(table="vms")
>>> # Events for a specific event type >>> events = client.task_events.list(event="poweron")
- get(key=None, *, fields=None)[source]
Get a task event by key.
- Parameters:
- Returns:
TaskEvent object.
- Raises:
NotFoundError – If event not found.
ValueError – If key not provided.
- Return type:
- create(task, event, *, table, event_name=None, table_event_filters=None, context=None)[source]
Create a task event.
Links a task to a system event for event-driven execution. The owner is auto-populated from the parent task.
- Parameters:
task (int) – Task $key to link (create the task first).
event (str) – Event identifier (e.g.
"lowered").table (str) – Event source table (required, e.g.
"alarms"). The table whose events will trigger the task.event_name (str | None) – Human-readable event name.
table_event_filters (dict[str, Any] | None) – JSON filter conditions for the event.
context (dict[str, Any] | None) – JSON context data to pass to the task.
- Returns:
Created TaskEvent object.
- Return type:
Example
>>> # Create a task first, then link an event >>> task = client.tasks.create( ... name="Alert on alarm", ... owner=1, ... action="send", ... table="smtp_settings", ... ) >>> # Trigger task when an alarm is lowered >>> event = client.task_events.create( ... task=task.key, ... event="lowered", ... table="alarms", ... table_event_filters={"level": "summary"}, ... )
- delete(key)[source]
Delete a task event.
Removes the link between a task and event.
- Parameters:
key (int) – Event $key (ID).
- Return type:
None
- trigger(key, context=None)[source]
Manually trigger a task event.
Fires the event, causing the linked task to execute.
- Parameters:
- Returns:
Action response dict or None.
- Return type:
Example
>>> # Trigger an event >>> client.task_events.trigger(event_key)
>>> # Trigger with context >>> client.task_events.trigger(event_key, context={"key": "value"})
Task Scripts
Task script resource manager for VergeOS automation scripts.
Task scripts are GCS (VergeOS scripting) code that can be executed as tasks. Scripts can define questions (settings) that are prompted when running, allowing for reusable automation with configurable parameters.
Example
>>> # List all scripts
>>> for script in client.task_scripts.list():
... print(f"{script.name}: {script.task_count} tasks")
>>> # Create a simple script
>>> script = client.task_scripts.create(
... name="Cleanup Script",
... description="Removes old temporary files",
... script="# GCS script code here\nlog('Cleanup started')",
... task_settings={"questions": []},
... )
>>> # Run a script
>>> result = script.run()
- class pyvergeos.resources.task_scripts.TaskScript[source]
Bases:
ResourceObjectTask script resource object.
Represents a GCS automation script that can be executed as tasks.
- Properties:
name: Script name (unique). description: Script description. script_code: The GCS script code. task_settings: JSON settings/questions for the script. task_count: Number of tasks using this script.
- class pyvergeos.resources.task_scripts.TaskScriptManager[source]
Bases:
ResourceManager[TaskScript]Manager for task script operations.
Task scripts provide reusable GCS automation code.
Example
>>> # List all scripts >>> for script in client.task_scripts.list(): ... print(f"{script.name}: {script.description}")
>>> # Create a script >>> script = client.task_scripts.create( ... name="My Script", ... script="log('Hello World')", ... task_settings={"questions": []}, ... )
>>> # Get a script by name >>> script = client.task_scripts.get(name="My Script")
>>> # Run a script >>> result = client.task_scripts.run(script.key)
>>> # Update script code >>> script = client.task_scripts.update( ... script.key, ... script="log('Updated code')" ... )
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, name=None, **filter_kwargs)[source]
List task scripts with optional filtering.
- Parameters:
- Returns:
List of TaskScript objects.
- Return type:
Example
>>> # All scripts >>> scripts = client.task_scripts.list()
>>> # Scripts by name pattern >>> scripts = client.task_scripts.list(name="Backup*")
- get(key=None, *, name=None, fields=None)[source]
Get a task script by key or name.
- Parameters:
- Returns:
TaskScript object.
- Raises:
NotFoundError – If script not found.
ValueError – If neither key nor name provided.
- Return type:
- create(name, script, *, description=None, task_settings=None)[source]
Create a new task script.
- Parameters:
- Returns:
Created TaskScript object.
- Return type:
Example
>>> script = client.task_scripts.create( ... name="My Script", ... description="Does something useful", ... script="log('Hello World')", ... task_settings={"questions": []}, ... )
- update(key, *, name=None, description=None, script=None, task_settings=None)[source]
Update an existing task script.
- Parameters:
- Returns:
Updated TaskScript object.
- Return type:
Example
>>> script = client.task_scripts.update( ... script.key, ... script="log('Updated code')" ... )
- delete(key)[source]
Delete a task script.
Note
Scripts with associated tasks cannot be deleted. The tasks will be cascade deleted.
- Parameters:
key (int) – Script $key (ID).
- Return type:
None
- run(key, **params)[source]
Run a task script.
Executes the script, optionally with provided parameters.
- Parameters:
- Returns:
Run action response dict or None.
- Return type:
Example
>>> # Run a script >>> result = client.task_scripts.run(script.key)
>>> # Run with parameters >>> result = client.task_scripts.run( ... script.key, ... target_vm=123, ... cleanup=True, ... )
Users and Groups
Users
User resource manager for VergeOS system users.
- class pyvergeos.resources.users.User[source]
Bases:
ResourceObjectUser resource object.
Represents a user account in VergeOS. Users can be normal users, API users, or VDI users.
- key
User primary key ($key).
- name
Username (login name).
- displayname
Display name.
- email
Email address.
- user_type
User type (‘normal’, ‘api’, ‘vdi’).
- enabled
Whether the account is enabled.
- created
Creation timestamp (Unix epoch).
- last_login
Last login timestamp (Unix epoch).
- change_password
Whether password change is required on next login.
- physical_access
Whether console/SSH access is enabled (admin privilege).
- two_factor_enabled
Whether 2FA is enabled.
- two_factor_type
Type of 2FA (‘email’ or ‘authenticator’).
- two_factor_setup_required
Whether 2FA setup is required on next login.
- account_locked
Timestamp when account was locked (0 if not locked).
- failed_attempts
Number of failed login attempts.
- auth_source
Authentication source key.
- auth_source_name
Authentication source name.
- remote_name
Remote username (for external auth).
- identity
Identity key.
- creator
Username of the user who created this account.
- ssh_keys
SSH public keys (newline-separated).
- property physical_access: bool
Check if physical (console/SSH) access is enabled.
Note: Users with physical access have administrator privileges.
- property two_factor_setup_required: bool
Check if 2FA setup is required on next login.
Note: This is a write-only field in the API, so this property will always return False. Use it only for setting during create/update operations.
- class pyvergeos.resources.users.UserManager[source]
Bases:
ResourceManager[User]Manager for VergeOS user operations.
Provides CRUD operations and management for user accounts.
Example
>>> # List all users >>> for user in client.users.list(): ... print(f"{user.name}: {user.user_type_display}")
>>> # List only API users >>> api_users = client.users.list(user_type="api")
>>> # Create a user >>> user = client.users.create( ... name="jsmith", ... password="SecurePass123!", ... displayname="John Smith", ... email="jsmith@company.com" ... )
>>> # Enable/disable users >>> client.users.disable(user.key) >>> client.users.enable(user.key)
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, user_type=None, enabled=None, include_system=False, **filter_kwargs)[source]
List users with optional filtering.
By default, excludes system user types (site_sync, site_user).
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
user_type (Literal['normal', 'api', 'vdi'] | None) – Filter by user type (‘normal’, ‘api’, ‘vdi’).
enabled (bool | None) – Filter by enabled status.
include_system (bool) – Include system user types (site_sync, site_user).
**filter_kwargs (Any) – Shorthand filter arguments (name, etc.).
- Returns:
List of User objects.
- Return type:
Example
>>> # List all users >>> users = client.users.list()
>>> # List only API users >>> api_users = client.users.list(user_type="api")
>>> # List disabled users >>> disabled = client.users.list(enabled=False)
>>> # List by name pattern (exact match) >>> users = client.users.list(name="admin")
- get(key=None, *, name=None, fields=None)[source]
Get a single user by key or name.
- Parameters:
- Returns:
User object.
- Raises:
NotFoundError – If user not found.
ValueError – If neither key nor name provided.
- Return type:
Example
>>> # Get by key >>> user = client.users.get(123)
>>> # Get by name >>> user = client.users.get(name="admin")
- create(name, password, *, displayname=None, email=None, user_type='normal', enabled=True, change_password=False, physical_access=False, two_factor_enabled=False, two_factor_type='email', two_factor_setup_required=False, ssh_keys=None)[source]
Create a new user.
- Parameters:
name (str) – Username (1-128 chars, no forward slashes, will be lowercased).
password (str) – User password.
displayname (str | None) – Display name for the user.
email (str | None) – Email address (required if enabling 2FA).
user_type (Literal['normal', 'api', 'vdi']) – User type (‘normal’, ‘api’, ‘vdi’). Default ‘normal’.
enabled (bool) – Enable the account. Default True.
change_password (bool) – Require password change on next login. Default False.
physical_access (bool) – Enable console/SSH access (grants admin). Default False.
two_factor_enabled (bool) – Enable two-factor authentication. Default False.
two_factor_type (Literal['email', 'authenticator']) – Type of 2FA (‘email’ or ‘authenticator’). Default ‘email’.
two_factor_setup_required (bool) – Require 2FA setup on next login. Default False.
ssh_keys (list[str] | str | None) – SSH public keys (list or newline-separated string).
- Returns:
Created User object.
- Raises:
ValueError – If email not provided when enabling 2FA.
- Return type:
Example
>>> # Create a basic user >>> user = client.users.create( ... name="jsmith", ... password="SecurePass123!", ... displayname="John Smith", ... email="jsmith@company.com" ... )
>>> # Create an API user >>> api_user = client.users.create( ... name="api_service", ... password="ApiSecret!", ... user_type="api" ... )
>>> # Create with 2FA enabled >>> user = client.users.create( ... name="secure_user", ... password="Pass123!", ... email="secure@company.com", ... two_factor_enabled=True, ... two_factor_type="authenticator" ... )
- update(key, *, password=None, displayname=None, email=None, enabled=None, change_password=None, physical_access=None, two_factor_enabled=None, two_factor_type=None, two_factor_setup_required=None, ssh_keys=None)[source]
Update a user.
- Parameters:
key (int) – User $key (ID).
password (str | None) – New password.
displayname (str | None) – New display name.
email (str | None) – New email address.
enabled (bool | None) – Enable or disable the account.
change_password (bool | None) – Require password change on next login.
physical_access (bool | None) – Enable or disable console/SSH access.
two_factor_enabled (bool | None) – Enable or disable 2FA.
two_factor_type (Literal['email', 'authenticator'] | None) – Type of 2FA (‘email’ or ‘authenticator’).
two_factor_setup_required (bool | None) – Require 2FA setup on next login.
ssh_keys (list[str] | str | None) – SSH public keys (list, string, or empty string to clear).
- Returns:
Updated User object.
- Return type:
Example
>>> # Change password >>> client.users.update(user.key, password="NewPass123!")
>>> # Update display name and email >>> client.users.update( ... user.key, ... displayname="John Q. Smith", ... email="john.smith@company.com" ... )
>>> # Enable 2FA >>> client.users.update( ... user.key, ... two_factor_enabled=True, ... two_factor_type="authenticator" ... )
Groups
Group resource manager for VergeOS groups.
- class pyvergeos.resources.groups.GroupMember[source]
Bases:
ResourceObjectGroup member resource object.
Represents a membership record linking a user or group to a parent group.
- key
Membership primary key ($key).
- group_key
Parent group key.
- member_type
Type of member (‘User’ or ‘Group’).
- member_key
Key of the member (user or group).
- member_name
Display name of the member.
- member_ref
API reference to the member.
- creator
Username of who created this membership.
- remove()[source]
Remove this member from the group.
- Raises:
ValueError – If membership key is not available.
- Return type:
None
- class pyvergeos.resources.groups.GroupMemberManager[source]
Bases:
ResourceManager[GroupMember]Manager for group membership operations.
This manager handles adding and removing users/groups from a parent group. It can be accessed via group.members or directly via client.groups.members().
Example
>>> # List members of a group >>> for member in client.groups.members(group_key).list(): ... print(f"{member.member_name} ({member.member_type})")
>>> # Add a user to a group >>> client.groups.members(group_key).add_user(user_key)
>>> # Remove a member >>> client.groups.members(group_key).remove(membership_key)
- __init__(client, group_key)[source]
- Parameters:
client (VergeClient)
group_key (int)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List members of this group.
- Parameters:
- Returns:
List of GroupMember objects.
- Return type:
Example
>>> members = client.groups.members(group_key).list() >>> for m in members: ... print(f"{m.member_name}: {m.member_type}")
- add_user(user_key)[source]
Add a user to this group.
- Parameters:
user_key (int) – User $key (ID) to add.
- Returns:
Created GroupMember object with full details.
- Raises:
ConflictError – If user is already a member.
- Return type:
Example
>>> member = client.groups.members(group_key).add_user(user.key)
- add_group(member_group_key)[source]
Add a group as a member of this group (nested group).
- Parameters:
member_group_key (int) – Group $key (ID) to add as member.
- Returns:
Created GroupMember object with full details.
- Raises:
ConflictError – If group is already a member.
- Return type:
Example
>>> # Add Developers group to AllUsers group >>> member = client.groups.members(all_users_key).add_group(developers_key)
- remove(membership_key)[source]
Remove a membership by its key.
- Parameters:
membership_key (int) – Membership $key (ID) to remove.
- Return type:
None
Example
>>> client.groups.members(group_key).remove(membership.key)
- remove_user(user_key)[source]
Remove a user from this group.
- Parameters:
user_key (int) – User $key (ID) to remove.
- Raises:
NotFoundError – If user is not a member of this group.
- Return type:
None
Example
>>> client.groups.members(group_key).remove_user(user.key)
- remove_group(member_group_key)[source]
Remove a group from this group.
- Parameters:
member_group_key (int) – Group $key (ID) to remove.
- Raises:
NotFoundError – If group is not a member of this group.
- Return type:
None
Example
>>> client.groups.members(parent_key).remove_group(child_key)
- class pyvergeos.resources.groups.Group[source]
Bases:
ResourceObjectGroup resource object.
Represents a group in VergeOS that can contain users and other groups. Groups are used for organizing users and assigning permissions.
- key
Group primary key ($key).
- name
Group name.
- description
Group description.
- enabled
Whether the group is enabled.
- email
Group email address.
- identifier
Group identifier (id field).
- identity
Identity key.
- is_system_group
Whether this is a system group.
- member_count
Number of members in the group.
- created
Creation timestamp (Unix epoch).
- creator
Username of who created this group.
- property members: GroupMemberManager
Access group member operations for this group.
- Returns:
GroupMemberManager for this group.
Example
>>> # List members >>> for member in group.members.list(): ... print(member.member_name)
>>> # Add a user >>> group.members.add_user(user.key)
- class pyvergeos.resources.groups.GroupManager[source]
Bases:
ResourceManager[Group]Manager for VergeOS group operations.
Provides CRUD operations and management for groups.
Example
>>> # List all groups >>> for group in client.groups.list(): ... print(f"{group.name}: {group.member_count} members")
>>> # List only enabled groups >>> enabled_groups = client.groups.list(enabled=True)
>>> # Create a group >>> group = client.groups.create( ... name="Developers", ... description="Development team", ... email="dev@company.com" ... )
>>> # Enable/disable groups >>> client.groups.disable(group.key) >>> client.groups.enable(group.key)
>>> # Manage members >>> client.groups.members(group.key).add_user(user.key)
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, enabled=None, include_system=True, **filter_kwargs)[source]
List groups with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
enabled (bool | None) – Filter by enabled status.
include_system (bool) – Include system groups (default True).
**filter_kwargs (Any) – Shorthand filter arguments (name, etc.).
- Returns:
List of Group objects.
- Return type:
Example
>>> # List all groups >>> groups = client.groups.list()
>>> # List only enabled groups >>> enabled = client.groups.list(enabled=True)
>>> # List non-system groups only >>> user_groups = client.groups.list(include_system=False)
>>> # List by name pattern (exact match) >>> groups = client.groups.list(name="Administrators")
- get(key=None, *, name=None, fields=None)[source]
Get a single group by key or name.
- Parameters:
- Returns:
Group object.
- Raises:
NotFoundError – If group not found.
ValueError – If neither key nor name provided.
- Return type:
Example
>>> # Get by key >>> group = client.groups.get(123)
>>> # Get by name >>> group = client.groups.get(name="Administrators")
- create(name, *, description=None, email=None, enabled=True)[source]
Create a new group.
- Parameters:
- Returns:
Created Group object.
- Return type:
Example
>>> # Create a basic group >>> group = client.groups.create(name="Developers")
>>> # Create with all options >>> group = client.groups.create( ... name="QA Team", ... description="Quality Assurance team", ... email="qa@company.com" ... )
- update(key, *, name=None, description=None, email=None, enabled=None)[source]
Update a group.
- Parameters:
- Returns:
Updated Group object.
- Return type:
Example
>>> # Update description >>> client.groups.update(group.key, description="New description")
>>> # Rename group >>> client.groups.update(group.key, name="NewName")
- disable(key)[source]
Disable a group.
The group is not deleted and can be re-enabled later.
Example
>>> client.groups.disable(group.key)
- members(group_key)[source]
Get a member manager for a specific group.
- Parameters:
group_key (int) – Group $key (ID).
- Returns:
GroupMemberManager for the specified group.
- Return type:
Example
>>> # List members >>> members = client.groups.members(group.key).list()
>>> # Add user to group >>> client.groups.members(group.key).add_user(user.key)
API Keys
API Key resource manager for VergeOS user API keys.
- class pyvergeos.resources.api_keys.APIKeyCreated[source]
Bases:
objectResponse from creating an API key containing the secret.
The secret is only available once at creation time and cannot be retrieved later.
- key
The API key ID ($key).
- name
The API key name.
- user_key
The user’s $key.
- user_name
The username.
- secret
The API key secret (only shown once).
- class pyvergeos.resources.api_keys.APIKey[source]
Bases:
ResourceObjectAPI Key resource object.
Represents an API key associated with a user account.
- key
API key primary key ($key).
- name
API key name.
- description
API key description.
- user_key
The user’s $key this key belongs to.
- user_name
The username this key belongs to.
- created
Creation timestamp (Unix epoch).
- expires
Expiration timestamp (Unix epoch), or None if never expires.
- last_login
Last login timestamp (Unix epoch).
- last_login_ip
IP address of last login.
- ip_allow_list
List of allowed IP addresses/CIDR ranges.
- ip_deny_list
List of denied IP addresses/CIDR ranges.
- class pyvergeos.resources.api_keys.APIKeyManager[source]
Bases:
ResourceManager[APIKey]Manager for VergeOS API key operations.
Provides CRUD operations for user API keys.
Example
>>> # List all API keys >>> for key in client.api_keys.list(): ... print(f"{key.name}: user={key.user_name}")
>>> # List API keys for a specific user >>> user_keys = client.api_keys.list(user=123)
>>> # Create an API key >>> result = client.api_keys.create( ... user=123, ... name="automation-key", ... description="CI/CD automation" ... ) >>> print(f"Secret: {result.secret}") # Only shown once!
>>> # Delete an API key >>> client.api_keys.delete(key_id)
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, user=None, **filter_kwargs)[source]
List API keys with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
user (int | str | None) – Filter by user - can be user $key (int) or username (str).
**filter_kwargs (Any) – Shorthand filter arguments (name, etc.).
- Returns:
List of APIKey objects.
- Return type:
Example
>>> # List all API keys >>> keys = client.api_keys.list()
>>> # List keys for a specific user by key >>> keys = client.api_keys.list(user=123)
>>> # List keys for a specific user by name >>> keys = client.api_keys.list(user="admin")
>>> # List by name >>> keys = client.api_keys.list(name="automation")
- get(key=None, *, name=None, user=None, fields=None)[source]
Get a single API key by key or name.
- Parameters:
- Returns:
APIKey object.
- Raises:
NotFoundError – If API key not found.
ValueError – If neither key nor name provided, or name without user.
- Return type:
Example
>>> # Get by key >>> api_key = client.api_keys.get(5)
>>> # Get by name for a user >>> api_key = client.api_keys.get(name="automation", user="admin")
- create(user, name, *, description=None, expires_in=None, expires=None, ip_allow_list=None, ip_deny_list=None)[source]
Create a new API key.
IMPORTANT: The API key secret is only returned once at creation time. Store it securely as it cannot be retrieved later.
- Parameters:
user (int | str) – User $key (int) or username (str) to create the key for.
name (str) – Name for the API key (1-128 chars, unique per user).
description (str | None) – Optional description for the API key.
expires_in (str | None) – Duration until expiration (‘30d’, ‘1w’, ‘3m’, ‘1y’, or ‘never’). Supported units: d (days), w (weeks), m (months), y (years). Default is ‘never’ (no expiration).
expires (datetime | None) – Specific datetime when the key should expire.
ip_allow_list (list[str] | None) – List of IP addresses or CIDR ranges allowed to use this key.
ip_deny_list (list[str] | None) – List of IP addresses or CIDR ranges denied from using this key.
- Returns:
APIKeyCreated object containing the key ID and secret.
- Raises:
NotFoundError – If user not found.
ValueError – If invalid expires_in format.
- Return type:
Example
>>> # Create a basic API key >>> result = client.api_keys.create( ... user="admin", ... name="automation-key" ... ) >>> print(f"Secret: {result.secret}") # Store this!
>>> # Create with expiration >>> result = client.api_keys.create( ... user=123, ... name="temp-key", ... expires_in="90d", ... description="Temporary CI/CD key" ... )
>>> # Create with IP restrictions >>> result = client.api_keys.create( ... user="apiuser", ... name="restricted-key", ... ip_allow_list=["10.0.0.0/8", "192.168.1.100"] ... )
Permissions
Permission resource manager for VergeOS permissions.
- class pyvergeos.resources.permissions.Permission[source]
Bases:
ResourceObjectPermission resource object.
Represents a permission grant in VergeOS that controls access to resources for users or groups.
- key
Permission primary key ($key).
- identity_key
Identity key (links to user or group identity).
- identity_name
Display name of the identity (user/group name).
- table
Resource table name (e.g., ‘vms’, ‘vnets’, ‘/’).
- row_key
Specific row key (0 for table-level access).
- row_display
Display name of the row (if row-specific).
- is_table_level
Whether this is table-level (all rows) permission.
- can_list
Whether list/see permission is granted.
- can_read
Whether read permission is granted.
- can_create
Whether create permission is granted.
- can_modify
Whether modify permission is granted.
- can_delete
Whether delete permission is granted.
- revoke()[source]
Revoke this permission.
- Raises:
ValueError – If permission key is not available.
- Return type:
None
- class pyvergeos.resources.permissions.PermissionManager[source]
Bases:
ResourceManager[Permission]Manager for VergeOS permission operations.
Provides operations to list, grant, and revoke permissions for users and groups on resources.
Example
>>> # List all permissions for a user >>> perms = client.permissions.list(user=user.key)
>>> # List permissions for a group on VMs >>> perms = client.permissions.list(group=group.key, table="vms")
>>> # Grant read-only access to VMs >>> client.permissions.grant( ... user=user.key, ... table="vms", ... can_list=True, ... can_read=True ... )
>>> # Grant full control to a group >>> client.permissions.grant( ... group=group.key, ... table="vms", ... full_control=True ... )
>>> # Revoke a permission >>> client.permissions.revoke(permission.key)
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, user=None, group=None, identity_key=None, table=None, **filter_kwargs)[source]
List permissions with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (builtins.list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
user (int | User | None) – User key or User object to filter by.
group (int | Group | None) – Group key or Group object to filter by.
identity_key (int | None) – Identity key to filter by directly.
table (str | None) – Resource table name to filter by (e.g., ‘vms’, ‘vnets’).
**filter_kwargs (Any) – Shorthand filter arguments.
- Returns:
List of Permission objects.
- Return type:
builtins.list[Permission]
Example
>>> # List all permissions >>> perms = client.permissions.list()
>>> # List permissions for a user >>> perms = client.permissions.list(user=user.key)
>>> # List permissions for a group on VMs >>> perms = client.permissions.list(group=group.key, table="vms")
>>> # List permissions by identity key directly >>> perms = client.permissions.list(identity_key=123)
- get(key, *, fields=None)[source]
Get a single permission by key.
- Parameters:
- Returns:
Permission object.
- Raises:
NotFoundError – If permission not found.
- Return type:
Example
>>> perm = client.permissions.get(123)
- grant(table, *, user=None, group=None, identity_key=None, row_key=0, can_list=True, can_read=False, can_create=False, can_modify=False, can_delete=False, full_control=False)[source]
Grant permission to a user or group.
- Parameters:
table (str) – Resource table to grant access to (e.g., ‘vms’, ‘vnets’, ‘/’).
user (int | User | None) – User key or User object to grant to.
group (int | Group | None) – Group key or Group object to grant to.
identity_key (int | None) – Identity key to grant to directly.
row_key (int) – Specific row key (0 for table-level access to all rows).
can_list (bool) – Grant permission to list/see items. Default True.
can_read (bool) – Grant permission to read item details. Default False.
can_create (bool) – Grant permission to create new items. Default False.
can_modify (bool) – Grant permission to modify existing items. Default False.
can_delete (bool) – Grant permission to delete items. Default False.
full_control (bool) – Grant all permissions (overrides individual flags).
- Returns:
Created Permission object.
- Raises:
ValueError – If no user, group, or identity_key provided.
ConflictError – If permission already exists.
- Return type:
Example
>>> # Grant read-only access to VMs for a user >>> perm = client.permissions.grant( ... table="vms", ... user=user.key, ... can_list=True, ... can_read=True ... )
>>> # Grant full control to a group >>> perm = client.permissions.grant( ... table="vms", ... group=group.key, ... full_control=True ... )
>>> # Grant root access (all resources) >>> perm = client.permissions.grant( ... table="/", ... user=user.key, ... can_list=True, ... can_read=True ... )
>>> # Grant access to a specific VM only >>> perm = client.permissions.grant( ... table="vms", ... user=user.key, ... row_key=vm.key, ... full_control=True ... )
- revoke(key)[source]
Revoke (delete) a permission.
- Parameters:
key (int) – Permission $key (ID) to revoke.
- Return type:
None
Example
>>> client.permissions.revoke(perm.key)
- revoke_for_user(user, table=None)[source]
Revoke all permissions for a user, optionally filtered by table.
- Parameters:
- Returns:
Number of permissions revoked.
- Return type:
Example
>>> # Revoke all permissions for user >>> count = client.permissions.revoke_for_user(user.key)
>>> # Revoke only VM permissions for user >>> count = client.permissions.revoke_for_user(user.key, table="vms")
- revoke_for_group(group, table=None)[source]
Revoke all permissions for a group, optionally filtered by table.
- Parameters:
- Returns:
Number of permissions revoked.
- Return type:
Example
>>> # Revoke all permissions for group >>> count = client.permissions.revoke_for_group(group.key)
>>> # Revoke only network permissions for group >>> count = client.permissions.revoke_for_group(group.key, table="vnets")
Authentication & Security
Authentication Sources
External identity providers (OAuth2, OIDC, Azure AD, Okta).
Authentication source management for external identity providers.
Authentication sources enable SSO and federated login via OAuth2/OIDC providers such as Azure AD, Google, GitLab, Okta, and generic OpenID Connect.
- Key concepts:
Auth Source: Configuration for an external identity provider
Driver: The type of provider (azure, google, gitlab, okta, openid, etc.)
Settings: Driver-specific configuration stored as JSON
States: Ephemeral OAuth state tokens during authentication flow
- Supported drivers:
azure: Azure Active Directory
google: Google OAuth
gitlab: GitLab (OpenID)
okta: Okta
openid: Generic OpenID Connect
openid-well-known: OpenID with well-known configuration discovery
oauth2: Generic OAuth2
verge.io: Verge.io parent system authentication
Example
>>> # List all authentication sources
>>> for source in client.auth_sources.list():
... print(f"{source.name} ({source.driver})")
>>> # Get a specific auth source
>>> azure = client.auth_sources.get(name="Azure AD")
>>> # Create an Azure AD auth source
>>> source = client.auth_sources.create(
... name="Corporate Azure",
... driver="azure",
... settings={
... "tenant_id": "your-tenant-id",
... "client_id": "your-client-id",
... "client_secret": "your-client-secret",
... "scope": "openid profile email",
... }
... )
>>> # Enable debug mode for troubleshooting
>>> source.enable_debug()
>>> # List users using this auth source
>>> for user in client.users.list(auth_source=source.key):
... print(f" {user.name}")
- class pyvergeos.resources.auth_sources.AuthSourceState[source]
Bases:
ResourceObjectOAuth state token for authentication flow.
Auth source states are ephemeral tokens created during the OAuth authentication flow. They expire after 15 minutes.
- key
State key (40-character hex string).
- auth_source
Parent auth source key.
- meta
State metadata (JSON).
- timestamp
Creation timestamp (microseconds).
- property key: str
State key (40-character hex string).
- Raises:
ValueError – If state has no key.
- class pyvergeos.resources.auth_sources.AuthSourceStateManager[source]
Bases:
ResourceManager[AuthSourceState]Manager for authentication source state operations.
States are read-only and automatically created/deleted during OAuth flow.
Example
>>> # List states for an auth source >>> for state in client.auth_source_states.list(auth_source=1): ... print(f"{state.key}: expired={state.is_expired}")
- __init__(client, *, auth_source_key=None)[source]
- Parameters:
client (VergeClient)
auth_source_key (int | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, auth_source=None, **filter_kwargs)[source]
List auth source states with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
auth_source (int | None) – Filter by auth source key. Ignored if manager is scoped.
**filter_kwargs (Any) – Shorthand filter arguments.
- Returns:
List of AuthSourceState objects.
- Return type:
- get(key=None, *, fields=None)[source]
Get a single state by key.
- Parameters:
- Returns:
AuthSourceState object.
- Raises:
NotFoundError – If state not found.
ValueError – If key not provided.
- Return type:
- class pyvergeos.resources.auth_sources.AuthSource[source]
Bases:
ResourceObjectAuthentication source resource object.
Represents an external identity provider configuration.
- key
Auth source $key (row ID).
- name
Display name shown on login button.
- driver
Provider type (azure, google, gitlab, okta, openid, etc.).
- settings
Driver-specific configuration (JSON).
Whether to show in dropdown menu.
- debug
Debug logging enabled.
- debug_ts
Debug mode timestamp.
- button_background_color
Login button background color (CSS).
- button_color
Login button text color (CSS).
- button_fa_icon
Login button Font Awesome icon class.
- icon_color
Login button icon color (CSS).
- property settings: dict[str, Any]
Get driver-specific settings.
Settings vary by driver but commonly include: - client_id: OAuth client ID - client_secret: OAuth client secret - tenant_id: Azure tenant ID (Azure only) - scope: OAuth scopes to request - redirect_uri: OAuth redirect URI - remote_user_fields: Fields to match users
Check if shown in dropdown menu.
- property button_style: dict[str, str | None]
Get login button styling properties.
- Returns:
Dict with background_color, text_color, icon, icon_color.
- property states: AuthSourceStateManager
Get a state manager scoped to this auth source.
- Returns:
AuthSourceStateManager for this auth source.
- enable_debug()[source]
Enable debug logging for this auth source.
Debug mode automatically disables after 1 hour.
- Returns:
Updated AuthSource object.
- Return type:
- disable_debug()[source]
Disable debug logging for this auth source.
- Returns:
Updated AuthSource object.
- Return type:
- class pyvergeos.resources.auth_sources.AuthSourceManager[source]
Bases:
ResourceManager[AuthSource]Manager for authentication source operations.
Authentication sources enable SSO via external identity providers.
Example
>>> # List all auth sources >>> for source in client.auth_sources.list(): ... print(f"{source.name} ({source.driver})")
>>> # Get a specific source >>> source = client.auth_sources.get(name="Azure AD")
>>> # Create an auth source >>> source = client.auth_sources.create( ... name="Google", ... driver="google", ... settings={ ... "client_id": "your-client-id", ... "client_secret": "your-secret", ... } ... )
>>> # Update settings >>> source = client.auth_sources.update( ... source.key, ... settings={"scope": "openid profile email groups"} ... )
>>> # Delete an auth source >>> client.auth_sources.delete(source.key)
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, driver=None, **filter_kwargs)[source]
List auth sources with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
driver (str | None) – Filter by driver type (azure, google, gitlab, etc.).
**filter_kwargs (Any) – Shorthand filter arguments (name, etc.).
- Returns:
List of AuthSource objects.
- Return type:
Example
>>> # List all sources >>> sources = client.auth_sources.list()
>>> # List Azure sources only >>> sources = client.auth_sources.list(driver="azure")
>>> # Filter by name pattern >>> sources = client.auth_sources.list(name="Corporate*")
- get(key=None, *, name=None, fields=None, include_settings=False)[source]
Get a single auth source by key or name.
- Parameters:
- Returns:
AuthSource object.
- Raises:
NotFoundError – If source not found.
ValueError – If no identifier provided.
- Return type:
Example
>>> # Get by key >>> source = client.auth_sources.get(1)
>>> # Get by name >>> source = client.auth_sources.get(name="Azure AD")
>>> # Include settings >>> source = client.auth_sources.get(1, include_settings=True) >>> print(source.settings)
- create(name, *, driver, settings=None, menu=False, button_background_color=None, button_color=None, button_fa_icon=None, icon_color=None)[source]
Create a new authentication source.
- Parameters:
name (str) – Display name for the auth source (appears on login button).
driver (str) – Provider type. One of: - azure: Azure Active Directory - google: Google OAuth - gitlab: GitLab (OpenID) - okta: Okta - openid: Generic OpenID Connect - openid-well-known: OpenID with well-known discovery - oauth2: Generic OAuth2 - verge.io: Verge.io parent system
settings (dict[str, Any] | None) – Driver-specific configuration. Common fields: - client_id: OAuth client ID - client_secret: OAuth client secret - tenant_id: Azure tenant ID (Azure only) - scope: OAuth scopes (default: “openid profile email”) - remote_user_fields: Fields to match users - auto_create_users: Pattern for auto-creating users - update_remote_user: Update remote user ID after login - update_user_email: Update user email from provider - update_user_display_name: Update display name from provider - update_group_membership: Sync group membership
menu (bool) – Show in dropdown menu instead of buttons.
button_background_color (str | None) – Button background color (CSS value).
button_color (str | None) – Button text color (CSS value).
button_fa_icon (str | None) – Button icon (Bootstrap Icon class, e.g. “bi-google”).
icon_color (str | None) – Button icon color (CSS value).
- Returns:
Created AuthSource object.
- Return type:
Example
>>> # Create Azure AD source >>> source = client.auth_sources.create( ... name="Corporate Azure", ... driver="azure", ... settings={ ... "tenant_id": "your-tenant-id", ... "client_id": "your-client-id", ... "client_secret": "your-client-secret", ... "scope": "openid profile email", ... "update_remote_user": True, ... "update_user_email": True, ... } ... )
>>> # Create Google source with custom styling >>> source = client.auth_sources.create( ... name="Sign in with Google", ... driver="google", ... settings={ ... "client_id": "your-client-id", ... "client_secret": "your-secret", ... }, ... button_background_color="#4285F4", ... button_color="#ffffff", ... button_fa_icon="bi-google", ... )
- update(key, *, name=None, settings=None, menu=None, debug=None, button_background_color=None, button_color=None, button_fa_icon=None, icon_color=None)[source]
Update an authentication source.
Note: The driver cannot be changed after creation.
- Parameters:
key (int) – Auth source $key (row ID).
name (str | None) – New display name.
settings (dict[str, Any] | None) – Updated settings (merged with existing).
menu (bool | None) – Show in dropdown menu.
debug (bool | None) – Enable/disable debug logging.
button_background_color (str | None) – Button background color.
button_color (str | None) – Button text color.
button_fa_icon (str | None) – Button icon class.
icon_color (str | None) – Button icon color.
- Returns:
Updated AuthSource object.
- Return type:
Example
>>> # Update settings >>> source = client.auth_sources.update( ... source.key, ... settings={"scope": "openid profile email groups"} ... )
>>> # Enable debug mode >>> source = client.auth_sources.update(source.key, debug=True)
- delete(key)[source]
Delete an authentication source.
This operation will fail if: - Users are assigned to this auth source - OIDC applications reference this auth source
- Parameters:
key (int) – Auth source $key (row ID).
- Raises:
NotFoundError – If source not found.
ConflictError – If source is in use by users or OIDC apps.
- Return type:
None
Example
>>> client.auth_sources.delete(source.key)
OIDC Applications
Use VergeOS as an identity provider.
OIDC application management for VergeOS as identity provider.
OIDC applications enable VergeOS to act as an OpenID Connect identity provider, allowing other systems and tenants to authenticate through VergeOS.
- Key concepts:
OIDC Application: Configuration for a client that authenticates via VergeOS
Client Credentials: Auto-generated client_id and client_secret for OAuth2 flow
Redirect URIs: Allowed callback URLs for the OAuth2 flow
Access Control: User/group ACLs to restrict who can use the application
- Benefits:
Central identity management across VergeOS systems and tenants
Single sign-on (SSO) capabilities
Can chain to upstream providers (Azure, Google, etc.)
Reduces administrative burden for multi-system environments
Example
>>> # List all OIDC applications
>>> for app in client.oidc_applications.list():
... print(f"{app.name}: {app.client_id}")
>>> # Create an OIDC application
>>> app = client.oidc_applications.create(
... name="Tenant Portal",
... redirect_uri="https://tenant.example.com/callback",
... description="OIDC for tenant authentication",
... )
>>> print(f"Client ID: {app.client_id}")
>>> print(f"Client Secret: {app.client_secret}")
>>> # Get well-known configuration URL
>>> print(f"Well-known: {app.well_known_configuration}")
>>> # Restrict access to specific users
>>> app = client.oidc_applications.update(app.key, restrict_access=True)
>>> app.allowed_users.add(user_key=123)
- class pyvergeos.resources.oidc_applications.OidcApplicationUser[source]
Bases:
ResourceObjectOIDC application user ACL entry.
Represents a user that is allowed to use an OIDC application when restrict_access is enabled.
- key
Entry $key (row ID).
- oidc_application
Parent application key.
- user
Allowed user key.
- class pyvergeos.resources.oidc_applications.OidcApplicationUserManager[source]
Bases:
ResourceManager[OidcApplicationUser]Manager for OIDC application user ACL operations.
Example
>>> # List allowed users for an application >>> for entry in app.allowed_users.list(): ... print(f"{entry.user_display}")
>>> # Add a user >>> app.allowed_users.add(user_key=123)
>>> # Remove a user >>> entry.delete()
- __init__(client, *, application_key=None)[source]
- Parameters:
client (VergeClient)
application_key (int | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, oidc_application=None, **filter_kwargs)[source]
List allowed users with optional filtering.
- Parameters:
- Returns:
List of OidcApplicationUser objects.
- Return type:
- get(key=None, *, fields=None)[source]
Get a single user ACL entry by key.
- Parameters:
- Returns:
OidcApplicationUser object.
- Raises:
NotFoundError – If entry not found.
ValueError – If key not provided.
- Return type:
- add(*, user_key)[source]
Add a user to allowed users.
- Parameters:
user_key (int) – User $key to add.
- Returns:
Created OidcApplicationUser object.
- Raises:
ValueError – If manager is not scoped to an application.
- Return type:
- class pyvergeos.resources.oidc_applications.OidcApplicationGroup[source]
Bases:
ResourceObjectOIDC application group ACL entry.
Represents a group whose members are allowed to use an OIDC application when restrict_access is enabled.
- key
Entry $key (row ID).
- oidc_application
Parent application key.
- group
Allowed group key.
- class pyvergeos.resources.oidc_applications.OidcApplicationGroupManager[source]
Bases:
ResourceManager[OidcApplicationGroup]Manager for OIDC application group ACL operations.
Example
>>> # List allowed groups for an application >>> for entry in app.allowed_groups.list(): ... print(f"{entry.group_display}")
>>> # Add a group >>> app.allowed_groups.add(group_key=456)
>>> # Remove a group >>> entry.delete()
- __init__(client, *, application_key=None)[source]
- Parameters:
client (VergeClient)
application_key (int | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, oidc_application=None, **filter_kwargs)[source]
List allowed groups with optional filtering.
- Parameters:
- Returns:
List of OidcApplicationGroup objects.
- Return type:
- get(key=None, *, fields=None)[source]
Get a single group ACL entry by key.
- Parameters:
- Returns:
OidcApplicationGroup object.
- Raises:
NotFoundError – If entry not found.
ValueError – If key not provided.
- Return type:
- add(*, group_key)[source]
Add a group to allowed groups.
- Parameters:
group_key (int) – Group $key to add.
- Returns:
Created OidcApplicationGroup object.
- Raises:
ValueError – If manager is not scoped to an application.
- Return type:
- class pyvergeos.resources.oidc_applications.OidcApplicationLog[source]
Bases:
ResourceObjectOIDC application log entry.
Represents an audit log entry for OIDC application operations.
- key
Log entry $key (row ID).
- oidc_application
Parent application key.
- level
Log level (audit, message, warning, error, critical).
- text
Log message text.
- timestamp
Log timestamp (microseconds).
- user
User who triggered the log.
- class pyvergeos.resources.oidc_applications.OidcApplicationLogManager[source]
Bases:
ResourceManager[OidcApplicationLog]Manager for OIDC application log operations.
Example
>>> # List all logs for an application >>> for log in app.logs.list(): ... print(f"{log.level}: {log.text}")
>>> # List errors only >>> errors = app.logs.list_errors()
- __init__(client, *, application_key=None)[source]
- Parameters:
client (VergeClient)
application_key (int | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, oidc_application=None, level=None, **filter_kwargs)[source]
List logs with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
oidc_application (int | None) – Filter by application key. Ignored if scoped.
level (str | None) – Filter by log level.
**filter_kwargs (Any) – Shorthand filter arguments.
- Returns:
List of OidcApplicationLog objects.
- Return type:
- get(key=None, *, fields=None)[source]
Get a single log entry by key.
- Parameters:
- Returns:
OidcApplicationLog object.
- Raises:
NotFoundError – If entry not found.
ValueError – If key not provided.
- Return type:
- list_errors(limit=None)[source]
List error and critical log entries.
- Parameters:
limit (int | None) – Maximum number of results.
- Returns:
List of error/critical log entries.
- Return type:
- list_warnings(limit=None)[source]
List warning log entries.
- Parameters:
limit (int | None) – Maximum number of results.
- Returns:
List of warning log entries.
- Return type:
- class pyvergeos.resources.oidc_applications.OidcApplication[source]
Bases:
ResourceObjectOIDC application resource object.
Represents an OIDC client application configuration for VergeOS acting as an identity provider.
- key
Application $key (row ID).
- name
Application name.
- enabled
Whether the application is enabled.
- created
Creation timestamp.
- description
Application description.
- redirect_uri
Allowed redirect URIs (newline-separated).
- client_id
OAuth2 client ID (auto-generated).
- client_secret
OAuth2 client secret (auto-generated).
- force_auth_source
Auth source for auto-redirect.
- restrict_access
Whether access is restricted to specific users/groups.
- map_user
User to map all logins to.
- scope_profile
Grant profile scope.
- scope_email
Grant email scope.
- scope_groups
Grant groups scope.
- well_known_configuration
Well-known configuration URL.
- property client_secret: str | None
Get the OAuth2 client secret.
Note: This is only available if fetched with include_secret=True.
- property redirect_uris: list[str]
Get redirect URIs as a list.
Redirect URIs are stored as newline-separated values.
- property allowed_users: OidcApplicationUserManager
Get a user ACL manager scoped to this application.
- Returns:
OidcApplicationUserManager for this application.
- property allowed_groups: OidcApplicationGroupManager
Get a group ACL manager scoped to this application.
- Returns:
OidcApplicationGroupManager for this application.
- property logs: OidcApplicationLogManager
Get a log manager scoped to this application.
- Returns:
OidcApplicationLogManager for this application.
- enable()[source]
Enable this OIDC application.
- Returns:
Updated OidcApplication object.
- Return type:
- disable()[source]
Disable this OIDC application.
- Returns:
Updated OidcApplication object.
- Return type:
- refresh()[source]
Refresh resource data from API.
- Returns:
Updated OidcApplication object.
- Return type:
- class pyvergeos.resources.oidc_applications.OidcApplicationManager[source]
Bases:
ResourceManager[OidcApplication]Manager for OIDC application operations.
OIDC applications enable VergeOS to act as an identity provider.
Example
>>> # List all OIDC applications >>> for app in client.oidc_applications.list(): ... print(f"{app.name}: {app.client_id}")
>>> # Get a specific application >>> app = client.oidc_applications.get(name="Tenant Portal")
>>> # Create an application >>> app = client.oidc_applications.create( ... name="Partner Portal", ... redirect_uri="https://partner.example.com/callback", ... description="OIDC for partner authentication", ... ) >>> print(f"Client ID: {app.client_id}") >>> print(f"Client Secret: {app.client_secret}")
>>> # Restrict access to specific users >>> app = client.oidc_applications.update(app.key, restrict_access=True) >>> app.allowed_users.add(user_key=123)
>>> # Delete an application >>> client.oidc_applications.delete(app.key)
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, enabled=None, **filter_kwargs)[source]
List OIDC applications with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
enabled (bool | None) – Filter by enabled state.
**filter_kwargs (Any) – Shorthand filter arguments (name, etc.).
- Returns:
List of OidcApplication objects.
- Return type:
Example
>>> # List all applications >>> apps = client.oidc_applications.list()
>>> # List enabled applications only >>> apps = client.oidc_applications.list(enabled=True)
>>> # Filter by name pattern >>> apps = client.oidc_applications.list(name="Tenant*")
- get(key=None, *, name=None, fields=None, include_secret=False, include_well_known=False)[source]
Get a single OIDC application by key or name.
- Parameters:
- Returns:
OidcApplication object.
- Raises:
NotFoundError – If application not found.
ValueError – If no identifier provided.
- Return type:
Example
>>> # Get by key >>> app = client.oidc_applications.get(1)
>>> # Get by name with secret >>> app = client.oidc_applications.get( ... name="Tenant Portal", ... include_secret=True ... ) >>> print(app.client_secret)
- create(name, *, redirect_uri=None, description=None, enabled=True, force_auth_source=None, restrict_access=False, map_user=None, scope_profile=True, scope_email=True, scope_groups=True)[source]
Create a new OIDC application.
The client_id and client_secret are auto-generated and returned in the created object.
- Parameters:
name (str) – Application name.
redirect_uri (str | list[str] | None) – Allowed redirect URIs (string or list of strings). Wildcards supported (e.g.,
https://*.example.com).description (str | None) – Application description.
enabled (bool) – Whether the application is enabled.
force_auth_source (int | None) – Auth source key for auto-redirect.
restrict_access (bool) – Restrict access to specific users/groups.
map_user (int | None) – User key to map all logins to.
scope_profile (bool) – Grant profile scope (read user name).
scope_email (bool) – Grant email scope (read user email).
scope_groups (bool) – Grant groups scope (read group membership).
- Returns:
Created OidcApplication object with client credentials.
- Return type:
Example
>>> app = client.oidc_applications.create( ... name="Partner Portal", ... redirect_uri=[ ... "https://portal.example.com/callback", ... "https://staging.example.com/callback", ... ], ... description="OIDC for partner authentication", ... ) >>> print(f"Client ID: {app.client_id}") >>> print(f"Client Secret: {app.client_secret}")
- update(key, *, name=None, redirect_uri=None, description=None, enabled=None, force_auth_source=None, restrict_access=None, map_user=None, scope_profile=None, scope_email=None, scope_groups=None)[source]
Update an OIDC application.
Note: client_id and client_secret cannot be changed.
- Parameters:
key (int) – Application $key (row ID).
name (str | None) – New application name.
redirect_uri (str | list[str] | None) – Updated redirect URIs.
description (str | None) – New description.
enabled (bool | None) – Enable or disable.
force_auth_source (int | None) – Auth source for auto-redirect.
restrict_access (bool | None) – Restrict to specific users/groups.
map_user (int | None) – User to map all logins to.
scope_profile (bool | None) – Grant profile scope.
scope_email (bool | None) – Grant email scope.
scope_groups (bool | None) – Grant groups scope.
- Returns:
Updated OidcApplication object.
- Return type:
Example
>>> # Update redirect URIs >>> app = client.oidc_applications.update( ... app.key, ... redirect_uri="https://new.example.com/callback" ... )
>>> # Enable access restriction >>> app = client.oidc_applications.update( ... app.key, ... restrict_access=True ... )
- delete(key)[source]
Delete an OIDC application.
- Parameters:
key (int) – Application $key (row ID).
- Raises:
NotFoundError – If application not found.
- Return type:
None
Example
>>> client.oidc_applications.delete(app.key)
- allowed_users(key)[source]
Get a user ACL manager scoped to a specific application.
- Parameters:
key (int) – Application $key (row ID).
- Returns:
OidcApplicationUserManager for the application.
- Return type:
- allowed_groups(key)[source]
Get a group ACL manager scoped to a specific application.
- Parameters:
key (int) – Application $key (row ID).
- Returns:
OidcApplicationGroupManager for the application.
- Return type:
Certificates
Certificate resource manager for VergeOS SSL/TLS certificate management.
- class pyvergeos.resources.certificates.Certificate[source]
Bases:
ResourceObjectSSL/TLS certificate resource object.
Represents an SSL/TLS certificate in VergeOS. Certificates can be: - Manual: Uploaded certificate with public/private keys - Let’s Encrypt: Automatically managed via ACME protocol - Self-Signed: Self-signed certificate generated by VergeOS
- Properties:
domain: Primary domain name for the certificate. domain_name: Alternative accessor for domain name. domain_list: List of Subject Alternative Names (SANs). description: Certificate description. cert_type: Certificate type (API value). cert_type_display: Friendly certificate type name. key_type: Key type (ecdsa or rsa). key_type_display: Friendly key type name. rsa_key_size: RSA key size (if RSA key type). acme_server: ACME server URL (for Let’s Encrypt). contact_user_key: Contact user key (for Let’s Encrypt). is_tos_agreed: Whether TOS is accepted (for Let’s Encrypt). is_valid: Whether certificate is valid (not expired). is_auto_created: Whether certificate was auto-created by system. expires_at: Expiration datetime. created_at: Creation datetime. modified_at: Last modified datetime. days_until_expiry: Days until certificate expires. public_key: Public certificate (PEM format, if loaded). private_key: Private key (PEM format, if loaded). chain: Certificate chain (PEM format, if loaded).
- refresh()[source]
Refresh certificate data from API.
- Returns:
Updated Certificate object.
- Return type:
- save(**kwargs)[source]
Update certificate with new values.
- Parameters:
**kwargs (Any) – Fields to update.
- Returns:
Updated Certificate object.
- Return type:
- renew(*, force=False)[source]
Renew or regenerate this certificate.
For Let’s Encrypt certificates, triggers ACME renewal. For self-signed certificates, regenerates with a new key pair.
- Parameters:
force (bool) – Force renewal even if not near expiration.
- Returns:
Updated Certificate object after renewal.
- Return type:
- class pyvergeos.resources.certificates.CertificateManager[source]
Bases:
ResourceManager[Certificate]Manager for SSL/TLS certificates.
Provides CRUD operations for SSL/TLS certificates including manual uploads, Let’s Encrypt (ACME) certificates, and self-signed certificates.
Example
>>> # List all certificates >>> certs = client.certificates.list() >>> >>> # Get a specific certificate >>> cert = client.certificates.get(domain="example.com") >>> >>> # Create a self-signed certificate >>> cert = client.certificates.create( ... domain="internal.local", ... cert_type="SelfSigned", ... description="Internal services" ... ) >>> >>> # Create a Let's Encrypt certificate >>> cert = client.certificates.create( ... domain="public.example.com", ... cert_type="LetsEncrypt", ... agree_tos=True, ... contact_user_key=1 ... ) >>> >>> # Renew a certificate >>> cert = client.certificates.renew(cert.key, force=True)
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, cert_type=None, valid=None, include_keys=False, **filter_kwargs)[source]
List certificates with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
cert_type (str | None) – Filter by certificate type (Manual, LetsEncrypt, SelfSigned).
valid (bool | None) – Filter by valid status (True for valid only).
include_keys (bool) – Include sensitive key material (public, private, chain).
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of Certificate objects.
- Return type:
- list_valid(**kwargs)[source]
List only valid (unexpired) certificates.
- Parameters:
**kwargs (Any) – Additional arguments passed to list().
- Returns:
List of valid Certificate objects.
- Return type:
- list_by_type(cert_type, **kwargs)[source]
List certificates by type.
- Parameters:
- Returns:
List of Certificate objects.
- Return type:
- list_expiring(days=30, **kwargs)[source]
List certificates expiring within specified days.
- Parameters:
- Returns:
List of Certificate objects expiring within the threshold.
- Return type:
- list_expired(**kwargs)[source]
List expired certificates.
- Parameters:
**kwargs (Any) – Additional arguments passed to list().
- Returns:
List of expired Certificate objects.
- Return type:
- get(key=None, *, domain=None, fields=None, include_keys=False)[source]
Get a certificate by key or domain.
- Parameters:
- Returns:
Certificate object.
- Raises:
NotFoundError – If certificate not found.
ValueError – If neither key nor domain provided.
- Return type:
- create(domain, *, cert_type='SelfSigned', domain_list=None, description=None, public_key=None, private_key=None, chain=None, acme_server=None, eab_key_id=None, eab_hmac_key=None, key_type=None, rsa_key_size=None, contact_user_key=None, agree_tos=False)[source]
Create a new SSL/TLS certificate.
- Parameters:
domain (str) – Primary domain name for the certificate.
cert_type (str) – Certificate type (Manual, LetsEncrypt, SelfSigned). Default is SelfSigned.
domain_list (list[str] | str | None) – Additional domains (SANs) as list or comma-separated string.
description (str | None) – Certificate description.
public_key (str | None) – Public certificate in PEM format (required for Manual).
private_key (str | None) – Private key in PEM format (required for Manual).
chain (str | None) – Certificate chain in PEM format (optional for Manual).
acme_server (str | None) – ACME server URL (for Let’s Encrypt).
eab_key_id (str | None) – External Account Binding key ID (for some ACME providers).
eab_hmac_key (str | None) – External Account Binding HMAC key.
key_type (str | None) – Key type (ECDSA or RSA). Default is ECDSA.
rsa_key_size (int | None) – RSA key size (2048, 3072, or 4096). Default is 2048.
contact_user_key (int | None) – Contact user $key for Let’s Encrypt.
agree_tos (bool) – Accept Let’s Encrypt Terms of Service (required for LE).
- Returns:
Created Certificate object.
- Raises:
ValidationError – If parameters invalid.
ConflictError – If certificate for domain already exists.
ValueError – If required parameters missing for certificate type.
- Return type:
- update(key, *, description=None, domain_list=None, public_key=None, private_key=None, chain=None, acme_server=None, eab_key_id=None, eab_hmac_key=None, key_type=None, rsa_key_size=None, contact_user_key=None, agree_tos=None)[source]
Update a certificate.
- Parameters:
key (int) – Certificate $key (ID).
description (str | None) – New certificate description.
domain_list (list[str] | str | None) – New additional domains (SANs).
public_key (str | None) – New public certificate (PEM format, manual certs only).
private_key (str | None) – New private key (PEM format, manual certs only).
chain (str | None) – New certificate chain (PEM format, manual certs only).
acme_server (str | None) – New ACME server URL (Let’s Encrypt only).
eab_key_id (str | None) – New External Account Binding key ID.
eab_hmac_key (str | None) – New External Account Binding HMAC key.
key_type (str | None) – New key type (ECDSA or RSA).
rsa_key_size (int | None) – New RSA key size (2048, 3072, or 4096).
contact_user_key (int | None) – New contact user $key.
agree_tos (bool | None) – Accept Terms of Service.
- Returns:
Updated Certificate object.
- Raises:
NotFoundError – If certificate not found.
ValidationError – If parameters invalid.
- Return type:
- delete(key)[source]
Delete a certificate.
- Parameters:
key (int) – Certificate $key (ID).
- Raises:
NotFoundError – If certificate not found.
- Return type:
None
- renew(key, *, force=False)[source]
Renew or regenerate a certificate.
For Let’s Encrypt certificates, triggers ACME renewal. For self-signed certificates, regenerates with a new key pair. Manual certificates cannot be renewed (upload new keys instead).
- Parameters:
- Returns:
Updated Certificate object after renewal.
- Raises:
NotFoundError – If certificate not found.
ValueError – If certificate type doesn’t support renewal.
- Return type:
System
System Management
System management for VergeOS - settings, statistics, licenses, diagnostics, and inventory.
- class pyvergeos.resources.system.SystemSetting[source]
Bases:
ResourceObjectRepresents a system setting in VergeOS.
System settings are key-value pairs that control various aspects of VergeOS behavior.
- class pyvergeos.resources.system.SettingsManager[source]
Bases:
ResourceManager[SystemSetting]Manages system settings in VergeOS.
Settings control various aspects of VergeOS behavior including connection limits, API rate limits, UI settings, and more.
Example
>>> # List all settings >>> for setting in client.settings.list(): ... print(f"{setting.key}: {setting.value}")
>>> # Get a specific setting >>> setting = client.settings.get("max_connections") >>> print(f"Max connections: {setting.value}")
>>> # Find modified settings >>> modified = [s for s in client.settings.list() if s.is_modified]
- list(filter=None, fields=None, key_contains=None, **filter_kwargs)[source]
List system settings.
- Parameters:
- Returns:
List of SystemSetting objects.
- Return type:
Example
>>> # List all settings >>> settings = client.settings.list()
>>> # List UI-related settings >>> ui_settings = client.settings.list(key_contains="ui_")
- get(key=None, *, fields=None)[source]
Get a system setting by key.
- Parameters:
- Returns:
SystemSetting object.
- Raises:
NotFoundError – If setting not found.
ValueError – If key not provided.
- Return type:
Example
>>> setting = client.settings.get("max_connections") >>> print(f"Value: {setting.value}, Default: {setting.default_value}")
- update(key, value)[source]
Update a system setting value.
- Parameters:
- Returns:
Updated SystemSetting object.
- Raises:
NotFoundError – If setting not found.
ValueError – If key not provided.
- Return type:
Example
>>> setting = client.system.settings.update("max_connections", "1000") >>> print(f"New value: {setting.value}")
- reset(key)[source]
Reset a system setting to its default value.
- Parameters:
key (str) – Setting key name.
- Returns:
Updated SystemSetting object with default value.
- Raises:
NotFoundError – If setting not found.
- Return type:
Example
>>> setting = client.system.settings.reset("max_connections") >>> print(f"Reset to: {setting.value}")
- class pyvergeos.resources.system.License[source]
Bases:
ResourceObjectRepresents a license in VergeOS.
Licenses control feature availability and system capabilities.
- class pyvergeos.resources.system.LicenseManager[source]
Bases:
ResourceManager[License]Manages licenses in VergeOS.
Licenses control which features are available and the capabilities of the VergeOS system.
Example
>>> # List all licenses >>> for lic in client.licenses.list(): ... print(f"{lic.name}: {'valid' if lic.is_valid else 'invalid'}")
>>> # Get license details >>> lic = client.licenses.get(name="Production") >>> print(f"Valid until: {lic.valid_until}")
- list(filter=None, fields=None, name=None, **filter_kwargs)[source]
List licenses.
- Parameters:
- Returns:
List of License objects.
- Return type:
Example
>>> # List all licenses >>> licenses = client.licenses.list()
>>> # Filter by name >>> prod_licenses = client.licenses.list(name="Production")
- get(key=None, *, name=None, fields=None)[source]
Get a license by key or name.
- Parameters:
- Returns:
License object.
- Raises:
NotFoundError – If license not found.
ValueError – If neither key nor name provided.
- Return type:
Example
>>> lic = client.licenses.get(name="Production") >>> print(f"Features: {lic.features}")
- generate_payload()[source]
Generate a license request payload for air-gapped systems.
For systems without internet connectivity, this generates a payload that can be sent to Verge.io support to obtain a license file.
- Returns:
License request payload as a string.
- Raises:
APIError – If payload generation fails.
- Return type:
Example
>>> payload = client.system.licenses.generate_payload() >>> # Save payload to a file and send to support >>> with open("license_request.txt", "w") as f: ... f.write(payload)
- add(license_text)[source]
Add a new license to the system.
- Parameters:
license_text (str) – The license text/key provided by Verge.io.
- Returns:
The newly added License object.
- Raises:
ValidationError – If the license is invalid.
ConflictError – If the license already exists.
- Return type:
Example
>>> license_data = open("license.txt").read() >>> lic = client.system.licenses.add(license_data) >>> print(f"Added license: {lic.name}")
- class pyvergeos.resources.system.SystemStatistics[source]
Bases:
objectSystem dashboard statistics.
Contains counts and status information for all major resource types.
- class pyvergeos.resources.system.InventoryStorageTier[source]
Bases:
objectStorage tier inventory item.
- class pyvergeos.resources.system.SystemInventory[source]
Bases:
objectSystem inventory containing all resource types.
Similar to RVtools for VMware, this provides a comprehensive view of all VergeOS resources.
- __init__(vms, networks, storage, nodes, clusters, tenants, generated_at)[source]
- Parameters:
vms (list[InventoryVM])
networks (list[InventoryNetwork])
storage (list[InventoryStorageTier])
nodes (list[InventoryNode])
clusters (list[InventoryCluster])
tenants (list[InventoryTenant])
generated_at (datetime)
- Return type:
None
- class pyvergeos.resources.system.SystemDiagnostic[source]
Bases:
ResourceObjectRepresents a system diagnostic report in VergeOS.
System diagnostics capture comprehensive system information including logs, configuration, network state, and other metrics useful for troubleshooting.
- Properties:
name: Diagnostic report name. description: Report description. status: Current status (initializing, building, uploading, complete, error). status_display: Human-readable status. status_info: Additional status information (e.g., current node being processed). file_key: Associated file $key for download. is_complete: Whether the diagnostic build is complete. is_building: Whether the diagnostic is currently building. has_error: Whether the diagnostic encountered an error. created_at: When the diagnostic was created.
- refresh()[source]
Refresh diagnostic data from API.
- Returns:
Updated SystemDiagnostic object.
- Return type:
- send_to_support()[source]
Send this diagnostic report to Verge.io support.
Requires the diagnostic to be complete.
- Raises:
ValueError – If diagnostic is not complete.
- Return type:
None
- wait_for_completion(timeout=300, poll_interval=2)[source]
Wait for the diagnostic build to complete.
- Parameters:
- Returns:
The completed SystemDiagnostic object.
- Raises:
TaskTimeoutError – If timeout is reached before completion.
- Return type:
- class pyvergeos.resources.system.SystemDiagnosticManager[source]
Bases:
ResourceManager[SystemDiagnostic]Manages system diagnostic reports in VergeOS.
System diagnostics capture comprehensive system information for troubleshooting and support purposes.
Example
>>> # Build a new diagnostic report >>> diag = client.system.diagnostics.build( ... name="Support Case #12345", ... description="Network connectivity issue", ... send_to_support=True ... ) >>> >>> # Wait for completion >>> diag = diag.wait_for_completion() >>> print(f"Status: {diag.status_display}") >>> >>> # List all diagnostics >>> for d in client.system.diagnostics.list(): ... print(f"{d.name}: {d.status_display}")
- list(filter=None, fields=None, limit=None, offset=None, *, status=None, **filter_kwargs)[source]
List system diagnostic reports.
- Parameters:
- Returns:
List of SystemDiagnostic objects.
- Return type:
Example
>>> # List all diagnostics >>> diagnostics = client.system.diagnostics.list() >>> >>> # List completed diagnostics only >>> completed = client.system.diagnostics.list(status="complete")
- get(key, *, fields=None)[source]
Get a diagnostic report by key.
- Parameters:
- Returns:
SystemDiagnostic object.
- Raises:
NotFoundError – If diagnostic not found.
- Return type:
- build(name=None, description=None, *, send_to_support=False)[source]
Build a new system diagnostic report.
Triggers collection of comprehensive system information from all nodes. This operation may take several minutes depending on system size.
- Parameters:
- Returns:
The new SystemDiagnostic object (initially in ‘initializing’ status).
- Return type:
Example
>>> # Build diagnostic for support case >>> diag = client.system.diagnostics.build( ... name="Support-12345", ... description="High CPU usage investigation", ... send_to_support=True ... ) >>> diag = diag.wait_for_completion()
- send_to_support(key)[source]
Send a diagnostic report to Verge.io support.
The diagnostic must be complete before sending.
- Parameters:
key (int) – Diagnostic $key.
- Raises:
NotFoundError – If diagnostic not found.
ValueError – If diagnostic is not complete.
- Return type:
None
- delete(key)[source]
Delete a diagnostic report.
- Parameters:
key (int) – Diagnostic $key.
- Raises:
NotFoundError – If diagnostic not found.
- Return type:
None
- update(key, *, name=None, description=None)[source]
Update a diagnostic report’s name or description.
- Parameters:
- Returns:
Updated SystemDiagnostic object.
- Raises:
NotFoundError – If diagnostic not found.
- Return type:
- get_download_url(key)[source]
Get the download URL for a completed diagnostic file.
- Parameters:
key (int) – Diagnostic $key.
- Returns:
Download URL string, or None if file not available.
- Raises:
NotFoundError – If diagnostic not found.
ValueError – If diagnostic is not complete.
- Return type:
str | None
- class pyvergeos.resources.system.RootCertificate[source]
Bases:
ResourceObjectRepresents a trusted root certificate authority in VergeOS.
Root certificates are added to the system’s trust store to enable secure connections to systems using private/internal CA certificates.
- Properties:
subject: Certificate subject (common name, organization, etc.). issuer: Certificate issuer. fingerprint: Certificate fingerprint (SHA-256). start_date: Certificate validity start date. end_date: Certificate validity end date. cert_pem: Certificate in PEM format. modified_at: When the certificate was last modified.
- class pyvergeos.resources.system.RootCertificateManager[source]
Bases:
ResourceManager[RootCertificate]Manages trusted root certificates in VergeOS.
Root certificates allow adding custom Certificate Authorities to the system’s trust store, enabling secure connections to systems using private/enterprise CA certificates.
Common use cases: - Enabling secure site syncs with internal CA certificates - Trusting enterprise PKI for LDAP/AD connections - Development environments with self-signed CAs
Example
>>> # Add a root CA >>> ca_cert = open("enterprise-ca.pem").read() >>> root_ca = client.system.root_certificates.create(cert=ca_cert) >>> print(f"Added CA: {root_ca.subject}") >>> >>> # List trusted CAs >>> for ca in client.system.root_certificates.list(): ... print(f"{ca.subject} (expires: {ca.end_date})")
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List trusted root certificates.
- Parameters:
- Returns:
List of RootCertificate objects.
- Return type:
Example
>>> # List all trusted CAs >>> for ca in client.system.root_certificates.list(): ... print(f"{ca.subject}")
- get(key, *, fields=None)[source]
Get a root certificate by key.
- Parameters:
- Returns:
RootCertificate object.
- Raises:
NotFoundError – If certificate not found.
- Return type:
- get_by_subject(subject)[source]
Get a root certificate by subject.
- Parameters:
subject (str) – Certificate subject (partial match supported).
- Returns:
RootCertificate object.
- Raises:
NotFoundError – If certificate not found.
- Return type:
- get_by_fingerprint(fingerprint)[source]
Get a root certificate by fingerprint.
- Parameters:
fingerprint (str) – Certificate fingerprint.
- Returns:
RootCertificate object.
- Raises:
NotFoundError – If certificate not found.
- Return type:
- create(cert)[source]
Add a new trusted root certificate.
- Parameters:
cert (str) – Certificate in PEM format.
- Returns:
The new RootCertificate object.
- Raises:
ValidationError – If the certificate is invalid.
ConflictError – If the certificate already exists.
- Return type:
Example
>>> ca_cert = '''-----BEGIN CERTIFICATE----- ... MIIDXTCCAkWgAwIBAgIJAJC1... ... -----END CERTIFICATE-----''' >>> root_ca = client.system.root_certificates.create(cert=ca_cert)
- delete(key)[source]
Delete a root certificate.
- Parameters:
key (int) – Certificate $key.
- Raises:
NotFoundError – If certificate not found.
- Return type:
None
- class pyvergeos.resources.system.SystemManager[source]
Bases:
objectProvides system-level operations in VergeOS.
Includes access to settings, statistics, licenses, diagnostics, root certificates, and inventory.
Example
>>> # Get system statistics >>> stats = client.system.statistics() >>> print(f"VMs: {stats.vms_online}/{stats.vms_total}")
>>> # Get licenses >>> for lic in client.system.licenses.list(): ... print(f"{lic.name}: {'valid' if lic.is_valid else 'invalid'}")
>>> # Get system settings >>> setting = client.system.settings.get("max_connections") >>> print(f"Max connections: {setting.value}")
>>> # Update a setting >>> setting = client.system.settings.update("max_connections", "1000")
>>> # Build system diagnostics >>> diag = client.system.diagnostics.build( ... name="Support Case", ... send_to_support=True ... )
>>> # Add a trusted root CA >>> root_ca = client.system.root_certificates.create(cert=pem_text)
>>> # Get full inventory >>> inventory = client.system.inventory() >>> print(inventory.summary)
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- property settings: SettingsManager
Access system settings.
System settings control various aspects of VergeOS behavior including connection limits, API rate limits, and more.
Example
>>> # List all settings >>> for s in client.system.settings.list(): ... print(f"{s.key}: {s.value}")
>>> # Update a setting >>> client.system.settings.update("max_connections", "1000")
>>> # List modified settings >>> for s in client.system.settings.list_modified(): ... print(f"{s.key}: {s.value} (default: {s.default_value})")
- property licenses: LicenseManager
Access license management.
Licenses control which features are available and the capabilities of the VergeOS system.
Example
>>> # List licenses >>> for lic in client.system.licenses.list(): ... print(f"{lic.name}: {'valid' if lic.is_valid else 'invalid'}")
>>> # Generate payload for air-gapped licensing >>> payload = client.system.licenses.generate_payload()
- property diagnostics: SystemDiagnosticManager
Access system diagnostics.
System diagnostics capture comprehensive system information for troubleshooting and support purposes.
Example
>>> # Build a diagnostic report >>> diag = client.system.diagnostics.build( ... name="Support-12345", ... description="Network issue", ... send_to_support=True ... ) >>> diag = diag.wait_for_completion()
>>> # List diagnostics >>> for d in client.system.diagnostics.list(): ... print(f"{d.name}: {d.status_display}")
- property root_certificates: RootCertificateManager
Access root certificate (trusted CA) management.
Root certificates allow adding custom Certificate Authorities to the system’s trust store for secure connections.
Example
>>> # Add a trusted CA >>> ca_pem = open("enterprise-ca.pem").read() >>> ca = client.system.root_certificates.create(cert=ca_pem)
>>> # List trusted CAs >>> for ca in client.system.root_certificates.list(): ... print(f"{ca.subject}")
- statistics()[source]
Get system dashboard statistics.
- Returns:
SystemStatistics object with counts for all resource types.
- Return type:
Example
>>> stats = client.system.statistics() >>> print(f"Total VMs: {stats.vms_total}") >>> print(f"Online VMs: {stats.vms_online}") >>> print(f"Active Alarms: {stats.alarms_total}")
- inventory(include_vms=True, include_networks=True, include_storage=True, include_nodes=True, include_clusters=True, include_tenants=True)[source]
Generate a comprehensive system inventory.
Similar to RVtools for VMware, this provides a complete view of all VergeOS resources.
- Parameters:
include_vms (bool) – Include VM inventory.
include_networks (bool) – Include network inventory.
include_storage (bool) – Include storage tier inventory.
include_nodes (bool) – Include node inventory.
include_clusters (bool) – Include cluster inventory.
include_tenants (bool) – Include tenant inventory.
- Returns:
SystemInventory object containing all requested resources.
- Return type:
Example
>>> inventory = client.system.inventory() >>> print(f"Total VMs: {len(inventory.vms)}") >>> print(f"Summary: {inventory.summary}")
Clusters
Cluster resource manager.
- class pyvergeos.resources.clusters.Cluster[source]
Bases:
ResourceObjectCluster resource object.
Represents a VergeOS cluster with compute and storage capabilities.
Example
>>> cluster = client.clusters.get(name="Production") >>> print(f"{cluster.name}: {cluster.status}") >>> print(f" Nodes: {cluster.online_nodes}/{cluster.total_nodes}") >>> print(f" RAM: {cluster.used_ram_gb}/{cluster.online_ram_gb} GB")
- property tiers: ClusterTierManager
Access tier management for this cluster.
- Returns:
ClusterTierManager scoped to this cluster.
Example
>>> cluster = client.clusters.get(name="Production") >>> for tier in cluster.tiers.list(): ... print(f"Tier {tier.tier}: {tier.used_percent}% used")
- class pyvergeos.resources.clusters.VSANStatus[source]
Bases:
ResourceObjectRepresents vSAN status for a cluster.
Provides health status, capacity information, and resource utilization metrics for a VergeOS cluster’s vSAN.
- class pyvergeos.resources.clusters.ClusterManager[source]
Bases:
ResourceManager[Cluster]Manager for Cluster operations.
Provides CRUD operations for VergeOS clusters including compute and storage configuration.
Example
>>> # List all clusters >>> clusters = client.clusters.list() >>> for cluster in clusters: ... print(f"{cluster.name}: {cluster.status}") ... print(f" Nodes: {cluster.online_nodes}/{cluster.total_nodes}")
>>> # Get a specific cluster >>> cluster = client.clusters.get(name="Production")
>>> # Create a new cluster >>> new_cluster = client.clusters.create( ... name="Development", ... compute=True, ... max_ram_per_vm=65536, ... max_cores_per_vm=32, ... )
>>> # Update cluster settings >>> client.clusters.update(cluster.key, max_ram_per_vm=131072)
>>> # Get vSAN status for all clusters >>> status_list = client.clusters.vsan_status() >>> for status in status_list: ... print(f"{status.cluster_name}: {status.health_status}")
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, name=None, enabled=None, compute=None, storage=None, **filter_kwargs)[source]
List clusters with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (defaults to comprehensive set).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
name (str | None) – Filter by cluster name (supports wildcards with ‘ct’).
enabled (bool | None) – Filter by enabled status.
compute (bool | None) – Filter by compute capability.
storage (bool | None) – Filter by storage capability.
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of Cluster objects.
- Return type:
Example
>>> # List all clusters >>> clusters = client.clusters.list()
>>> # List only compute clusters >>> compute_clusters = client.clusters.list(compute=True)
>>> # List enabled clusters >>> enabled = client.clusters.list(enabled=True)
- get(key=None, *, name=None, fields=None)[source]
Get a single cluster by key or name.
- Parameters:
- Returns:
Cluster object.
- Raises:
NotFoundError – If cluster not found.
ValueError – If neither key nor name provided.
- Return type:
Example
>>> cluster = client.clusters.get(key=1) >>> cluster = client.clusters.get(name="Production")
- create(name, *, description=None, enabled=True, compute=False, nested_virtualization=False, allow_nested_virt_migration=True, allow_vgpu_migration=False, default_cpu=None, disable_cpu_security_mitigations=False, disable_smt=False, enable_split_lock_detection=False, energy_perf_policy='performance', scaling_governor='performance', ram_per_unit=4096, cores_per_unit=1, cost_per_unit=0, price_per_unit=0, max_ram_per_vm=65536, max_cores_per_vm=16, target_ram_percent=80, ram_overcommit_percent=0, storage_cache_per_node=None, storage_buffer_per_node=None, storage_hugepages=True, enable_nvme_power_management=False, swap_tier=-1, swap_per_drive=None, max_core_temp=None, critical_core_temp=None, max_core_temp_warn_percent=10, disable_sleep=False, log_filter=None)[source]
Create a new cluster.
- Parameters:
name (str) – Cluster name (1-128 characters, must be unique).
description (str | None) – Optional description (max 2048 characters).
enabled (bool) – Enable the cluster after creation.
compute (bool) – Enable compute workloads on this cluster.
nested_virtualization (bool) – Enable nested virtualization (VMs inside VMs).
allow_nested_virt_migration (bool) – Allow live migration of VMs with nested virt.
allow_vgpu_migration (bool) – Allow live migration of VMs with vGPU devices.
default_cpu (str | None) – Default CPU type for VMs (e.g., ‘host’, ‘EPYC-Milan’).
disable_cpu_security_mitigations (bool) – Disable CPU security mitigations.
disable_smt (bool) – Disable Simultaneous Multi-Threading (hyper-threading).
enable_split_lock_detection (bool) – Enable split lock detection.
energy_perf_policy (Literal['performance', 'balance-performance', 'balance-power', 'normal', 'power']) – CPU energy-performance policy.
scaling_governor (Literal['performance', 'ondemand', 'powersave']) – CPU scaling governor.
ram_per_unit (int) – RAM per billing unit in MB.
cores_per_unit (int) – CPU cores per billing unit.
cost_per_unit (float) – Cost per billing unit.
price_per_unit (float) – Price per billing unit.
max_ram_per_vm (int) – Maximum RAM allowed per VM in MB.
max_cores_per_vm (int) – Maximum CPU cores allowed per VM.
target_ram_percent (float) – Target maximum RAM utilization percentage (0-100).
ram_overcommit_percent (float) – Percentage of reserve RAM for machines (0-100).
storage_cache_per_node (int | None) – Storage cache per node in MB.
storage_buffer_per_node (int | None) – Storage buffer per node in MB.
storage_hugepages (bool) – Allocate hugepages for storage.
enable_nvme_power_management (bool) – Enable NVMe power management.
swap_tier (int) – Storage tier for swap (-1 to disable, 0-5 for tier).
swap_per_drive (int | None) – Swap space per drive in MB.
max_core_temp (int | None) – Maximum core temperature in Celsius.
critical_core_temp (int | None) – Critical core temperature in Celsius.
max_core_temp_warn_percent (int) – Temperature warning threshold percentage.
disable_sleep (bool) – Disable CPU sleep states.
log_filter (str | None) – System log filter expression.
- Returns:
Created Cluster object.
- Raises:
ValidationError – If parameters are invalid.
ConflictError – If cluster name already exists.
- Return type:
Example
>>> cluster = client.clusters.create( ... name="Development", ... description="Development workloads", ... compute=True, ... max_ram_per_vm=65536, ... max_cores_per_vm=32, ... )
- update(key, *, name=None, description=None, enabled=None, compute=None, nested_virtualization=None, allow_nested_virt_migration=None, allow_vgpu_migration=None, default_cpu=None, disable_cpu_security_mitigations=None, disable_smt=None, enable_split_lock_detection=None, energy_perf_policy=None, scaling_governor=None, ram_per_unit=None, cores_per_unit=None, cost_per_unit=None, price_per_unit=None, max_ram_per_vm=None, max_cores_per_vm=None, target_ram_percent=None, ram_overcommit_percent=None, storage_cache_per_node=None, storage_buffer_per_node=None, storage_hugepages=None, enable_nvme_power_management=None, swap_tier=None, swap_per_drive=None, max_core_temp=None, critical_core_temp=None, max_core_temp_warn_percent=None, disable_sleep=None, log_filter=None)[source]
Update an existing cluster.
- Parameters:
key (int) – Cluster $key (ID).
name (str | None) – New cluster name.
description (str | None) – New description.
enabled (bool | None) – Enable or disable the cluster.
compute (bool | None) – Enable or disable compute workloads.
nested_virtualization (bool | None) – Enable or disable nested virtualization.
allow_nested_virt_migration (bool | None) – Allow live migration with nested virt.
allow_vgpu_migration (bool | None) – Allow live migration with vGPU.
default_cpu (str | None) – Default CPU type for VMs.
disable_cpu_security_mitigations (bool | None) – Disable CPU security mitigations.
disable_smt (bool | None) – Disable Simultaneous Multi-Threading.
enable_split_lock_detection (bool | None) – Enable split lock detection.
energy_perf_policy (Literal['performance', 'balance-performance', 'balance-power', 'normal', 'power'] | None) – CPU energy-performance policy.
scaling_governor (Literal['performance', 'ondemand', 'powersave'] | None) – CPU scaling governor.
ram_per_unit (int | None) – RAM per billing unit in MB.
cores_per_unit (int | None) – CPU cores per billing unit.
cost_per_unit (float | None) – Cost per billing unit.
price_per_unit (float | None) – Price per billing unit.
max_ram_per_vm (int | None) – Maximum RAM allowed per VM in MB.
max_cores_per_vm (int | None) – Maximum CPU cores allowed per VM.
target_ram_percent (float | None) – Target maximum RAM utilization percentage.
ram_overcommit_percent (float | None) – Percentage of reserve RAM for machines.
storage_cache_per_node (int | None) – Storage cache per node in MB.
storage_buffer_per_node (int | None) – Storage buffer per node in MB.
storage_hugepages (bool | None) – Allocate hugepages for storage.
enable_nvme_power_management (bool | None) – Enable NVMe power management.
swap_tier (int | None) – Storage tier for swap.
swap_per_drive (int | None) – Swap space per drive in MB.
max_core_temp (int | None) – Maximum core temperature in Celsius.
critical_core_temp (int | None) – Critical core temperature in Celsius.
max_core_temp_warn_percent (int | None) – Temperature warning threshold percentage.
disable_sleep (bool | None) – Disable CPU sleep states.
log_filter (str | None) – System log filter expression.
- Returns:
Updated Cluster object.
- Return type:
Example
>>> updated = client.clusters.update( ... cluster.key, ... max_ram_per_vm=131072, ... max_cores_per_vm=64, ... )
- delete(key)[source]
Delete a cluster.
Clusters cannot be deleted if they have nodes or running machines assigned to them. Reassign resources before deletion.
- Parameters:
key (int) – Cluster $key (ID).
- Raises:
ValidationError – If cluster has nodes or running machines.
NotFoundError – If cluster not found.
- Return type:
None
Example
>>> client.clusters.delete(cluster.key)
- vsan_status(cluster_name=None, include_tiers=False)[source]
Get vSAN health status for clusters.
- Parameters:
- Returns:
List of VSANStatus objects with health and capacity info.
- Return type:
Example
>>> status_list = client.clusters.vsan_status() >>> for status in status_list: ... print(f"{status.cluster_name}: {status.health_status}") ... print(f" RAM: {status.used_ram_gb}/{status.online_ram_gb} GB") ... print(f" Cores: {status.used_cores}/{status.online_cores}")
>>> # With tier information >>> status_list = client.clusters.vsan_status(include_tiers=True) >>> for status in status_list: ... for tier in status.tiers: ... print(f" Tier {tier['tier']}: {tier['used_percent']}% used")
Cluster Tiers
Storage tier health and performance monitoring.
Cluster Tier Management for VergeOS vSAN.
This module provides access to cluster storage tiers, their status, performance stats, and historical metrics.
Example
>>> # Access tiers for a cluster
>>> cluster = client.clusters.get(name="Production")
>>> for tier in cluster.tiers.list():
... print(f"Tier {tier.tier}: {tier.used_percent}% used")
>>> # Get tier status
>>> tier = cluster.tiers.get(tier=1)
>>> status = tier.get_status()
>>> print(f"Status: {status.status}, Redundant: {status.is_redundant}")
>>> # Get tier stats
>>> stats = tier.get_stats()
>>> print(f"IOPS: {stats.read_ops} read, {stats.write_ops} write")
>>> # Get stats history
>>> history = tier.stats_history_short(limit=100)
>>> for point in history:
... print(f"{point.timestamp}: {point.read_ops} IOPS")
- class pyvergeos.resources.cluster_tiers.ClusterTierStatsHistoryLong[source]
Bases:
ResourceObjectLong-term cluster tier stats history record.
Contains peak and average metrics with longer retention but lower resolution.
- class pyvergeos.resources.cluster_tiers.ClusterTierStatsHistoryShort[source]
Bases:
ResourceObjectShort-term cluster tier stats history record.
Contains high-resolution metrics with shorter retention.
- class pyvergeos.resources.cluster_tiers.ClusterTierStats[source]
Bases:
ResourceObjectCurrent cluster tier statistics.
Provides real-time I/O performance metrics for a tier.
- class pyvergeos.resources.cluster_tiers.ClusterTierStatus[source]
Bases:
ResourceObjectCluster tier health and capacity status.
Provides operational status, capacity metrics, and health indicators.
- class pyvergeos.resources.cluster_tiers.ClusterTier[source]
Bases:
ResourceObjectCluster storage tier resource object.
Represents a storage tier within a specific cluster.
Example
>>> tier = cluster.tiers.get(tier=1) >>> print(f"Tier {tier.tier}: {tier.description}") >>> print(f" Status: {tier.status}, Capacity: {tier.capacity_gb} GB")
- get_status()[source]
Get detailed tier status.
- Returns:
ClusterTierStatus object with full status information.
- Return type:
- get_stats()[source]
Get current tier statistics.
- Returns:
ClusterTierStats object with current I/O metrics.
- Return type:
- stats_history_short(limit=None, offset=None, since=None, until=None)[source]
Get short-term stats history (high resolution).
- Parameters:
- Returns:
List of ClusterTierStatsHistoryShort objects.
- Return type:
- class pyvergeos.resources.cluster_tiers.ClusterTierManager[source]
Bases:
ResourceManager[ClusterTier]Manager for cluster tier operations.
Provides access to storage tiers within a specific cluster, including status, statistics, and historical metrics.
Scoped to a specific cluster.
Example
>>> # Access via cluster object >>> cluster = client.clusters.get(name="Production") >>> for tier in cluster.tiers.list(): ... print(f"Tier {tier.tier}: {tier.used_percent}% used")
>>> # Get specific tier >>> tier = cluster.tiers.get(tier=1)
>>> # Get tier status >>> status = cluster.tiers.get_tier_status(tier.key) >>> print(f"Status: {status.status}")
>>> # Get tier stats >>> stats = cluster.tiers.get_tier_stats(tier.key) >>> print(f"IOPS: {stats.read_ops} read, {stats.write_ops} write")
- __init__(client, cluster_key)[source]
- Parameters:
client (VergeClient)
cluster_key (int)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, tier=None, **filter_kwargs)[source]
List cluster tiers.
- Parameters:
- Returns:
List of ClusterTier objects.
- Return type:
Example
>>> # List all tiers for this cluster >>> for tier in cluster.tiers.list(): ... print(f"Tier {tier.tier}: {tier.used_percent}% used")
- get(key=None, *, tier=None, fields=None)[source]
Get a cluster tier by key or tier number.
- Parameters:
- Returns:
ClusterTier object.
- Raises:
NotFoundError – If tier not found.
ValueError – If neither key nor tier provided.
- Return type:
Example
>>> tier1 = cluster.tiers.get(tier=1) >>> print(f"Tier 1: {tier1.used_gb} GB used")
- get_tier_status(tier_key)[source]
Get detailed status for a tier.
- Parameters:
tier_key (int) – Tier $key.
- Returns:
ClusterTierStatus object.
- Raises:
NotFoundError – If status not found.
- Return type:
- get_tier_stats(tier_key)[source]
Get current statistics for a tier.
- Parameters:
tier_key (int) – Tier $key.
- Returns:
ClusterTierStats object.
- Raises:
NotFoundError – If stats not found.
- Return type:
- get_stats_history_short(tier_key, limit=None, offset=None, since=None, until=None)[source]
Get short-term stats history for a tier.
- Parameters:
- Returns:
List of ClusterTierStatsHistoryShort objects.
- Return type:
- get_stats_history_long(tier_key, limit=None, offset=None, since=None, until=None)[source]
Get long-term stats history for a tier.
- Parameters:
- Returns:
List of ClusterTierStatsHistoryLong objects.
- Return type:
Nodes
Node resource manager.
- class pyvergeos.resources.nodes.Node[source]
Bases:
ResourceObjectNode resource object.
Represents a VergeOS node with compute and storage capabilities.
Example
>>> node = client.nodes.get(name="node1") >>> print(f"{node.name}: {node.status}") >>> print(f" RAM: {node.ram_mb}MB, Cores: {node.cores}") >>> if node.is_maintenance: ... print(" In maintenance mode")
- enable_maintenance()[source]
Enable maintenance mode on this node.
- Returns:
Updated Node object.
- Return type:
- disable_maintenance()[source]
Disable maintenance mode on this node.
- Returns:
Updated Node object.
- Return type:
- property drivers: NodeDriverManager
Access drivers for this node.
- Returns:
NodeDriverManager scoped to this node.
- property pci_devices: NodePCIDeviceManager
Access PCI devices for this node.
- Returns:
NodePCIDeviceManager scoped to this node.
- property usb_devices: NodeUSBDeviceManager
Access USB devices for this node.
- Returns:
NodeUSBDeviceManager scoped to this node.
- property stats: MachineStatsManager
Access performance stats for this node.
- Returns:
MachineStatsManager scoped to this node.
Example
>>> stats = node.stats.get() >>> print(f"CPU: {stats.total_cpu}%, RAM: {stats.ram_used_mb}MB")
>>> # Get stats history >>> history = node.stats.history_short(limit=100)
- Raises:
ValueError – If node has no associated machine.
- property machine_status: MachineStatusManager
Access detailed operational status for this node.
- Returns:
MachineStatusManager scoped to this node.
Example
>>> status = node.machine_status.get() >>> print(f"Status: {status.status}")
- Raises:
ValueError – If node has no associated machine.
- property machine_logs: MachineLogManager
Access log entries for this node.
- Returns:
MachineLogManager scoped to this node.
Example
>>> logs = node.machine_logs.list(limit=20) >>> errors = node.machine_logs.list(errors_only=True)
- Raises:
ValueError – If node has no associated machine.
- property gpus: NodeGpuManager
Access GPU configurations for this node.
- Returns:
NodeGpuManager scoped to this node.
Example
>>> for gpu in node.gpus.list(): ... print(f"{gpu.name}: {gpu.mode_display}")
- property vgpu_devices: NodeVgpuDeviceManager
Access NVIDIA vGPU-capable devices on this node.
- Returns:
NodeVgpuDeviceManager scoped to this node.
Example
>>> for device in node.vgpu_devices.list(): ... print(f"{device.name}: {device.vendor} {device.device}")
- property host_gpu_devices: NodeHostGpuDeviceManager
Access host GPU devices available for passthrough on this node.
- Returns:
NodeHostGpuDeviceManager scoped to this node.
Example
>>> for device in node.host_gpu_devices.list(): ... print(f"{device.name}: {device.vendor} {device.device}")
- property sriov_nics: NodeSriovNicDeviceManager
Access SR-IOV NIC devices on this node.
- Returns:
NodeSriovNicDeviceManager scoped to this node.
Example
>>> for device in node.sriov_nics.list(): ... print(f"{device.name}: PF {device.physical_function}")
- class pyvergeos.resources.nodes.NodeDriver[source]
Bases:
ResourceObjectNode driver resource object.
Represents a driver installed on a VergeOS node.
- class pyvergeos.resources.nodes.NodePCIDevice[source]
Bases:
ResourceObjectNode PCI device resource object.
Represents a PCI device attached to a VergeOS node.
- class pyvergeos.resources.nodes.NodeUSBDevice[source]
Bases:
ResourceObjectNode USB device resource object.
Represents a USB device attached to a VergeOS node.
- class pyvergeos.resources.nodes.NodeSriovNicDevice[source]
Bases:
ResourceObjectNode SR-IOV NIC device resource object.
Represents an SR-IOV capable NIC (Virtual Function) attached to a VergeOS node. These are virtual network interfaces created from a physical NIC that supports SR-IOV.
- class pyvergeos.resources.nodes.NodeDriverManager[source]
Bases:
ResourceManager[NodeDriver]Manager for node driver operations.
Provides access to drivers installed on VergeOS nodes. Can be used globally or scoped to a specific node.
Example
>>> # List all drivers across all nodes >>> drivers = client.nodes.all_drivers.list()
>>> # List drivers for a specific node >>> node_drivers = client.nodes.drivers(node_key).list()
>>> # Or via node object >>> node = client.nodes.get(name="node1") >>> for driver in node.drivers.list(): ... print(f"{driver.driver_name}: {driver.status}")
- __init__(client, node_key=None)[source]
- Parameters:
client (VergeClient)
node_key (int | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, driver_name=None, status=None, **filter_kwargs)[source]
List node drivers with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
driver_name (str | None) – Filter by driver name (contains).
status (Literal['Installed', 'Verifying', 'Error'] | None) – Filter by status (Installed, Verifying, Error).
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of NodeDriver objects.
- Return type:
Example
>>> # List all drivers >>> drivers = client.nodes.all_drivers.list()
>>> # List installed drivers >>> installed = client.nodes.all_drivers.list(status="Installed")
>>> # List NVIDIA drivers >>> nvidia = client.nodes.all_drivers.list(driver_name="nvidia")
- get(key=None, *, driver_name=None, fields=None)[source]
Get a single driver by key or name.
- Parameters:
- Returns:
NodeDriver object.
- Raises:
NotFoundError – If driver not found.
ValueError – If neither key nor driver_name provided.
- Return type:
- class pyvergeos.resources.nodes.NodePCIDeviceManager[source]
Bases:
ResourceManager[NodePCIDevice]Manager for node PCI device operations.
Provides access to PCI devices attached to VergeOS nodes. Can be used globally or scoped to a specific node.
Example
>>> # List all PCI devices >>> devices = client.nodes.all_pci_devices.list()
>>> # List GPUs only >>> gpus = client.nodes.all_pci_devices.list(device_type="GPU")
>>> # List devices for a specific node >>> node_devices = client.nodes.pci_devices(node_key).list()
- __init__(client, node_key=None)[source]
- Parameters:
client (VergeClient)
node_key (int | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, device_type=None, device_class=None, vendor=None, **filter_kwargs)[source]
List PCI devices with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
device_type (Literal['GPU', 'Network', 'Storage'] | None) – Filter by device type (GPU, Network, Storage).
device_class (str | None) – Filter by device class (contains).
vendor (str | None) – Filter by vendor name (contains).
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of NodePCIDevice objects.
- Return type:
Example
>>> # List all PCI devices >>> devices = client.nodes.all_pci_devices.list()
>>> # List GPUs only >>> gpus = client.nodes.all_pci_devices.list(device_type="GPU")
>>> # List network controllers >>> nics = client.nodes.all_pci_devices.list(device_type="Network")
- get(key, *, fields=None)[source]
Get a single PCI device by key.
- Parameters:
- Returns:
NodePCIDevice object.
- Raises:
NotFoundError – If device not found.
- Return type:
- class pyvergeos.resources.nodes.NodeUSBDeviceManager[source]
Bases:
ResourceManager[NodeUSBDevice]Manager for node USB device operations.
Provides access to USB devices attached to VergeOS nodes. Can be used globally or scoped to a specific node.
Example
>>> # List all USB devices >>> devices = client.nodes.all_usb_devices.list()
>>> # List USB devices for a specific node >>> node_devices = client.nodes.usb_devices(node_key).list()
- __init__(client, node_key=None)[source]
- Parameters:
client (VergeClient)
node_key (int | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, vendor=None, model=None, **filter_kwargs)[source]
List USB devices with optional filtering.
- Parameters:
- Returns:
List of NodeUSBDevice objects.
- Return type:
Example
>>> # List all USB devices >>> devices = client.nodes.all_usb_devices.list()
>>> # List USB devices by vendor >>> devices = client.nodes.all_usb_devices.list(vendor="Logitech")
- get(key, *, fields=None)[source]
Get a single USB device by key.
- Parameters:
- Returns:
NodeUSBDevice object.
- Raises:
NotFoundError – If device not found.
- Return type:
- class pyvergeos.resources.nodes.NodeSriovNicDeviceManager[source]
Bases:
ResourceManager[NodeSriovNicDevice]Manager for node SR-IOV NIC device operations.
Provides access to SR-IOV capable NIC virtual functions (VFs) attached to VergeOS nodes. Can be used globally or scoped to a specific node.
SR-IOV (Single Root I/O Virtualization) allows a single physical NIC to appear as multiple virtual network interfaces, each passable to a VM for near-native network performance.
Example
>>> # List all SR-IOV NIC devices >>> devices = client.nodes.all_sriov_nics.list()
>>> # List SR-IOV NICs for a specific node >>> node_devices = client.nodes.sriov_nics(node_key).list()
>>> # Or via node object >>> for device in node.sriov_nics.list(): ... print(f"{device.name} on {device.slot} (PF: {device.physical_function})")
- __init__(client, node_key=None)[source]
- Parameters:
client (VergeClient)
node_key (int | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, vendor=None, physical_function=None, **filter_kwargs)[source]
List SR-IOV NIC devices with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
vendor (str | None) – Filter by vendor name (contains).
physical_function (str | None) – Filter by physical function slot (exact match).
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of NodeSriovNicDevice objects.
- Return type:
Example
>>> # List all SR-IOV NIC devices >>> devices = client.nodes.all_sriov_nics.list()
>>> # List Intel SR-IOV NICs >>> intel = client.nodes.all_sriov_nics.list(vendor="Intel")
>>> # List VFs for a specific physical function >>> vfs = client.nodes.all_sriov_nics.list( ... physical_function="0000:3b:00.0" ... )
- get(key, *, fields=None)[source]
Get a single SR-IOV NIC device by key.
- Parameters:
- Returns:
NodeSriovNicDevice object.
- Raises:
NotFoundError – If device not found.
- Return type:
- class pyvergeos.resources.nodes.NodeManager[source]
Bases:
ResourceManager[Node]Manager for Node operations.
Provides CRUD operations and actions for VergeOS nodes.
Example
>>> # List all nodes >>> nodes = client.nodes.list() >>> for node in nodes: ... print(f"{node.name}: {node.status}")
>>> # Get a specific node >>> node = client.nodes.get(name="node1")
>>> # Enable maintenance mode >>> node = client.nodes.enable_maintenance(node.key)
>>> # Access node drivers >>> for driver in node.drivers.list(): ... print(f"{driver.driver_name}: {driver.status}")
>>> # Access PCI devices (GPUs) >>> gpus = client.nodes.all_pci_devices.list(device_type="GPU")
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, name=None, cluster=None, maintenance=None, **filter_kwargs)[source]
List nodes with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (defaults to comprehensive set).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
name (str | None) – Filter by node name.
cluster (str | None) – Filter by cluster name.
maintenance (bool | None) – Filter by maintenance mode status.
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of Node objects.
- Return type:
Example
>>> # List all nodes >>> nodes = client.nodes.list()
>>> # List nodes in a specific cluster >>> nodes = client.nodes.list(cluster="Cluster1")
>>> # List nodes in maintenance mode >>> nodes = client.nodes.list(maintenance=True)
- get(key=None, *, name=None, fields=None)[source]
Get a single node by key or name.
- Parameters:
- Returns:
Node object.
- Raises:
NotFoundError – If node not found.
ValueError – If neither key nor name provided.
- Return type:
Example
>>> node = client.nodes.get(key=1) >>> node = client.nodes.get(name="node1")
- enable_maintenance(key)[source]
Enable maintenance mode on a node.
When in maintenance mode, VMs will be migrated off the node and no new workloads will be scheduled to it.
Example
>>> node = client.nodes.enable_maintenance(node.key) >>> print(f"Maintenance mode: {node.is_maintenance}")
- disable_maintenance(key)[source]
Disable maintenance mode on a node.
Once disabled, the node will be available to run VMs and receive new workloads.
Example
>>> node = client.nodes.disable_maintenance(node.key) >>> print(f"Maintenance mode: {node.is_maintenance}")
- restart(key)[source]
Perform a maintenance reboot on a node.
This safely reboots the node by first migrating workloads and then restarting the system.
- Parameters:
key (int) – Node $key (ID).
- Returns:
Task information dict or None.
- Return type:
Example
>>> result = client.nodes.restart(node.key) >>> if result and "task" in result: ... client.tasks.wait(result["task"])
- drivers(node_key)[source]
Get driver manager scoped to a specific node.
- Parameters:
node_key (int) – Node $key (ID).
- Returns:
NodeDriverManager for the specified node.
- Return type:
Example
>>> drivers = client.nodes.drivers(node.key).list()
- pci_devices(node_key)[source]
Get PCI device manager scoped to a specific node.
- Parameters:
node_key (int) – Node $key (ID).
- Returns:
NodePCIDeviceManager for the specified node.
- Return type:
Example
>>> devices = client.nodes.pci_devices(node.key).list()
- usb_devices(node_key)[source]
Get USB device manager scoped to a specific node.
- Parameters:
node_key (int) – Node $key (ID).
- Returns:
NodeUSBDeviceManager for the specified node.
- Return type:
Example
>>> devices = client.nodes.usb_devices(node.key).list()
- property all_drivers: NodeDriverManager
Access all drivers across all nodes.
- Returns:
NodeDriverManager (global, not scoped to a node).
Example
>>> all_drivers = client.nodes.all_drivers.list()
- property all_pci_devices: NodePCIDeviceManager
Access all PCI devices across all nodes.
- Returns:
NodePCIDeviceManager (global, not scoped to a node).
Example
>>> all_gpus = client.nodes.all_pci_devices.list(device_type="GPU")
- property all_usb_devices: NodeUSBDeviceManager
Access all USB devices across all nodes.
- Returns:
NodeUSBDeviceManager (global, not scoped to a node).
Example
>>> all_usb = client.nodes.all_usb_devices.list()
- sriov_nics(node_key)[source]
Get SR-IOV NIC device manager scoped to a specific node.
- Parameters:
node_key (int) – Node $key (ID).
- Returns:
NodeSriovNicDeviceManager for the specified node.
- Return type:
Example
>>> devices = client.nodes.sriov_nics(node.key).list()
- property all_sriov_nics: NodeSriovNicDeviceManager
Access all SR-IOV NIC devices across all nodes.
- Returns:
NodeSriovNicDeviceManager (global, not scoped to a node).
Example
>>> all_sriov = client.nodes.all_sriov_nics.list() >>> intel_vfs = client.nodes.all_sriov_nics.list(vendor="Intel")
- gpus(node_key)[source]
Get GPU manager scoped to a specific node.
- Parameters:
node_key (int) – Node $key (ID).
- Returns:
NodeGpuManager for the specified node.
- Return type:
Example
>>> gpus = client.nodes.gpus(node.key).list()
- vgpu_devices(node_key)[source]
Get vGPU device manager scoped to a specific node.
- Parameters:
node_key (int) – Node $key (ID).
- Returns:
NodeVgpuDeviceManager for the specified node.
- Return type:
Example
>>> devices = client.nodes.vgpu_devices(node.key).list()
- host_gpu_devices(node_key)[source]
Get host GPU device manager scoped to a specific node.
- Parameters:
node_key (int) – Node $key (ID).
- Returns:
NodeHostGpuDeviceManager for the specified node.
- Return type:
Example
>>> devices = client.nodes.host_gpu_devices(node.key).list()
- property all_gpus: NodeGpuManager
Access all GPU configurations across all nodes.
- Returns:
NodeGpuManager (global, not scoped to a node).
Example
>>> all_gpus = client.nodes.all_gpus.list() >>> passthrough = client.nodes.all_gpus.list(mode="gpu")
- property all_vgpu_devices: NodeVgpuDeviceManager
Access all vGPU-capable devices across all nodes.
- Returns:
NodeVgpuDeviceManager (global, not scoped to a node).
Example
>>> all_vgpu = client.nodes.all_vgpu_devices.list()
- property all_host_gpu_devices: NodeHostGpuDeviceManager
Access all host GPU devices across all nodes.
- Returns:
NodeHostGpuDeviceManager (global, not scoped to a node).
Example
>>> all_host_gpu = client.nodes.all_host_gpu_devices.list()
GPU/vGPU Management
GPU passthrough and vGPU configuration.
GPU and vGPU management for VergeOS.
This module provides access to GPU passthrough and NVIDIA vGPU functionality, enabling AI/ML workloads and graphics-intensive applications.
Example
>>> # List all vGPU profiles available in the system
>>> for profile in client.vgpu_profiles.list():
... print(f"{profile.name}: {profile.framebuffer} RAM")
>>> # List GPUs configured on a node
>>> node = client.nodes.get(name="node2")
>>> for gpu in node.gpus.list():
... print(f"{gpu.name}: {gpu.mode_display}")
>>> # Configure a GPU for passthrough
>>> gpu = node.gpus.get(name="GPU_1")
>>> gpu = node.gpus.update(gpu.key, mode="gpu")
>>> # Get GPU stats
>>> stats = gpu.stats.get()
>>> print(f"vGPUs in use: {stats.vgpus}/{stats.vgpus_total}")
- class pyvergeos.resources.gpu.NvidiaVgpuProfile[source]
Bases:
ResourceObjectNVIDIA vGPU profile resource object.
Represents a vGPU profile available in the system. Profiles define the characteristics of virtual GPUs that can be created.
These are read-only and determined by NVIDIA drivers.
- class pyvergeos.resources.gpu.NvidiaVgpuProfileManager[source]
Bases:
ResourceManager[NvidiaVgpuProfile]Manager for NVIDIA vGPU profiles.
Provides read-only access to vGPU profiles available in the system. These profiles are determined by the NVIDIA drivers and available hardware.
Example
>>> # List all profiles >>> for profile in client.vgpu_profiles.list(): ... print(f"{profile.name}: {profile.framebuffer} ({profile.profile_type_display})")
>>> # Get profiles for AI/ML workloads >>> ml_profiles = client.vgpu_profiles.list(profile_type="C")
- list(filter=None, fields=None, limit=None, offset=None, *, profile_type=None, **filter_kwargs)[source]
List NVIDIA vGPU profiles.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
profile_type (Literal['A', 'B', 'C', 'Q'] | None) – Filter by profile type: - A: Virtual Applications (vApps) - B: Virtual Desktops (vPC) - C: AI/ML/Training (vCS or vWS) - Q: Virtual Workstations (vWS)
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of NvidiaVgpuProfile objects.
- Return type:
Example
>>> # List all profiles >>> profiles = client.vgpu_profiles.list()
>>> # List AI/ML profiles only >>> ml_profiles = client.vgpu_profiles.list(profile_type="C")
- get(key=None, *, name=None, fields=None)[source]
Get a vGPU profile by key or name.
- Parameters:
- Returns:
NvidiaVgpuProfile object.
- Raises:
NotFoundError – If profile not found.
ValueError – If neither key nor name provided.
- Return type:
- class pyvergeos.resources.gpu.NodeGpu[source]
Bases:
ResourceObjectNode GPU resource object.
Represents a physical GPU configured on a VergeOS node. A GPU can be configured for PCI passthrough or NVIDIA vGPU mode.
Example
>>> gpu = node.gpus.get(name="GPU_1") >>> print(f"Mode: {gpu.mode_display}") >>> print(f"Instances: {gpu.instances_count}/{gpu.max_instances}")
- property stats: NodeGpuStatsManager
Access GPU utilization stats.
- Returns:
NodeGpuStatsManager scoped to this GPU.
Example
>>> stats = gpu.stats.get() >>> print(f"vGPUs: {stats.vgpus}/{stats.vgpus_total}")
- property instances: NodeGpuInstanceManager
Access GPU instances assigned to VMs.
- Returns:
NodeGpuInstanceManager scoped to this GPU.
Example
>>> for inst in gpu.instances.list(): ... print(f"VM: {inst.machine_name}")
- class pyvergeos.resources.gpu.NodeGpuManager[source]
Bases:
ResourceManager[NodeGpu]Manager for node GPU operations.
Provides CRUD operations for GPU configurations on nodes. Can be used globally or scoped to a specific node.
Example
>>> # List all GPUs on a node >>> for gpu in node.gpus.list(): ... print(f"{gpu.name}: {gpu.mode_display}")
>>> # Configure a GPU for passthrough >>> gpu = node.gpus.update(gpu.key, mode="gpu")
>>> # Configure for vGPU with a specific profile >>> gpu = node.gpus.update( ... gpu.key, ... mode="nvidia_vgpu", ... nvidia_vgpu_profile=profile.key ... )
- __init__(client, node_key=None)[source]
- Parameters:
client (VergeClient)
node_key (int | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, mode=None, enabled_only=False, **filter_kwargs)[source]
List node GPUs.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
mode (Literal['none', 'gpu', 'nvidia_vgpu'] | None) – Filter by GPU mode.
enabled_only (bool) – Only return GPUs with a mode set (not ‘none’).
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of NodeGpu objects.
- Return type:
Example
>>> # List all GPUs on a node >>> gpus = node.gpus.list()
>>> # List only passthrough GPUs >>> passthrough_gpus = node.gpus.list(mode="gpu")
>>> # List enabled GPUs >>> enabled = node.gpus.list(enabled_only=True)
- get(key=None, *, name=None, fields=None)[source]
Get a GPU by key or name.
- Parameters:
- Returns:
NodeGpu object.
- Raises:
NotFoundError – If GPU not found.
ValueError – If neither key nor name provided.
- Return type:
- update(key, **kwargs)[source]
Update a GPU configuration.
- Parameters:
- Returns:
Updated NodeGpu object.
- Return type:
Example
>>> # Enable PCI passthrough >>> gpu = client.nodes.gpus(node_key).update(gpu.key, mode="gpu")
>>> # Enable vGPU mode with a profile >>> gpu = client.nodes.gpus(node_key).update( ... gpu.key, ... mode="nvidia_vgpu", ... nvidia_vgpu_profile=profile.key ... )
>>> # Disable GPU >>> gpu = client.nodes.gpus(node_key).update(gpu.key, mode="none")
- class pyvergeos.resources.gpu.NodeGpuStats[source]
Bases:
ResourceObjectNode GPU stats resource object.
Provides current GPU utilization metrics.
- class pyvergeos.resources.gpu.NodeGpuStatsHistory[source]
Bases:
ResourceObjectNode GPU stats history record.
Represents a single time point in the GPU stats history.
- class pyvergeos.resources.gpu.NodeGpuStatsManager[source]
Bases:
ResourceManager[NodeGpuStats]Manager for node GPU stats.
Provides access to current and historical GPU utilization metrics. Scoped to a specific GPU.
Example
>>> # Get current stats >>> stats = gpu.stats.get() >>> print(f"vGPUs: {stats.vgpus}/{stats.vgpus_total}")
>>> # Get stats history >>> history = gpu.stats.history_short(limit=100)
- __init__(client, gpu_key)[source]
- Parameters:
client (VergeClient)
gpu_key (int)
- Return type:
None
- get(fields=None)[source]
Get current GPU stats.
- Parameters:
- Returns:
NodeGpuStats object.
- Raises:
NotFoundError – If stats not found for this GPU.
- Return type:
- history_short(limit=None, offset=None, since=None, until=None, fields=None)[source]
Get short-term GPU stats history (high resolution).
- Parameters:
- Returns:
List of NodeGpuStatsHistory objects, sorted by timestamp descending.
- Return type:
- history_long(limit=None, offset=None, since=None, until=None, fields=None)[source]
Get long-term GPU stats history (lower resolution, longer retention).
- Parameters:
- Returns:
List of NodeGpuStatsHistory objects, sorted by timestamp descending.
- Return type:
- class pyvergeos.resources.gpu.NodeGpuInstance[source]
Bases:
ResourceObjectNode GPU instance resource object.
Represents a GPU or vGPU instance assigned to a VM.
- class pyvergeos.resources.gpu.NodeGpuInstanceManager[source]
Bases:
ResourceManager[NodeGpuInstance]Manager for node GPU instances.
Provides read-only access to GPU instances assigned to VMs. Scoped to a specific GPU.
Example
>>> # List instances for a GPU >>> for inst in gpu.instances.list(): ... print(f"VM: {inst.machine_name} ({inst.machine_device_status})")
- __init__(client, gpu_key)[source]
- Parameters:
client (VergeClient)
gpu_key (int)
- Return type:
None
- class pyvergeos.resources.gpu.NodeVgpuDevice[source]
Bases:
ResourceObjectNode vGPU device resource object.
Represents a physical NVIDIA vGPU-capable device on a node. These are detected automatically by the system.
- class pyvergeos.resources.gpu.NodeVgpuDeviceManager[source]
Bases:
ResourceManager[NodeVgpuDevice]Manager for node vGPU device operations.
Provides read-only access to NVIDIA vGPU-capable devices on nodes. Can be used globally or scoped to a specific node.
Example
>>> # List all vGPU devices on a node >>> for device in node.vgpu_devices.list(): ... print(f"{device.name}: {device.vendor} {device.device}")
>>> # List all vGPU devices across all nodes >>> for device in client.nodes.all_vgpu_devices.list(): ... print(f"{device.node_name}: {device.name}")
- __init__(client, node_key=None)[source]
- Parameters:
client (VergeClient)
node_key (int | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, vendor=None, **filter_kwargs)[source]
List vGPU-capable devices.
- Parameters:
- Returns:
List of NodeVgpuDevice objects.
- Return type:
- get(key, *, fields=None)[source]
Get a vGPU device by key.
- Parameters:
- Returns:
NodeVgpuDevice object.
- Raises:
NotFoundError – If device not found.
- Return type:
- class pyvergeos.resources.gpu.NodeHostGpuDevice[source]
Bases:
ResourceObjectNode host GPU device resource object.
Represents a physical GPU device available for host GPU passthrough. These are detected automatically by the system.
- class pyvergeos.resources.gpu.NodeHostGpuDeviceManager[source]
Bases:
ResourceManager[NodeHostGpuDevice]Manager for node host GPU device operations.
Provides read-only access to GPUs available for host passthrough on nodes. Can be used globally or scoped to a specific node.
Example
>>> # List all host GPUs on a node >>> for device in node.host_gpu_devices.list(): ... print(f"{device.name}: {device.vendor} {device.device}")
>>> # List all host GPUs across all nodes >>> for device in client.nodes.all_host_gpu_devices.list(): ... print(f"{device.node_name}: {device.name}")
- __init__(client, node_key=None)[source]
- Parameters:
client (VergeClient)
node_key (int | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, vendor=None, **filter_kwargs)[source]
List host GPU devices.
- Parameters:
- Returns:
List of NodeHostGpuDevice objects.
- Return type:
- get(key, *, fields=None)[source]
Get a host GPU device by key.
- Parameters:
- Returns:
NodeHostGpuDevice object.
- Raises:
NotFoundError – If device not found.
- Return type:
- class pyvergeos.resources.gpu.NodeVgpuProfile[source]
Bases:
ResourceObjectNode vGPU profile resource object.
Represents a vGPU profile available on a specific node’s physical GPU. These are determined by the physical hardware and NVIDIA drivers.
- class pyvergeos.resources.gpu.NodeVgpuProfileManager[source]
Bases:
ResourceManager[NodeVgpuProfile]Manager for node vGPU profile operations.
Provides read-only access to vGPU profiles available on a specific node. These are determined by the physical hardware.
Example
>>> # List profiles available on a node's GPU >>> for profile in node.vgpu_profiles.list(): ... print(f"{profile.name}: {profile.available_instances} available")
- __init__(client, physical_gpu_key=None)[source]
- Parameters:
client (VergeClient)
physical_gpu_key (int | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, profile_type=None, **filter_kwargs)[source]
List vGPU profiles.
- Parameters:
- Returns:
List of NodeVgpuProfile objects.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a vGPU profile by key or name.
- Parameters:
- Returns:
NodeVgpuProfile object.
- Raises:
NotFoundError – If profile not found.
ValueError – If neither key nor name provided.
- Return type:
Devices
VM Device resource manager for device passthrough.
This module provides management of hardware devices attached to VMs, including GPU passthrough, NVIDIA vGPU, USB, PCI, SR-IOV NICs, and TPM.
Example
>>> # List devices attached to a VM
>>> devices = vm.devices.list()
>>> for device in devices:
... print(f"{device.name}: {device.device_type}")
>>> # Attach a vGPU to a VM
>>> device = vm.devices.create_vgpu(
... resource_group=vgpu_pool.key,
... frame_rate_limit=60,
... attach_guest_drivers=True,
... )
>>> # Attach a USB device
>>> device = vm.devices.create_usb(
... resource_group=usb_pool.key,
... allow_guest_reset=True,
... )
- class pyvergeos.resources.devices.Device[source]
Bases:
ResourceObjectVM device resource object.
Represents a hardware device attached to a VM (GPU, TPM, USB, PCI, SR-IOV, etc.).
Example
>>> device = vm.devices.get(name="vGPU-1") >>> print(f"Type: {device.device_type}, Status: {device.status}")
- refresh()[source]
Refresh this device’s data from the server.
- Returns:
Updated Device object.
- Return type:
- class pyvergeos.resources.devices.DeviceManager[source]
Bases:
ResourceManager[Device]Manager for VM device operations.
Provides CRUD operations for hardware devices attached to VMs, including GPU passthrough, NVIDIA vGPU, USB, PCI, and SR-IOV NICs.
Example
>>> # List all devices on a VM >>> for device in vm.devices.list(): ... print(f"{device.name}: {device.device_type}")
>>> # Attach a vGPU >>> device = vm.devices.create_vgpu( ... resource_group=vgpu_pool.key, ... frame_rate_limit=60, ... )
>>> # Attach a USB device >>> device = vm.devices.create_usb( ... resource_group=usb_pool.key, ... )
- __init__(client, machine_key)[source]
- Parameters:
client (VergeClient)
machine_key (int)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, device_type=None, enabled_only=False, **filter_kwargs)[source]
List devices attached to this machine.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
device_type (Literal['gpu', 'nvidia_vgpu', 'tpm', 'node_usb_devices', 'node_sriov_nic_devices', 'node_pci_devices', 'node_host_gpu_devices', 'node_nvidia_vgpu_devices'] | None) – Filter by device type.
enabled_only (bool) – Only return enabled devices.
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of Device objects.
- Return type:
Example
>>> # List all devices >>> devices = vm.devices.list()
>>> # List vGPUs only >>> vgpus = vm.devices.list(device_type="node_nvidia_vgpu_devices")
>>> # List enabled devices >>> enabled = vm.devices.list(enabled_only=True)
- get(key=None, *, name=None, fields=None)[source]
Get a specific device by key or name.
- Parameters:
- Returns:
Device object.
- Raises:
NotFoundError – If device not found.
ValueError – If neither key nor name provided.
- Return type:
- create(device_type, name=None, description='', enabled=True, optional=False, resource_group=None, count=1, settings=None, **kwargs)[source]
Create a new device for this machine.
- Parameters:
device_type (Literal['gpu', 'nvidia_vgpu', 'tpm', 'node_usb_devices', 'node_sriov_nic_devices', 'node_pci_devices', 'node_host_gpu_devices', 'node_nvidia_vgpu_devices']) – Type of device to create.
name (str | None) – Device name (auto-generated if not provided).
description (str) – Device description.
enabled (bool) – Whether device is enabled.
optional (bool) – Allow machine to start without this device.
resource_group (int | None) – Resource group key for the device.
count (int) – Number of devices to create from the resource group.
settings (dict[str, Any] | None) – Device-specific settings (passed as settings_args).
**kwargs (Any) – Additional device fields.
- Returns:
Created Device object.
- Return type:
Example
>>> device = vm.devices.create( ... device_type="node_nvidia_vgpu_devices", ... resource_group=vgpu_pool.key, ... settings={"frame_rate_limiter": 60} ... )
- create_vgpu(resource_group, name=None, *, frame_rate_limit=60, attach_guest_drivers=False, disable_console_vnc=False, enable_unified_memory=False, enable_cuda_debuggers=False, enable_cuda_profilers=False, profile_type='any', enabled=True, optional=False, count=1)[source]
Create an NVIDIA vGPU device.
- Parameters:
resource_group (int) – Resource group key for the vGPU pool.
name (str | None) – Device name (auto-generated if not provided).
frame_rate_limit (int) – Frame rate limiter (0 to disable, default 60).
attach_guest_drivers (bool) – Attach guest drivers ISO to this machine.
disable_console_vnc (bool) – Disable VNC console (use RDP instead).
enable_unified_memory (bool) – Enable NVIDIA unified memory.
enable_cuda_debuggers (bool) – Enable NVIDIA CUDA Toolkit debuggers.
enable_cuda_profilers (bool) – Enable NVIDIA CUDA Toolkit profilers.
profile_type (str) – vGPU profile type filter (default “any”).
enabled (bool) – Whether device is enabled.
optional (bool) – Allow machine to start without this device.
count (int) – Number of vGPU devices to attach.
- Returns:
Created Device object.
- Return type:
Example
>>> device = vm.devices.create_vgpu( ... resource_group=vgpu_pool.key, ... frame_rate_limit=0, # Compute only, no graphics ... attach_guest_drivers=True, ... )
- create_host_gpu(resource_group, name=None, *, enabled=True, optional=False, count=1)[source]
Create a host GPU passthrough device.
This provides full GPU passthrough to a single VM (1:1 mapping).
- Parameters:
- Returns:
Created Device object.
- Return type:
Example
>>> device = vm.devices.create_host_gpu( ... resource_group=gpu_pool.key, ... )
- create_usb(resource_group, name=None, *, allow_guest_reset=True, allow_guest_reset_all=False, enabled=True, optional=False)[source]
Create a USB passthrough device.
- Parameters:
resource_group (int) – Resource group key for the USB device pool.
name (str | None) – Device name (auto-generated if not provided).
allow_guest_reset (bool) – Allow VM to reset the USB device.
allow_guest_reset_all (bool) – Allow VM to reset the USB hub.
enabled (bool) – Whether device is enabled.
optional (bool) – Allow machine to start without this device.
- Returns:
Created Device object.
- Return type:
Example
>>> device = vm.devices.create_usb( ... resource_group=usb_pool.key, ... allow_guest_reset=True, ... )
- create_pci(resource_group, name=None, *, enabled=True, optional=False, count=1)[source]
Create a PCI passthrough device.
- Parameters:
- Returns:
Created Device object.
- Return type:
Example
>>> device = vm.devices.create_pci( ... resource_group=pci_pool.key, ... count=2, ... )
- create_sriov_nic(resource_group, name=None, *, mac_address=None, native_vlan=0, vlan_qos=0, vlan_protocol='802.1Q', max_tx_rate=0, min_tx_rate=0, trust='off', spoof_checking='on', query_rss='default', virtual_link_state='default', enabled=True, optional=False, count=1)[source]
Create an SR-IOV NIC device.
- Parameters:
resource_group (int) – Resource group key for the SR-IOV NIC pool.
name (str | None) – Device name (auto-generated if not provided).
mac_address (str | None) – MAC address (auto-generated if not provided).
native_vlan (int) – VLAN tag (0 disables VLAN tagging).
vlan_qos (int) – VLAN QOS priority (0-7).
vlan_protocol (Literal['802.1Q', '802.1ad']) – VLAN protocol (802.1Q or 802.1ad for QinQ).
max_tx_rate (int) – Maximum transmit bandwidth in Mbps (0 disables).
min_tx_rate (int) – Minimum transmit bandwidth in Mbps (0 disables).
trust (Literal['default', 'on', 'off']) – Enable VF trust mode for special features.
spoof_checking (Literal['default', 'on', 'off']) – Enable MAC spoof checking.
query_rss (Literal['default', 'on', 'off']) – Allow querying RSS configuration.
virtual_link_state (Literal['default', 'auto', 'enable', 'disable']) – Virtual link state (auto mirrors PF state).
enabled (bool) – Whether device is enabled.
optional (bool) – Allow machine to start without this device.
count (int) – Number of SR-IOV VFs to attach.
- Returns:
Created Device object.
- Return type:
Example
>>> device = vm.devices.create_sriov_nic( ... resource_group=sriov_pool.key, ... native_vlan=100, ... max_tx_rate=1000, # 1 Gbps cap ... )
- create_tpm(name=None, *, enabled=True, optional=False)[source]
Create a virtual TPM (Trusted Platform Module) device.
TPM provides hardware-based security features for the VM.
- Parameters:
- Returns:
Created Device object.
- Return type:
Example
>>> device = vm.devices.create_tpm()
Logs
Log resource manager for VergeOS system logs.
- class pyvergeos.resources.logs.Log[source]
Bases:
ResourceObjectLog resource object.
Represents a log entry in VergeOS system logs including audit events, messages, warnings, errors, and critical events.
- Properties:
level: Log severity (critical, error, warning, message, audit, summary, debug). level_display: Capitalized display name for level. text: Log message text. user: User who performed the action. object_type: API object type value (vm, vnet, etc.). object_type_display: Friendly object type name (VM, Network, etc.). object_name: Name of the related object. created_at: Datetime when log was created (from microsecond timestamp). timestamp_us: Raw timestamp in microseconds.
- class pyvergeos.resources.logs.LogManager[source]
Bases:
ResourceManager[Log]Manager for Log operations.
Logs provide an audit trail and history of events in the VergeOS system, including user actions, system events, errors, and warnings.
Example
>>> # List recent logs >>> logs = client.logs.list(limit=100) >>> for log in logs: ... print(f"{log.level_display}: {log.text}")
>>> # List errors and critical logs >>> errors = client.logs.list(level=["error", "critical"])
>>> # Filter by object type >>> vm_logs = client.logs.list(object_type="VM")
>>> # Filter by user >>> admin_logs = client.logs.list(user="admin")
>>> # Filter by time range (last hour) >>> from datetime import datetime, timedelta, timezone >>> since = datetime.now(timezone.utc) - timedelta(hours=1) >>> recent = client.logs.list(since=since)
>>> # Search log text >>> power_logs = client.logs.list(text="power")
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=100, offset=None, *, level=None, object_type=None, user=None, text=None, since=None, before=None, errors_only=False, **filter_kwargs)[source]
List logs with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results (default: 100, max: 10000).
offset (int | None) – Skip this many results.
level (str | list[str] | None) – Filter by severity level (or list of levels). Values: critical, error, warning, message, audit, summary, debug.
object_type (str | None) – Filter by object type. Values: VM, Network, Tenant, User, System, Node, Cluster, File, Group, Permission, SMTP, Task, Site, etc.
user (str | None) – Filter logs by user (contains search).
text (str | None) – Filter logs containing this text (contains search).
since (datetime | None) – Return logs since this datetime.
before (datetime | None) – Return logs before this datetime.
errors_only (bool) – Shortcut to filter for error and critical logs only.
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of Log objects sorted by timestamp (newest first).
- Return type:
Example
>>> # Recent logs >>> logs = client.logs.list()
>>> # Error and critical logs only >>> errors = client.logs.list(errors_only=True)
>>> # VM logs from the last hour >>> from datetime import datetime, timedelta, timezone >>> since = datetime.now(timezone.utc) - timedelta(hours=1) >>> vm_logs = client.logs.list(object_type="VM", since=since)
>>> # Search for specific text >>> logs = client.logs.list(text="snapshot")
- list_errors(limit=100, since=None)[source]
List error and critical logs.
- Parameters:
- Returns:
List of error and critical Log objects.
- Return type:
Example
>>> errors = client.logs.list_errors() >>> for log in errors: ... print(f"[{log.level_display}] {log.text}")
- list_by_level(level, limit=100, since=None)[source]
List logs by severity level.
- Parameters:
- Returns:
List of Log objects at the specified level.
- Return type:
Example
>>> warnings = client.logs.list_by_level("warning")
- list_by_object_type(object_type, limit=100, since=None)[source]
List logs by object type.
- Parameters:
- Returns:
List of Log objects for the specified object type.
- Return type:
Example
>>> vm_logs = client.logs.list_by_object_type("VM") >>> network_logs = client.logs.list_by_object_type("Network")
- list_by_user(user, limit=100, since=None)[source]
List logs by user.
- Parameters:
- Returns:
List of Log objects for the specified user.
- Return type:
Example
>>> admin_logs = client.logs.list_by_user("admin")
- search(text, limit=100, since=None, level=None, object_type=None)[source]
Search logs by text content.
- Parameters:
- Returns:
List of Log objects containing the search text.
- Return type:
Example
>>> power_logs = client.logs.search("power") >>> snapshot_errors = client.logs.search( ... "snapshot", level=["error", "critical"] ... )
- get(key=None, *, name=None, fields=None)[source]
Get a log entry by key.
Note: Logs do not have a name field, so name parameter is not supported.
- Parameters:
- Returns:
Log object.
- Raises:
NotFoundError – If log not found.
ValueError – If key not provided or if name is used.
- Return type:
Example
>>> log = client.logs.get(12345) >>> print(f"{log.level_display}: {log.text}")
Alarms
Alarm resource manager for VergeOS system monitoring.
- class pyvergeos.resources.alarms.Alarm[source]
Bases:
ResourceObjectAlarm resource object.
Represents an active alarm in VergeOS indicating a condition requiring attention such as errors, warnings, or critical issues.
- Properties:
level: Alarm severity (critical, error, warning, message, audit). level_display: Capitalized display name for level. status: Alarm status message. alarm_type: Alarm type name. alarm_type_key: Alarm type $key. description: Alarm type description. alarm_id: Unique alarm identifier (8-char string). owner_name: Name of the owner object. owner_key: Key of the owner object. owner_type: API owner type value (vms, vnets, etc.). owner_type_display: Friendly owner type name (VM, Network, etc.). sub_owner: Sub-owner key if applicable. is_resolvable: True if alarm can be resolved. resolve_text: Text describing how to resolve. is_snoozed: True if alarm is currently snoozed. snoozed_by: User who snoozed the alarm. snooze_until: Datetime when snooze expires. created_at: Datetime when alarm was raised. modified_at: Datetime when alarm was last modified.
- unsnooze()[source]
Remove snooze from this alarm, making it active again.
- Returns:
Updated Alarm object.
- Return type:
- resolve()[source]
Resolve this alarm.
- Raises:
ValueError – If alarm is not resolvable.
APIError – If resolve action fails.
- Return type:
None
- class pyvergeos.resources.alarms.AlarmHistory[source]
Bases:
ResourceObjectAlarm history resource object.
Represents a resolved/lowered alarm in the history.
- Properties:
level: Alarm severity when raised. level_display: Capitalized display name for level. status: Alarm status message. alarm_type: Alarm type name. alarm_id: Unique alarm identifier. owner: Owner object description (string in history). archived_by: How the alarm was archived (auto, user, etc.). raised_at: Datetime when alarm was raised. lowered_at: Datetime when alarm was lowered/resolved.
- class pyvergeos.resources.alarms.AlarmManager[source]
Bases:
ResourceManager[Alarm]Manager for Alarm operations.
Alarms indicate conditions requiring attention such as errors, warnings, or critical issues with VMs, networks, nodes, or the system.
Example
>>> # List all active alarms >>> alarms = client.alarms.list() >>> for alarm in alarms: ... print(f"{alarm.level_display}: {alarm.status}")
>>> # List critical and error alarms >>> critical = client.alarms.list(level=["critical", "error"])
>>> # List alarms by owner type >>> vm_alarms = client.alarms.list(owner_type="VM")
>>> # Snooze an alarm >>> client.alarms.snooze(alarm_key, hours=24)
>>> # Resolve a resolvable alarm >>> client.alarms.resolve(alarm_key)
>>> # Get alarm history >>> history = client.alarms.list_history()
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, level=None, owner_type=None, include_snoozed=False, **filter_kwargs)[source]
List alarms with optional filtering.
By default, only returns active (non-snoozed) alarms.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
level (str | list[str] | None) – Filter by severity level (or list of levels). Values: critical, error, warning, message, audit, summary, debug.
owner_type (str | None) – Filter by owner type. Values: VM, Network, Node, Tenant, User, System, CloudSnapshot.
include_snoozed (bool) – If True, include snoozed alarms (default: False).
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of Alarm objects sorted by created date (newest first).
- Return type:
Example
>>> # All active alarms >>> alarms = client.alarms.list()
>>> # Critical alarms only >>> critical = client.alarms.list(level="critical")
>>> # Critical and error alarms >>> severe = client.alarms.list(level=["critical", "error"])
>>> # VM alarms >>> vm_alarms = client.alarms.list(owner_type="VM")
>>> # Include snoozed alarms >>> all_alarms = client.alarms.list(include_snoozed=True)
- list_by_owner_type(owner_type, include_snoozed=False, limit=None)[source]
List alarms by owner type.
- get(key=None, *, name=None, fields=None)[source]
Get an alarm by key.
Note: Alarms do not have a name field, so name parameter is not supported.
- Parameters:
- Returns:
Alarm object.
- Raises:
NotFoundError – If alarm not found.
ValueError – If key not provided or if name is used.
- Return type:
- snooze(key, hours=24)[source]
Snooze an alarm for a specified duration.
Snoozing temporarily hides the alarm from the active alarm list.
- Parameters:
- Returns:
Updated Alarm object.
- Return type:
Example
>>> # Snooze for 24 hours (default) >>> alarm = client.alarms.snooze(alarm_key)
>>> # Snooze for 48 hours >>> alarm = client.alarms.snooze(alarm_key, hours=48)
- snooze_to(key, until)[source]
Snooze an alarm until a specific time.
- Parameters:
- Returns:
Updated Alarm object.
- Return type:
Example
>>> from datetime import datetime, timedelta >>> next_week = datetime.now() + timedelta(days=7) >>> alarm = client.alarms.snooze_to(alarm_key, until=next_week)
- unsnooze(key)[source]
Remove snooze from an alarm, making it active again.
Example
>>> alarm = client.alarms.unsnooze(alarm_key) >>> print(alarm.is_snoozed) # False
- resolve(key)[source]
Resolve a resolvable alarm.
Only alarms with resolvable=True can be resolved. After resolution, the alarm may be removed or moved to history.
- Parameters:
key (int) – Alarm $key.
- Raises:
ValueError – If alarm is not resolvable.
NotFoundError – If alarm not found.
APIError – If resolve action fails.
- Return type:
None
Example
>>> alarm = client.alarms.get(alarm_key) >>> if alarm.is_resolvable: ... client.alarms.resolve(alarm_key)
- list_history(filter=None, fields=None, limit=None, offset=None, *, level=None, **filter_kwargs)[source]
List alarm history (resolved/lowered alarms).
- Parameters:
- Returns:
List of AlarmHistory objects sorted by lowered date (newest first).
- Return type:
Example
>>> # Recent alarm history >>> history = client.alarms.list_history(limit=50)
>>> # Critical alarm history >>> critical_history = client.alarms.list_history(level="critical")
- get_history(key, *, fields=None)[source]
Get an alarm history entry by key.
- Parameters:
- Returns:
AlarmHistory object.
- Raises:
NotFoundError – If alarm history not found.
- Return type:
- get_summary()[source]
Get a summary of current alarm status.
Example
>>> summary = client.alarms.get_summary() >>> print(f"Critical: {summary['critical']}") >>> print(f"Error: {summary['error']}") >>> print(f"Warning: {summary['warning']}") >>> print(f"Total: {summary['total']}") >>> print(f"Snoozed: {summary['snoozed']}")
Update Management
System update configuration and application.
Update management resources for VergeOS system updates.
This module provides programmatic access to VergeOS system updates, including checking for updates, downloading, installing, and monitoring update progress.
- Key concepts:
Update Settings: Main singleton configuration for update behavior
Update Source: Update server (Verge.io Updates, Trial/NFR, etc.)
Update Branch: Version branch (stable-4.13, etc.)
Update Package: Available/installed update packages
Update Source Package: Packages available from a specific source/branch
Update Source Status: Current operational status of update source
Update Log: History of update operations
Update Dashboard: Aggregated view of update status
- Update workflow:
Check for updates (refresh from update source)
Download available packages
Install downloaded packages
Reboot nodes (done automatically per-node with workload migration)
Example
>>> # Get update settings
>>> settings = client.update_settings.get()
>>> print(f"Branch: {settings.branch_name}, Source: {settings.source_name}")
>>> # Check for updates
>>> client.update_settings.check()
>>> # Download and install updates
>>> client.update_settings.download()
>>> client.update_settings.install()
>>> # Or do everything at once
>>> client.update_settings.update_all()
>>> # View update logs
>>> for log in client.update_logs.list(limit=10):
... print(f"{log.level}: {log.text}")
- class pyvergeos.resources.updates.UpdateLog[source]
Bases:
ResourceObjectUpdate log entry resource object.
Represents a log entry from update operations.
- key
Log entry $key (row ID).
- level
Log level (audit, message, warning, error, critical).
- text
Log message text.
- timestamp
Log timestamp (microseconds since epoch).
- user
User who triggered the operation.
- object_name
Name of the object related to the log entry.
- class pyvergeos.resources.updates.UpdateLogManager[source]
Bases:
ResourceManager[UpdateLog]Manager for update log operations.
Update logs provide history of update operations including downloads, installs, and errors.
Example
>>> # List recent update logs >>> for log in client.update_logs.list(limit=20): ... print(f"{log.level}: {log.text}")
>>> # List errors only >>> errors = client.update_logs.list_errors()
>>> # List warnings only >>> warnings = client.update_logs.list_warnings()
- list(filter=None, fields=None, limit=None, offset=None, level=None, **filter_kwargs)[source]
List update logs with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
level (str | None) – Filter by log level (audit, message, warning, error, critical).
**filter_kwargs (Any) – Shorthand filter arguments.
- Returns:
List of UpdateLog objects, sorted by timestamp descending.
- Return type:
- get(key=None, *, fields=None)[source]
Get a single log entry by key.
- Parameters:
- Returns:
UpdateLog object.
- Raises:
NotFoundError – If log entry not found.
ValueError – If key not provided.
- Return type:
- class pyvergeos.resources.updates.UpdateBranch[source]
Bases:
ResourceObjectUpdate branch resource object.
Represents an update branch (version stream) like stable-4.13.
- key
Branch $key (row ID).
- name
Branch name (e.g., ‘stable-4.13’).
- description
Human-readable description.
- created
Creation timestamp.
- class pyvergeos.resources.updates.UpdateBranchManager[source]
Bases:
ResourceManager[UpdateBranch]Manager for update branch operations.
Update branches define version streams available for updates. Branches are typically read-only and managed by the update source.
Example
>>> # List available branches >>> for branch in client.update_branches.list(): ... print(f"{branch.name}: {branch.description}")
>>> # Get current branch from settings >>> settings = client.update_settings.get() >>> current_branch = client.update_branches.get(settings.branch)
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List update branches with optional filtering.
- Parameters:
- Returns:
List of UpdateBranch objects.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a single branch by key or name.
- Parameters:
- Returns:
UpdateBranch object.
- Raises:
NotFoundError – If branch not found.
ValueError – If no identifier provided.
- Return type:
- class pyvergeos.resources.updates.UpdateSourceStatus[source]
Bases:
ResourceObjectUpdate source status resource object.
Represents the current operational status of an update source.
- key
Status $key (row ID).
- source
Parent source key.
- status
Current status (idle, refreshing, downloading, installing, applying, error).
- info
Additional status information text.
- nodes_updated
Count of nodes that have been updated.
- last_update
Timestamp of last status change.
- class pyvergeos.resources.updates.UpdateSourceStatusManager[source]
Bases:
ResourceManager[UpdateSourceStatus]Manager for update source status operations.
Status objects are read-only and automatically created/updated for each update source.
Example
>>> # Get status for the active update source >>> settings = client.update_settings.get() >>> status = client.update_source_status.get_for_source(settings.source) >>> print(f"Status: {status.status}, Nodes updated: {status.nodes_updated}")
>>> # Check if update is in progress >>> if status.is_busy: ... print("Update in progress...")
- __init__(client, *, source_key=None)[source]
- Parameters:
client (VergeClient)
source_key (int | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, source=None, **filter_kwargs)[source]
List source status records with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
source (int | None) – Filter by source key. Ignored if manager is scoped.
**filter_kwargs (Any) – Shorthand filter arguments.
- Returns:
List of UpdateSourceStatus objects.
- Return type:
- get(key=None, *, fields=None)[source]
Get a single status record by key.
- Parameters:
- Returns:
UpdateSourceStatus object.
- Raises:
NotFoundError – If status not found.
ValueError – If key not provided.
- Return type:
- get_for_source(source_key)[source]
Get status for a specific update source.
- Parameters:
source_key (int) – Update source $key.
- Returns:
UpdateSourceStatus object.
- Raises:
NotFoundError – If status not found.
- Return type:
- class pyvergeos.resources.updates.UpdateSourcePackage[source]
Bases:
ResourceObjectUpdate source package resource object.
Represents a package available from an update source for a specific branch.
- key
Package $key (row ID).
- name
Package name.
- description
Package description.
- version
Package version.
- branch
Branch key.
- source
Source key.
- downloaded
Whether the package has been downloaded.
- optional
Whether the package is optional.
- require_license_feature
License feature required for this package.
- created
Creation timestamp.
- class pyvergeos.resources.updates.UpdateSourcePackageManager[source]
Bases:
ResourceManager[UpdateSourcePackage]Manager for update source package operations.
Source packages represent what’s available from an update source for a specific branch.
Example
>>> # List all available packages >>> for pkg in client.update_source_packages.list(): ... status = "Downloaded" if pkg.is_downloaded else "Available" ... print(f"{pkg.name} ({pkg.version}): {status}")
>>> # List packages for a specific source >>> packages = client.update_source_packages.list(source=1)
>>> # List packages not yet downloaded >>> pending = client.update_source_packages.list(downloaded=False)
- __init__(client, *, source_key=None, branch_key=None)[source]
- Parameters:
client (VergeClient)
source_key (int | None)
branch_key (int | None)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, source=None, branch=None, downloaded=None, **filter_kwargs)[source]
List source packages with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
source (int | None) – Filter by source key. Ignored if manager is scoped.
branch (int | None) – Filter by branch key. Ignored if manager is scoped.
downloaded (bool | None) – Filter by download status.
**filter_kwargs (Any) – Shorthand filter arguments.
- Returns:
List of UpdateSourcePackage objects.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a single source package by key or name.
- Parameters:
- Returns:
UpdateSourcePackage object.
- Raises:
NotFoundError – If package not found.
ValueError – If no identifier provided.
- Return type:
- list_pending()[source]
List packages that are available but not yet downloaded.
- Returns:
List of packages pending download.
- Return type:
- class pyvergeos.resources.updates.UpdateSource[source]
Bases:
ResourceObjectUpdate source resource object.
Represents an update server (e.g., Verge.io Updates, Trial/NFR).
- key
Source $key (row ID).
- name
Source name.
- description
Source description.
- url
Update server URL.
- user
Authentication username.
- last_updated
Timestamp of last successful update.
- last_refreshed
Timestamp of last refresh check.
- enabled
Whether the source is enabled.
- property status: UpdateSourceStatusManager
Get a status manager scoped to this source.
- Returns:
UpdateSourceStatusManager for this source.
- property packages: UpdateSourcePackageManager
Get a package manager scoped to this source.
- Returns:
UpdateSourcePackageManager for this source.
- class pyvergeos.resources.updates.UpdateSourceManager[source]
Bases:
ResourceManager[UpdateSource]Manager for update source operations.
Update sources define where updates come from (Verge.io update servers).
Example
>>> # List available sources >>> for source in client.update_sources.list(): ... print(f"{source.name}: {source.url}")
>>> # Get the active source >>> settings = client.update_settings.get() >>> source = client.update_sources.get(settings.source)
>>> # Check source status >>> status = source.get_status() >>> print(f"Status: {status.status}")
- list(filter=None, fields=None, limit=None, offset=None, enabled=None, **filter_kwargs)[source]
List update sources with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
enabled (bool | None) – Filter by enabled state.
**filter_kwargs (Any) – Shorthand filter arguments.
- Returns:
List of UpdateSource objects.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a single source by key or name.
- Parameters:
- Returns:
UpdateSource object.
- Raises:
NotFoundError – If source not found.
ValueError – If no identifier provided.
- Return type:
- create(name, *, url, description=None, user=None, password=None, enabled=True)[source]
Create a new update source.
- Parameters:
- Returns:
Created UpdateSource object.
- Return type:
- update(key, *, name=None, description=None, url=None, user=None, password=None, enabled=None)[source]
Update an update source.
- Parameters:
- Returns:
Updated UpdateSource object.
- Return type:
- delete(key)[source]
Delete an update source.
- Parameters:
key (int) – Source $key (row ID).
- Raises:
NotFoundError – If source not found.
- Return type:
None
- get_status(key)[source]
Get the current status for an update source.
- Parameters:
key (int) – Source $key (row ID).
- Returns:
UpdateSourceStatus object.
- Return type:
- class pyvergeos.resources.updates.UpdatePackage[source]
Bases:
ResourceObjectUpdate package resource object.
Represents an installed or available update package.
- key
Package key (name string, not integer).
- name
Package name.
- description
Package description.
- version
Package version.
- branch
Branch key.
- type
Package type (ybpkg).
- optional
Whether the package is optional.
- created
Creation timestamp.
- modified
Last modified timestamp.
- property key: str
Resource primary key ($key) - package name string.
Unlike most resources, update packages use the name as the key.
- Raises:
ValueError – If resource has no $key.
- class pyvergeos.resources.updates.UpdatePackageManager[source]
Bases:
ResourceManager[UpdatePackage]Manager for update package operations.
Update packages represent the actual software packages that make up a VergeOS system.
Example
>>> # List all packages >>> for pkg in client.update_packages.list(): ... print(f"{pkg.name}: {pkg.version}")
>>> # Get a specific package >>> pkg = client.update_packages.get("yb-system")
- list(filter=None, fields=None, limit=None, offset=None, branch=None, **filter_kwargs)[source]
List update packages with optional filtering.
- Parameters:
filter (str | None) – OData filter string.
fields (list[str] | None) – List of fields to return (uses defaults if not specified).
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
branch (int | None) – Filter by branch key.
**filter_kwargs (Any) – Shorthand filter arguments.
- Returns:
List of UpdatePackage objects.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a single package by key (name).
- Parameters:
- Returns:
UpdatePackage object.
- Raises:
NotFoundError – If package not found.
ValueError – If no identifier provided.
- Return type:
- class pyvergeos.resources.updates.UpdateSettings[source]
Bases:
ResourceObjectUpdate settings resource object.
Singleton configuration for system update behavior. There is only one update settings record (key=1).
- key
Settings $key (always 1).
- name
Settings name.
- source
Active update source key.
- branch
Selected update branch key.
- auto_refresh
Automatically check for updates.
- auto_update
Automatically install updates.
- auto_reboot
Automatically reboot after updates.
- update_time
Scheduled update time (HH:MM format).
- max_vsan_usage
Maximum vSAN usage percentage for automatic updates.
- warm_reboot
Use kexec for faster reboots.
- multi_cluster_update
Allow multiple clusters to update simultaneously.
- snapshot_cloud_on_update
Take system snapshot before updates.
- snapshot_cloud_expire_seconds
Snapshot expiration period.
- installed
Whether updates are installed and pending reboot.
- reboot_required
Whether a reboot is required.
- applying_updates
Whether updates are currently being applied.
- release_notes_url
URL to release notes.
- anonymize_statistics
Anonymize statistics sent to update server.
- class pyvergeos.resources.updates.UpdateSettingsManager[source]
Bases:
ResourceManager[UpdateSettings]Manager for update settings operations.
Update settings is a singleton - there is only one record with key=1.
Example
>>> # Get current settings >>> settings = client.update_settings.get() >>> print(f"Branch: {settings.branch_name}") >>> print(f"Auto-refresh: {settings.is_auto_refresh}")
>>> # Check for updates >>> client.update_settings.check()
>>> # Download available updates >>> client.update_settings.download()
>>> # Install updates >>> client.update_settings.install()
>>> # Or do everything at once >>> client.update_settings.update_all()
>>> # Update settings >>> client.update_settings.update( ... auto_refresh=True, ... update_time="02:00", ... snapshot_cloud_on_update=True, ... )
- get(key=None, *, fields=None)[source]
Get update settings.
Update settings is a singleton (key=1), so the key parameter is optional and ignored.
- Parameters:
- Returns:
UpdateSettings object.
- Return type:
- update(key=None, *, source=None, branch=None, user=None, password=None, auto_refresh=None, auto_update=None, auto_reboot=None, update_time=None, max_vsan_usage=None, warm_reboot=None, multi_cluster_update=None, snapshot_cloud_on_update=None, snapshot_cloud_expire_seconds=None, anonymize_statistics=None)[source]
Update the update settings.
- Parameters:
key (int | None) – Ignored (settings is always key=1).
source (int | None) – Update source key.
branch (int | None) – Update branch key.
user (str | None) – Update server username.
password (str | None) – Update server password.
auto_refresh (bool | None) – Automatically check for updates.
auto_update (bool | None) – Automatically install updates.
auto_reboot (bool | None) – Automatically reboot after updates.
update_time (str | None) – Scheduled update time (HH:MM format).
max_vsan_usage (int | None) – Maximum vSAN usage percentage (10-100).
warm_reboot (bool | None) – Use kexec for faster reboots.
multi_cluster_update (bool | None) – Allow multiple clusters to update simultaneously.
snapshot_cloud_on_update (bool | None) – Take system snapshot before updates.
snapshot_cloud_expire_seconds (int | None) – Snapshot expiration period in seconds.
anonymize_statistics (bool | None) – Anonymize statistics sent to update server.
- Returns:
Updated UpdateSettings object.
- Return type:
- check()[source]
Check for available updates.
Triggers a refresh to check the update source for new packages.
Example
>>> result = client.update_settings.check() >>> if result: ... task = client.tasks.wait(result.get("task"))
- download()[source]
Download available updates.
Downloads packages that are available from the update source.
Example
>>> result = client.update_settings.download() >>> if result: ... task = client.tasks.wait(result.get("task"))
- install()[source]
Install downloaded updates.
Installs packages that have been downloaded. This prepares them for application during node reboots.
Example
>>> result = client.update_settings.install() >>> if result: ... task = client.tasks.wait(result.get("task"))
- update_all(force=False)[source]
Download, install, and reboot in one operation.
This is the recommended way to apply updates. It will: 1. Download available packages 2. Install packages 3. Reboot nodes one at a time with workload migration
- Parameters:
force (bool) – Allow unmigratable workloads to be temporarily rebooted. Use this if there are VMs that cannot be migrated (e.g., VMs with GPU passthrough).
- Returns:
Task information dict or None.
- Return type:
Example
>>> # Normal update >>> result = client.update_settings.update_all()
>>> # Force update (allows non-migratable workloads to reboot) >>> result = client.update_settings.update_all(force=True)
- class pyvergeos.resources.updates.UpdateDashboard[source]
Bases:
ResourceObjectUpdate dashboard resource object.
Provides an aggregated view of update status including packages, branches, settings, and logs.
- logs
Recent update logs.
- packages
Available packages with status.
- branches
Available branches.
- settings
Current update settings.
- node_count
Number of physical nodes.
- counts
Event and task counts.
- class pyvergeos.resources.updates.UpdateDashboardManager[source]
Bases:
ResourceManager[UpdateDashboard]Manager for update dashboard operations.
The update dashboard provides an aggregated view of the update system including packages, branches, settings, and logs.
Example
>>> # Get the dashboard >>> dashboard = client.update_dashboard.get()
>>> # Check node count >>> print(f"Nodes: {dashboard.node_count}")
>>> # Get settings summary >>> settings = dashboard.get_settings() >>> print(f"Branch: {settings.get('branch#name')}")
>>> # List packages >>> for pkg in dashboard.get_packages(): ... print(f"{pkg.get('name')}: {pkg.get('version')}")
Billing
Resource usage tracking and billing reports.
Billing resource managers for tracking resource usage and chargeback.
This module provides access to system-wide billing records and report generation for tracking resource utilization across the VergeOS system.
Example
>>> # List billing records
>>> records = client.billing.list(limit=100)
>>> for record in records:
... print(f"{record.created}: {record.used_cores} cores, {record.used_ram_gb}GB RAM")
>>> # Get total storage usage across tiers
>>> record = client.billing.get_latest()
>>> print(f"Tier 0: {record.tier0_used_gb}GB / {record.tier0_total_gb}GB")
>>> # Generate a new billing report
>>> result = client.billing.generate()
>>> print(f"Generated billing report: {result}")
>>> # Get billing data for a time range
>>> from datetime import datetime, timedelta
>>> since = datetime.now() - timedelta(days=30)
>>> records = client.billing.list(since=since)
- class pyvergeos.resources.billing.BillingRecord[source]
Bases:
ResourceObjectBilling record representing resource usage at a point in time.
Billing records capture system-wide resource utilization metrics for billing and chargeback purposes.
- get_tier_stats(tier)[source]
Get stats for a specific storage tier.
- Parameters:
tier (int) – Tier number (0-5).
- Returns:
Dict with used and total values in bytes and GB.
- Raises:
ValueError – If tier is not 0-5.
- Return type:
- class pyvergeos.resources.billing.BillingManager[source]
Bases:
ResourceManager[BillingRecord]Manager for billing records.
Provides access to system-wide resource usage records for billing and chargeback purposes. Records are automatically generated and stored by VergeOS.
Example
>>> # List billing records >>> records = client.billing.list(limit=100)
>>> # Get the latest billing record >>> latest = client.billing.get_latest() >>> print(f"CPU: {latest.cpu_utilization_pct:.1f}%")
>>> # Get records for a specific time range >>> from datetime import datetime, timedelta >>> since = datetime.now() - timedelta(days=7) >>> records = client.billing.list(since=since)
>>> # Generate a new billing report >>> result = client.billing.generate()
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, since=None, until=None, **filter_kwargs)[source]
List billing records.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
since (datetime | int | None) – Return records created after this time (datetime or epoch).
until (datetime | int | None) – Return records created before this time (datetime or epoch).
**filter_kwargs (Any) – Shorthand filter arguments.
- Returns:
List of BillingRecord objects, sorted by created descending.
- Return type:
- get(key=None, *, fields=None)[source]
Get a specific billing record by key.
- Parameters:
- Returns:
BillingRecord object.
- Raises:
NotFoundError – If record not found.
ValueError – If key not provided.
- Return type:
- get_latest(fields=None)[source]
Get the most recent billing record.
- Parameters:
- Returns:
Most recent BillingRecord object.
- Raises:
NotFoundError – If no billing records exist.
- Return type:
- generate()[source]
Generate a new billing report.
Triggers the generation of a new billing record with current resource usage data.
Example
>>> result = client.billing.generate() >>> print(f"Generated billing report")
- get_summary(since=None, until=None)[source]
Get a summary of billing data over a time period.
Calculates average and peak usage across all billing records in the specified time range.
- Parameters:
- Returns:
record_count: Number of billing records
avg_cpu_utilization: Average CPU utilization percentage
peak_cpu_cores: Peak CPU cores used
avg_ram_utilization: Average RAM utilization percentage
peak_ram_gb: Peak RAM usage in GB
avg_storage_used_gb: Average storage used in GB
peak_storage_used_gb: Peak storage used in GB
total_gpus: Total GPUs available
avg_gpus_used: Average GPUs in use
total_vgpus: Total vGPUs available
avg_vgpus_used: Average vGPUs in use
- Return type:
Dict with summary statistics including
Backup & DR
Cloud Snapshots
Cloud (system) snapshot resource manager for VergeOS backup/DR.
- class pyvergeos.resources.cloud_snapshots.CloudSnapshotVM[source]
Bases:
ResourceObjectVM within a cloud snapshot.
Represents a VM captured in a cloud (system) snapshot. Can be used to restore the VM to its state at snapshot time.
- Properties:
name: VM name at snapshot time. description: VM description. uuid: VM UUID. machine_uuid: VM machine UUID. cpu_cores: Number of CPU cores. ram_mb: RAM in megabytes. os_family: Operating system family. is_snapshot: Whether this is a snapshot VM. status: Recovery status (idle, importing, complete, error). status_info: Additional status information. original_key: Original VM key at snapshot time. cloud_snapshot_key: Key of the parent cloud snapshot.
- class pyvergeos.resources.cloud_snapshots.CloudSnapshotTenant[source]
Bases:
ResourceObjectTenant within a cloud snapshot.
Represents a tenant captured in a cloud (system) snapshot. Can be used to restore the tenant to its state at snapshot time.
- Properties:
name: Tenant name at snapshot time. description: Tenant description. uuid: Tenant UUID. nodes: Number of nodes. cpu_cores: Total CPU cores. ram_mb: Total RAM in megabytes. is_snapshot: Whether this is a snapshot tenant. status: Recovery status (idle, importing, complete, error). status_info: Additional status information. original_key: Original tenant key at snapshot time. cloud_snapshot_key: Key of the parent cloud snapshot.
- class pyvergeos.resources.cloud_snapshots.CloudSnapshotVMManager[source]
Bases:
ResourceManager[CloudSnapshotVM]Manager for VMs within a cloud snapshot.
Provides access to VMs captured in a specific cloud snapshot.
Example
>>> # Get VMs in a snapshot >>> snapshot = client.cloud_snapshots.get(name="Daily_20260123") >>> vms = client.cloud_snapshots.vms(snapshot.key).list() >>> for vm in vms: ... print(f"{vm.name}: {vm.cpu_cores} cores, {vm.ram_mb} MB RAM")
- __init__(client, snapshot_key)[source]
- Parameters:
client (VergeClient)
snapshot_key (int)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List VMs in this cloud snapshot.
- Parameters:
- Returns:
List of CloudSnapshotVM objects.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a VM from this snapshot by key or name.
- Parameters:
- Returns:
CloudSnapshotVM object.
- Raises:
NotFoundError – If VM not found.
ValueError – If neither key nor name provided.
- Return type:
- class pyvergeos.resources.cloud_snapshots.CloudSnapshotTenantManager[source]
Bases:
ResourceManager[CloudSnapshotTenant]Manager for tenants within a cloud snapshot.
Provides access to tenants captured in a specific cloud snapshot.
Example
>>> # Get tenants in a snapshot >>> snapshot = client.cloud_snapshots.get(name="Daily_20260123") >>> tenants = client.cloud_snapshots.tenants(snapshot.key).list() >>> for tenant in tenants: ... print(f"{tenant.name}: {tenant.nodes} nodes")
- __init__(client, snapshot_key)[source]
- Parameters:
client (VergeClient)
snapshot_key (int)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List tenants in this cloud snapshot.
- Parameters:
- Returns:
List of CloudSnapshotTenant objects.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a tenant from this snapshot by key or name.
- Parameters:
- Returns:
CloudSnapshotTenant object.
- Raises:
NotFoundError – If tenant not found.
ValueError – If neither key nor name provided.
- Return type:
- class pyvergeos.resources.cloud_snapshots.CloudSnapshot[source]
Bases:
ResourceObjectCloud (system) snapshot resource object.
Represents a cloud snapshot that captures the entire system state including all VMs and tenants at a point in time.
- Properties:
name: Snapshot name. description: Snapshot description. created_at: When the snapshot was created. expires_at: When the snapshot expires (None if never). never_expires: Whether the snapshot never expires. snapshot_profile_key: Key of associated snapshot profile. is_private: Whether the snapshot is hidden from tenants. is_remote_sync: Whether this was synced from a remote system. is_immutable: Whether the snapshot is immutable. immutable_status: Immutable status (unlocked, unlocking, locked). immutable_lock_expires_at: When the immutable lock expires. status: Snapshot status (normal, held). status_info: Additional status information.
- __init__(data, manager, vms=None, tenants=None)[source]
- Parameters:
manager (ResourceManager[Any])
vms (list[CloudSnapshotVM] | None)
tenants (list[CloudSnapshotTenant] | None)
- Return type:
None
- property vms: list[CloudSnapshotVM] | None
Get VMs in this snapshot (if loaded with include_vms=True).
- property tenants: list[CloudSnapshotTenant] | None
Get tenants in this snapshot (if loaded with include_tenants=True).
- get_vms()[source]
Get all VMs in this snapshot.
- Returns:
List of CloudSnapshotVM objects.
- Return type:
- get_tenants()[source]
Get all tenants in this snapshot.
- Returns:
List of CloudSnapshotTenant objects.
- Return type:
- delete()[source]
Delete this snapshot.
- Raises:
ValidationError – If snapshot is immutable and locked.
- Return type:
None
- class pyvergeos.resources.cloud_snapshots.CloudSnapshotManager[source]
Bases:
ResourceManager[CloudSnapshot]Manager for cloud (system) snapshot operations.
Cloud snapshots capture the entire system state including all VMs and tenants at a point in time. They are used for disaster recovery and point-in-time restoration.
Example
>>> # List all snapshots >>> snapshots = client.cloud_snapshots.list()
>>> # Create a new snapshot >>> snapshot = client.cloud_snapshots.create( ... name="Pre-Upgrade", ... retention_seconds=604800, # 7 days ... )
>>> # Get a snapshot by name with VMs >>> snapshot = client.cloud_snapshots.get( ... name="Daily_20260123", ... include_vms=True, ... ) >>> for vm in snapshot.vms: ... print(vm.name)
>>> # Restore a VM from snapshot >>> client.cloud_snapshots.restore_vm( ... snapshot_key=snapshot.key, ... vm_name="WebServer01", ... new_name="WebServer01-Restored", ... )
>>> # Delete a snapshot >>> client.cloud_snapshots.delete(snapshot.key)
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- vms(snapshot_key)[source]
Get the VM manager for a snapshot.
- Parameters:
snapshot_key (int) – Snapshot $key (ID).
- Returns:
CloudSnapshotVMManager for the snapshot.
- Return type:
- tenants(snapshot_key)[source]
Get the tenant manager for a snapshot.
- Parameters:
snapshot_key (int) – Snapshot $key (ID).
- Returns:
CloudSnapshotTenantManager for the snapshot.
- Return type:
- list(filter=None, fields=None, limit=None, offset=None, *, include_expired=False, include_vms=False, include_tenants=False, **filter_kwargs)[source]
List cloud snapshots.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
include_expired (bool) – Include expired snapshots.
include_vms (bool) – Include VMs for each snapshot.
include_tenants (bool) – Include tenants for each snapshot.
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of CloudSnapshot objects sorted by creation time (newest first).
- Return type:
Example
>>> # All active snapshots >>> snapshots = client.cloud_snapshots.list()
>>> # All snapshots including expired >>> snapshots = client.cloud_snapshots.list(include_expired=True)
>>> # Snapshots with VMs and tenants >>> snapshots = client.cloud_snapshots.list( ... include_vms=True, ... include_tenants=True, ... )
- get(key=None, *, name=None, fields=None, include_vms=False, include_tenants=False, include_expired=True)[source]
Get a cloud snapshot by key or name.
- Parameters:
- Returns:
CloudSnapshot object.
- Raises:
NotFoundError – If snapshot not found.
ValueError – If neither key nor name provided.
- Return type:
- create(name=None, *, retention_seconds=None, retention=None, never_expire=False, min_snapshots=1, immutable=False, private=False, wait=False, wait_timeout=300)[source]
Create a new cloud snapshot.
- Parameters:
name (str | None) – Snapshot name. If not provided, a timestamped name is generated.
retention_seconds (int | None) – Retention period in seconds (default: 259200 = 3 days).
retention (timedelta | None) – Retention period as timedelta (alternative to retention_seconds).
never_expire (bool) – If True, snapshot never expires.
min_snapshots (int) – Minimum snapshots to retain (default: 1).
immutable (bool) – Make snapshot immutable (locked, read-only).
private (bool) – Hide snapshot from tenants.
wait (bool) – Wait for snapshot creation to complete.
wait_timeout (int) – Maximum seconds to wait (default: 300).
- Returns:
Created CloudSnapshot object.
- Raises:
ValueError – If invalid parameters.
APIError – If creation fails.
- Return type:
Example
>>> # Create with default settings (3-day retention) >>> snapshot = client.cloud_snapshots.create()
>>> # Create with custom name and retention >>> snapshot = client.cloud_snapshots.create( ... name="Pre-Upgrade", ... retention=timedelta(days=7), ... )
>>> # Create immutable snapshot that never expires >>> snapshot = client.cloud_snapshots.create( ... name="Permanent-Backup", ... never_expire=True, ... immutable=True, ... )
- delete(key)[source]
Delete a cloud snapshot.
- Parameters:
key (int) – Snapshot $key (ID).
- Raises:
ValidationError – If snapshot is immutable and locked.
NotFoundError – If snapshot not found.
- Return type:
None
- restore_vm(snapshot_key=None, snapshot_name=None, *, vm_key=None, vm_name=None, new_name=None)[source]
Restore a VM from a cloud snapshot.
Creates a new VM from the snapshot data. Does not overwrite any existing VM.
- Parameters:
snapshot_key (int | None) – Cloud snapshot $key (ID).
snapshot_name (str | None) – Cloud snapshot name (alternative to snapshot_key).
vm_key (int | None) – VM snapshot key within the cloud snapshot.
vm_name (str | None) – VM name within the cloud snapshot (alternative to vm_key).
new_name (str | None) – Optional new name for the restored VM.
- Returns:
Dict with restore operation details (task key if available).
- Raises:
ValueError – If required parameters not provided.
NotFoundError – If snapshot or VM not found.
- Return type:
Example
>>> # Restore VM by name >>> result = client.cloud_snapshots.restore_vm( ... snapshot_name="Daily_20260123", ... vm_name="WebServer01", ... new_name="WebServer01-Restored", ... )
>>> # Restore by keys >>> result = client.cloud_snapshots.restore_vm( ... snapshot_key=5, ... vm_key=123, ... )
- restore_tenant(snapshot_key=None, snapshot_name=None, *, tenant_key=None, tenant_name=None, new_name=None)[source]
Restore a tenant from a cloud snapshot.
Creates a new tenant from the snapshot data. Does not overwrite any existing tenant.
- Parameters:
snapshot_key (int | None) – Cloud snapshot $key (ID).
snapshot_name (str | None) – Cloud snapshot name (alternative to snapshot_key).
tenant_key (int | None) – Tenant snapshot key within the cloud snapshot.
tenant_name (str | None) – Tenant name within the cloud snapshot (alternative to tenant_key).
new_name (str | None) – Optional new name for the restored tenant.
- Returns:
Dict with restore operation details (task key if available).
- Raises:
ValueError – If required parameters not provided.
NotFoundError – If snapshot or tenant not found.
- Return type:
Example
>>> # Restore tenant by name >>> result = client.cloud_snapshots.restore_tenant( ... snapshot_name="Daily_20260123", ... tenant_name="CustomerA", ... new_name="CustomerA-DR", ... )
Snapshot Profiles
Snapshot profile resource manager for VergeOS backup/DR.
- class pyvergeos.resources.snapshot_profiles.SnapshotProfilePeriod[source]
Bases:
ResourceObjectSnapshot profile period (schedule) resource object.
Represents a snapshot schedule period within a profile. Defines when snapshots are taken and how long they are retained.
- Properties:
profile_key: Key of the parent snapshot profile. name: Period name (e.g., “Hourly”, “Daily”). frequency: Schedule frequency (custom, hourly, daily, weekly, monthly, yearly). frequency_display: Capitalized frequency display name. minute: Minute of the hour (0-59). hour: Hour of the day (0-23). day_of_week: Day of week (sun, mon, tue, wed, thu, fri, sat, any). day_of_week_display: Full day name. day_of_month: Day of month (0-31, 0 = any). month: Month (0-12, 0 = any). retention_seconds: Retention period in seconds. retention: Retention as timedelta. retention_display: Human-readable retention string. skip_missed: Skip if snapshot time was missed. max_tier: Maximum storage tier for snapshots (1-5). quiesce: Whether to quiesce disks during snapshot. min_snapshots: Minimum snapshots to retain. is_immutable: Whether snapshots are immutable (system snapshots only). estimated_snapshot_count: Estimated number of snapshots.
- class pyvergeos.resources.snapshot_profiles.SnapshotProfile[source]
Bases:
ResourceObjectSnapshot profile resource object.
Represents a snapshot profile that defines automated snapshot schedules for VMs, NAS volumes, and cloud/system snapshots.
- Properties:
name: Profile name. description: Profile description. ignore_warnings: Whether to ignore snapshot count warnings. periods: List of schedule periods (if loaded with include_periods=True).
- __init__(data, manager, periods=None)[source]
- Parameters:
manager (ResourceManager[Any])
periods (list[SnapshotProfilePeriod] | None)
- Return type:
None
- property periods: list[SnapshotProfilePeriod] | None
Get schedule periods (if loaded).
- save(**kwargs)[source]
Save changes to profile.
- Parameters:
**kwargs (Any) – Fields to update.
- Returns:
Updated profile object.
- Return type:
- get_periods()[source]
Get all schedule periods for this profile.
- Returns:
List of SnapshotProfilePeriod objects.
- Return type:
- add_period(name, frequency, retention_seconds, *, minute=0, hour=0, day_of_week='any', day_of_month=0, month=0, skip_missed=False, max_tier=1, quiesce=False, min_snapshots=1, immutable=False)[source]
Add a schedule period to this profile.
- Parameters:
name (str) – Period name.
frequency (str) – Schedule frequency (hourly, daily, weekly, monthly, yearly, custom).
retention_seconds (int) – Retention period in seconds.
minute (int) – Minute of the hour (0-59).
hour (int) – Hour of the day (0-23).
day_of_week (str) – Day of week (sun, mon, tue, wed, thu, fri, sat, any).
day_of_month (int) – Day of month (0-31, 0 = any).
month (int) – Month (0-12, 0 = any).
skip_missed (bool) – Skip if snapshot time was missed.
max_tier (int) – Maximum storage tier (1-5).
quiesce (bool) – Enable disk quiescing.
min_snapshots (int) – Minimum snapshots to retain.
immutable (bool) – Make snapshots immutable (system snapshots only).
- Returns:
Created SnapshotProfilePeriod object.
- Return type:
- class pyvergeos.resources.snapshot_profiles.SnapshotProfilePeriodManager[source]
Bases:
ResourceManager[SnapshotProfilePeriod]Manager for snapshot profile period operations.
Manages schedule periods within a snapshot profile.
Example
>>> # Get periods for a profile >>> profile = client.snapshot_profiles.get(name="Daily Backups") >>> periods = client.snapshot_profiles.periods(profile.key).list()
>>> # Create a period >>> period = client.snapshot_profiles.periods(profile.key).create( ... name="Daily", ... frequency="daily", ... retention=86400 * 7, # 7 days ... hour=2, # 2 AM ... minute=0, ... )
>>> # Or use the profile object directly >>> period = profile.add_period( ... name="Hourly", ... frequency="hourly", ... retention_seconds=86400, # 1 day ... )
- __init__(client, profile_key)[source]
- Parameters:
client (VergeClient)
profile_key (int)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List periods for this profile.
- Parameters:
- Returns:
List of SnapshotProfilePeriod objects.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a period by key or name.
- Parameters:
- Returns:
SnapshotProfilePeriod object.
- Raises:
NotFoundError – If period not found.
ValueError – If neither key nor name provided.
- Return type:
- create(name, frequency, retention, *, minute=0, hour=0, day_of_week='any', day_of_month=0, month=0, skip_missed=False, max_tier=1, quiesce=False, min_snapshots=1, immutable=False)[source]
Create a new period in this profile.
- Parameters:
name (str) – Period name (e.g., “Daily”, “Hourly”).
frequency (str) – Schedule frequency (hourly, daily, weekly, monthly, yearly, custom).
retention (int) – Retention period in seconds.
minute (int) – Minute of the hour (0-59).
hour (int) – Hour of the day (0-23).
day_of_week (str) – Day of week (sun, mon, tue, wed, thu, fri, sat, any).
day_of_month (int) – Day of month (0-31, 0 = any).
month (int) – Month (0-12, 0 = any).
skip_missed (bool) – Skip if snapshot time was missed.
max_tier (int) – Maximum storage tier (1-5).
quiesce (bool) – Enable disk quiescing.
min_snapshots (int) – Minimum snapshots to retain.
immutable (bool) – Make snapshots immutable (system snapshots only).
- Returns:
Created SnapshotProfilePeriod object.
- Raises:
ValueError – If invalid parameters provided.
APIError – If creation fails.
- Return type:
- class pyvergeos.resources.snapshot_profiles.SnapshotProfileManager[source]
Bases:
ResourceManager[SnapshotProfile]Manager for snapshot profile operations.
Snapshot profiles define automated snapshot schedules for VMs, NAS volumes, and cloud/system snapshots.
Example
>>> # List all profiles >>> profiles = client.snapshot_profiles.list()
>>> # Get a profile by name >>> profile = client.snapshot_profiles.get(name="Daily Backups")
>>> # Create a new profile >>> profile = client.snapshot_profiles.create( ... name="Production VMs", ... description="Snapshot profile for production workloads", ... )
>>> # Add schedule periods >>> profile.add_period( ... name="Hourly", ... frequency="hourly", ... retention_seconds=86400, # 1 day ... ) >>> profile.add_period( ... name="Daily", ... frequency="daily", ... retention_seconds=604800, # 7 days ... hour=2, ... minute=0, ... )
>>> # Delete a profile >>> client.snapshot_profiles.delete(profile.key)
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- periods(profile_key)[source]
Get the period manager for a profile.
- Parameters:
profile_key (int) – Profile $key (ID).
- Returns:
SnapshotProfilePeriodManager for the profile.
- Return type:
- list(filter=None, fields=None, limit=None, offset=None, *, include_periods=False, **filter_kwargs)[source]
List snapshot profiles.
- Parameters:
- Returns:
List of SnapshotProfile objects sorted by name.
- Return type:
Example
>>> # All profiles >>> profiles = client.snapshot_profiles.list()
>>> # Profiles with periods >>> profiles = client.snapshot_profiles.list(include_periods=True) >>> for profile in profiles: ... print(f"{profile.name}: {len(profile.periods or [])} periods")
- get(key=None, *, name=None, fields=None, include_periods=False)[source]
Get a snapshot profile by key or name.
- Parameters:
- Returns:
SnapshotProfile object.
- Raises:
NotFoundError – If profile not found.
ValueError – If neither key nor name provided.
- Return type:
- create(name, *, description=None, ignore_warnings=False)[source]
Create a new snapshot profile.
- Parameters:
- Returns:
Created SnapshotProfile object.
- Raises:
ValueError – If name is empty.
APIError – If creation fails (e.g., duplicate name).
- Return type:
Example
>>> profile = client.snapshot_profiles.create( ... name="Production VMs", ... description="Snapshot profile for production workloads", ... )
- update(key, **kwargs)[source]
Update a snapshot profile.
- Parameters:
- Returns:
Updated SnapshotProfile object.
- Return type:
Example
>>> profile = client.snapshot_profiles.update( ... profile.key, ... description="Updated description", ... )
- delete(key)[source]
Delete a snapshot profile.
Uses the snapshot_profile_actions endpoint with delete action. The profile must not be in use by any VMs, volumes, or cloud snapshots.
- Parameters:
key (int) – Profile $key (ID).
- Raises:
APIError – If deletion fails (e.g., profile in use).
- Return type:
None
Example
>>> client.snapshot_profiles.delete(profile.key)
Sites
Site resource manager for VergeOS backup/DR operations.
- class pyvergeos.resources.sites.Site[source]
Bases:
ResourceObjectSite resource object representing a connection to a remote VergeOS system.
Sites are used for disaster recovery, replication, and remote management between VergeOS systems.
- Properties:
name: Site name. description: Site description. is_enabled: Whether the site is enabled. url: URL of the remote VergeOS system. domain: Domain name for the site. city: City where the site is located. country: Country code where the site is located. timezone: Timezone for the site. latitude: Geographic latitude. longitude: Geographic longitude. status: Site status (idle, authenticating, syncing, error, warning). status_info: Additional status information. authentication_status: Authentication status (unauthenticated, authenticated, legacy). config_cloud_snapshots: Cloud snapshot sync config (disabled, send, receive, both). config_statistics: Statistics sync config (disabled, send, receive, both). config_management: Machine management config (disabled, manage, managed, both). config_repair_server: Repair server config (disabled, send, receive, both). vsan_host: vSAN connection host. vsan_port: vSAN connection port. is_tenant: Whether site is a tenant. has_incoming_syncs: Whether incoming syncs are enabled. has_outgoing_syncs: Whether outgoing syncs are enabled. statistics_interval: Statistics sync interval in seconds. statistics_retention: Statistics retention period in seconds. created_at: When the site was created. modified_at: When the site was last modified. creator: Username who created the site.
- property authentication_status: str
Get authentication status (unauthenticated, authenticated, legacy).
- property config_cloud_snapshots: str
Get cloud snapshot sync config (disabled, send, receive, both).
- class pyvergeos.resources.sites.SiteManager[source]
Bases:
ResourceManager[Site]Manager for site operations.
Sites represent connections to other VergeOS systems for disaster recovery, replication, and remote management.
Example
>>> # List all sites >>> sites = client.sites.list()
>>> # Create a new site >>> site = client.sites.create( ... name="DR-Site", ... url="https://dr.example.com", ... username="admin", ... password="secret", ... config_cloud_snapshots="send", ... )
>>> # Get a site by name >>> site = client.sites.get(name="DR-Site")
>>> # Enable/disable a site >>> site = client.sites.enable(site.key) >>> site = client.sites.disable(site.key)
>>> # Delete a site >>> client.sites.delete(site.key)
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, enabled=None, status=None, **filter_kwargs)[source]
List sites.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
enabled (bool | None) – Filter by enabled status.
status (str | None) – Filter by status (idle, authenticating, syncing, error, warning).
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of Site objects sorted by name.
- Return type:
Example
>>> # All sites >>> sites = client.sites.list()
>>> # Enabled sites only >>> sites = client.sites.list(enabled=True)
>>> # Sites with errors >>> sites = client.sites.list(status="error")
- get(key=None, *, name=None, fields=None)[source]
Get a site by key or name.
- Parameters:
- Returns:
Site object.
- Raises:
NotFoundError – If site not found.
ValueError – If neither key nor name provided.
- Return type:
- create(name, url, username, password, *, description=None, allow_insecure=False, config_cloud_snapshots='disabled', config_statistics='disabled', config_management='disabled', config_repair_server='disabled', auto_create_syncs=True, domain=None, city=None, country=None, timezone=None, request_url=None)[source]
Create a new site connection.
- Parameters:
name (str) – Site name.
url (str) – URL of the remote VergeOS system.
username (str) – Username for authentication.
password (str) – Password for authentication.
description (str | None) – Optional site description.
allow_insecure (bool) – Allow insecure SSL connections (for self-signed certs).
config_cloud_snapshots (str) – Cloud snapshot config (disabled, send, receive, both).
config_statistics (str) – Statistics config (disabled, send, receive, both).
config_management (str) – Management config (disabled, manage, managed, both).
config_repair_server (str) – Repair server config (disabled, send, receive, both).
auto_create_syncs (bool) – Automatically create sync configurations.
domain (str | None) – Domain name for the site.
city (str | None) – City where the site is located.
country (str | None) – Country code where the site is located.
timezone (str | None) – Timezone for the site.
request_url (str | None) – URL the remote system uses to connect back.
- Returns:
Created Site object.
- Raises:
ValidationError – If invalid parameters.
APIError – If creation fails.
- Return type:
Example
>>> site = client.sites.create( ... name="DR-Site", ... url="https://dr.example.com", ... username="admin", ... password="secret", ... config_cloud_snapshots="send", ... allow_insecure=True, ... )
- update(key, *, name=None, description=None, enabled=None, config_cloud_snapshots=None, config_statistics=None, config_management=None, config_repair_server=None, domain=None, city=None, country=None, timezone=None, statistics_interval=None, statistics_retention=None)[source]
Update a site’s settings.
- Parameters:
key (int) – Site $key (ID).
name (str | None) – New site name.
description (str | None) – New site description.
enabled (bool | None) – Enable or disable the site.
config_cloud_snapshots (str | None) – Cloud snapshot config (disabled, send, receive, both).
config_statistics (str | None) – Statistics config (disabled, send, receive, both).
config_management (str | None) – Management config (disabled, manage, managed, both).
config_repair_server (str | None) – Repair server config (disabled, send, receive, both).
domain (str | None) – Domain name for the site.
city (str | None) – City where the site is located.
country (str | None) – Country code where the site is located.
timezone (str | None) – Timezone for the site.
statistics_interval (int | None) – Statistics sync interval in seconds.
statistics_retention (int | None) – Statistics retention period in seconds.
- Returns:
Updated Site object.
- Return type:
- delete(key)[source]
Delete a site.
This will also remove all associated sync configurations.
- Parameters:
key (int) – Site $key (ID).
- Raises:
NotFoundError – If site not found.
- Return type:
None
- reauthenticate(key, username, password)[source]
Reauthenticate with a remote site.
Use this to update credentials or resolve authentication issues.
Site Syncs
DR synchronization management.
Site sync resource managers for VergeOS backup/DR operations.
- class pyvergeos.resources.site_syncs.SiteSyncOutgoing[source]
Bases:
ResourceObjectOutgoing site sync resource object.
Outgoing syncs send cloud snapshots from this system to a remote site for disaster recovery purposes.
- Properties:
site_key: Key of the associated site. name: Sync name. description: Sync description. is_enabled: Whether the sync is enabled. status: Sync status (offline, initializing, syncing, error). status_info: Additional status information. state: Sync state (offline, online, warning, error). url: Remote URL. has_encryption: Whether encryption is enabled. has_compression: Whether compression is enabled. has_network_integrity: Whether network integrity checking is enabled. data_threads: Number of data threads. file_threads: Number of file threads. send_throttle: Send throttle in bytes/sec (0 = disabled). destination_tier: Override destination storage tier. queue_retry_count: Number of retry attempts for queued items. queue_retry_interval: Retry interval in seconds. has_retry_multiplier: Whether retry interval multiplier is enabled. last_run_at: When the sync last ran. remote_min_snapshots: Minimum snapshots to retain on remote. note: Optional note.
- start()[source]
Start (enable) this sync.
Alias for enable().
- Returns:
Updated SiteSyncOutgoing object.
- Return type:
- stop()[source]
Stop (disable) this sync.
Alias for disable().
- Returns:
Updated SiteSyncOutgoing object.
- Return type:
- refresh()[source]
Refresh sync data from server.
- Returns:
Updated SiteSyncOutgoing object.
- Return type:
- add_to_queue(snapshot_key, retention=259200, priority=0, do_not_expire=False, destination_prefix=None)[source]
Add a cloud snapshot to the transfer queue.
- Parameters:
snapshot_key (int) – Key of the cloud snapshot to queue.
retention (int | timedelta) – Retention period in seconds or timedelta. Default 3 days.
priority (int) – Priority for syncing (lower = first). Default 0.
do_not_expire (bool) – If True, snapshot won’t expire until synced.
destination_prefix (str | None) – Prefix for snapshot name on destination.
- Return type:
None
- property queue: SiteSyncQueueManager
Access the sync queue for this outgoing sync.
- Returns:
SiteSyncQueueManager scoped to this sync.
Example
>>> sync = client.site_syncs.get(1) >>> items = sync.queue.list() >>> syncing = sync.queue.list_syncing()
- property remote_snapshots: SiteSyncRemoteSnapManager
Access remote snapshots for this outgoing sync.
- Returns:
SiteSyncRemoteSnapManager scoped to this sync.
Example
>>> sync = client.site_syncs.get(1) >>> snaps = sync.remote_snapshots.list() >>> snap = snaps[0] >>> snap.request_sync_back()
- property stats: SiteSyncStatsManager
Access stats for this outgoing sync.
- Returns:
SiteSyncStatsManager scoped to this sync.
Example
>>> sync = client.site_syncs.get(1) >>> stats = sync.stats.get() >>> print(f"Sent: {stats.sent_display}")
- property logs: SiteSyncOutgoingLogManager
Access logs for this outgoing sync.
- Returns:
SiteSyncOutgoingLogManager scoped to this sync.
Example
>>> sync = client.site_syncs.get(1) >>> logs = sync.logs.list(limit=20) >>> errors = sync.logs.list_errors()
- class pyvergeos.resources.site_syncs.SiteSyncIncoming[source]
Bases:
ResourceObjectIncoming site sync resource object.
Incoming syncs receive cloud snapshots from a remote site for disaster recovery purposes.
- Properties:
site_key: Key of the associated site. name: Sync name. description: Sync description. is_enabled: Whether the sync is enabled. status: Sync status (offline, syncing, error, etc.). status_info: Additional status information. state: Sync state (offline, online, warning, error). sync_id: Unique sync identifier. registration_code: Code used by remote site to establish connection. public_ip: Public IP/domain of connecting system. force_tier: Force all synced data to this tier. min_snapshots: Minimum snapshots to retain. last_sync_at: When last sync occurred. vsan_host: vSAN connection host. vsan_port: vSAN connection port. request_url: URL remote system uses to connect back. is_system_created: Whether sync was created by system.
- refresh()[source]
Refresh sync data from server.
- Returns:
Updated SiteSyncIncoming object.
- Return type:
- property verified: SiteSyncIncomingVerifiedManager
Access verified sync info for this incoming sync.
- Returns:
SiteSyncIncomingVerifiedManager scoped to this sync.
Example
>>> incoming = client.site_syncs_incoming.get(1) >>> verified = incoming.verified.get() >>> snaps = verified.list_remote_snapshots()
- property logs: SiteSyncIncomingLogManager
Access logs for this incoming sync.
- Returns:
SiteSyncIncomingLogManager scoped to this sync.
Example
>>> incoming = client.site_syncs_incoming.get(1) >>> logs = incoming.logs.list(limit=20) >>> errors = incoming.logs.list_errors()
- class pyvergeos.resources.site_syncs.SiteSyncSchedule[source]
Bases:
ResourceObjectSite sync schedule resource object.
Schedules link snapshot profile periods to outgoing site syncs, enabling automatic syncing of snapshots taken by those periods.
- Properties:
sync_key: Key of the associated outgoing sync. profile_period_key: Key of the snapshot profile period. retention: Retention period in seconds. retention_timedelta: Retention period as timedelta. priority: Sync priority (lower = first). do_not_expire: Whether source snapshot should not expire until synced. destination_prefix: Prefix for snapshot name on destination.
- class pyvergeos.resources.site_syncs.SiteSyncOutgoingManager[source]
Bases:
ResourceManager[SiteSyncOutgoing]Manager for outgoing site sync operations.
Outgoing syncs send cloud snapshots to remote sites for disaster recovery.
Example
>>> # List all outgoing syncs >>> syncs = client.site_syncs.list()
>>> # Get syncs for a specific site >>> syncs = client.site_syncs.list(site_key=1)
>>> # Get a sync by name >>> sync = client.site_syncs.get(name="DR-Sync")
>>> # Enable/disable a sync >>> sync = client.site_syncs.enable(sync.key) >>> sync = client.site_syncs.disable(sync.key)
>>> # Add snapshot to queue >>> client.site_syncs.add_to_queue( ... sync_key=1, ... snapshot_key=5, ... retention=604800, # 7 days ... )
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, site_key=None, site_name=None, enabled=None, **filter_kwargs)[source]
List outgoing site syncs.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
site_key (int | None) – Filter by site key.
site_name (str | None) – Filter by site name (looks up site key).
enabled (bool | None) – Filter by enabled status.
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of SiteSyncOutgoing objects sorted by name.
- Return type:
Example
>>> # All outgoing syncs >>> syncs = client.site_syncs.list()
>>> # Syncs for a specific site >>> syncs = client.site_syncs.list(site_key=1)
>>> # Enabled syncs only >>> syncs = client.site_syncs.list(enabled=True)
- list_enabled(fields=None)[source]
List enabled outgoing syncs.
- Parameters:
- Returns:
List of enabled SiteSyncOutgoing objects.
- Return type:
- list_disabled(fields=None)[source]
List disabled outgoing syncs.
- Parameters:
- Returns:
List of disabled SiteSyncOutgoing objects.
- Return type:
- list_for_site(site_key=None, site_name=None, fields=None)[source]
List outgoing syncs for a specific site.
- get(key=None, *, name=None, site_key=None, site_name=None, fields=None)[source]
Get an outgoing sync by key or name.
- Parameters:
- Returns:
SiteSyncOutgoing object.
- Raises:
NotFoundError – If sync not found.
ValueError – If neither key nor name provided.
- Return type:
- enable(key)[source]
Enable an outgoing sync.
- Parameters:
key (int) – Sync $key (ID).
- Returns:
Updated SiteSyncOutgoing object.
- Return type:
- disable(key)[source]
Disable an outgoing sync.
- Parameters:
key (int) – Sync $key (ID).
- Returns:
Updated SiteSyncOutgoing object.
- Return type:
- start(key)[source]
Start (enable) an outgoing sync.
Alias for enable().
- Parameters:
key (int) – Sync $key (ID).
- Returns:
Updated SiteSyncOutgoing object.
- Return type:
- stop(key)[source]
Stop (disable) an outgoing sync.
Alias for disable().
- Parameters:
key (int) – Sync $key (ID).
- Returns:
Updated SiteSyncOutgoing object.
- Return type:
- add_to_queue(sync_key, snapshot_key, retention=259200, priority=0, do_not_expire=False, destination_prefix=None)[source]
Add a cloud snapshot to the transfer queue.
- Parameters:
sync_key (int) – Key of the outgoing sync.
snapshot_key (int) – Key of the cloud snapshot to queue.
retention (int | timedelta) – Retention period in seconds or timedelta. Default 3 days.
priority (int) – Priority for syncing (lower = first). Default 0.
do_not_expire (bool) – If True, snapshot won’t expire until synced.
destination_prefix (str | None) – Prefix for snapshot name on destination.
- Raises:
ValidationError – If invalid parameters.
- Return type:
None
- invoke(sync_key, snapshot_key, retention=259200, priority=0, do_not_expire=False, destination_prefix=None)[source]
Manually trigger a sync for a cloud snapshot.
Alias for add_to_queue().
- Parameters:
sync_key (int) – Key of the outgoing sync.
snapshot_key (int) – Key of the cloud snapshot to queue.
retention (int | timedelta) – Retention period in seconds or timedelta. Default 3 days.
priority (int) – Priority for syncing (lower = first). Default 0.
do_not_expire (bool) – If True, snapshot won’t expire until synced.
destination_prefix (str | None) – Prefix for snapshot name on destination.
- Return type:
None
- set_throttle(key, throttle)[source]
Set send throttle for an outgoing sync.
- Parameters:
- Returns:
Updated SiteSyncOutgoing object.
- Return type:
- disable_throttle(key)[source]
Disable send throttle for an outgoing sync.
- Parameters:
key (int) – Sync $key (ID).
- Returns:
Updated SiteSyncOutgoing object.
- Return type:
- class pyvergeos.resources.site_syncs.SiteSyncIncomingManager[source]
Bases:
ResourceManager[SiteSyncIncoming]Manager for incoming site sync operations.
Incoming syncs receive cloud snapshots from remote sites for disaster recovery.
Example
>>> # List all incoming syncs >>> syncs = client.site_syncs_incoming.list()
>>> # Get syncs for a specific site >>> syncs = client.site_syncs_incoming.list(site_key=1)
>>> # Get a sync by name >>> sync = client.site_syncs_incoming.get(name="DR-Sync")
>>> # Enable/disable a sync >>> sync = client.site_syncs_incoming.enable(sync.key) >>> sync = client.site_syncs_incoming.disable(sync.key)
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, site_key=None, site_name=None, enabled=None, **filter_kwargs)[source]
List incoming site syncs.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
site_key (int | None) – Filter by site key.
site_name (str | None) – Filter by site name (looks up site key).
enabled (bool | None) – Filter by enabled status.
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of SiteSyncIncoming objects sorted by name.
- Return type:
Example
>>> # All incoming syncs >>> syncs = client.site_syncs_incoming.list()
>>> # Syncs for a specific site >>> syncs = client.site_syncs_incoming.list(site_key=1)
>>> # Enabled syncs only >>> syncs = client.site_syncs_incoming.list(enabled=True)
- list_for_site(site_key=None, site_name=None, fields=None)[source]
List incoming syncs for a specific site.
- get(key=None, *, name=None, site_key=None, site_name=None, fields=None)[source]
Get an incoming sync by key or name.
- Parameters:
- Returns:
SiteSyncIncoming object.
- Raises:
NotFoundError – If sync not found.
ValueError – If neither key nor name provided.
- Return type:
- enable(key)[source]
Enable an incoming sync.
- Parameters:
key (int) – Sync $key (ID).
- Returns:
Updated SiteSyncIncoming object.
- Return type:
- class pyvergeos.resources.site_syncs.SiteSyncScheduleManager[source]
Bases:
ResourceManager[SiteSyncSchedule]Manager for site sync schedule operations.
Schedules link snapshot profile periods to outgoing syncs, enabling automatic syncing of snapshots taken by those periods.
Example
>>> # List all schedules >>> schedules = client.site_sync_schedules.list()
>>> # Get schedules for a specific sync >>> schedules = client.site_sync_schedules.list(sync_key=1)
>>> # Create a new schedule >>> schedule = client.site_sync_schedules.create( ... sync_key=1, ... profile_period_key=2, ... retention=604800, # 7 days ... )
>>> # Delete a schedule >>> client.site_sync_schedules.delete(schedule.key)
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, sync_key=None, sync_name=None, **filter_kwargs)[source]
List site sync schedules.
- Parameters:
- Returns:
List of SiteSyncSchedule objects sorted by priority.
- Return type:
Example
>>> # All schedules >>> schedules = client.site_sync_schedules.list()
>>> # Schedules for a specific sync >>> schedules = client.site_sync_schedules.list(sync_key=1)
- list_for_sync(sync_key=None, sync_name=None, fields=None)[source]
List schedules for a specific outgoing sync.
- get(key, *, fields=None)[source]
Get a schedule by key.
- Parameters:
- Returns:
SiteSyncSchedule object.
- Raises:
NotFoundError – If schedule not found.
- Return type:
- create(sync_key, profile_period_key, retention, *, priority=None, do_not_expire=False, destination_prefix='remote')[source]
Create a new site sync schedule.
Links a snapshot profile period to an outgoing sync so that snapshots taken by that period are automatically queued for sync.
- Parameters:
sync_key (int) – Key of the outgoing sync.
profile_period_key (int) – Key of the snapshot profile period.
retention (int | timedelta) – Retention period in seconds or timedelta.
priority (int | None) – Sync priority (lower = first). Auto-assigned if not specified.
do_not_expire (bool) – If True, source snapshot won’t expire until synced.
destination_prefix (str) – Prefix for snapshot name on destination.
- Returns:
Created SiteSyncSchedule object.
- Raises:
ValidationError – If invalid parameters.
- Return type:
Example
>>> schedule = client.site_sync_schedules.create( ... sync_key=1, ... profile_period_key=2, ... retention=timedelta(days=7), ... destination_prefix="remote", ... )
- delete(key)[source]
Delete a site sync schedule.
- Parameters:
key (int) – Schedule $key (ID).
- Raises:
NotFoundError – If schedule not found.
- Return type:
None
- class pyvergeos.resources.site_syncs.SiteSyncStats[source]
Bases:
ResourceObjectSite sync statistics resource object.
Provides performance metrics for a site sync operation.
- Properties:
parent_key: Key of the parent sync. checked_bytes: Total bytes checked (file-level, pre-deduplication). scanned_bytes: Total bytes scanned (block comparison). sent_bytes: Bytes determined to need sending (pre-compression). sent_net_bytes: Actual bytes sent on wire (post-compression). dirs_checked: Number of directories checked. files_checked: Number of files checked. files_updated: Number of files updated. last_run_time_ms: Last run time in milliseconds. started_at: When sync started. stopped_at: When sync stopped. error_at: When error occurred. last_error: Last error message. send_throttle: Current throttle rate in bytes/sec. retry_count: Number of retry attempts. snapshot_name: Name of snapshot being synced. last_retry_at: When last retry occurred.
- class pyvergeos.resources.site_syncs.SiteSyncStatsHistory[source]
Bases:
ResourceObjectSite sync stats history entry.
Long-term historical metrics for sync operations.
- class pyvergeos.resources.site_syncs.SiteSyncStatsManager[source]
Bases:
objectManager for site sync stats (scoped to a sync).
Example
>>> sync = client.site_syncs.get(1) >>> stats = sync.stats.get() >>> print(f"Checked: {stats.checked_display}")
>>> # Get historical stats >>> history = sync.stats.history() >>> for entry in history: ... print(f"{entry.snapshot_name}: {entry.sent_bytes} bytes")
- __init__(client, sync_key)[source]
- Parameters:
client (VergeClient)
sync_key (int)
- Return type:
None
- get(fields=None)[source]
Get current stats for this sync.
- Parameters:
- Returns:
SiteSyncStats object or None if no stats available.
- Return type:
SiteSyncStats | None
- class pyvergeos.resources.site_syncs.SiteSyncQueueItem[source]
Bases:
ResourceObjectSite sync queue item resource object.
Represents a cloud snapshot queued for sync to a remote site.
- Properties:
sync_key: Key of the parent outgoing sync. cloud_snapshot_key: Key of the cloud snapshot. priority: Sync priority (lower = first). status: Queue status (queue, paused, syncing, complete, error, retry). retention: Retention period in seconds. remote_expiration_at: When snapshot will expire on remote. destination_prefix: Prefix for snapshot name on remote. created_at: When item was queued. do_not_expire: Whether snapshot should not expire until synced.
- property status: str
Get queue status.
Values: queue, paused, syncing, complete, error, retry, initializing, skip_retention.
- get_stats()[source]
Get stats for this queue item.
- Returns:
SiteSyncStats object or None if no stats available.
- Return type:
SiteSyncStats | None
- class pyvergeos.resources.site_syncs.SiteSyncQueueManager[source]
Bases:
objectManager for site sync queue (scoped to an outgoing sync).
Example
>>> sync = client.site_syncs.get(1) >>> # List queued items >>> items = sync.queue.list() >>> for item in items: ... print(f"{item.key}: {item.status} (priority {item.priority})")
>>> # Get items currently syncing >>> syncing = sync.queue.list_syncing()
>>> # Get items with errors >>> errors = sync.queue.list_errors()
- __init__(client, sync_key)[source]
- Parameters:
client (VergeClient)
sync_key (int)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, status=None, **filter_kwargs)[source]
List queue items for this sync.
- Parameters:
- Returns:
List of SiteSyncQueueItem objects sorted by priority.
- Return type:
- list_queued(fields=None)[source]
List items waiting to sync.
- Parameters:
- Returns:
List of queued SiteSyncQueueItem objects.
- Return type:
- list_syncing(fields=None)[source]
List items currently syncing.
- Parameters:
- Returns:
List of syncing SiteSyncQueueItem objects.
- Return type:
- list_complete(limit=20, fields=None)[source]
List completed items.
- Parameters:
- Returns:
List of completed SiteSyncQueueItem objects.
- Return type:
- list_errors(fields=None)[source]
List items with errors.
- Parameters:
- Returns:
List of error/retry SiteSyncQueueItem objects.
- Return type:
- get(key, fields=None)[source]
Get a queue item by key.
- Parameters:
- Returns:
SiteSyncQueueItem object.
- Raises:
NotFoundError – If item not found.
- Return type:
- delete(key)[source]
Remove an item from the queue.
- Parameters:
key (int) – Queue item $key (ID).
- Return type:
None
- class pyvergeos.resources.site_syncs.SiteSyncRemoteSnap[source]
Bases:
ResourceObjectRemote snapshot on destination site.
Represents a cloud snapshot that has been synced to the remote site.
- Properties:
sync_key: Key of the parent outgoing sync. name: Snapshot name on remote. status: Status (offline, requesting, downloading, error). status_info: Additional status information. remote_key: Key of snapshot on remote system. created_at: When snapshot was created. description: Snapshot description. expires_at: When snapshot expires on remote.
- class pyvergeos.resources.site_syncs.SiteSyncRemoteSnapManager[source]
Bases:
objectManager for remote snapshots (scoped to an outgoing sync).
Example
>>> sync = client.site_syncs.get(1) >>> # Refresh list of remote snapshots >>> sync.refresh_remote_snapshots()
>>> # List remote snapshots >>> snaps = sync.remote_snapshots.list() >>> for snap in snaps: ... print(f"{snap.name}: expires {snap.expires_at}")
>>> # Request a snapshot to be synced back >>> snap = snaps[0] >>> snap.request_sync_back()
- __init__(client, sync_key)[source]
- Parameters:
client (VergeClient)
sync_key (int)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List remote snapshots.
- Parameters:
- Returns:
List of SiteSyncRemoteSnap objects sorted by expiration.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a remote snapshot by key or name.
- Parameters:
- Returns:
SiteSyncRemoteSnap object.
- Raises:
NotFoundError – If not found.
ValueError – If neither key nor name provided.
- Return type:
- request_sync_back(key)[source]
Request a remote snapshot to be synced back.
- Parameters:
key (int) – Remote snapshot $key (ID).
- Return type:
None
- class pyvergeos.resources.site_syncs.SiteSyncIncomingVerified[source]
Bases:
ResourceObjectVerified incoming sync resource object.
Represents a verified/registered incoming sync connection.
- Properties:
incoming_sync_key: Key of the parent incoming sync. name: Name (from parent sync). is_registered: Whether sync is registered. registered_at: When sync was registered.
- class pyvergeos.resources.site_syncs.SiteSyncIncomingVerifiedManager[source]
Bases:
objectManager for verified incoming syncs (scoped to an incoming sync).
Example
>>> incoming = client.site_syncs_incoming.get(1) >>> verified = incoming.verified.get() >>> print(f"Registered: {verified.is_registered}")
>>> # List snapshots available on sender >>> snaps = verified.list_remote_snapshots()
>>> # Request a snapshot to sync back >>> verified.request_snapshot("cloud-snap-2024-01-01", retention=604800)
- __init__(client, incoming_sync_key)[source]
- Parameters:
client (VergeClient)
incoming_sync_key (int)
- Return type:
None
- get(fields=None)[source]
Get the verified sync entry for this incoming sync.
- Parameters:
- Returns:
SiteSyncIncomingVerified object or None.
- Return type:
SiteSyncIncomingVerified | None
- list_remote_snapshots(verified_key)[source]
Request list of snapshots available on the remote sender.
- class pyvergeos.resources.site_syncs.SiteSyncLog[source]
Bases:
ResourceObjectSite sync log entry.
- Properties:
level: Log level (audit, message, warning, error, critical). level_display: Human-readable level name. text: Log message text. timestamp_us: Timestamp in microseconds. logged_at: Datetime when logged. user: User who triggered the log (if applicable).
- class pyvergeos.resources.site_syncs.SiteSyncOutgoingLogManager[source]
Bases:
objectManager for outgoing sync logs (scoped to an outgoing sync).
Example
>>> sync = client.site_syncs.get(1) >>> logs = sync.logs.list(limit=20) >>> for log in logs: ... print(f"[{log.level}] {log.text}")
>>> # Get only errors >>> errors = sync.logs.list_errors()
- __init__(client, sync_key)[source]
- Parameters:
client (VergeClient)
sync_key (int)
- Return type:
None
- list(filter=None, fields=None, limit=100, offset=None, *, level=None, **filter_kwargs)[source]
List logs for this sync.
- Parameters:
- Returns:
List of SiteSyncLog objects, newest first.
- Return type:
- class pyvergeos.resources.site_syncs.SiteSyncIncomingLogManager[source]
Bases:
objectManager for incoming sync logs (scoped to an incoming sync).
Example
>>> incoming = client.site_syncs_incoming.get(1) >>> logs = incoming.logs.list(limit=20) >>> for log in logs: ... print(f"[{log.level}] {log.text}")
>>> # Get only errors >>> errors = incoming.logs.list_errors()
- __init__(client, sync_key)[source]
- Parameters:
client (VergeClient)
sync_key (int)
- Return type:
None
- list(filter=None, fields=None, limit=100, offset=None, *, level=None, **filter_kwargs)[source]
List logs for this sync.
- Parameters:
- Returns:
List of SiteSyncLog objects, newest first.
- Return type:
Organization
Resource Groups
Resource group management for VergeOS hardware device pools.
- class pyvergeos.resources.resource_groups.ResourceGroup[source]
Bases:
ResourceObjectRepresents a resource group in VergeOS.
Resource groups define collections of hardware devices (GPU, PCI, USB, SR-IOV NIC, vGPU) that can be assigned to virtual machines for device passthrough.
Resource groups are read-only - they are typically configured through the VergeOS UI to associate physical devices with virtual machines.
Note
Resource groups use UUID as their primary key, not integer IDs. The key property returns the UUID string.
- property device_type: str
Device type (raw API value).
One of: node_pci_devices, node_sriov_nic_devices, node_usb_devices, node_host_gpu_devices, node_nvidia_vgpu_devices
- property device_type_display: str
Human-readable device type.
One of: PCI, SR-IOV NIC, USB, Host GPU, NVIDIA vGPU
- property device_class: str
Device class (raw API value).
One of: gpu, vgpu, storage, hid, usb, network, media, audio, fpga, pci, unknown
- property device_class_display: str
Human-readable device class.
One of: GPU, vGPU, Storage, Human Input Device, Generic USB Device, Network, Media, Audio, FPGA, Generic PCI, Unknown
- property rules: ResourceRuleManager
Access resource rules for this resource group.
- Returns:
ResourceRuleManager scoped to this resource group.
Example
>>> # List rules for this group >>> for rule in group.rules.list(): ... print(f"{rule.name}: {rule.filter_expression}")
>>> # Create a rule >>> rule = group.rules.create( ... name="Intel NICs", ... filter_expression="vendor ct 'Intel'", ... )
- class pyvergeos.resources.resource_groups.ResourceGroupManager[source]
Bases:
ResourceManager[ResourceGroup]Manages resource groups in VergeOS.
Resource groups define collections of hardware devices (GPU, PCI, USB, SR-IOV NIC, vGPU) that can be assigned to VMs for device passthrough.
- Device Types:
PCI: General PCI passthrough (network cards, storage controllers, etc.)
SR-IOV NIC: SR-IOV enabled NICs for direct network virtualization
USB: USB device passthrough
Host GPU: Full GPU passthrough to a single VM
NVIDIA vGPU: NVIDIA vGPU for GPU sharing across multiple VMs
- Device Classes:
GPU, vGPU, Storage, Human Input Device, Generic USB Device, Network, Media, Audio, FPGA, Generic PCI, Unknown
Example
>>> # List all resource groups >>> for rg in client.resource_groups.list(): ... print(f"{rg.name}: {rg.device_type_display} ({rg.device_class_display})")
>>> # Get a specific resource group >>> gpu_group = client.resource_groups.get(name="GPU Pool") >>> print(f"Devices: {gpu_group.resource_count}")
>>> # Filter by device type >>> gpu_groups = client.resource_groups.list_by_type("Host GPU") >>> pci_groups = client.resource_groups.list_by_type("PCI")
>>> # Filter by device class >>> network_groups = client.resource_groups.list_by_class("Network")
>>> # List enabled groups only >>> enabled_groups = client.resource_groups.list_enabled()
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List resource groups with optional filtering.
- Parameters:
- Returns:
List of ResourceGroup objects.
- Return type:
Example
>>> # List all resource groups >>> groups = client.resource_groups.list()
>>> # Filter by enabled status >>> enabled = client.resource_groups.list(enabled=True)
>>> # Filter with OData >>> gpu_groups = client.resource_groups.list( ... filter="class eq 'gpu' and enabled eq true" ... )
- get(key=None, *, name=None, uuid=None, fields=None)[source]
Get a resource group by key (UUID), name, or UUID.
- Parameters:
- Returns:
ResourceGroup object.
- Raises:
NotFoundError – If resource group not found.
ValueError – If no identifier provided.
- Return type:
Example
>>> # Get by UUID key >>> rg = client.resource_groups.get("12345678-1234-1234-1234-123456789abc")
>>> # Get by name >>> rg = client.resource_groups.get(name="GPU Pool")
>>> # Get by uuid parameter (same as key) >>> rg = client.resource_groups.get(uuid="12345678-1234-1234-1234-123456789abc")
- list_enabled(fields=None)[source]
List enabled resource groups.
- Parameters:
- Returns:
List of enabled ResourceGroup objects.
- Return type:
Example
>>> enabled_groups = client.resource_groups.list_enabled() >>> for rg in enabled_groups: ... print(f"{rg.name}: {rg.device_type_display}")
- list_disabled(fields=None)[source]
List disabled resource groups.
- Parameters:
- Returns:
List of disabled ResourceGroup objects.
- Return type:
- list_by_type(device_type, *, enabled=None, fields=None)[source]
List resource groups by device type.
- Parameters:
- Returns:
List of ResourceGroup objects matching the device type.
- Return type:
Example
>>> # List all Host GPU resource groups >>> gpu_groups = client.resource_groups.list_by_type("Host GPU")
>>> # List enabled PCI resource groups >>> pci_groups = client.resource_groups.list_by_type("PCI", enabled=True)
>>> # Use API value >>> usb_groups = client.resource_groups.list_by_type("node_usb_devices")
- list_by_class(device_class, *, enabled=None, fields=None)[source]
List resource groups by device class.
- Parameters:
- Returns:
List of ResourceGroup objects matching the device class.
- Return type:
Example
>>> # List all GPU class resource groups >>> gpu_groups = client.resource_groups.list_by_class("GPU")
>>> # List enabled Network resource groups >>> net_groups = client.resource_groups.list_by_class("Network", enabled=True)
>>> # List storage device groups >>> storage_groups = client.resource_groups.list_by_class("Storage")
- create(name, device_type, *, description='', device_class='unknown', enabled=True, settings=None, device_keys=None)[source]
Create a new resource group.
- Parameters:
name (str) – Resource group name.
device_type (Literal['node_pci_devices', 'node_sriov_nic_devices', 'node_usb_devices', 'node_host_gpu_devices', 'node_nvidia_vgpu_devices']) – Type of devices in this group.
description (str) – Resource group description.
device_class (str) – Device classification for UI icon.
enabled (bool) – Whether the resource group is enabled.
settings (dict[str, Any] | None) – Type-specific settings (see create_* methods for details).
device_keys (list[int] | None) – List of device keys to auto-create rules from.
- Returns:
Created ResourceGroup object.
- Return type:
Example
>>> # Create a PCI device group >>> group = client.resource_groups.create( ... name="GPU Pool", ... device_type="node_host_gpu_devices", ... device_class="gpu", ... )
- create_nvidia_vgpu(name, driver_file, *, nvidia_vgpu_profile=None, make_guest_driver_iso=False, driver_iso=None, scheduler_policy='1', strict_round_robin='', frequency=0, averaging_factor=33, time_slice_length_ns=0, description='', enabled=True, device_keys=None)[source]
Create an NVIDIA vGPU resource group.
- Parameters:
name (str) – Resource group name.
driver_file (int) – File key for the NVIDIA vGPU driver bundle.
nvidia_vgpu_profile (int | None) – vGPU profile key to use.
make_guest_driver_iso (bool) – Auto-create guest driver ISO from bundle.
driver_iso (int | None) – Pre-existing guest driver ISO file key.
scheduler_policy (Literal['1', '2', '3']) – vGPU scheduler policy (1=Best Effort, 2=Equal Share, 3=Fixed Share).
strict_round_robin (Literal['', '0', '1']) – Enable strict round robin (“”, “0”, “1”).
frequency (int) – Scheduler frequency (0-960).
averaging_factor (int) – Averaging factor (1-60, default 33).
time_slice_length_ns (int) – Time slice length in nanoseconds (0-30000000).
description (str) – Resource group description.
enabled (bool) – Whether the resource group is enabled.
device_keys (list[int] | None) – List of PCI device keys to auto-create rules from.
- Returns:
Created ResourceGroup object.
- Return type:
Example
>>> group = client.resource_groups.create_nvidia_vgpu( ... name="vGPU A100 Pool", ... driver_file=driver.key, ... nvidia_vgpu_profile=profile.key, ... make_guest_driver_iso=True, ... )
- create_usb(name, *, allow_guest_reset=True, allow_guest_reset_all=False, device_class='usb', description='', enabled=True, device_keys=None)[source]
Create a USB device resource group.
- Parameters:
name (str) – Resource group name.
allow_guest_reset (bool) – Allow VM to reset the USB device.
allow_guest_reset_all (bool) – Allow VM to reset the USB hub.
device_class (str) – Device classification for UI icon.
description (str) – Resource group description.
enabled (bool) – Whether the resource group is enabled.
device_keys (list[int] | None) – List of USB device keys to auto-create rules from.
- Returns:
Created ResourceGroup object.
- Return type:
Example
>>> group = client.resource_groups.create_usb( ... name="USB License Keys", ... device_class="hid", ... device_keys=[usb_device.key], ... )
- create_sriov_nic(name, *, vf_count=1, native_vlan=0, vlan_qos=0, vlan_protocol='802.1Q', max_tx_rate=0, min_tx_rate=0, trust='off', spoof_checking='on', query_rss='default', virtual_link_state='default', mac_allow_override=True, vlan_allow_override=False, qos_allow_override=False, proto_allow_override=False, max_tx_rate_allow_override=False, min_tx_rate_allow_override=False, trust_allow_override=False, spoofchk_allow_override=False, query_rss_allow_override=False, state_allow_override=False, description='', enabled=True, device_keys=None)[source]
Create an SR-IOV NIC resource group.
- Parameters:
name (str) – Resource group name.
vf_count (int) – Number of VFs to create per physical device.
native_vlan (int) – Default VLAN tag (0 disables VLAN tagging).
vlan_qos (int) – VLAN QOS priority (0-7).
vlan_protocol (Literal['802.1Q', '802.1ad']) – VLAN protocol (802.1Q or 802.1ad for QinQ).
max_tx_rate (int) – Maximum transmit bandwidth in Mbps (0 disables).
min_tx_rate (int) – Minimum transmit bandwidth in Mbps (0 disables).
trust (Literal['default', 'on', 'off']) – Enable VF trust mode for special features.
spoof_checking (Literal['default', 'on', 'off']) – Enable MAC spoof checking.
query_rss (Literal['default', 'on', 'off']) – Allow querying RSS configuration.
virtual_link_state (Literal['default', 'auto', 'enable', 'disable']) – Virtual link state (auto mirrors PF state).
mac_allow_override (bool) – Allow VMs to override MAC address.
vlan_allow_override (bool) – Allow VMs to override VLAN.
qos_allow_override (bool) – Allow VMs to override QOS.
proto_allow_override (bool) – Allow VMs to override protocol.
max_tx_rate_allow_override (bool) – Allow VMs to override max TX rate.
min_tx_rate_allow_override (bool) – Allow VMs to override min TX rate.
trust_allow_override (bool) – Allow VMs to override trust.
spoofchk_allow_override (bool) – Allow VMs to override spoof checking.
query_rss_allow_override (bool) – Allow VMs to override query RSS.
state_allow_override (bool) – Allow VMs to override link state.
description (str) – Resource group description.
enabled (bool) – Whether the resource group is enabled.
device_keys (list[int] | None) – List of PCI device keys to auto-create rules from.
- Returns:
Created ResourceGroup object.
- Return type:
Example
>>> group = client.resource_groups.create_sriov_nic( ... name="SR-IOV NIC Pool", ... vf_count=8, ... native_vlan=100, ... device_keys=[pci_device.key], ... )
- create_pci(name, *, device_class='pci', description='', enabled=True, device_keys=None)[source]
Create a PCI passthrough resource group.
- Parameters:
name (str) – Resource group name.
device_class (str) – Device classification for UI icon (gpu, storage, network, pci, etc.).
description (str) – Resource group description.
enabled (bool) – Whether the resource group is enabled.
device_keys (list[int] | None) – List of PCI device keys to auto-create rules from.
- Returns:
Created ResourceGroup object.
- Return type:
Example
>>> group = client.resource_groups.create_pci( ... name="NVMe Controllers", ... device_class="storage", ... device_keys=[pci_device.key], ... )
- create_host_gpu(name, *, description='', enabled=True, device_keys=None)[source]
Create a host GPU passthrough resource group.
- Parameters:
- Returns:
Created ResourceGroup object.
- Return type:
Example
>>> group = client.resource_groups.create_host_gpu( ... name="GPU Passthrough Pool", ... device_keys=[gpu_device.key], ... )
- update(key, **kwargs)[source]
Update a resource group.
- Parameters:
- Returns:
Updated ResourceGroup object.
- Return type:
Example
>>> group = client.resource_groups.update( ... group.key, ... name="Renamed Pool", ... enabled=False, ... )
- delete(key)[source]
Delete a resource group.
- Parameters:
key (str) – Resource group UUID.
- Raises:
ConflictError – If there are machine devices using this group.
- Return type:
None
Note
All machine devices using this resource group must be removed first.
- property rules: ResourceRuleManager
Access resource rules globally (unscoped).
- Returns:
ResourceRuleManager for all resource rules.
Example
>>> # List all resource rules >>> rules = client.resource_groups.rules.list()
- class pyvergeos.resources.resource_groups.ResourceRule[source]
Bases:
ResourceObjectResource rule that defines which devices belong to a resource group.
Resource rules use filter expressions to match devices by attributes such as vendor, slot, serial number, etc.
- class pyvergeos.resources.resource_groups.ResourceRuleManager[source]
Bases:
ResourceManager[ResourceRule]Manages resource rules for device passthrough.
Resource rules define which physical devices belong to a resource group using filter expressions that match device attributes.
Example
>>> # List all rules for a resource group >>> rules = resource_group.rules.list()
>>> # Create a rule matching devices by vendor >>> rule = resource_group.rules.create( ... name="Intel NICs", ... filter="vendor ct 'Intel'", ... )
>>> # Create a rule for a specific PCI slot >>> rule = resource_group.rules.create( ... name="GPU in slot 3", ... filter="slot eq '03:00.0'", ... node=node.key, ... )
- __init__(client, resource_group_key=None)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, node_key=None, enabled_only=False, **filter_kwargs)[source]
List resource rules.
- Parameters:
- Returns:
List of ResourceRule objects.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a resource rule by key or name.
- Parameters:
- Returns:
ResourceRule object.
- Raises:
NotFoundError – If rule not found.
ValueError – If no identifier provided.
- Return type:
- create(name, filter_expression, *, node=None, enabled=True, auto_create_from_device=None)[source]
Create a new resource rule.
- Parameters:
name (str) – Rule name.
filter_expression (str) – OData-style filter for matching devices. Examples: “vendor ct ‘Intel’”, “slot eq ‘03:00.0’”, “vendor_device_hex eq ‘8086:8c31’”
node (int | None) – Restrict to a specific node (None = all nodes).
enabled (bool) – Whether the rule is enabled.
auto_create_from_device (int | None) – Device key to auto-generate filter from.
- Returns:
Created ResourceRule object.
- Raises:
ValueError – If not scoped to a resource group.
- Return type:
Example
>>> rule = group.rules.create( ... name="Intel X710 NICs", ... filter_expression="vendor ct 'Intel' and device ct 'X710'", ... )
Cloud-Init Files
Cloud-init file resource manager for VM provisioning automation.
- class pyvergeos.resources.cloudinit_files.CloudInitFile[source]
Bases:
ResourceObjectCloud-init file resource object.
Represents a cloud-init configuration file in VergeOS used for VM provisioning automation. Cloud-init files provide user-data, meta-data, network-config, and other configuration to VMs during boot.
- Properties:
name: File name (typically /user-data, /meta-data, /network-config). owner: Owner reference (e.g., “vms/123”). vm_key: Key of the VM this file belongs to. render: Render type (API value: no, variables, jinja2). render_display: Friendly render type name. contains_variables: Whether file contains VergeOS variables. filesize: Size of file contents in bytes. allocated_bytes: Allocated storage size. used_bytes: Used storage size on disk. creator: Username who created the file. modified_at: Datetime when file was last modified. contents: File contents (if loaded).
- property contents: str | None
Get file contents from the raw API response.
Note: The VergeOS API does not return file contents in standard GET responses. This property will typically return None. To retrieve actual file contents, use the get_content() method which fetches from the download endpoint.
Example
>>> file = client.cloudinit_files.get(key=123) >>> file.contents # Usually None >>> content = file.get_content() # Actual content
- class pyvergeos.resources.cloudinit_files.CloudInitFileManager[source]
Bases:
ResourceManager[CloudInitFile]Manager for cloud-init file operations.
Provides CRUD operations for cloud-init files used in VM provisioning. Cloud-init files are associated with specific VMs and provide configuration for automated VM setup during boot.
Example
>>> # List cloud-init files for a VM >>> files = client.cloudinit_files.list(vm_key=123) >>> >>> # Create a user-data file >>> user_data = '''#cloud-config ... users: ... - name: admin ... sudo: ALL=(ALL) NOPASSWD:ALL ... ''' >>> file = client.cloudinit_files.create( ... vm_key=123, ... name="/user-data", ... contents=user_data, ... render="No" ... ) >>> >>> # Get file contents >>> content = file.get_content() >>> >>> # Update file >>> file = client.cloudinit_files.update(file.key, render="Variables") >>> >>> # Delete file >>> client.cloudinit_files.delete(file.key)
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, vm_key=None, name=None, render=None, **filter_kwargs)[source]
List cloud-init files with optional filtering.
Note: File contents are not returned in list operations. Use get_content() to retrieve actual file contents.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
vm_key (int | None) – Filter by VM $key.
name (str | None) – Filter by file name (exact match or wildcard
*).render (str | None) – Filter by render type (No, Variables, Jinja2).
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of CloudInitFile objects.
- Return type:
- get(key=None, *, name=None, vm_key=None, fields=None)[source]
Get a cloud-init file by key or name.
Note: File contents are not returned in GET operations. Use get_content() to retrieve actual file contents.
- Parameters:
- Returns:
CloudInitFile object.
- Raises:
NotFoundError – If file not found.
ValueError – If neither key nor (name + vm_key) provided.
- Return type:
- create(vm_key, name, *, contents=None, render='No')[source]
Create a new cloud-init file.
- Parameters:
vm_key (int) – VM $key (ID) to attach the file to.
name (str) – File name (typically /user-data, /meta-data, /network-config). Maximum 256 characters.
contents (str | None) – File contents. Maximum 64KB.
render (str) – Render type for variable processing: - No: File is used as-is without processing (default). - Variables: File supports VergeOS variable substitution. - Jinja2: File is processed as a Jinja2 template.
- Returns:
Created CloudInitFile object.
- Raises:
ValidationError – If parameters invalid or contents too large.
ConflictError – If file with same name already exists for VM.
- Return type:
- update(key, *, name=None, contents=None, render=None)[source]
Update a cloud-init file.
- Parameters:
- Returns:
Updated CloudInitFile object.
- Raises:
NotFoundError – If file not found.
ValidationError – If parameters invalid.
- Return type:
- delete(key)[source]
Delete a cloud-init file.
- Parameters:
key (int) – CloudInitFile $key (ID).
- Raises:
NotFoundError – If file not found.
- Return type:
None
- get_content(key, *, as_bytes=False)[source]
Retrieve the raw contents of a cloud-init file.
This method downloads the file contents directly from the API, which is useful when you need the exact file content without any metadata.
- Parameters:
- Returns:
File contents as string (default) or bytes.
- Raises:
NotFoundError – If file not found.
- Return type:
- list_for_vm(vm_key)[source]
List all cloud-init files for a specific VM.
Convenience method that filters by VM key.
Note: File contents are not returned. Use get_content() to retrieve actual file contents for individual files.
- Parameters:
vm_key (int) – VM $key (ID).
- Returns:
List of CloudInitFile objects for the VM.
- Return type:
- class pyvergeos.resources.cloudinit_files.VMCloudInitFileManager[source]
Bases:
CloudInitFileManagerManager for cloud-init files scoped to a specific VM.
This manager is accessed through a VM object’s cloudinit_files property and automatically filters operations to that VM.
Example
>>> vm = client.vms.get(name="my-vm") >>> # List cloud-init files for this VM >>> files = vm.cloudinit_files.list() >>> # Create user-data file >>> vm.cloudinit_files.create(name="/user-data", contents="...", render="No")
- __init__(client, vm)[source]
- Parameters:
client (VergeClient)
vm (VM)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, name=None, render=None, **filter_kwargs)[source]
List cloud-init files for this VM.
- Parameters:
filter (str | None) – OData filter string.
limit (int | None) – Maximum number of results.
offset (int | None) – Skip this many results.
name (str | None) – Filter by file name (exact match or wildcard
*).render (str | None) – Filter by render type (No, Variables, Jinja2).
**filter_kwargs (Any) – Additional filter arguments.
- Returns:
List of CloudInitFile objects for this VM.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a cloud-init file by key or name for this VM.
- Parameters:
- Returns:
CloudInitFile object.
- Raises:
NotFoundError – If file not found.
ValueError – If neither key nor name provided.
- Return type:
- create(name, *, contents=None, render='No')[source]
Create a cloud-init file for this VM.
- Parameters:
- Returns:
Created CloudInitFile object.
- Raises:
ValidationError – If parameters invalid.
- Return type:
Example
>>> vm = client.vms.get(name="my-vm") >>> # Create user-data with cloud-config >>> vm.cloudinit_files.create( ... name="/user-data", ... contents="#cloud-config\nusers:\n - name: admin\n", ... render="No" ... )
Files
File management for VergeOS media catalog.
- class pyvergeos.resources.files.File[source]
Bases:
ResourceObjectRepresents a file in the VergeOS media catalog.
Files can be ISO images for mounting to VM drives, disk images for import, OVA/OVF packages, or other media types.
- class pyvergeos.resources.files.FileManager[source]
Bases:
ResourceManager[File]Manages files in the VergeOS media catalog.
Files in the media catalog can be used as: - ISO images for VM CD-ROM drives - Disk images for VM drive import - OVA/OVF packages for VM import
Example
>>> files = client.files.list(file_type="iso") >>> for f in files: ... print(f"{f.name}: {f.size_gb} GB")
>>> # Upload a file >>> uploaded = client.files.upload("/path/to/image.iso", tier=1)
>>> # Download a file >>> client.files.download(name="ubuntu.iso", destination="/tmp/")
- list(filter=None, fields=None, limit=None, offset=None, file_type=None, **filter_kwargs)[source]
List files in the media catalog.
- Parameters:
- Returns:
List of File objects.
- Return type:
Example
>>> # List all ISO files >>> isos = client.files.list(file_type="iso")
>>> # List importable disk images >>> images = client.files.list(file_type=["ova", "ovf", "vmdk", "qcow2"])
- get(key=None, *, name=None, fields=None)[source]
Get a file by key or name.
- Parameters:
- Returns:
File object.
- Raises:
NotFoundError – If file not found.
ValueError – If neither key nor name provided.
- Return type:
- upload(path, name=None, description=None, tier=None, progress_callback=None)[source]
Upload a file to the media catalog.
- Parameters:
- Returns:
Uploaded File object.
- Raises:
FileNotFoundError – If local file doesn’t exist.
ValidationError – If upload fails.
- Return type:
Example
>>> def show_progress(uploaded, total): ... pct = (uploaded / total) * 100 ... print(f"\rUploading: {pct:.1f}%", end="") >>> client.files.upload("/path/to/image.iso", tier=1, progress_callback=show_progress)
- download(key=None, *, name=None, destination='.', filename=None, overwrite=False, progress_callback=None)[source]
Download a file from the media catalog.
- Parameters:
key (int | None) – File $key (ID).
name (str | None) – File name (alternative to key).
destination (str | Path) – Directory or full path for downloaded file.
filename (str | None) – Override the filename (defaults to file’s name).
overwrite (bool) – Whether to overwrite existing files.
progress_callback (Callable[[int, int], None] | None) – Optional callback(bytes_downloaded, total_bytes).
- Returns:
Path to the downloaded file.
- Raises:
NotFoundError – If file not found.
FileExistsError – If destination exists and overwrite=False.
ValueError – If neither key nor name provided.
- Return type:
Example
>>> path = client.files.download(name="ubuntu.iso", destination="/tmp/") >>> print(f"Downloaded to: {path}")
- delete(key)[source]
Delete a file from the media catalog.
- Parameters:
key (int) – File $key (ID).
- Raises:
NotFoundError – If file not found.
ValidationError – If file is in use by VM drives.
- Return type:
None
Note
Files that are referenced by VM drives cannot be deleted until the references are removed.
Webhooks
Webhook resource manager for VergeOS notification integrations.
- class pyvergeos.resources.webhooks.Webhook[source]
Bases:
ResourceObjectWebhook URL configuration resource object.
Represents a webhook URL configuration in VergeOS that can receive notifications when events occur.
- Properties:
name: Webhook name (unique identifier). webhook_type: Webhook type (currently only ‘custom’). url: Destination URL for webhook payloads. headers: Dict of custom HTTP headers. headers_raw: Raw header string in “Name:Value” format. authorization_type: Auth method (none, basic, bearer, apikey). authorization_type_display: Friendly auth type name. is_insecure: True if insecure SSL connections are allowed. timeout: Request timeout in seconds (3-120). retries: Number of retry attempts (0-100).
- class pyvergeos.resources.webhooks.WebhookHistory[source]
Bases:
ResourceObjectWebhook execution history resource object.
Represents a webhook message delivery attempt and its status.
- Properties:
webhook_key: Key of the parent webhook URL. status: Delivery status (API value). status_display: Friendly status name. status_info: Additional status/error information. message: Parsed message payload (if JSON). message_raw: Raw message string. is_pending: True if message is queued or running. is_sent: True if message was successfully sent. has_error: True if delivery failed. last_attempt_at: Datetime of last delivery attempt. created_at: Datetime when message was queued.
- class pyvergeos.resources.webhooks.WebhookManager[source]
Bases:
ResourceManager[Webhook]Manager for webhook URL configurations.
Provides CRUD operations for webhook URL configurations and methods to send test messages and view delivery history.
Example
>>> # List all webhooks >>> webhooks = client.webhooks.list() >>> >>> # Create a webhook >>> webhook = client.webhooks.create( ... name="slack-alerts", ... url="https://hooks.slack.com/services/xxx", ... authorization_type="none" ... ) >>> >>> # Send a test message >>> client.webhooks.send(webhook.key, message='{"text": "Hello!"}') >>> >>> # View delivery history >>> history = client.webhooks.history(webhook_key=webhook.key)
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, *, authorization_type=None, **filter_kwargs)[source]
List webhooks with optional filtering.
- Parameters:
- Returns:
List of Webhook objects.
- Return type:
- get(key=None, *, name=None, fields=None)[source]
Get a webhook by key or name.
- Parameters:
- Returns:
Webhook object.
- Raises:
NotFoundError – If webhook not found.
ValueError – If neither key nor name provided.
- Return type:
- create(name, url, *, headers=None, authorization_type='None', authorization_value=None, allow_insecure=False, timeout=None, retries=None)[source]
Create a new webhook URL configuration.
- Parameters:
name (str) – Webhook name (unique).
url (str) – Destination URL (must start with http:// or https://).
headers (dict[str, str] | str | None) – Custom HTTP headers as dict or “Name:Value” string.
authorization_type (str) – Auth method (None, Basic, Bearer, ApiKey).
authorization_value (str | None) – Auth credential value. - Basic: “username:password” (will be base64 encoded) - Bearer: token value - ApiKey: key value
allow_insecure (bool) – Allow insecure SSL connections.
timeout (int | None) – Request timeout in seconds (3-120, default 5).
retries (int | None) – Number of retry attempts (0-100, default 3).
- Returns:
Created Webhook object.
- Raises:
ValidationError – If parameters invalid.
ConflictError – If webhook with name already exists.
- Return type:
- update(key, *, name=None, url=None, headers=None, authorization_type=None, authorization_value=None, allow_insecure=None, timeout=None, retries=None)[source]
Update a webhook configuration.
- Parameters:
key (int) – Webhook $key (ID).
name (str | None) – New webhook name.
url (str | None) – New destination URL.
headers (dict[str, str] | str | None) – New custom HTTP headers. Pass empty dict to clear.
authorization_type (str | None) – New auth method.
authorization_value (str | None) – New auth credential value.
allow_insecure (bool | None) – New allow insecure setting.
timeout (int | None) – New request timeout.
retries (int | None) – New retry count.
- Returns:
Updated Webhook object.
- Raises:
NotFoundError – If webhook not found.
ValidationError – If parameters invalid.
- Return type:
- delete(key)[source]
Delete a webhook configuration.
This also deletes any pending messages in the queue for this webhook.
- Parameters:
key (int) – Webhook $key (ID).
- Raises:
NotFoundError – If webhook not found.
- Return type:
None
- send(key, *, message=None)[source]
Send a message to a webhook.
The message is queued for delivery. Use history() to check delivery status.
- Parameters:
- Returns:
Action response (may include task info).
- Raises:
NotFoundError – If webhook not found.
- Return type:
- history(key=None, *, webhook_key=None, webhook_name=None, status=None, pending=False, failed=False, limit=100, fields=None)[source]
Get webhook execution history.
- Parameters:
key (int | None) – History entry $key (ID) to get specific entry.
webhook_key (int | None) – Filter by webhook $key.
webhook_name (str | None) – Filter by webhook name.
status (str | None) – Filter by status (queued, running, sent, error).
pending (bool) – If True, show only pending (queued/running) messages.
failed (bool) – If True, show only failed (error) messages.
limit (int) – Maximum number of entries to return.
- Returns:
List of WebhookHistory objects.
- Return type:
- get_history(key)[source]
Get a specific webhook history entry by key.
- Parameters:
key (int) – History entry $key (ID).
- Returns:
WebhookHistory object.
- Raises:
NotFoundError – If history entry not found.
- Return type:
Base Classes
Base resource manager providing CRUD operations.
- class pyvergeos.resources.base.ResourceObject[source]
-
Dict subclass with attribute access and resource methods.
Provides a dict-like object that also supports attribute access and common resource operations like refresh, save, and delete.
- __init__(data, manager)[source]
- Parameters:
manager (ResourceManager[Any])
- Return type:
None
- property key: int
Resource primary key ($key).
- Raises:
ValueError – If resource has no $key (not yet persisted).
- class pyvergeos.resources.base.ResourceManager[source]
Bases:
Generic[T]Base class for resource managers.
Provides standard CRUD operations and filtering for API resources. Subclasses should set _endpoint and optionally override _to_model.
- __init__(client)[source]
- Parameters:
client (VergeClient)
- Return type:
None
- list(filter=None, fields=None, limit=None, offset=None, **filter_kwargs)[source]
List resources with optional filtering.
- Parameters:
- Returns:
List of resource objects.
- Return type:
list[T]
- get(key=None, *, name=None, fields=None)[source]
Get a single resource by key or name.
- Parameters:
- Returns:
Resource object.
- Raises:
NotFoundError – If resource not found.
ValueError – If neither key nor name provided.
- Return type:
T
- create(**kwargs)[source]
Create a new resource.
- Parameters:
**kwargs (Any) – Resource attributes.
- Returns:
Created resource object.
- Return type:
T
- delete(key)[source]
Delete a resource.
- Parameters:
key (int) – Resource $key (ID).
- Return type:
None