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

VergeOS Go SDK (govergeos)

govergeos is a Go client library for managing VergeOS infrastructure through the REST API, providing type-safe interfaces for automating VMs, networking, storage, tenants, and disaster recovery.

Overview

govergeos is a Go client library for managing VergeOS infrastructure through the REST API. It provides a type-safe, idiomatic Go interface for automating VM lifecycle, networking, storage, multi-tenant operations, and disaster recovery workflows, making it ideal for building tools, operators, and infrastructure automation.

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, async volume browsing, and synchronization

  • Multi-Tenancy: Tenant provisioning with resource isolation and node management

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

  • Type-Safe API: Full Go interfaces for mocking, context support, and thread-safe concurrent operations

  • Zero Dependencies: Standard library only—no external dependencies

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

Requirements

  • Go 1.21 or later

  • VergeOS 26.0 or later

Installation

Using go get

In go.mod

Authentication

The SDK supports multiple authentication methods:

Username/Password

SSL Certificate Verification

Set WithInsecureTLS(true) only for environments with self-signed certificates. For production environments with valid certificates, omit this option.

API Key

Environment Variables

Variable
Required
Default
Description

VERGEOS_HOST

Yes

Base URL (e.g., https://vergeos.example.com)

VERGEOS_USERNAME

No*

Username for basic auth

VERGEOS_PASSWORD

No*

Password for basic auth

VERGEOS_API_KEY

No*

API key for bearer auth

VERGEOS_VERIFY_SSL

No

true

Verify TLS certificates

VERGEOS_TIMEOUT

No

30

Request timeout in seconds

*One of (USERNAME+PASSWORD) or API_KEY is required.

Client Options

The client supports additional configuration options:

Available Resources

The SDK provides access to the following VergeOS resources:

Category
Services

Virtual Machines

VMs, VMDrives, VMNICs, VMSnapshots, VMDevices

Networking

Networks, VNetRules, VNetAddresses, VNetHosts, VNetDNSViews/Zones/Records

VPN

VNetIPSecs, VNetIPSecPhase1s/Phase2s, VNetWireGuards, VNetWireGuardPeers

NAS/Storage

NASServices, Volumes, VolumeSnapshots, VolumeCIFSShares, VolumeNFSShares, VolumeSyncs

Tenants

Tenants, TenantNodes, TenantStorage, TenantSnapshots, TenantLayer2Networks

Users & Groups

Users, Groups, Members, Permissions, UserAPIKeys

System

Clusters, Nodes, Settings, System, Certificates

Monitoring

Alarms, Logs, Tasks, StorageTiers, ClusterTiers

Backup & DR

SnapshotProfiles, CloudSnapshots, Sites, SiteSyncs

Automation

Files, CloudInitFiles, WebhookURLs, Webhooks

Organization

Tags, TagCategories, TagMembers, ResourceGroups

Usage Examples

Managing Virtual Machines

Creating and Managing Networks

Filtering Resources

The SDK supports flexible filtering with list options:

Concurrent Operations

The SDK is thread-safe and supports concurrent operations using goroutines:

Error Handling

The SDK provides specific error types for different error conditions:

Available Error Types

Error Type
Helper Function
Description

APIError

Base error for all API errors

AuthError

IsAuthError(err)

Invalid credentials or expired token

NotFoundError

IsNotFoundError(err)

Requested resource does not exist

ValidationError

IsValidationError(err)

Invalid parameter values

UnsupportedVersionError

IsUnsupportedVersionError(err)

VergeOS version not supported

Common Use Cases

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

  • Kubernetes operators: Build custom controllers for VergeOS resources

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

  • Monitoring tools: Query resource status and build custom dashboards

  • 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?