For the complete documentation index, see llms.txt. This page is also available as Markdown.

VergeOS Python SDK (pyvergeos)

pyvergeos is a Python SDK for managing VergeOS through the REST API, providing a Pythonic, type-annotated interface for automating VMs, networking, storage, tenants, and disaster recovery.

Overview

pyvergeos is a Python SDK for managing VergeOS infrastructure through the REST API. It provides a Pythonic, type-annotated interface for automating VM lifecycle, networking, storage, multi-tenant operations, and disaster recovery workflows, making it ideal for automation scripts, tooling development, and integrations.

Key Features

  • VM Management: Creation, configuration, power control, cloning, and snapshots

  • Advanced Networking: Virtual networks, firewall rules, DHCP, DNS, IPSec VPN, and WireGuard

  • NAS & Storage: Volume management, CIFS/NFS shares, and synchronization

  • Multi-Tenancy: Tenant provisioning with resource isolation

  • Disaster Recovery: Cloud snapshots, site synchronization, and recovery workflows

  • Filtering: OData filter support with a fluent filter builder API

  • Type Annotations: Full type hints for IDE autocompletion and static analysis

  • Cross-Platform: Windows, macOS, and Linux support

Requirements

  • Python 3.9 or later

  • VergeOS 26.0 or later

Installation

Using uv

From Source

Authentication

The SDK supports multiple authentication methods:

Username/Password

SSL Certificate Verification

Set verify_ssl=False only for environments with self-signed certificates. For production environments with valid certificates, omit this parameter or set it to True.

API Token

Environment Variables

Context Manager

Available Resources

The SDK provides access to the following VergeOS resources:

Category
Resources

Virtual Machines

VMs, drives, NICs, snapshots

Networking

Networks, rules, DNS, DHCP, aliases, hosts

VPN

IPSec connections, WireGuard interfaces and peers

NAS/Storage

Services, volumes, CIFS/NFS shares, volume syncs

Tenants

Tenant management, snapshots, storage, network blocks

Users & Groups

Users, groups, permissions, API keys

System

Clusters, nodes, storage tiers, certificates

Monitoring

Alarms, logs, tasks

Backup & DR

Snapshot profiles, cloud snapshots, sites, site syncs

Usage Examples

Managing Virtual Machines

Creating and Managing Networks

Filtering Resources

The SDK supports multiple filtering approaches:

Task Waiting

Many operations in VergeOS run asynchronously. Use the task manager to wait for completion:

Async Operations

Operations like snapshots, clones, and migrations return immediately with a task ID. Use client.tasks.wait() to block until the operation completes.

Error Handling

The SDK provides specific exception types for different error conditions:

Available Exception Types

Exception
Description

VergeError

Base exception for all SDK errors

AuthenticationError

Invalid credentials or expired token

NotFoundError

Requested resource does not exist

ConflictError

Resource state conflict (e.g., VM already running)

ValidationError

Invalid parameter values

TaskTimeoutError

Task did not complete within timeout

TaskError

Task failed during execution

Common Use Cases

  • Infrastructure automation: Provision VMs, networks, and storage programmatically

  • CI/CD integration: Create and destroy test environments in pipelines

  • Monitoring and reporting: Query resource status and generate inventory reports

  • Backup automation: Schedule and manage snapshots and cloud backups

  • Multi-tenant provisioning: Automate tenant creation and resource allocation

Documentation and Resources

For complete documentation, including all available methods and detailed usage examples, visit the official repository:

Support

If you encounter issues or have feature requests, please open an issue on the GitHub repository:

Additional Resources

Last updated

Was this helpful?