You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pre-release: This library is under active development. APIs may change before v1.0.0.
A Go client library for managing VergeOS infrastructure programmatically. goVergeOS provides complete API coverage for virtual machines, networking, storage, multi-tenancy, and disaster recovery operations.
Built for infrastructure administrators and Go developers who want to automate VergeOS management. This library serves as the foundation for the Terraform Provider, Prometheus Exporter, and other VergeOS tooling.
Key Features
Complete VM Management - Create, configure, power, clone, and snapshot virtual machines with full drive and NIC control
Advanced Networking - Virtual networks, firewall rules, DHCP, DNS views/zones/records, WireGuard and IPSec VPNs
Configure the client from environment variables using WithEnvConfig():
// Simple: all config from environmentclient, err:=vergeos.NewClient(vergeos.WithEnvConfig())
// With explicit overrideclient, err:=vergeos.NewClient(
vergeos.WithEnvConfig(),
vergeos.WithTimeout(60*time.Second), // Override just timeout
)
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 (true/false)
VERGEOS_TIMEOUT
No
30
Request timeout in seconds
*One of (USERNAME+PASSWORD) or API_KEY is required.
The library supports HTTP Basic Authentication and API key authentication:
Basic Auth: User must have list and read permissions; MFA must be disabled
API Keys: Created via UserAPIKeys service; token shown only on creation
Query Options
Field Selection
nodes, err:=client.Nodes.List(ctx,
vergeos.WithFields("most"), // Common fields (default)vergeos.WithFields("dashboard"), // Dashboard-specific fieldsvergeos.WithFields("all"), // All available fields
)
The client is safe for concurrent use. Share a single client instance across multiple goroutines.
Development
# Build
go build ./...
# Run tests
go test ./...
go test -v ./... # Verbose
go test -run TestName ./... # Single test# Code quality
go fmt ./...
go vet ./...
Integration Tests
Integration tests run against a live VergeOS instance. Tests are organized by category for selective execution.
# Virtual machines and snapshots
go test -tags=integration -v ./test/integration/ -run "TestVMSnapshots"# Networking (addresses, DNS, hosts)
go test -tags=integration -v ./test/integration/ -run "TestVNet"# NAS and storage
go test -tags=integration -v ./test/integration/ -run "TestNAS|TestVolume"# Tenants
go test -tags=integration -v ./test/integration/ -run "TestTenants"# Monitoring (alarms, tasks)
go test -tags=integration -v ./test/integration/ -run "TestAlarms|TestTasks"# VSAN storage metrics
go test -tags=integration -v ./test/integration/ -run "TestVSAN|TestStorage|TestClusterTiers"# DR and backup
go test -tags=integration -v ./test/integration/ -run "TestSites|TestCloudSnapshots"# VPN (WireGuard, IPSec)
go test -tags=integration -v ./test/integration/ -run "TestWireGuard|TestIPSec"# Files and certificates
go test -tags=integration -v ./test/integration/ -run "TestFiles|TestCertificates"# Tags and permissions
go test -tags=integration -v ./test/integration/ -run "TestTags|TestPermissions"# CRUD lifecycle tests only
go test -tags=integration -v ./test/integration/ -run "CRUD"
Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
About
Go SDK for VergeOS infrastructure automation. Client library for VM lifecycle, networking, storage, NAS, multi-tenancy, and user management via the REST API.