Documentation
¶
Overview ¶
Package vergeos provides a Go client library for the VergeOS API.
goVergeOS provides a convenient way to interact with VergeOS infrastructure from Go applications. It handles authentication, request building, and response parsing.
Quick Start ¶
Create a client and start making API calls:
client, err := vergeos.NewClient(
vergeos.WithBaseURL("https://your-vergeos-host"),
vergeos.WithCredentials("username", "password"),
vergeos.WithInsecureTLS(true),
)
if err != nil {
log.Fatal(err)
}
// List all VMs
vms, err := client.VMs.List(ctx)
if err != nil {
log.Fatal(err)
}
// Create a VM
vm, err := client.VMs.Create(ctx, &vergeos.VMCreateRequest{
Name: "my-vm",
CPUCores: 4,
RAM: 8192,
})
Environment Configuration ¶
Use WithEnvConfig() to configure the client from environment variables:
client, err := vergeos.NewClient(vergeos.WithEnvConfig())
Environment variables:
- VERGEOS_HOST: Base URL (required)
- VERGEOS_USERNAME + VERGEOS_PASSWORD: Basic authentication
- VERGEOS_API_KEY: Bearer token authentication
- VERGEOS_VERIFY_SSL: TLS verification, "true" or "false" (default: "true")
- VERGEOS_TIMEOUT: Request timeout in seconds (default: "30")
Authentication ¶
The library supports HTTP Basic Authentication and API key authentication. For basic auth, MFA must be disabled for the user account.
Query Options ¶
List operations support filtering, sorting, and pagination:
vms, err := client.VMs.List(ctx,
vergeos.WithFilter("enabled eq true"),
vergeos.WithSort("name"),
vergeos.WithLimit(50),
)
Error Handling ¶
The library provides typed errors and helper functions:
vm, err := client.VMs.Get(ctx, vmID)
if vergeos.IsNotFoundError(err) {
// Handle not found
}
if vergeos.IsAuthError(err) {
// Handle authentication failure
}
Index ¶
- Constants
- func IsAuthError(err error) bool
- func IsNotFoundError(err error) bool
- func IsUnsupportedVersionError(err error) bool
- func IsValidationError(err error) bool
- type APIError
- type Alarm
- type AlarmService
- func (s *AlarmService) Delete(ctx context.Context, id int) error
- func (s *AlarmService) Get(ctx context.Context, id int) (*Alarm, error)
- func (s *AlarmService) List(ctx context.Context, opts ...ListOption) ([]Alarm, error)
- func (s *AlarmService) ListActive(ctx context.Context, opts ...ListOption) ([]Alarm, error)
- func (s *AlarmService) ListByAlarmType(ctx context.Context, alarmTypeKey string, opts ...ListOption) ([]Alarm, error)
- func (s *AlarmService) ListByLevel(ctx context.Context, level string, opts ...ListOption) ([]Alarm, error)
- func (s *AlarmService) ListByOwner(ctx context.Context, owner string, opts ...ListOption) ([]Alarm, error)
- func (s *AlarmService) Resolve(ctx context.Context, id int) error
- func (s *AlarmService) Snooze(ctx context.Context, id int, until int64) error
- func (s *AlarmService) Unsnooze(ctx context.Context, id int) error
- func (s *AlarmService) Update(ctx context.Context, id int, req *AlarmUpdateRequest) (*Alarm, error)
- type AlarmServiceInterface
- type AlarmType
- type AlarmTypeService
- type AlarmTypeServiceInterface
- type AlarmUpdateRequest
- type AuthError
- type Certificate
- type CertificateCreateRequest
- type CertificateService
- func (s *CertificateService) Create(ctx context.Context, req *CertificateCreateRequest) (*Certificate, error)
- func (s *CertificateService) Delete(ctx context.Context, id int) error
- func (s *CertificateService) Get(ctx context.Context, id int) (*Certificate, error)
- func (s *CertificateService) GetByDomain(ctx context.Context, domain string) (*Certificate, error)
- func (s *CertificateService) GetWithKeys(ctx context.Context, id int) (*Certificate, error)
- func (s *CertificateService) List(ctx context.Context, opts ...ListOption) ([]Certificate, error)
- func (s *CertificateService) ListByType(ctx context.Context, certType string, opts ...ListOption) ([]Certificate, error)
- func (s *CertificateService) ListExpiring(ctx context.Context, days int, opts ...ListOption) ([]Certificate, error)
- func (s *CertificateService) ListValid(ctx context.Context, opts ...ListOption) ([]Certificate, error)
- func (s *CertificateService) Renew(ctx context.Context, id int) (*Certificate, error)
- func (s *CertificateService) Update(ctx context.Context, id int, req *CertificateUpdateRequest) (*Certificate, error)
- type CertificateServiceInterface
- type CertificateUpdateRequest
- type Client
- type ClientOption
- func WithAPIKey(apiKey string) ClientOption
- func WithBaseURL(baseURL string) ClientOption
- func WithCredentials(username, password string) ClientOption
- func WithEnvConfig() ClientOption
- func WithHTTPClient(httpClient *http.Client) ClientOption
- func WithInsecureTLS(insecure bool) ClientOption
- func WithTimeout(timeout time.Duration) ClientOption
- func WithUserAgent(userAgent string) ClientOption
- type CloudInitFile
- type CloudInitFileCreateRequest
- type CloudInitFileRef
- type CloudInitFileUpdateRequest
- type CloudInitService
- func (s *CloudInitService) Create(ctx context.Context, req *CloudInitFileCreateRequest) (*CloudInitFile, error)
- func (s *CloudInitService) Delete(ctx context.Context, id int) error
- func (s *CloudInitService) Get(ctx context.Context, id int) (*CloudInitFile, error)
- func (s *CloudInitService) GetByName(ctx context.Context, name string) (*CloudInitFile, error)
- func (s *CloudInitService) List(ctx context.Context, opts ...ListOption) ([]CloudInitFile, error)
- func (s *CloudInitService) Update(ctx context.Context, id int, req *CloudInitFileUpdateRequest) (*CloudInitFile, error)
- type CloudInitServiceInterface
- type CloudSnapshot
- type CloudSnapshotCloneOptions
- type CloudSnapshotCreateRequest
- type CloudSnapshotService
- func (s *CloudSnapshotService) Clone(ctx context.Context, id int, opts *CloudSnapshotCloneOptions) error
- func (s *CloudSnapshotService) Create(ctx context.Context, req *CloudSnapshotCreateRequest) (*CloudSnapshot, error)
- func (s *CloudSnapshotService) Delete(ctx context.Context, id int) error
- func (s *CloudSnapshotService) FindTenants(ctx context.Context, id int) error
- func (s *CloudSnapshotService) FindVMs(ctx context.Context, id int) error
- func (s *CloudSnapshotService) Get(ctx context.Context, id int) (*CloudSnapshot, error)
- func (s *CloudSnapshotService) GetByName(ctx context.Context, name string) (*CloudSnapshot, error)
- func (s *CloudSnapshotService) List(ctx context.Context, opts ...ListOption) ([]CloudSnapshot, error)
- func (s *CloudSnapshotService) ListByProfile(ctx context.Context, profileID int, opts ...ListOption) ([]CloudSnapshot, error)
- func (s *CloudSnapshotService) ListExpiring(ctx context.Context, opts ...ListOption) ([]CloudSnapshot, error)
- func (s *CloudSnapshotService) ListLocal(ctx context.Context, opts ...ListOption) ([]CloudSnapshot, error)
- func (s *CloudSnapshotService) Refresh(ctx context.Context, id int) error
- func (s *CloudSnapshotService) RequestFromProvider(ctx context.Context, id int) error
- func (s *CloudSnapshotService) Update(ctx context.Context, id int, req *CloudSnapshotUpdateRequest) (*CloudSnapshot, error)
- type CloudSnapshotServiceInterface
- type CloudSnapshotTenant
- type CloudSnapshotTenantService
- func (s *CloudSnapshotTenantService) Get(ctx context.Context, id int) (*CloudSnapshotTenant, error)
- func (s *CloudSnapshotTenantService) List(ctx context.Context, opts ...ListOption) ([]CloudSnapshotTenant, error)
- func (s *CloudSnapshotTenantService) ListBySnapshot(ctx context.Context, snapshotID int, opts ...ListOption) ([]CloudSnapshotTenant, error)
- type CloudSnapshotTenantServiceInterface
- type CloudSnapshotUpdateRequest
- type CloudSnapshotVM
- type CloudSnapshotVMService
- func (s *CloudSnapshotVMService) Get(ctx context.Context, id int) (*CloudSnapshotVM, error)
- func (s *CloudSnapshotVMService) List(ctx context.Context, opts ...ListOption) ([]CloudSnapshotVM, error)
- func (s *CloudSnapshotVMService) ListBySnapshot(ctx context.Context, snapshotID int, opts ...ListOption) ([]CloudSnapshotVM, error)
- type CloudSnapshotVMServiceInterface
- type Cluster
- type ClusterCreateRequest
- type ClusterService
- func (s *ClusterService) Create(ctx context.Context, req *ClusterCreateRequest) (*Cluster, error)
- func (s *ClusterService) Delete(ctx context.Context, id int) error
- func (s *ClusterService) Get(ctx context.Context, id int) (*Cluster, error)
- func (s *ClusterService) GetByName(ctx context.Context, name string) (*Cluster, error)
- func (s *ClusterService) GetStatus(ctx context.Context, id int) (*ClusterStatus, error)
- func (s *ClusterService) List(ctx context.Context, opts ...ListOption) ([]Cluster, error)
- func (s *ClusterService) Update(ctx context.Context, id int, req *ClusterUpdateRequest) (*Cluster, error)
- type ClusterServiceInterface
- type ClusterStatsHistory
- type ClusterStatsHistoryService
- func (s *ClusterStatsHistoryService) GetLatestShort(ctx context.Context, clusterID int) (*ClusterStatsHistory, error)
- func (s *ClusterStatsHistoryService) GetLong(ctx context.Context, id int) (*ClusterStatsHistory, error)
- func (s *ClusterStatsHistoryService) GetShort(ctx context.Context, id int) (*ClusterStatsHistory, error)
- func (s *ClusterStatsHistoryService) ListLong(ctx context.Context, opts ...ListOption) ([]ClusterStatsHistory, error)
- func (s *ClusterStatsHistoryService) ListLongByCluster(ctx context.Context, clusterID int, opts ...ListOption) ([]ClusterStatsHistory, error)
- func (s *ClusterStatsHistoryService) ListShort(ctx context.Context, opts ...ListOption) ([]ClusterStatsHistory, error)
- func (s *ClusterStatsHistoryService) ListShortByCluster(ctx context.Context, clusterID int, opts ...ListOption) ([]ClusterStatsHistory, error)
- type ClusterStatsHistoryServiceInterface
- type ClusterStatus
- type ClusterTier
- type ClusterTierDriveState
- type ClusterTierNodeState
- type ClusterTierNodesOnline
- type ClusterTierService
- func (s *ClusterTierService) Get(ctx context.Context, id int) (*ClusterTier, error)
- func (s *ClusterTierService) GetByClusterAndTier(ctx context.Context, clusterID int, tierNum int) (*ClusterTier, error)
- func (s *ClusterTierService) List(ctx context.Context, opts ...ListOption) ([]ClusterTier, error)
- func (s *ClusterTierService) ListByCluster(ctx context.Context, clusterID int, opts ...ListOption) ([]ClusterTier, error)
- type ClusterTierServiceInterface
- type ClusterTierStats
- type ClusterTierStatus
- type ClusterUpdateRequest
- type File
- type FileCreateRequest
- type FileService
- func (s *FileService) Create(ctx context.Context, req *FileCreateRequest) (*File, error)
- func (s *FileService) Delete(ctx context.Context, id int) error
- func (s *FileService) Download(ctx context.Context, id int) (io.ReadCloser, *File, error)
- func (s *FileService) DownloadToFile(ctx context.Context, id int, destPath string) (string, error)
- func (s *FileService) Get(ctx context.Context, id int) (*File, error)
- func (s *FileService) GetByName(ctx context.Context, name string) (*File, error)
- func (s *FileService) List(ctx context.Context, opts ...ListOption) ([]File, error)
- func (s *FileService) ListISOs(ctx context.Context, opts ...ListOption) ([]File, error)
- func (s *FileService) Update(ctx context.Context, id int, req *FileUpdateRequest) (*File, error)
- func (s *FileService) Upload(ctx context.Context, id int, reader io.Reader, size int64) (*File, error)
- func (s *FileService) UploadFromFile(ctx context.Context, localPath string, req *FileCreateRequest) (*File, error)
- func (s *FileService) UploadWithChunkSize(ctx context.Context, id int, reader io.Reader, size int64, chunkSize int) (*File, error)
- type FileServiceInterface
- type FileUpdateRequest
- type FlexInt
- type Group
- type GroupCreateRequest
- type GroupService
- func (s *GroupService) Create(ctx context.Context, req *GroupCreateRequest) (*Group, error)
- func (s *GroupService) Delete(ctx context.Context, id int) error
- func (s *GroupService) Get(ctx context.Context, id int) (*Group, error)
- func (s *GroupService) GetByName(ctx context.Context, name string) (*Group, error)
- func (s *GroupService) List(ctx context.Context, opts ...ListOption) ([]Group, error)
- func (s *GroupService) Update(ctx context.Context, id int, req *GroupUpdateRequest) (*Group, error)
- type GroupServiceInterface
- type GroupUpdateRequest
- type ListOption
- type ListOptions
- type Log
- type LogService
- func (s *LogService) Get(ctx context.Context, id int) (*Log, error)
- func (s *LogService) GetRecent(ctx context.Context, count int) ([]Log, error)
- func (s *LogService) GetRecentErrors(ctx context.Context, count int) ([]Log, error)
- func (s *LogService) List(ctx context.Context, opts ...ListOption) ([]Log, error)
- func (s *LogService) ListAudit(ctx context.Context, opts ...ListOption) ([]Log, error)
- func (s *LogService) ListByLevel(ctx context.Context, level string, opts ...ListOption) ([]Log, error)
- func (s *LogService) ListByObjectType(ctx context.Context, objectType string, opts ...ListOption) ([]Log, error)
- func (s *LogService) ListByUser(ctx context.Context, username string, opts ...ListOption) ([]Log, error)
- func (s *LogService) ListErrors(ctx context.Context, opts ...ListOption) ([]Log, error)
- func (s *LogService) ListSince(ctx context.Context, timestampMicros int64, opts ...ListOption) ([]Log, error)
- func (s *LogService) ListWarnings(ctx context.Context, opts ...ListOption) ([]Log, error)
- func (s *LogService) Search(ctx context.Context, pattern string, opts ...ListOption) ([]Log, error)
- type LogServiceInterface
- type MachineDrivePhys
- type MachineDrivePhysService
- func (s *MachineDrivePhysService) Get(ctx context.Context, id int) (*MachineDrivePhys, error)
- func (s *MachineDrivePhysService) GetByParentDrive(ctx context.Context, driveID int) (*MachineDrivePhys, error)
- func (s *MachineDrivePhysService) List(ctx context.Context, opts ...ListOption) ([]MachineDrivePhys, error)
- func (s *MachineDrivePhysService) ListByVSANTier(ctx context.Context, tier int, opts ...ListOption) ([]MachineDrivePhys, error)
- func (s *MachineDrivePhysService) ListSpares(ctx context.Context, opts ...ListOption) ([]MachineDrivePhys, error)
- func (s *MachineDrivePhysService) ListWithWarnings(ctx context.Context, opts ...ListOption) ([]MachineDrivePhys, error)
- type MachineDrivePhysServiceInterface
- type MachineDriveStats
- type MachineDriveStatsService
- func (s *MachineDriveStatsService) Get(ctx context.Context, id int) (*MachineDriveStats, error)
- func (s *MachineDriveStatsService) GetByDrive(ctx context.Context, driveID int) (*MachineDriveStats, error)
- func (s *MachineDriveStatsService) List(ctx context.Context, opts ...ListOption) ([]MachineDriveStats, error)
- func (s *MachineDriveStatsService) ListPhysical(ctx context.Context, opts ...ListOption) ([]MachineDriveStats, error)
- type MachineDriveStatsServiceInterface
- type MachineNIC
- type MachineNICService
- type MachineNICServiceInterface
- type MachineNICStats
- type MachineNICStatus
- type MachineStats
- type MachineStatsService
- type MachineStatsServiceInterface
- type Member
- type MemberCreateRequest
- type MemberService
- func (s *MemberService) Add(ctx context.Context, groupID int, member string) (*Member, error)
- func (s *MemberService) Create(ctx context.Context, req *MemberCreateRequest) (*Member, error)
- func (s *MemberService) Delete(ctx context.Context, id int) error
- func (s *MemberService) Get(ctx context.Context, id int) (*Member, error)
- func (s *MemberService) List(ctx context.Context, opts ...ListOption) ([]Member, error)
- func (s *MemberService) ListByGroup(ctx context.Context, groupID int) ([]Member, error)
- func (s *MemberService) Remove(ctx context.Context, groupID int, member string) error
- func (s *MemberService) Update(ctx context.Context, id int, req *MemberUpdateRequest) (*Member, error)
- type MemberServiceInterface
- type MemberUpdateRequest
- type NASService
- type NASServiceCreateRequest
- type NASServiceService
- func (s *NASServiceService) Create(ctx context.Context, req *NASServiceCreateRequest) (*NASService, error)
- func (s *NASServiceService) Delete(ctx context.Context, id int) error
- func (s *NASServiceService) Get(ctx context.Context, id int) (*NASService, error)
- func (s *NASServiceService) GetByName(ctx context.Context, name string) (*NASService, error)
- func (s *NASServiceService) GetByVM(ctx context.Context, vmID int) (*NASService, error)
- func (s *NASServiceService) List(ctx context.Context, opts ...ListOption) ([]NASService, error)
- func (s *NASServiceService) Update(ctx context.Context, id int, req *NASServiceUpdateRequest) (*NASService, error)
- type NASServiceServiceInterface
- type NASServiceUpdateRequest
- type NASServiceUser
- type NASServiceUserCreateRequest
- type NASServiceUserService
- func (s *NASServiceUserService) Create(ctx context.Context, req *NASServiceUserCreateRequest) (*NASServiceUser, error)
- func (s *NASServiceUserService) Delete(ctx context.Context, id string) error
- func (s *NASServiceUserService) Disable(ctx context.Context, id string) error
- func (s *NASServiceUserService) Enable(ctx context.Context, id string) error
- func (s *NASServiceUserService) Get(ctx context.Context, id string) (*NASServiceUser, error)
- func (s *NASServiceUserService) GetByName(ctx context.Context, serviceID int, name string) (*NASServiceUser, error)
- func (s *NASServiceUserService) List(ctx context.Context, opts ...ListOption) ([]NASServiceUser, error)
- func (s *NASServiceUserService) ListByService(ctx context.Context, serviceID int) ([]NASServiceUser, error)
- func (s *NASServiceUserService) Update(ctx context.Context, id string, req *NASServiceUserUpdateRequest) (*NASServiceUser, error)
- type NASServiceUserServiceInterface
- type NASServiceUserUpdateRequest
- type Network
- type NetworkCreateRequest
- type NetworkMonitorStats
- type NetworkQuery
- type NetworkQueryRequest
- type NetworkService
- func (s *NetworkService) ApplyDNS(ctx context.Context, id int) error
- func (s *NetworkService) ApplyRules(ctx context.Context, id int) error
- func (s *NetworkService) Create(ctx context.Context, req *NetworkCreateRequest) (*Network, error)
- func (s *NetworkService) DNSLookup(ctx context.Context, networkID int, hostname string) (*NetworkQuery, error)
- func (s *NetworkService) Delete(ctx context.Context, id int) error
- func (s *NetworkService) Get(ctx context.Context, id int) (*Network, error)
- func (s *NetworkService) GetDiagnostics(ctx context.Context, id int) (*NetworkQuery, error)
- func (s *NetworkService) GetLatestStatistics(ctx context.Context, id int) (*NetworkMonitorStats, error)
- func (s *NetworkService) GetQuery(ctx context.Context, id string) (*NetworkQuery, error)
- func (s *NetworkService) GetStatistics(ctx context.Context, id int) ([]NetworkMonitorStats, error)
- func (s *NetworkService) Kill(ctx context.Context, id int) error
- func (s *NetworkService) List(ctx context.Context, opts ...ListOption) ([]Network, error)
- func (s *NetworkService) Ping(ctx context.Context, networkID int, target string, count int) (*NetworkQuery, error)
- func (s *NetworkService) PowerOff(ctx context.Context, id int) error
- func (s *NetworkService) PowerOn(ctx context.Context, id int) error
- func (s *NetworkService) Reset(ctx context.Context, id int, applyFirewall bool) error
- func (s *NetworkService) RunQuery(ctx context.Context, req *NetworkQueryRequest) (*NetworkQuery, error)
- func (s *NetworkService) RunQueryWait(ctx context.Context, req *NetworkQueryRequest) (*NetworkQuery, error)
- func (s *NetworkService) Traceroute(ctx context.Context, networkID int, target string) (*NetworkQuery, error)
- func (s *NetworkService) Update(ctx context.Context, id int, req *NetworkUpdateRequest) (*Network, error)
- type NetworkServiceInterface
- type NetworkUpdateRequest
- type Node
- type NodeService
- func (s *NodeService) ClearPStore(ctx context.Context, id int) error
- func (s *NodeService) DisableMaintenance(ctx context.Context, id int) error
- func (s *NodeService) EnableMaintenance(ctx context.Context, id int) error
- func (s *NodeService) Get(ctx context.Context, id int) (*Node, error)
- func (s *NodeService) GetByName(ctx context.Context, name string) (*Node, error)
- func (s *NodeService) GetDashboard(ctx context.Context, id int) (*Node, error)
- func (s *NodeService) List(ctx context.Context, opts ...ListOption) ([]Node, error)
- func (s *NodeService) ListPhysical(ctx context.Context, opts ...ListOption) ([]Node, error)
- func (s *NodeService) MaintenanceReboot(ctx context.Context, id int) error
- type NodeServiceInterface
- type NodeStatus
- type NotFoundError
- type Permission
- type PermissionCreateRequest
- type PermissionService
- func (s *PermissionService) Create(ctx context.Context, req *PermissionCreateRequest) (*Permission, error)
- func (s *PermissionService) Delete(ctx context.Context, id int) error
- func (s *PermissionService) Get(ctx context.Context, id int) (*Permission, error)
- func (s *PermissionService) GetByIdentityAndResource(ctx context.Context, identityID int, table string, rowID int64) (*Permission, error)
- func (s *PermissionService) Grant(ctx context.Context, identityID int, table string, rowID int64, ...) (*Permission, error)
- func (s *PermissionService) GrantFullAccess(ctx context.Context, identityID int, table string, rowID int64) (*Permission, error)
- func (s *PermissionService) GrantReadOnly(ctx context.Context, identityID int, table string, rowID int64) (*Permission, error)
- func (s *PermissionService) List(ctx context.Context, opts ...ListOption) ([]Permission, error)
- func (s *PermissionService) ListByIdentity(ctx context.Context, identityID int, opts ...ListOption) ([]Permission, error)
- func (s *PermissionService) ListByResource(ctx context.Context, table string, rowID int64, opts ...ListOption) ([]Permission, error)
- func (s *PermissionService) ListByTable(ctx context.Context, table string, opts ...ListOption) ([]Permission, error)
- func (s *PermissionService) Revoke(ctx context.Context, identityID int, table string, rowID int64) error
- func (s *PermissionService) Update(ctx context.Context, id int, req *PermissionUpdateRequest) (*Permission, error)
- type PermissionServiceInterface
- type PermissionUpdateRequest
- type ResourceGroup
- type ResourceGroupService
- type ResourceGroupServiceInterface
- type SchemaService
- func (s *SchemaService) GetTableSchema(ctx context.Context, resource string) (*TableSchema, error)
- func (s *SchemaService) GetVMMachineTypes(ctx context.Context) (map[string]string, error)
- func (s *SchemaService) GetVMOSFamilies(ctx context.Context) (map[string]string, error)
- func (s *SchemaService) GetValidValues(ctx context.Context, resource, field string) (map[string]string, error)
- type SchemaServiceInterface
- type Setting
- type SettingsService
- func (s *SettingsService) Get(ctx context.Context, id int) (*Setting, error)
- func (s *SettingsService) GetByKey(ctx context.Context, key string) (*Setting, error)
- func (s *SettingsService) GetCloudName(ctx context.Context) (string, error)
- func (s *SettingsService) GetValue(ctx context.Context, key string) (string, error)
- func (s *SettingsService) List(ctx context.Context, opts ...ListOption) ([]Setting, error)
- type SettingsServiceInterface
- type Site
- type SiteCreateRequest
- type SiteService
- func (s *SiteService) ClearSyncedLogs(ctx context.Context, id int) error
- func (s *SiteService) Create(ctx context.Context, req *SiteCreateRequest) (*Site, error)
- func (s *SiteService) Delete(ctx context.Context, id int) error
- func (s *SiteService) Get(ctx context.Context, id int) (*Site, error)
- func (s *SiteService) GetByName(ctx context.Context, name string) (*Site, error)
- func (s *SiteService) GetBySiteID(ctx context.Context, siteID string) (*Site, error)
- func (s *SiteService) List(ctx context.Context, opts ...ListOption) ([]Site, error)
- func (s *SiteService) Reauthenticate(ctx context.Context, id int) error
- func (s *SiteService) Refresh(ctx context.Context, id int) error
- func (s *SiteService) RefreshSettings(ctx context.Context, id int) error
- func (s *SiteService) RunUpdates(ctx context.Context, id int) error
- func (s *SiteService) Update(ctx context.Context, id int, req *SiteUpdateRequest) (*Site, error)
- type SiteServiceInterface
- type SiteSyncIncoming
- type SiteSyncIncomingCreateRequest
- type SiteSyncIncomingService
- func (s *SiteSyncIncomingService) Create(ctx context.Context, req *SiteSyncIncomingCreateRequest) (*SiteSyncIncoming, error)
- func (s *SiteSyncIncomingService) Delete(ctx context.Context, id int) error
- func (s *SiteSyncIncomingService) Disable(ctx context.Context, id int) error
- func (s *SiteSyncIncomingService) Enable(ctx context.Context, id int) error
- func (s *SiteSyncIncomingService) Get(ctx context.Context, id int) (*SiteSyncIncoming, error)
- func (s *SiteSyncIncomingService) GetByName(ctx context.Context, siteID int, name string) (*SiteSyncIncoming, error)
- func (s *SiteSyncIncomingService) GetBySyncID(ctx context.Context, syncID string) (*SiteSyncIncoming, error)
- func (s *SiteSyncIncomingService) List(ctx context.Context, opts ...ListOption) ([]SiteSyncIncoming, error)
- func (s *SiteSyncIncomingService) ListBySite(ctx context.Context, siteID int, opts ...ListOption) ([]SiteSyncIncoming, error)
- func (s *SiteSyncIncomingService) Update(ctx context.Context, id int, req *SiteSyncIncomingUpdateRequest) (*SiteSyncIncoming, error)
- type SiteSyncIncomingServiceInterface
- type SiteSyncIncomingUpdateRequest
- type SiteSyncOutgoing
- type SiteSyncOutgoingCreateRequest
- type SiteSyncOutgoingService
- func (s *SiteSyncOutgoingService) Create(ctx context.Context, req *SiteSyncOutgoingCreateRequest) (*SiteSyncOutgoing, error)
- func (s *SiteSyncOutgoingService) Delete(ctx context.Context, id int) error
- func (s *SiteSyncOutgoingService) Disable(ctx context.Context, id int) error
- func (s *SiteSyncOutgoingService) DisableThrottle(ctx context.Context, id int) error
- func (s *SiteSyncOutgoingService) Enable(ctx context.Context, id int) error
- func (s *SiteSyncOutgoingService) Get(ctx context.Context, id int) (*SiteSyncOutgoing, error)
- func (s *SiteSyncOutgoingService) GetByName(ctx context.Context, siteID int, name string) (*SiteSyncOutgoing, error)
- func (s *SiteSyncOutgoingService) List(ctx context.Context, opts ...ListOption) ([]SiteSyncOutgoing, error)
- func (s *SiteSyncOutgoingService) ListBySite(ctx context.Context, siteID int, opts ...ListOption) ([]SiteSyncOutgoing, error)
- func (s *SiteSyncOutgoingService) RefreshSnapshots(ctx context.Context, id int) error
- func (s *SiteSyncOutgoingService) Throttle(ctx context.Context, id int, throttle int) error
- func (s *SiteSyncOutgoingService) Update(ctx context.Context, id int, req *SiteSyncOutgoingUpdateRequest) (*SiteSyncOutgoing, error)
- type SiteSyncOutgoingServiceInterface
- type SiteSyncOutgoingUpdateRequest
- type SiteSyncProfilePeriod
- type SiteSyncProfilePeriodCreateRequest
- type SiteSyncProfilePeriodService
- func (s *SiteSyncProfilePeriodService) Create(ctx context.Context, req *SiteSyncProfilePeriodCreateRequest) (*SiteSyncProfilePeriod, error)
- func (s *SiteSyncProfilePeriodService) Delete(ctx context.Context, id int) error
- func (s *SiteSyncProfilePeriodService) Get(ctx context.Context, id int) (*SiteSyncProfilePeriod, error)
- func (s *SiteSyncProfilePeriodService) List(ctx context.Context, opts ...ListOption) ([]SiteSyncProfilePeriod, error)
- func (s *SiteSyncProfilePeriodService) ListByOutgoingSync(ctx context.Context, outgoingSyncID int, opts ...ListOption) ([]SiteSyncProfilePeriod, error)
- func (s *SiteSyncProfilePeriodService) Update(ctx context.Context, id int, req *SiteSyncProfilePeriodUpdateRequest) (*SiteSyncProfilePeriod, error)
- type SiteSyncProfilePeriodServiceInterface
- type SiteSyncProfilePeriodUpdateRequest
- type SiteUpdateRequest
- type SnapshotProfile
- type SnapshotProfileCreateRequest
- type SnapshotProfilePeriod
- type SnapshotProfilePeriodCreateRequest
- type SnapshotProfilePeriodService
- func (s *SnapshotProfilePeriodService) Create(ctx context.Context, req *SnapshotProfilePeriodCreateRequest) (*SnapshotProfilePeriod, error)
- func (s *SnapshotProfilePeriodService) Delete(ctx context.Context, id int) error
- func (s *SnapshotProfilePeriodService) Get(ctx context.Context, id int) (*SnapshotProfilePeriod, error)
- func (s *SnapshotProfilePeriodService) GetByName(ctx context.Context, profileID int, name string) (*SnapshotProfilePeriod, error)
- func (s *SnapshotProfilePeriodService) List(ctx context.Context, opts ...ListOption) ([]SnapshotProfilePeriod, error)
- func (s *SnapshotProfilePeriodService) ListByProfile(ctx context.Context, profileID int, opts ...ListOption) ([]SnapshotProfilePeriod, error)
- func (s *SnapshotProfilePeriodService) Update(ctx context.Context, id int, req *SnapshotProfilePeriodUpdateRequest) (*SnapshotProfilePeriod, error)
- type SnapshotProfilePeriodServiceInterface
- type SnapshotProfilePeriodUpdateRequest
- type SnapshotProfileService
- func (s *SnapshotProfileService) Create(ctx context.Context, req *SnapshotProfileCreateRequest) (*SnapshotProfile, error)
- func (s *SnapshotProfileService) Delete(ctx context.Context, id int) error
- func (s *SnapshotProfileService) Get(ctx context.Context, id int) (*SnapshotProfile, error)
- func (s *SnapshotProfileService) GetByName(ctx context.Context, name string) (*SnapshotProfile, error)
- func (s *SnapshotProfileService) List(ctx context.Context, opts ...ListOption) ([]SnapshotProfile, error)
- func (s *SnapshotProfileService) Update(ctx context.Context, id int, req *SnapshotProfileUpdateRequest) (*SnapshotProfile, error)
- type SnapshotProfileServiceInterface
- type SnapshotProfileUpdateRequest
- type StorageTier
- type StorageTierService
- type StorageTierServiceInterface
- type StorageTierStats
- type SystemInfo
- type SystemService
- type SystemServiceInterface
- type TPMDeviceSettings
- type TableField
- type TableSchema
- type Tag
- type TagCategory
- type TagCategoryCreateRequest
- type TagCategoryService
- func (s *TagCategoryService) Create(ctx context.Context, req *TagCategoryCreateRequest) (*TagCategory, error)
- func (s *TagCategoryService) Delete(ctx context.Context, id int) error
- func (s *TagCategoryService) Get(ctx context.Context, id int) (*TagCategory, error)
- func (s *TagCategoryService) GetByName(ctx context.Context, name string) (*TagCategory, error)
- func (s *TagCategoryService) List(ctx context.Context, opts ...ListOption) ([]TagCategory, error)
- func (s *TagCategoryService) Update(ctx context.Context, id int, req *TagCategoryUpdateRequest) (*TagCategory, error)
- type TagCategoryServiceInterface
- type TagCategoryUpdateRequest
- type TagCreateRequest
- type TagMember
- type TagMemberCreateRequest
- type TagMemberService
- func (s *TagMemberService) Assign(ctx context.Context, tagID int, member string) (*TagMember, error)
- func (s *TagMemberService) Create(ctx context.Context, req *TagMemberCreateRequest) (*TagMember, error)
- func (s *TagMemberService) Delete(ctx context.Context, id int) error
- func (s *TagMemberService) Get(ctx context.Context, id int) (*TagMember, error)
- func (s *TagMemberService) List(ctx context.Context, opts ...ListOption) ([]TagMember, error)
- func (s *TagMemberService) ListByMember(ctx context.Context, member string) ([]TagMember, error)
- func (s *TagMemberService) ListByTag(ctx context.Context, tagID int) ([]TagMember, error)
- func (s *TagMemberService) Unassign(ctx context.Context, tagID int, member string) error
- func (s *TagMemberService) Update(ctx context.Context, id int, req *TagMemberUpdateRequest) (*TagMember, error)
- type TagMemberServiceInterface
- type TagMemberUpdateRequest
- type TagService
- func (s *TagService) Create(ctx context.Context, req *TagCreateRequest) (*Tag, error)
- func (s *TagService) Delete(ctx context.Context, id int) error
- func (s *TagService) Get(ctx context.Context, id int) (*Tag, error)
- func (s *TagService) GetByName(ctx context.Context, name string) (*Tag, error)
- func (s *TagService) List(ctx context.Context, opts ...ListOption) ([]Tag, error)
- func (s *TagService) ListByCategory(ctx context.Context, categoryID int) ([]Tag, error)
- func (s *TagService) Update(ctx context.Context, id int, req *TagUpdateRequest) (*Tag, error)
- type TagServiceInterface
- type TagUpdateRequest
- type Task
- type TaskCreateRequest
- type TaskExecuteOptions
- type TaskService
- func (s *TaskService) Create(ctx context.Context, req *TaskCreateRequest) (*Task, error)
- func (s *TaskService) Delete(ctx context.Context, id int) error
- func (s *TaskService) Disable(ctx context.Context, id int) error
- func (s *TaskService) Enable(ctx context.Context, id int) error
- func (s *TaskService) Execute(ctx context.Context, id int, opts *TaskExecuteOptions) error
- func (s *TaskService) Get(ctx context.Context, id int) (*Task, error)
- func (s *TaskService) GetByID(ctx context.Context, taskID string) (*Task, error)
- func (s *TaskService) GetByName(ctx context.Context, owner, name string) (*Task, error)
- func (s *TaskService) List(ctx context.Context, opts ...ListOption) ([]Task, error)
- func (s *TaskService) ListByOwner(ctx context.Context, owner string, opts ...ListOption) ([]Task, error)
- func (s *TaskService) ListEnabled(ctx context.Context, opts ...ListOption) ([]Task, error)
- func (s *TaskService) ListRunning(ctx context.Context, opts ...ListOption) ([]Task, error)
- func (s *TaskService) Update(ctx context.Context, id int, req *TaskUpdateRequest) (*Task, error)
- type TaskServiceInterface
- type TaskUpdateRequest
- type Tenant
- type TenantCloneOptions
- type TenantCreateRequest
- type TenantLayer2Network
- type TenantLayer2NetworkCreateRequest
- type TenantLayer2NetworkService
- func (s *TenantLayer2NetworkService) Assign(ctx context.Context, tenantID, vnetID int) (*TenantLayer2Network, error)
- func (s *TenantLayer2NetworkService) Create(ctx context.Context, req *TenantLayer2NetworkCreateRequest) (*TenantLayer2Network, error)
- func (s *TenantLayer2NetworkService) Delete(ctx context.Context, id int) error
- func (s *TenantLayer2NetworkService) Disable(ctx context.Context, id int) (*TenantLayer2Network, error)
- func (s *TenantLayer2NetworkService) Enable(ctx context.Context, id int) (*TenantLayer2Network, error)
- func (s *TenantLayer2NetworkService) Get(ctx context.Context, id int) (*TenantLayer2Network, error)
- func (s *TenantLayer2NetworkService) GetByTenantAndNetwork(ctx context.Context, tenantID, vnetID int) (*TenantLayer2Network, error)
- func (s *TenantLayer2NetworkService) List(ctx context.Context, opts ...ListOption) ([]TenantLayer2Network, error)
- func (s *TenantLayer2NetworkService) ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]TenantLayer2Network, error)
- func (s *TenantLayer2NetworkService) ListByTenant(ctx context.Context, tenantID int, opts ...ListOption) ([]TenantLayer2Network, error)
- func (s *TenantLayer2NetworkService) Unassign(ctx context.Context, tenantID, vnetID int) error
- func (s *TenantLayer2NetworkService) Update(ctx context.Context, id int, req *TenantLayer2NetworkUpdateRequest) (*TenantLayer2Network, error)
- type TenantLayer2NetworkServiceInterface
- type TenantLayer2NetworkUpdateRequest
- type TenantNode
- type TenantNodeCreateRequest
- type TenantNodeService
- func (s *TenantNodeService) Create(ctx context.Context, req *TenantNodeCreateRequest) (*TenantNode, error)
- func (s *TenantNodeService) Delete(ctx context.Context, id int) error
- func (s *TenantNodeService) Get(ctx context.Context, id int) (*TenantNode, error)
- func (s *TenantNodeService) GetByName(ctx context.Context, tenantID int, name string) (*TenantNode, error)
- func (s *TenantNodeService) Kill(ctx context.Context, id int) error
- func (s *TenantNodeService) List(ctx context.Context, opts ...ListOption) ([]TenantNode, error)
- func (s *TenantNodeService) ListByTenant(ctx context.Context, tenantID int, opts ...ListOption) ([]TenantNode, error)
- func (s *TenantNodeService) Migrate(ctx context.Context, id int, targetNode int) error
- func (s *TenantNodeService) PowerOff(ctx context.Context, id int) error
- func (s *TenantNodeService) PowerOn(ctx context.Context, id int) error
- func (s *TenantNodeService) Reset(ctx context.Context, id int) error
- func (s *TenantNodeService) Update(ctx context.Context, id int, req *TenantNodeUpdateRequest) (*TenantNode, error)
- type TenantNodeServiceInterface
- type TenantNodeUpdateRequest
- type TenantService
- func (s *TenantService) Clone(ctx context.Context, id int, opts *TenantCloneOptions) error
- func (s *TenantService) Create(ctx context.Context, req *TenantCreateRequest) (*Tenant, error)
- func (s *TenantService) Delete(ctx context.Context, id int) error
- func (s *TenantService) Get(ctx context.Context, id int) (*Tenant, error)
- func (s *TenantService) GetByName(ctx context.Context, name string) (*Tenant, error)
- func (s *TenantService) IsolateOff(ctx context.Context, id int) error
- func (s *TenantService) IsolateOn(ctx context.Context, id int) error
- func (s *TenantService) List(ctx context.Context, opts ...ListOption) ([]Tenant, error)
- func (s *TenantService) PowerOff(ctx context.Context, id int) error
- func (s *TenantService) PowerOn(ctx context.Context, id int) error
- func (s *TenantService) PowerOnWithNode(ctx context.Context, id int, preferredNode int) error
- func (s *TenantService) Reset(ctx context.Context, id int) error
- func (s *TenantService) Update(ctx context.Context, id int, req *TenantUpdateRequest) (*Tenant, error)
- type TenantServiceInterface
- type TenantSnapshot
- type TenantSnapshotService
- func (s *TenantSnapshotService) Delete(ctx context.Context, id int) error
- func (s *TenantSnapshotService) Get(ctx context.Context, id int) (*TenantSnapshot, error)
- func (s *TenantSnapshotService) GetByName(ctx context.Context, tenantID int, name string) (*TenantSnapshot, error)
- func (s *TenantSnapshotService) List(ctx context.Context, opts ...ListOption) ([]TenantSnapshot, error)
- func (s *TenantSnapshotService) ListByTenant(ctx context.Context, tenantID int, opts ...ListOption) ([]TenantSnapshot, error)
- func (s *TenantSnapshotService) ListExpiring(ctx context.Context, days int, opts ...ListOption) ([]TenantSnapshot, error)
- func (s *TenantSnapshotService) Refresh(ctx context.Context, tenantID int) error
- func (s *TenantSnapshotService) SetExpires(ctx context.Context, id int, expires int64) (*TenantSnapshot, error)
- func (s *TenantSnapshotService) SetNeverExpires(ctx context.Context, id int) (*TenantSnapshot, error)
- func (s *TenantSnapshotService) Update(ctx context.Context, id int, req *TenantSnapshotUpdateRequest) (*TenantSnapshot, error)
- type TenantSnapshotServiceInterface
- type TenantSnapshotUpdateRequest
- type TenantStorage
- type TenantStorageCreateRequest
- type TenantStorageService
- func (s *TenantStorageService) Create(ctx context.Context, req *TenantStorageCreateRequest) (*TenantStorage, error)
- func (s *TenantStorageService) Delete(ctx context.Context, id int) error
- func (s *TenantStorageService) Get(ctx context.Context, id int) (*TenantStorage, error)
- func (s *TenantStorageService) List(ctx context.Context, opts ...ListOption) ([]TenantStorage, error)
- func (s *TenantStorageService) ListByTenant(ctx context.Context, tenantID int, opts ...ListOption) ([]TenantStorage, error)
- func (s *TenantStorageService) Update(ctx context.Context, id int, req *TenantStorageUpdateRequest) (*TenantStorage, error)
- type TenantStorageServiceInterface
- type TenantStorageUpdateRequest
- type TenantUpdateRequest
- type USBDeviceSettings
- type UnsupportedVersionError
- type UpdateBranch
- type UpdateBranchService
- type UpdateBranchServiceInterface
- type UpdateSettings
- type UpdateSettingsService
- type UpdateSettingsServiceInterface
- type UpdateSourcePackage
- type UpdateSourcePackageService
- func (s *UpdateSourcePackageService) Get(ctx context.Context, id int) (*UpdateSourcePackage, error)
- func (s *UpdateSourcePackageService) List(ctx context.Context, opts ...ListOption) ([]UpdateSourcePackage, error)
- func (s *UpdateSourcePackageService) ListByBranchAndSource(ctx context.Context, branch, source int) ([]UpdateSourcePackage, error)
- type UpdateSourcePackageServiceInterface
- type User
- type UserAPIKey
- type UserAPIKeyCreateRequest
- type UserAPIKeyCreateResponse
- type UserAPIKeyService
- func (s *UserAPIKeyService) Create(ctx context.Context, req *UserAPIKeyCreateRequest) (*UserAPIKey, string, error)
- func (s *UserAPIKeyService) Delete(ctx context.Context, id int) error
- func (s *UserAPIKeyService) Get(ctx context.Context, id int) (*UserAPIKey, error)
- func (s *UserAPIKeyService) GetByName(ctx context.Context, userID int, name string) (*UserAPIKey, error)
- func (s *UserAPIKeyService) List(ctx context.Context, opts ...ListOption) ([]UserAPIKey, error)
- func (s *UserAPIKeyService) ListByUser(ctx context.Context, userID int, opts ...ListOption) ([]UserAPIKey, error)
- func (s *UserAPIKeyService) ListExpired(ctx context.Context, opts ...ListOption) ([]UserAPIKey, error)
- func (s *UserAPIKeyService) Update(ctx context.Context, id int, req *UserAPIKeyUpdateRequest) (*UserAPIKey, error)
- type UserAPIKeyServiceInterface
- type UserAPIKeyUpdateRequest
- type UserCreateRequest
- type UserService
- func (s *UserService) Create(ctx context.Context, req *UserCreateRequest) (*User, error)
- func (s *UserService) Delete(ctx context.Context, id int) error
- func (s *UserService) Disable(ctx context.Context, id int) error
- func (s *UserService) Enable(ctx context.Context, id int) error
- func (s *UserService) Get(ctx context.Context, id int) (*User, error)
- func (s *UserService) GetByName(ctx context.Context, name string) (*User, error)
- func (s *UserService) List(ctx context.Context, opts ...ListOption) ([]User, error)
- func (s *UserService) Update(ctx context.Context, id int, req *UserUpdateRequest) (*User, error)
- type UserServiceInterface
- type UserUpdateRequest
- type VGPUDeviceSettings
- type VM
- type VMCloneOptions
- type VMCreateRequest
- type VMDevice
- type VMDeviceCreateRequest
- type VMDeviceService
- func (s *VMDeviceService) Create(ctx context.Context, vmID int, req *VMDeviceCreateRequest) (*VMDevice, error)
- func (s *VMDeviceService) Delete(ctx context.Context, deviceID int) error
- func (s *VMDeviceService) Get(ctx context.Context, deviceID int) (*VMDevice, error)
- func (s *VMDeviceService) List(ctx context.Context, vmID int) ([]VMDevice, error)
- func (s *VMDeviceService) Update(ctx context.Context, deviceID int, req *VMDeviceUpdateRequest) (*VMDevice, error)
- type VMDeviceServiceInterface
- type VMDeviceUpdateRequest
- type VMDrive
- type VMDriveCreateRequest
- type VMDriveService
- func (s *VMDriveService) Create(ctx context.Context, vmID int, req *VMDriveCreateRequest) (*VMDrive, error)
- func (s *VMDriveService) Delete(ctx context.Context, driveID int) error
- func (s *VMDriveService) Get(ctx context.Context, driveID int) (*VMDrive, error)
- func (s *VMDriveService) HotUnplugDrive(ctx context.Context, vmID, driveID int) error
- func (s *VMDriveService) HotplugDrive(ctx context.Context, vmID, driveID int) error
- func (s *VMDriveService) List(ctx context.Context, vmID int) ([]VMDrive, error)
- func (s *VMDriveService) Update(ctx context.Context, driveID int, req *VMDriveUpdateRequest) (*VMDrive, error)
- type VMDriveServiceInterface
- type VMDriveUpdateRequest
- type VMMigrateOptions
- type VMNIC
- type VMNICCreateRequest
- type VMNICService
- func (s *VMNICService) Create(ctx context.Context, vmID int, req *VMNICCreateRequest) (*VMNIC, error)
- func (s *VMNICService) Delete(ctx context.Context, nicID int) error
- func (s *VMNICService) Get(ctx context.Context, nicID int) (*VMNIC, error)
- func (s *VMNICService) List(ctx context.Context, vmID int) ([]VMNIC, error)
- func (s *VMNICService) Update(ctx context.Context, nicID int, req *VMNICUpdateRequest) (*VMNIC, error)
- type VMNICServiceInterface
- type VMNICUpdateRequest
- type VMService
- func (s *VMService) Clone(ctx context.Context, id int, opts *VMCloneOptions) error
- func (s *VMService) Create(ctx context.Context, req *VMCreateRequest) (*VM, error)
- func (s *VMService) Delete(ctx context.Context, id int) error
- func (s *VMService) Get(ctx context.Context, id int) (*VM, error)
- func (s *VMService) GetConsoleURL(ctx context.Context, id int) (string, error)
- func (s *VMService) GuestReboot(ctx context.Context, id int) error
- func (s *VMService) GuestShutdown(ctx context.Context, id int) error
- func (s *VMService) List(ctx context.Context, opts ...ListOption) ([]VM, error)
- func (s *VMService) Migrate(ctx context.Context, id int, opts *VMMigrateOptions) error
- func (s *VMService) PowerOff(ctx context.Context, id int) error
- func (s *VMService) PowerOn(ctx context.Context, id int) error
- func (s *VMService) Reset(ctx context.Context, id int) error
- func (s *VMService) Snapshot(ctx context.Context, id int, opts *VMSnapshotOptions) error
- func (s *VMService) Update(ctx context.Context, id int, req *VMUpdateRequest) (*VM, error)
- type VMServiceInterface
- type VMSnapshot
- type VMSnapshotCreateRequest
- type VMSnapshotOptions
- type VMSnapshotRestoreOptions
- type VMSnapshotService
- func (s *VMSnapshotService) Create(ctx context.Context, req *VMSnapshotCreateRequest) (*VMSnapshot, error)
- func (s *VMSnapshotService) Delete(ctx context.Context, id int) error
- func (s *VMSnapshotService) Get(ctx context.Context, id int) (*VMSnapshot, error)
- func (s *VMSnapshotService) GetByName(ctx context.Context, vmID int, name string) (*VMSnapshot, error)
- func (s *VMSnapshotService) List(ctx context.Context, opts ...ListOption) ([]VMSnapshot, error)
- func (s *VMSnapshotService) ListByVM(ctx context.Context, vmID int, opts ...ListOption) ([]VMSnapshot, error)
- func (s *VMSnapshotService) ListExpiring(ctx context.Context, days int, opts ...ListOption) ([]VMSnapshot, error)
- func (s *VMSnapshotService) Restore(ctx context.Context, id int, opts *VMSnapshotRestoreOptions) error
- func (s *VMSnapshotService) SetExpires(ctx context.Context, id int, expires int64) (*VMSnapshot, error)
- func (s *VMSnapshotService) SetNeverExpires(ctx context.Context, id int) (*VMSnapshot, error)
- func (s *VMSnapshotService) Update(ctx context.Context, id int, req *VMSnapshotUpdateRequest) (*VMSnapshot, error)
- type VMSnapshotServiceInterface
- type VMSnapshotUpdateRequest
- type VMUpdateRequest
- type VNetAddress
- type VNetAddressCreateRequest
- type VNetAddressService
- func (s *VNetAddressService) Create(ctx context.Context, req *VNetAddressCreateRequest) (*VNetAddress, error)
- func (s *VNetAddressService) Delete(ctx context.Context, id int) error
- func (s *VNetAddressService) Get(ctx context.Context, id int) (*VNetAddress, error)
- func (s *VNetAddressService) GetByIP(ctx context.Context, vnetID int, ip string) (*VNetAddress, error)
- func (s *VNetAddressService) GetByMAC(ctx context.Context, vnetID int, mac string) (*VNetAddress, error)
- func (s *VNetAddressService) List(ctx context.Context, opts ...ListOption) ([]VNetAddress, error)
- func (s *VNetAddressService) ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]VNetAddress, error)
- func (s *VNetAddressService) ListByType(ctx context.Context, vnetID int, addrType string, opts ...ListOption) ([]VNetAddress, error)
- func (s *VNetAddressService) Update(ctx context.Context, id int, req *VNetAddressUpdateRequest) (*VNetAddress, error)
- type VNetAddressServiceInterface
- type VNetAddressUpdateRequest
- type VNetDNSRecord
- type VNetDNSRecordCreateRequest
- type VNetDNSRecordService
- func (s *VNetDNSRecordService) Create(ctx context.Context, req *VNetDNSRecordCreateRequest) (*VNetDNSRecord, error)
- func (s *VNetDNSRecordService) Delete(ctx context.Context, id int) error
- func (s *VNetDNSRecordService) Get(ctx context.Context, id int) (*VNetDNSRecord, error)
- func (s *VNetDNSRecordService) GetByHostAndType(ctx context.Context, zoneID int, host, recordType string) (*VNetDNSRecord, error)
- func (s *VNetDNSRecordService) List(ctx context.Context, opts ...ListOption) ([]VNetDNSRecord, error)
- func (s *VNetDNSRecordService) ListByType(ctx context.Context, zoneID int, recordType string, opts ...ListOption) ([]VNetDNSRecord, error)
- func (s *VNetDNSRecordService) ListByZone(ctx context.Context, zoneID int, opts ...ListOption) ([]VNetDNSRecord, error)
- func (s *VNetDNSRecordService) Update(ctx context.Context, id int, req *VNetDNSRecordUpdateRequest) (*VNetDNSRecord, error)
- type VNetDNSRecordServiceInterface
- type VNetDNSRecordUpdateRequest
- type VNetDNSView
- type VNetDNSViewCreateRequest
- type VNetDNSViewService
- func (s *VNetDNSViewService) Create(ctx context.Context, req *VNetDNSViewCreateRequest) (*VNetDNSView, error)
- func (s *VNetDNSViewService) Delete(ctx context.Context, id int) error
- func (s *VNetDNSViewService) Get(ctx context.Context, id int) (*VNetDNSView, error)
- func (s *VNetDNSViewService) GetByName(ctx context.Context, vnetID int, name string) (*VNetDNSView, error)
- func (s *VNetDNSViewService) List(ctx context.Context, opts ...ListOption) ([]VNetDNSView, error)
- func (s *VNetDNSViewService) ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]VNetDNSView, error)
- func (s *VNetDNSViewService) Update(ctx context.Context, id int, req *VNetDNSViewUpdateRequest) (*VNetDNSView, error)
- type VNetDNSViewServiceInterface
- type VNetDNSViewUpdateRequest
- type VNetDNSZone
- type VNetDNSZoneCreateRequest
- type VNetDNSZoneService
- func (s *VNetDNSZoneService) Create(ctx context.Context, req *VNetDNSZoneCreateRequest) (*VNetDNSZone, error)
- func (s *VNetDNSZoneService) Delete(ctx context.Context, id int) error
- func (s *VNetDNSZoneService) Get(ctx context.Context, id int) (*VNetDNSZone, error)
- func (s *VNetDNSZoneService) GetByDomain(ctx context.Context, viewID int, domain string) (*VNetDNSZone, error)
- func (s *VNetDNSZoneService) List(ctx context.Context, opts ...ListOption) ([]VNetDNSZone, error)
- func (s *VNetDNSZoneService) ListByView(ctx context.Context, viewID int, opts ...ListOption) ([]VNetDNSZone, error)
- func (s *VNetDNSZoneService) Update(ctx context.Context, id int, req *VNetDNSZoneUpdateRequest) (*VNetDNSZone, error)
- type VNetDNSZoneServiceInterface
- type VNetDNSZoneUpdateRequest
- type VNetHost
- type VNetHostCreateRequest
- type VNetHostService
- func (s *VNetHostService) Create(ctx context.Context, req *VNetHostCreateRequest) (*VNetHost, error)
- func (s *VNetHostService) Delete(ctx context.Context, id int) error
- func (s *VNetHostService) Get(ctx context.Context, id int) (*VNetHost, error)
- func (s *VNetHostService) GetByHost(ctx context.Context, vnetID int, hostname string) (*VNetHost, error)
- func (s *VNetHostService) GetByIP(ctx context.Context, vnetID int, ip string) (*VNetHost, error)
- func (s *VNetHostService) List(ctx context.Context, opts ...ListOption) ([]VNetHost, error)
- func (s *VNetHostService) ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]VNetHost, error)
- func (s *VNetHostService) Update(ctx context.Context, id int, req *VNetHostUpdateRequest) (*VNetHost, error)
- type VNetHostServiceInterface
- type VNetHostUpdateRequest
- type VNetIPSec
- type VNetIPSecConnection
- type VNetIPSecConnectionService
- func (s *VNetIPSecConnectionService) Get(ctx context.Context, id int) (*VNetIPSecConnection, error)
- func (s *VNetIPSecConnectionService) List(ctx context.Context, opts ...ListOption) ([]VNetIPSecConnection, error)
- func (s *VNetIPSecConnectionService) ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]VNetIPSecConnection, error)
- func (s *VNetIPSecConnectionService) ListByPhase1(ctx context.Context, phase1ID int, opts ...ListOption) ([]VNetIPSecConnection, error)
- type VNetIPSecConnectionServiceInterface
- type VNetIPSecCreateRequest
- type VNetIPSecPhase1
- type VNetIPSecPhase1CreateRequest
- type VNetIPSecPhase1Service
- func (s *VNetIPSecPhase1Service) Create(ctx context.Context, req *VNetIPSecPhase1CreateRequest) (*VNetIPSecPhase1, error)
- func (s *VNetIPSecPhase1Service) Delete(ctx context.Context, id int) error
- func (s *VNetIPSecPhase1Service) Get(ctx context.Context, id int) (*VNetIPSecPhase1, error)
- func (s *VNetIPSecPhase1Service) GetByName(ctx context.Context, ipsecID int, name string) (*VNetIPSecPhase1, error)
- func (s *VNetIPSecPhase1Service) List(ctx context.Context, opts ...ListOption) ([]VNetIPSecPhase1, error)
- func (s *VNetIPSecPhase1Service) ListByIPSec(ctx context.Context, ipsecID int, opts ...ListOption) ([]VNetIPSecPhase1, error)
- func (s *VNetIPSecPhase1Service) Update(ctx context.Context, id int, req *VNetIPSecPhase1UpdateRequest) (*VNetIPSecPhase1, error)
- type VNetIPSecPhase1ServiceInterface
- type VNetIPSecPhase1UpdateRequest
- type VNetIPSecPhase2
- type VNetIPSecPhase2CreateRequest
- type VNetIPSecPhase2Service
- func (s *VNetIPSecPhase2Service) Create(ctx context.Context, req *VNetIPSecPhase2CreateRequest) (*VNetIPSecPhase2, error)
- func (s *VNetIPSecPhase2Service) Delete(ctx context.Context, id int) error
- func (s *VNetIPSecPhase2Service) Get(ctx context.Context, id int) (*VNetIPSecPhase2, error)
- func (s *VNetIPSecPhase2Service) GetByName(ctx context.Context, phase1ID int, name string) (*VNetIPSecPhase2, error)
- func (s *VNetIPSecPhase2Service) List(ctx context.Context, opts ...ListOption) ([]VNetIPSecPhase2, error)
- func (s *VNetIPSecPhase2Service) ListByPhase1(ctx context.Context, phase1ID int, opts ...ListOption) ([]VNetIPSecPhase2, error)
- func (s *VNetIPSecPhase2Service) Update(ctx context.Context, id int, req *VNetIPSecPhase2UpdateRequest) (*VNetIPSecPhase2, error)
- type VNetIPSecPhase2ServiceInterface
- type VNetIPSecPhase2UpdateRequest
- type VNetIPSecService
- func (s *VNetIPSecService) Create(ctx context.Context, req *VNetIPSecCreateRequest) (*VNetIPSec, error)
- func (s *VNetIPSecService) Delete(ctx context.Context, id int) error
- func (s *VNetIPSecService) Get(ctx context.Context, id int) (*VNetIPSec, error)
- func (s *VNetIPSecService) GetByNetwork(ctx context.Context, vnetID int) (*VNetIPSec, error)
- func (s *VNetIPSecService) List(ctx context.Context, opts ...ListOption) ([]VNetIPSec, error)
- func (s *VNetIPSecService) Update(ctx context.Context, id int, req *VNetIPSecUpdateRequest) (*VNetIPSec, error)
- type VNetIPSecServiceInterface
- type VNetIPSecUpdateRequest
- type VNetRule
- type VNetRuleAlias
- type VNetRuleAliasCreateRequest
- type VNetRuleAliasService
- func (s *VNetRuleAliasService) Create(ctx context.Context, req *VNetRuleAliasCreateRequest) (*VNetRuleAlias, error)
- func (s *VNetRuleAliasService) Delete(ctx context.Context, id int) error
- func (s *VNetRuleAliasService) Get(ctx context.Context, id int) (*VNetRuleAlias, error)
- func (s *VNetRuleAliasService) GetByName(ctx context.Context, name string) (*VNetRuleAlias, error)
- func (s *VNetRuleAliasService) List(ctx context.Context, opts ...ListOption) ([]VNetRuleAlias, error)
- func (s *VNetRuleAliasService) Update(ctx context.Context, id int, req *VNetRuleAliasUpdateRequest) (*VNetRuleAlias, error)
- type VNetRuleAliasServiceInterface
- type VNetRuleAliasUpdateRequest
- type VNetRuleCreateRequest
- type VNetRuleService
- func (s *VNetRuleService) Create(ctx context.Context, req *VNetRuleCreateRequest) (*VNetRule, error)
- func (s *VNetRuleService) Delete(ctx context.Context, id int) error
- func (s *VNetRuleService) Disable(ctx context.Context, id int, apply bool) error
- func (s *VNetRuleService) Enable(ctx context.Context, id int, apply bool) error
- func (s *VNetRuleService) Get(ctx context.Context, id int) (*VNetRule, error)
- func (s *VNetRuleService) GetByName(ctx context.Context, vnetID int, name string) (*VNetRule, error)
- func (s *VNetRuleService) List(ctx context.Context, opts ...ListOption) ([]VNetRule, error)
- func (s *VNetRuleService) ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]VNetRule, error)
- func (s *VNetRuleService) Update(ctx context.Context, id int, req *VNetRuleUpdateRequest) (*VNetRule, error)
- type VNetRuleServiceInterface
- type VNetRuleUpdateRequest
- type VNetWireGuard
- type VNetWireGuardCreateRequest
- type VNetWireGuardPeer
- type VNetWireGuardPeerCreateRequest
- type VNetWireGuardPeerService
- func (s *VNetWireGuardPeerService) Create(ctx context.Context, req *VNetWireGuardPeerCreateRequest) (*VNetWireGuardPeer, error)
- func (s *VNetWireGuardPeerService) Delete(ctx context.Context, id int) error
- func (s *VNetWireGuardPeerService) Get(ctx context.Context, id int) (*VNetWireGuardPeer, error)
- func (s *VNetWireGuardPeerService) GetByName(ctx context.Context, wireguardID int, name string) (*VNetWireGuardPeer, error)
- func (s *VNetWireGuardPeerService) GetConfig(ctx context.Context, id int) (string, error)
- func (s *VNetWireGuardPeerService) List(ctx context.Context, opts ...ListOption) ([]VNetWireGuardPeer, error)
- func (s *VNetWireGuardPeerService) ListByWireGuard(ctx context.Context, wireguardID int, opts ...ListOption) ([]VNetWireGuardPeer, error)
- func (s *VNetWireGuardPeerService) Update(ctx context.Context, id int, req *VNetWireGuardPeerUpdateRequest) (*VNetWireGuardPeer, error)
- type VNetWireGuardPeerServiceInterface
- type VNetWireGuardPeerStatus
- type VNetWireGuardPeerStatusService
- func (s *VNetWireGuardPeerStatusService) Get(ctx context.Context, id int) (*VNetWireGuardPeerStatus, error)
- func (s *VNetWireGuardPeerStatusService) GetByPeer(ctx context.Context, peerID int) (*VNetWireGuardPeerStatus, error)
- func (s *VNetWireGuardPeerStatusService) List(ctx context.Context, opts ...ListOption) ([]VNetWireGuardPeerStatus, error)
- type VNetWireGuardPeerStatusServiceInterface
- type VNetWireGuardPeerUpdateRequest
- type VNetWireGuardService
- func (s *VNetWireGuardService) Create(ctx context.Context, req *VNetWireGuardCreateRequest) (*VNetWireGuard, error)
- func (s *VNetWireGuardService) Delete(ctx context.Context, id int) error
- func (s *VNetWireGuardService) Get(ctx context.Context, id int) (*VNetWireGuard, error)
- func (s *VNetWireGuardService) GetByName(ctx context.Context, vnetID int, name string) (*VNetWireGuard, error)
- func (s *VNetWireGuardService) List(ctx context.Context, opts ...ListOption) ([]VNetWireGuard, error)
- func (s *VNetWireGuardService) ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]VNetWireGuard, error)
- func (s *VNetWireGuardService) Update(ctx context.Context, id int, req *VNetWireGuardUpdateRequest) (*VNetWireGuard, error)
- type VNetWireGuardServiceInterface
- type VNetWireGuardUpdateRequest
- type ValidationError
- type Volume
- type VolumeBrowserEntry
- type VolumeBrowserFilter
- type VolumeBrowserJob
- type VolumeBrowserParams
- type VolumeBrowserRequest
- type VolumeBrowserService
- func (s *VolumeBrowserService) Browse(ctx context.Context, volumeID, dir string, limit int) ([]VolumeBrowserEntry, error)
- func (s *VolumeBrowserService) BrowseWithOptions(ctx context.Context, volumeID, dir string, limit int, offset *int, ...) ([]VolumeBrowserEntry, error)
- func (s *VolumeBrowserService) CreateJob(ctx context.Context, req *VolumeBrowserRequest) (*VolumeBrowserJob, error)
- func (s *VolumeBrowserService) GetJob(ctx context.Context, id string) (*VolumeBrowserJob, error)
- func (s *VolumeBrowserService) List(ctx context.Context, opts ...ListOption) ([]VolumeBrowserJob, error)
- func (s *VolumeBrowserService) ListByVolume(ctx context.Context, volumeID string, opts ...ListOption) ([]VolumeBrowserJob, error)
- func (s *VolumeBrowserService) WaitForResult(ctx context.Context, jobID string, timeout time.Duration) ([]VolumeBrowserEntry, error)
- type VolumeBrowserServiceInterface
- type VolumeCIFSShare
- type VolumeCIFSShareCreateRequest
- type VolumeCIFSShareService
- func (s *VolumeCIFSShareService) Create(ctx context.Context, req *VolumeCIFSShareCreateRequest) (*VolumeCIFSShare, error)
- func (s *VolumeCIFSShareService) Delete(ctx context.Context, id string) error
- func (s *VolumeCIFSShareService) Get(ctx context.Context, id string) (*VolumeCIFSShare, error)
- func (s *VolumeCIFSShareService) GetByName(ctx context.Context, volumeID, name string) (*VolumeCIFSShare, error)
- func (s *VolumeCIFSShareService) List(ctx context.Context, opts ...ListOption) ([]VolumeCIFSShare, error)
- func (s *VolumeCIFSShareService) ListByVolume(ctx context.Context, volumeID string, opts ...ListOption) ([]VolumeCIFSShare, error)
- func (s *VolumeCIFSShareService) Update(ctx context.Context, id string, req *VolumeCIFSShareUpdateRequest) (*VolumeCIFSShare, error)
- type VolumeCIFSShareServiceInterface
- type VolumeCIFSShareUpdateRequest
- type VolumeCreateRequest
- type VolumeNFSShare
- type VolumeNFSShareCreateRequest
- type VolumeNFSShareService
- func (s *VolumeNFSShareService) Create(ctx context.Context, req *VolumeNFSShareCreateRequest) (*VolumeNFSShare, error)
- func (s *VolumeNFSShareService) Delete(ctx context.Context, id string) error
- func (s *VolumeNFSShareService) Get(ctx context.Context, id string) (*VolumeNFSShare, error)
- func (s *VolumeNFSShareService) GetByName(ctx context.Context, volumeID, name string) (*VolumeNFSShare, error)
- func (s *VolumeNFSShareService) List(ctx context.Context, opts ...ListOption) ([]VolumeNFSShare, error)
- func (s *VolumeNFSShareService) ListByVolume(ctx context.Context, volumeID string, opts ...ListOption) ([]VolumeNFSShare, error)
- func (s *VolumeNFSShareService) Update(ctx context.Context, id string, req *VolumeNFSShareUpdateRequest) (*VolumeNFSShare, error)
- type VolumeNFSShareServiceInterface
- type VolumeNFSShareUpdateRequest
- type VolumeService
- func (s *VolumeService) Create(ctx context.Context, req *VolumeCreateRequest) (*Volume, error)
- func (s *VolumeService) Delete(ctx context.Context, id string) error
- func (s *VolumeService) Disable(ctx context.Context, id string) error
- func (s *VolumeService) Enable(ctx context.Context, id string) error
- func (s *VolumeService) Get(ctx context.Context, id string) (*Volume, error)
- func (s *VolumeService) GetByName(ctx context.Context, serviceID int, name string) (*Volume, error)
- func (s *VolumeService) List(ctx context.Context, opts ...ListOption) ([]Volume, error)
- func (s *VolumeService) ListByService(ctx context.Context, serviceID int) ([]Volume, error)
- func (s *VolumeService) Reset(ctx context.Context, id string) error
- func (s *VolumeService) Update(ctx context.Context, id string, req *VolumeUpdateRequest) (*Volume, error)
- type VolumeServiceInterface
- type VolumeSnapshot
- type VolumeSnapshotCreateRequest
- type VolumeSnapshotService
- func (s *VolumeSnapshotService) Create(ctx context.Context, req *VolumeSnapshotCreateRequest) (*VolumeSnapshot, error)
- func (s *VolumeSnapshotService) Delete(ctx context.Context, id int) error
- func (s *VolumeSnapshotService) Disable(ctx context.Context, id int) error
- func (s *VolumeSnapshotService) Enable(ctx context.Context, id int) error
- func (s *VolumeSnapshotService) Get(ctx context.Context, id int) (*VolumeSnapshot, error)
- func (s *VolumeSnapshotService) GetByName(ctx context.Context, volumeID int, name string) (*VolumeSnapshot, error)
- func (s *VolumeSnapshotService) List(ctx context.Context, opts ...ListOption) ([]VolumeSnapshot, error)
- func (s *VolumeSnapshotService) ListByVolume(ctx context.Context, volumeID int, opts ...ListOption) ([]VolumeSnapshot, error)
- func (s *VolumeSnapshotService) ListExpiring(ctx context.Context, days int, opts ...ListOption) ([]VolumeSnapshot, error)
- func (s *VolumeSnapshotService) ListManual(ctx context.Context, opts ...ListOption) ([]VolumeSnapshot, error)
- func (s *VolumeSnapshotService) SetExpires(ctx context.Context, id int, expires int64) (*VolumeSnapshot, error)
- func (s *VolumeSnapshotService) SetNeverExpires(ctx context.Context, id int) (*VolumeSnapshot, error)
- func (s *VolumeSnapshotService) Update(ctx context.Context, id int, req *VolumeSnapshotUpdateRequest) (*VolumeSnapshot, error)
- type VolumeSnapshotServiceInterface
- type VolumeSnapshotUpdateRequest
- type VolumeSync
- type VolumeSyncCreateRequest
- type VolumeSyncService
- func (s *VolumeSyncService) Create(ctx context.Context, req *VolumeSyncCreateRequest) (*VolumeSync, error)
- func (s *VolumeSyncService) Delete(ctx context.Context, id string) error
- func (s *VolumeSyncService) Disable(ctx context.Context, id string) error
- func (s *VolumeSyncService) Enable(ctx context.Context, id string) error
- func (s *VolumeSyncService) Get(ctx context.Context, id string) (*VolumeSync, error)
- func (s *VolumeSyncService) GetByName(ctx context.Context, serviceID int, name string) (*VolumeSync, error)
- func (s *VolumeSyncService) List(ctx context.Context, opts ...ListOption) ([]VolumeSync, error)
- func (s *VolumeSyncService) ListByService(ctx context.Context, serviceID int) ([]VolumeSync, error)
- func (s *VolumeSyncService) ListEnabled(ctx context.Context, opts ...ListOption) ([]VolumeSync, error)
- func (s *VolumeSyncService) Start(ctx context.Context, id string) error
- func (s *VolumeSyncService) Stop(ctx context.Context, id string) error
- func (s *VolumeSyncService) Update(ctx context.Context, id string, req *VolumeSyncUpdateRequest) (*VolumeSync, error)
- type VolumeSyncServiceInterface
- type VolumeSyncUpdateRequest
- type VolumeUpdateRequest
- type Webhook
- type WebhookSendRequest
- type WebhookService
- func (s *WebhookService) Delete(ctx context.Context, id int) error
- func (s *WebhookService) Get(ctx context.Context, id int) (*Webhook, error)
- func (s *WebhookService) List(ctx context.Context, opts ...ListOption) ([]Webhook, error)
- func (s *WebhookService) ListByStatus(ctx context.Context, status string, opts ...ListOption) ([]Webhook, error)
- func (s *WebhookService) ListByWebhookURL(ctx context.Context, webhookURLID int, opts ...ListOption) ([]Webhook, error)
- func (s *WebhookService) ListFailed(ctx context.Context, opts ...ListOption) ([]Webhook, error)
- func (s *WebhookService) ListPending(ctx context.Context, opts ...ListOption) ([]Webhook, error)
- type WebhookServiceInterface
- type WebhookURL
- type WebhookURLCreateRequest
- type WebhookURLService
- func (s *WebhookURLService) Create(ctx context.Context, req *WebhookURLCreateRequest) (*WebhookURL, error)
- func (s *WebhookURLService) Delete(ctx context.Context, id int) error
- func (s *WebhookURLService) Get(ctx context.Context, id int) (*WebhookURL, error)
- func (s *WebhookURLService) GetByName(ctx context.Context, name string) (*WebhookURL, error)
- func (s *WebhookURLService) List(ctx context.Context, opts ...ListOption) ([]WebhookURL, error)
- func (s *WebhookURLService) Send(ctx context.Context, id int, message string) error
- func (s *WebhookURLService) Update(ctx context.Context, id int, req *WebhookURLUpdateRequest) (*WebhookURL, error)
- type WebhookURLServiceInterface
- type WebhookURLUpdateRequest
Constants ¶
const ( AlarmLevelAudit = "audit" AlarmLevelMessage = "message" AlarmLevelWarning = "warning" AlarmLevelError = "error" AlarmLevelCritical = "critical" AlarmLevelSummary = "summary" AlarmLevelDebug = "debug" )
AlarmLevel constants for alarm severity.
const ( AlarmOwnerTypeVM = "vms" AlarmOwnerTypeNetwork = "vnets" AlarmOwnerTypeTenantNode = "tenant_nodes" AlarmOwnerTypeNode = "nodes" AlarmOwnerTypeUser = "users" AlarmOwnerTypeSystem = "system" AlarmOwnerTypeCloudSnapshot = "cloud_snapshots" )
AlarmOwnerType constants for alarm owner types.
const ( AlarmSubOwnerTypeDrive = "machine_drives" AlarmSubOwnerTypeNIC = "machine_nics" AlarmSubOwnerTypeDevice = "machine_devices" AlarmSubOwnerTypeSMTPSettings = "smtp_settings" )
AlarmSubOwnerType constants for alarm sub-owner types.
const ( // APIKeyExpiresNever indicates the API key never expires. APIKeyExpiresNever = "never" // APIKeyExpiresDate indicates the API key expires at a specific date. APIKeyExpiresDate = "date" )
API key expiration type constants.
const ( // CertificateTypeManual indicates a manually uploaded certificate. CertificateTypeManual = "manual" // CertificateTypeLetsEncrypt indicates a Let's Encrypt (ACME) certificate. CertificateTypeLetsEncrypt = "letsencrypt" // CertificateTypeSelfSigned indicates a self-signed certificate. CertificateTypeSelfSigned = "self_signed" )
Certificate type constants
const ( // CertificateKeyTypeECDSA indicates an ECDSA key. CertificateKeyTypeECDSA = "ecdsa" // CertificateKeyTypeRSA indicates an RSA key. CertificateKeyTypeRSA = "rsa" )
Certificate key type constants
const ( CloudSnapshotStatusNormal string = "normal" CloudSnapshotStatusHeld string = "held" )
Cloud snapshot status values
const ( CloudSnapshotImmutableUnlocked string = "unlocked" CloudSnapshotImmutableUnlocking string = "unlocking" CloudSnapshotImmutableLocked string = "locked" )
Cloud snapshot immutable status values
const ( LogLevelAudit string = "audit" LogLevelMessage string = "message" LogLevelWarning string = "warning" LogLevelError string = "error" LogLevelCritical string = "critical" LogLevelSummary string = "summary" LogLevelDebug string = "debug" )
Log level constants
const ( LogObjectTypeCatalogRepository string = "catalog_repository" LogObjectTypeCloudSnapshots string = "cloud_snapshots" LogObjectTypeCluster string = "cluster" LogObjectTypeFile string = "file" LogObjectTypeGroup string = "group" LogObjectTypeNode string = "node" LogObjectTypeOIDCApplication string = "oidc_application" LogObjectTypeOther string = "other" LogObjectTypePermission string = "permission" LogObjectTypeServiceContainer string = "service_container" LogObjectTypeSMTP string = "smtp" LogObjectTypeTenant string = "tenant" LogObjectTypeUpdates string = "updates" LogObjectTypeUser string = "user" LogObjectTypeVM string = "vm" LogObjectTypeVMService string = "vm_service" // NAS Service LogObjectTypeVMImport string = "vm_import" LogObjectTypeVMwareContainer string = "vmware_container" LogObjectTypeVNet string = "vnet" LogObjectTypeSite string = "site" LogObjectTypeSystem string = "system" LogObjectTypeSnapshotProfile string = "snapshot_profile" LogObjectTypeImportExport string = "import_export" LogObjectTypeTask string = "task" )
Log object type constants
const ( NetworkQueryLogs = "logs" NetworkQueryTopCPU = "top" NetworkQueryTopNetwork = "top_if" NetworkQueryTCPDump = "tcpdump" NetworkQueryPing = "ping" NetworkQueryDNS = "dns" NetworkQueryTraceroute = "traceroute" NetworkQueryIP = "ip" NetworkQueryIPSec = "ipsec" NetworkQueryWhatsMyIP = "whatsmyip" NetworkQueryARP = "arp" NetworkQueryARPScan = "arp-scan" NetworkQueryFRR = "frr" NetworkQueryTrace = "trace" NetworkQueryDHCPReleaseRenew = "dhcp_release_renew" NetworkQueryWireGuard = "wireguard" NetworkQueryFirewall = "firewall" NetworkQueryNmap = "nmap" NetworkQueryTCPConnect = "tcp_connect" )
Query type constants for network diagnostics.
const ( NetworkQueryStatusRunning = "running" NetworkQueryStatusError = "error" NetworkQueryStatusComplete = "complete" )
Query status constants.
const ( PermissionTableVMs = "vms" PermissionTableNetworks = "vnets" PermissionTableVolumes = "volumes" PermissionTableTenants = "tenants" PermissionTableUsers = "users" PermissionTableGroups = "groups" PermissionTableFiles = "media_images" PermissionTableClusters = "clusters" PermissionTableNodes = "machines" PermissionTableSnapshots = "snapshots" )
Common resource table names for use with permissions.
const ( SiteConfigDisabled string = "disabled" SiteConfigSend string = "send" SiteConfigReceive string = "receive" SiteConfigBoth string = "both" )
Site configuration options for sync direction
const ( SiteManagementManage string = "manage" // Manage this site's machines SiteManagementManaged string = "managed" // This site can manage my machines )
Site management config options
const ( SiteStatusIdle string = "idle" SiteStatusAuthenticating string = "authenticating" SiteStatusSyncing string = "syncing" SiteStatusError string = "error" SiteStatusWarning string = "warning" )
Site status values
const ( SiteAuthUnauthenticated string = "unauthenticated" SiteAuthAuthenticated string = "authenticated" SiteAuthLegacy string = "legacy" )
Site authentication status values
const ( SiteSyncIncomingStatusGeneratingReg string = "generating_reg" SiteSyncIncomingStatusSyncing string = "syncing" SiteSyncIncomingStatusOffline string = "offline" SiteSyncIncomingStatusError string = "error" SiteSyncIncomingStatusRegenerationNeeded string = "regeneration_needed" )
Incoming sync status values
const ( SiteSyncOutgoingStatusInitializing string = "initializing" SiteSyncOutgoingStatusSyncing string = "syncing" SiteSyncOutgoingStatusOffline string = "offline" SiteSyncOutgoingStatusError string = "error" )
Outgoing sync status values
const ( SiteSyncTierUnspecified string = "unspecified" SiteSyncTier1 string = "1" SiteSyncTier2 string = "2" SiteSyncTier3 string = "3" SiteSyncTier4 string = "4" SiteSyncTier5 string = "5" )
Tier options for site syncs
const ( // FrequencyCustom allows custom scheduling with all time fields. FrequencyCustom = "custom" // FrequencyHourly takes snapshots every hour. FrequencyHourly = "hourly" // FrequencyDaily takes snapshots once per day. FrequencyDaily = "daily" // FrequencyWeekly takes snapshots once per week. FrequencyWeekly = "weekly" // FrequencyMonthly takes snapshots once per month. FrequencyMonthly = "monthly" // FrequencyYearly takes snapshots once per year. FrequencyYearly = "yearly" )
Frequency constants for snapshot profile periods.
const ( DayOfWeekSunday = "sun" DayOfWeekMonday = "mon" DayOfWeekTuesday = "tue" DayOfWeekWednesday = "wed" DayOfWeekThursday = "thu" DayOfWeekFriday = "fri" DayOfWeekSaturday = "sat" DayOfWeekAny = "any" )
DayOfWeek constants for snapshot profile periods.
const ( MaxTier1 = "1" // No restrictions (highest tier) MaxTier2 = "2" MaxTier3 = "3" MaxTier4 = "4" MaxTier5 = "5" // Lowest tier )
MaxTier constants for snapshot storage tier restrictions.
const ( TaskStatusIdle = "idle" TaskStatusRunning = "running" )
TaskStatus constants for task status.
const ( DeviceTypeUSB = "node_usb_devices" DeviceTypeTPM = "tpm" DeviceTypePCI = "node_pci_devices" DeviceTypeVGPU = "node_nvidia_vgpu_devices" )
Device type constants
const ( // AddressTypeDynamic indicates a DHCP-assigned address. AddressTypeDynamic = "dynamic" // AddressTypeStatic indicates a statically assigned address. AddressTypeStatic = "static" // AddressTypeIPAlias indicates an IP alias. AddressTypeIPAlias = "ipalias" // AddressTypeProxy indicates a proxy ARP address. AddressTypeProxy = "proxy" // AddressTypeVirtual indicates a virtual IP address. AddressTypeVirtual = "virtual" )
Address type constants
const ( // DNSZoneTypeMaster indicates a primary zone. DNSZoneTypeMaster = "master" // DNSZoneTypeSlave indicates a secondary zone. DNSZoneTypeSlave = "slave" // DNSZoneTypeRedirect indicates a redirect zone. DNSZoneTypeRedirect = "redirect" // DNSZoneTypeForward indicates a forward zone. DNSZoneTypeForward = "forward" // DNSZoneTypeStaticStub indicates a static stub zone. DNSZoneTypeStaticStub = "static-stub" // DNSZoneTypeStub indicates a stub zone. DNSZoneTypeStub = "stub" )
DNS zone type constants
const ( // DNSRecordTypeA indicates an A (IPv4 address) record. DNSRecordTypeA = "A" // DNSRecordTypeAAAA indicates an AAAA (IPv6 address) record. DNSRecordTypeAAAA = "AAAA" // DNSRecordTypeCNAME indicates a CNAME (canonical name) record. DNSRecordTypeCNAME = "CNAME" // DNSRecordTypeMX indicates an MX (mail exchange) record. DNSRecordTypeMX = "MX" // DNSRecordTypeNS indicates an NS (name server) record. DNSRecordTypeNS = "NS" // DNSRecordTypePTR indicates a PTR (pointer) record. DNSRecordTypePTR = "PTR" // DNSRecordTypeSRV indicates an SRV (service) record. DNSRecordTypeSRV = "SRV" // DNSRecordTypeTXT indicates a TXT (text) record. DNSRecordTypeTXT = "TXT" // DNSRecordTypeCAA indicates a CAA (certificate authority authorization) record. DNSRecordTypeCAA = "CAA" )
DNS record type constants
const ( // HostTypeHost indicates a single hostname override. HostTypeHost = "host" // HostTypeDomain indicates a domain-wide override. HostTypeDomain = "domain" )
Host override type constants
const ( // IPSecModeNormal uses the normal GUI-based configuration. IPSecModeNormal = "normal" // IPSecModeAdvanced uses raw configuration files. IPSecModeAdvanced = "advanced" )
IPSec mode constants
const ( // IPSecUniqueIDsYes replaces old IKE_SAs with same ID. IPSecUniqueIDsYes = "yes" // IPSecUniqueIDsNo keeps duplicate IKE_SAs. IPSecUniqueIDsNo = "no" // IPSecUniqueIDsNever ignores INITIAL_CONTACT notifies. IPSecUniqueIDsNever = "never" // IPSecUniqueIDsReplace is identical to yes. IPSecUniqueIDsReplace = "replace" // IPSecUniqueIDsKeep rejects new setups, keeps old. IPSecUniqueIDsKeep = "keep" )
IPSec uniqueids constants
const ( // IPSecKeyExchangeIKEv1 uses IKEv1 only. IPSecKeyExchangeIKEv1 = "ikev1" // IPSecKeyExchangeIKEv2 uses IKEv2 only. IPSecKeyExchangeIKEv2 = "ikev2" // IPSecKeyExchangeAuto uses IKEv2 as initiator, accepts either as responder. IPSecKeyExchangeAuto = "ike" )
Phase 1 key exchange constants
const ( // IPSecAuthPSK uses mutual pre-shared key. IPSecAuthPSK = "psk" // IPSecAuthPubkey uses mutual RSA certificates. IPSecAuthPubkey = "pubkey" )
Phase 1 authentication constants
const ( // IPSecNegotiationMain uses main mode (more secure). IPSecNegotiationMain = "main" // IPSecNegotiationAggressive uses aggressive mode (more flexible, less secure). IPSecNegotiationAggressive = "aggressive" )
Phase 1 negotiation mode constants
const ( // IPSecAutoAdd loads without starting (responder only). IPSecAutoAdd = "add" // IPSecAutoRoute loads and installs traps (on-demand). IPSecAutoRoute = "route" // IPSecAutoStart loads and starts immediately. IPSecAutoStart = "start" )
Phase 1 connection behavior constants
const ( // IPSecDPDNone disables active DPD. IPSecDPDNone = "none" // IPSecDPDClear closes connection on timeout. IPSecDPDClear = "clear" // IPSecDPDHold installs trap policy on timeout. IPSecDPDHold = "hold" // IPSecDPDRestart renegotiates on timeout. IPSecDPDRestart = "restart" )
Phase 1 DPD action constants
const ( // IPSecModeTunnel encapsulates entire IP packets (subnet-to-subnet). IPSecModeTunnel = "tunnel" // IPSecModeTransport encrypts only payload (host-to-host). IPSecModeTransport = "transport" )
Phase 2 mode constants
const ( // IPSecProtocolESP uses Encapsulating Security Payload (encryption). IPSecProtocolESP = "esp" // IPSecProtocolAH uses Authentication Header (authentication only). IPSecProtocolAH = "ah" )
Phase 2 protocol constants
const ( // WireGuardPeerFirewallSiteToSite creates routes and accept rules for allowed IPs. WireGuardPeerFirewallSiteToSite = "site-to-site" // WireGuardPeerFirewallRemoteUser creates rules and SNATs outbound traffic. WireGuardPeerFirewallRemoteUser = "remote-user" // WireGuardPeerFirewallNone doesn't create any firewall rules. WireGuardPeerFirewallNone = "none" )
WireGuard peer firewall configuration constants
const ( VolumeBrowserStatusRunning = "running" VolumeBrowserStatusComplete = "complete" VolumeBrowserStatusError = "error" )
VolumeBrowserJob status values
const ( VolumeBrowserQueryGetDir = "get-dir" VolumeBrowserQueryRename = "rename" VolumeBrowserQueryDelete = "delete" VolumeBrowserQueryPaste = "paste" )
VolumeBrowserQuery types
const ( NFSSquashRoot = "root_squash" // Squash root user to anonymous NFSSquashAll = "all_squash" // Squash all users to anonymous NFSSquashNone = "no_root_squash" // No squashing (root has full access) )
NFS squash options
const ( NFSAccessReadOnly = "ro" // Read-only access NFSAccessReadWrite = "rw" // Read and write access )
NFS data access options
const ( // WebhookStatusQueued indicates the webhook is queued for delivery. WebhookStatusQueued = "queued" // WebhookStatusRunning indicates the webhook is currently being delivered. WebhookStatusRunning = "running" // WebhookStatusSent indicates the webhook was successfully delivered. WebhookStatusSent = "sent" // WebhookStatusError indicates the webhook delivery failed. WebhookStatusError = "error" )
Webhook status constants.
const ( // WebhookAuthNone indicates no authorization. WebhookAuthNone = "none" // WebhookAuthBasic indicates HTTP Basic authentication. WebhookAuthBasic = "basic" // WebhookAuthBearer indicates Bearer token authentication. WebhookAuthBearer = "bearer" // WebhookAuthAPIKey indicates API key authentication. WebhookAuthAPIKey = "apikey" )
WebhookURL authorization type constants.
const DefaultChunkSize = 262144
DefaultChunkSize is the default chunk size for file uploads (256KB). This matches the chunk size used by verge-cli and PSVergeOS.
const RequiredMajorVersion = 26
RequiredMajorVersion is the VergeOS major version this SDK requires.
Variables ¶
This section is empty.
Functions ¶
func IsAuthError ¶
IsAuthError returns true if the error is an AuthError or a 401/403 API error.
func IsNotFoundError ¶
IsNotFoundError returns true if the error is a NotFoundError or a 404 API error.
func IsUnsupportedVersionError ¶ added in v0.1.1
IsUnsupportedVersionError returns true if err is an UnsupportedVersionError.
func IsValidationError ¶
IsValidationError returns true if the error is a ValidationError or a 400 API error.
Types ¶
type APIError ¶
type APIError struct {
// StatusCode is the HTTP status code returned by the API.
StatusCode int
// Endpoint is the API endpoint that was called.
Endpoint string
// Message is the error message from the API.
Message string
}
APIError represents an error returned by the VergeOS API.
type Alarm ¶
type Alarm struct {
// Key is the unique identifier for the alarm.
Key FlexInt `json:"$key,omitempty"`
// Owner is the resource path that owns this alarm (e.g., "vms/123", "nodes/1").
Owner string `json:"owner,omitempty"`
// OwnerType is the type of owner resource.
// Valid values: vms, vnets, tenant_nodes, nodes, users, system, cloud_snapshots
OwnerType string `json:"owner_type,omitempty"`
// SubOwner is an optional sub-resource path (e.g., "machine_drives/456").
SubOwner string `json:"sub_owner,omitempty"`
// SubOwnerType is the type of sub-owner resource.
// Valid values: machine_drives, machine_nics, machine_devices, smtp_settings
SubOwnerType string `json:"sub_owner_type,omitempty"`
// AlarmType is the alarm type key (foreign key to alarm_types).
// Note: This is a string key like "vm_cpu_high", not an integer.
AlarmType string `json:"alarm_type,omitempty"`
// Level is the severity level of the alarm.
// Valid values: audit, message, warning, error, critical, summary, debug
Level string `json:"level,omitempty"`
// Status is the current status message of the alarm.
Status string `json:"status,omitempty"`
// AlarmID is a unique 8-character identifier for the alarm.
AlarmID string `json:"alarm_id,omitempty"`
// Resolvable indicates whether the alarm can be manually resolved.
Resolvable bool `json:"resolvable,omitempty"`
// ResolveText is the text displayed for the resolve action.
ResolveText string `json:"resolve_text,omitempty"`
// ResolveAction is the action to execute when resolving.
ResolveAction string `json:"resolve_action,omitempty"`
// SnoozeThreshold is the threshold value for snoozing.
SnoozeThreshold float64 `json:"snooze_threshold,omitempty"`
// Snooze is the timestamp until which the alarm is snoozed (0 if not snoozed).
Snooze int64 `json:"snooze,omitempty"`
// SnoozedBy is the username who snoozed the alarm.
SnoozedBy string `json:"snoozed_by,omitempty"`
// Expires is the timestamp when the alarm expires (0 if never).
Expires int64 `json:"expires,omitempty"`
// Created is the timestamp when the alarm was created.
Created int64 `json:"created,omitempty"`
// Modified is the timestamp when the alarm was last modified.
Modified int64 `json:"modified,omitempty"`
// Expanded fields from views
// OwnerName is the display name of the owner resource.
OwnerName string `json:"owner_name,omitempty"`
// OwnerTypeDisplay is the human-readable owner type.
OwnerTypeDisplay string `json:"owner_type_display,omitempty"`
// LevelDisplay is the human-readable level.
LevelDisplay string `json:"level_display,omitempty"`
}
Alarm represents an active alarm in VergeOS. Alarms are raised by the system to indicate issues requiring attention.
type AlarmService ¶
type AlarmService struct {
// contains filtered or unexported fields
}
AlarmService handles alarm operations.
func (*AlarmService) Delete ¶
func (s *AlarmService) Delete(ctx context.Context, id int) error
Delete deletes an alarm.
func (*AlarmService) List ¶
func (s *AlarmService) List(ctx context.Context, opts ...ListOption) ([]Alarm, error)
List returns all alarms, with optional filtering and pagination.
func (*AlarmService) ListActive ¶
func (s *AlarmService) ListActive(ctx context.Context, opts ...ListOption) ([]Alarm, error)
ListActive returns all active (non-snoozed) alarms.
func (*AlarmService) ListByAlarmType ¶
func (s *AlarmService) ListByAlarmType(ctx context.Context, alarmTypeKey string, opts ...ListOption) ([]Alarm, error)
ListByAlarmType returns all alarms of a specific alarm type.
func (*AlarmService) ListByLevel ¶
func (s *AlarmService) ListByLevel(ctx context.Context, level string, opts ...ListOption) ([]Alarm, error)
ListByLevel returns all alarms with a specific severity level.
func (*AlarmService) ListByOwner ¶
func (s *AlarmService) ListByOwner(ctx context.Context, owner string, opts ...ListOption) ([]Alarm, error)
ListByOwner returns all alarms for a specific owner resource. owner should be a resource path like "vms/123" or "nodes/1".
func (*AlarmService) Resolve ¶
func (s *AlarmService) Resolve(ctx context.Context, id int) error
Resolve resolves an alarm if it is resolvable.
func (*AlarmService) Unsnooze ¶
func (s *AlarmService) Unsnooze(ctx context.Context, id int) error
Unsnooze removes the snooze from an alarm.
func (*AlarmService) Update ¶
func (s *AlarmService) Update(ctx context.Context, id int, req *AlarmUpdateRequest) (*Alarm, error)
Update updates an alarm (primarily for snoozing).
type AlarmServiceInterface ¶
type AlarmServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]Alarm, error)
ListActive(ctx context.Context, opts ...ListOption) ([]Alarm, error)
ListByOwner(ctx context.Context, owner string, opts ...ListOption) ([]Alarm, error)
ListByLevel(ctx context.Context, level string, opts ...ListOption) ([]Alarm, error)
ListByAlarmType(ctx context.Context, alarmTypeKey string, opts ...ListOption) ([]Alarm, error)
Get(ctx context.Context, id int) (*Alarm, error)
Update(ctx context.Context, id int, req *AlarmUpdateRequest) (*Alarm, error)
Snooze(ctx context.Context, id int, until int64) error
Unsnooze(ctx context.Context, id int) error
Resolve(ctx context.Context, id int) error
Delete(ctx context.Context, id int) error
}
AlarmServiceInterface defines the interface for Alarm operations.
type AlarmType ¶
type AlarmType struct {
// Key is the unique string identifier for the alarm type.
Key string `json:"$key,omitempty"`
// Name is the display name of the alarm type.
Name string `json:"name,omitempty"`
// Description is a detailed description of the alarm type.
Description string `json:"description,omitempty"`
// Level is the default severity level for alarms of this type.
Level string `json:"level,omitempty"`
// DisableLogging prevents logging for this alarm type when true.
DisableLogging bool `json:"disable_logging,omitempty"`
// AllowDelete permits deletion of alarms of this type.
AllowDelete bool `json:"allow_delete,omitempty"`
// Threshold is the threshold value for triggering this alarm type.
Threshold float64 `json:"threshold,omitempty"`
// MaxSnoozeThreshold is the maximum threshold for snoozing (-1 for unlimited).
MaxSnoozeThreshold float64 `json:"max_snooze_threshold,omitempty"`
// MaxSnoozeSeconds is the maximum snooze duration in seconds (-1 for unlimited).
MaxSnoozeSeconds int `json:"max_snooze_seconds,omitempty"`
// DefaultSnoozeSeconds is the default snooze duration in seconds.
DefaultSnoozeSeconds int `json:"default_snooze_seconds,omitempty"`
}
AlarmType represents an alarm type definition in VergeOS. Alarm types define the categories and behavior of alarms. Note: Alarm types use string keys, not integer IDs.
type AlarmTypeService ¶
type AlarmTypeService struct {
// contains filtered or unexported fields
}
AlarmTypeService handles alarm type operations. Alarm types are read-only reference data.
func (*AlarmTypeService) Get ¶
Get returns a single alarm type by key. Note: Alarm types use string keys, not integer IDs.
func (*AlarmTypeService) List ¶
func (s *AlarmTypeService) List(ctx context.Context, opts ...ListOption) ([]AlarmType, error)
List returns all alarm types, with optional filtering and pagination.
func (*AlarmTypeService) ListByLevel ¶
func (s *AlarmTypeService) ListByLevel(ctx context.Context, level string, opts ...ListOption) ([]AlarmType, error)
ListByLevel returns all alarm types with a specific default severity level.
type AlarmTypeServiceInterface ¶
type AlarmTypeServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]AlarmType, error)
Get(ctx context.Context, key string) (*AlarmType, error)
ListByLevel(ctx context.Context, level string, opts ...ListOption) ([]AlarmType, error)
}
AlarmTypeServiceInterface defines the interface for AlarmType operations. Alarm types are read-only reference data. Note: Uses string keys, not integers.
type AlarmUpdateRequest ¶
type AlarmUpdateRequest struct {
// Snooze is the timestamp until which to snooze the alarm.
// Set to 0 to unsnooze. Set to a future timestamp to snooze.
Snooze *int64 `json:"snooze,omitempty"`
}
AlarmUpdateRequest is the request body for updating an alarm. Note: Most alarm fields are readonly. Only snooze can be updated.
type AuthError ¶
type AuthError struct {
Message string
}
AuthError is returned when authentication fails.
type Certificate ¶
type Certificate struct {
// Key is the unique identifier for the certificate.
Key FlexInt `json:"$key,omitempty"`
// Domain is the primary domain for this certificate (read-only).
Domain string `json:"domain,omitempty"`
// DomainList is a comma-separated list of additional domains (SANs).
DomainList string `json:"domainlist,omitempty"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// Type is the certificate type: manual, letsencrypt, self_signed.
Type string `json:"type,omitempty"`
// Public is the public certificate in PEM format.
Public string `json:"public,omitempty"`
// Private is the private key in PEM format (hidden in responses).
Private string `json:"private,omitempty"`
// Chain is the certificate chain in PEM format.
Chain string `json:"chain,omitempty"`
// ACMEServer is the ACME server URL for Let's Encrypt certificates.
ACMEServer string `json:"acme_server,omitempty"`
// EABKid is the Key Identifier for External Account Binding (ACME).
EABKid string `json:"eab_kid,omitempty"`
// EABHMACKey is the HMAC key for External Account Binding (ACME).
EABHMACKey string `json:"eab_hmac_key,omitempty"`
// KeyType is the key type: ecdsa or rsa.
KeyType string `json:"key_type,omitempty"`
// RSAKeySize is the RSA key size (default: 2048).
RSAKeySize string `json:"rsa_key_size,omitempty"`
// Contact is the contact user ID for Let's Encrypt.
Contact FlexInt `json:"contact,omitempty"`
// AgreeTOS indicates agreement to terms of service.
AgreeTOS bool `json:"agree_tos,omitempty"`
// Valid indicates if the certificate is currently valid (read-only).
Valid bool `json:"valid,omitempty"`
// AutoCreated indicates if the certificate was auto-created (read-only).
AutoCreated bool `json:"autocreated,omitempty"`
// Expires is the certificate expiration timestamp (Unix epoch, read-only).
Expires int64 `json:"expires,omitempty"`
// Created is the creation timestamp (Unix epoch, read-only).
Created int64 `json:"created,omitempty"`
// Modified is the last modification timestamp (Unix epoch, read-only).
Modified int64 `json:"modified,omitempty"`
}
Certificate represents a VergeOS SSL/TLS certificate.
type CertificateCreateRequest ¶
type CertificateCreateRequest struct {
// DomainName is the primary domain for the certificate (required for manual/self-signed).
DomainName string `json:"domainname,omitempty"`
// DomainList is a comma-separated list of additional domains (SANs).
DomainList string `json:"domainlist,omitempty"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// Type is the certificate type: manual, letsencrypt, self_signed.
Type string `json:"type,omitempty"`
// Public is the public certificate in PEM format (required for manual).
Public string `json:"public,omitempty"`
// Private is the private key in PEM format (required for manual).
Private string `json:"private,omitempty"`
// Chain is the certificate chain in PEM format.
Chain string `json:"chain,omitempty"`
// ACMEServer is the ACME server URL (for letsencrypt type).
ACMEServer string `json:"acme_server,omitempty"`
// EABKid is the Key Identifier for External Account Binding.
EABKid string `json:"eab_kid,omitempty"`
// EABHMACKey is the HMAC key for External Account Binding.
EABHMACKey string `json:"eab_hmac_key,omitempty"`
// KeyType is the key type: ecdsa or rsa.
KeyType string `json:"key_type,omitempty"`
// RSAKeySize is the RSA key size.
RSAKeySize string `json:"rsa_key_size,omitempty"`
// Contact is the contact user ID (for letsencrypt type).
Contact *int `json:"contact,omitempty"`
// AgreeTOS indicates agreement to Let's Encrypt terms of service.
AgreeTOS *bool `json:"agree_tos,omitempty"`
// Renew forces renewal of an existing certificate.
Renew *bool `json:"renew,omitempty"`
}
CertificateCreateRequest is the request body for creating a certificate.
type CertificateService ¶
type CertificateService struct {
// contains filtered or unexported fields
}
CertificateService handles SSL/TLS certificate operations.
func (*CertificateService) Create ¶
func (s *CertificateService) Create(ctx context.Context, req *CertificateCreateRequest) (*Certificate, error)
Create creates a new certificate and returns the created certificate.
func (*CertificateService) Delete ¶
func (s *CertificateService) Delete(ctx context.Context, id int) error
Delete deletes a certificate.
func (*CertificateService) Get ¶
func (s *CertificateService) Get(ctx context.Context, id int) (*Certificate, error)
Get returns a single certificate by ID.
func (*CertificateService) GetByDomain ¶
func (s *CertificateService) GetByDomain(ctx context.Context, domain string) (*Certificate, error)
GetByDomain returns a certificate by its primary domain.
func (*CertificateService) GetWithKeys ¶
func (s *CertificateService) GetWithKeys(ctx context.Context, id int) (*Certificate, error)
GetWithKeys returns a certificate including its public key, private key, and chain. Use this method when you need to export or use the certificate keys.
func (*CertificateService) List ¶
func (s *CertificateService) List(ctx context.Context, opts ...ListOption) ([]Certificate, error)
List returns all certificates, with optional filtering and pagination.
func (*CertificateService) ListByType ¶
func (s *CertificateService) ListByType(ctx context.Context, certType string, opts ...ListOption) ([]Certificate, error)
ListByType returns certificates of a specific type (manual, letsencrypt, self_signed).
func (*CertificateService) ListExpiring ¶
func (s *CertificateService) ListExpiring(ctx context.Context, days int, opts ...ListOption) ([]Certificate, error)
ListExpiring returns certificates that will expire within the specified number of days.
func (*CertificateService) ListValid ¶
func (s *CertificateService) ListValid(ctx context.Context, opts ...ListOption) ([]Certificate, error)
ListValid returns all valid certificates.
func (*CertificateService) Renew ¶
func (s *CertificateService) Renew(ctx context.Context, id int) (*Certificate, error)
Renew triggers renewal of a Let's Encrypt certificate.
func (*CertificateService) Update ¶
func (s *CertificateService) Update(ctx context.Context, id int, req *CertificateUpdateRequest) (*Certificate, error)
Update updates a certificate and returns the updated certificate.
type CertificateServiceInterface ¶
type CertificateServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]Certificate, error)
Get(ctx context.Context, id int) (*Certificate, error)
GetByDomain(ctx context.Context, domain string) (*Certificate, error)
GetWithKeys(ctx context.Context, id int) (*Certificate, error)
Create(ctx context.Context, req *CertificateCreateRequest) (*Certificate, error)
Update(ctx context.Context, id int, req *CertificateUpdateRequest) (*Certificate, error)
Delete(ctx context.Context, id int) error
Renew(ctx context.Context, id int) (*Certificate, error)
ListExpiring(ctx context.Context, days int, opts ...ListOption) ([]Certificate, error)
ListValid(ctx context.Context, opts ...ListOption) ([]Certificate, error)
ListByType(ctx context.Context, certType string, opts ...ListOption) ([]Certificate, error)
}
CertificateServiceInterface defines the interface for SSL/TLS certificate operations.
type CertificateUpdateRequest ¶
type CertificateUpdateRequest struct {
// DomainList is a comma-separated list of additional domains.
DomainList *string `json:"domainlist,omitempty"`
// Description is the certificate description.
Description *string `json:"description,omitempty"`
// Public is the public certificate in PEM format.
Public *string `json:"public,omitempty"`
// Private is the private key in PEM format.
Private *string `json:"private,omitempty"`
// Chain is the certificate chain in PEM format.
Chain *string `json:"chain,omitempty"`
// ACMEServer is the ACME server URL.
ACMEServer *string `json:"acme_server,omitempty"`
// EABKid is the Key Identifier for External Account Binding.
EABKid *string `json:"eab_kid,omitempty"`
// EABHMACKey is the HMAC key for External Account Binding.
EABHMACKey *string `json:"eab_hmac_key,omitempty"`
// KeyType is the key type.
KeyType *string `json:"key_type,omitempty"`
// RSAKeySize is the RSA key size.
RSAKeySize *string `json:"rsa_key_size,omitempty"`
// Contact is the contact user ID.
Contact *int `json:"contact,omitempty"`
// AgreeTOS indicates agreement to terms of service.
AgreeTOS *bool `json:"agree_tos,omitempty"`
// Renew forces renewal of the certificate.
Renew *bool `json:"renew,omitempty"`
}
CertificateUpdateRequest is the request body for updating a certificate.
type Client ¶
type Client struct {
// Services for interacting with different API resources.
// All services implement their corresponding interfaces for mock testing.
VMs VMServiceInterface
VMSnapshots VMSnapshotServiceInterface
VMNICs VMNICServiceInterface
VMDrives VMDriveServiceInterface
VMDevices VMDeviceServiceInterface
Networks NetworkServiceInterface
Users UserServiceInterface
Members MemberServiceInterface
CloudInitFiles CloudInitServiceInterface
Clusters ClusterServiceInterface
Nodes NodeServiceInterface
Groups GroupServiceInterface
Files FileServiceInterface
ResourceGroups ResourceGroupServiceInterface
Settings SettingsServiceInterface
System SystemServiceInterface
Schema SchemaServiceInterface
Tags TagServiceInterface
TagCategories TagCategoryServiceInterface
TagMembers TagMemberServiceInterface
Volumes VolumeServiceInterface
VNetRules VNetRuleServiceInterface
VNetRuleAliases VNetRuleAliasServiceInterface
Tenants TenantServiceInterface
TenantNodes TenantNodeServiceInterface
TenantStorage TenantStorageServiceInterface
TenantSnapshots TenantSnapshotServiceInterface
TenantLayer2Networks TenantLayer2NetworkServiceInterface
SnapshotProfiles SnapshotProfileServiceInterface
SnapshotProfilePeriods SnapshotProfilePeriodServiceInterface
Alarms AlarmServiceInterface
AlarmTypes AlarmTypeServiceInterface
Tasks TaskServiceInterface
VNetAddresses VNetAddressServiceInterface
VNetDNSViews VNetDNSViewServiceInterface
VNetDNSZones VNetDNSZoneServiceInterface
VNetDNSRecords VNetDNSRecordServiceInterface
VNetHosts VNetHostServiceInterface
VNetWireGuards VNetWireGuardServiceInterface
VNetWireGuardPeers VNetWireGuardPeerServiceInterface
VNetWireGuardPeerStatus VNetWireGuardPeerStatusServiceInterface
Certificates CertificateServiceInterface
VNetIPSecs VNetIPSecServiceInterface
VNetIPSecPhase1s VNetIPSecPhase1ServiceInterface
VNetIPSecPhase2s VNetIPSecPhase2ServiceInterface
VNetIPSecConnections VNetIPSecConnectionServiceInterface
Sites SiteServiceInterface
SiteSyncsIncoming SiteSyncIncomingServiceInterface
SiteSyncsOutgoing SiteSyncOutgoingServiceInterface
SiteSyncProfilePeriods SiteSyncProfilePeriodServiceInterface
CloudSnapshots CloudSnapshotServiceInterface
CloudSnapshotVMs CloudSnapshotVMServiceInterface
CloudSnapshotTenants CloudSnapshotTenantServiceInterface
VolumeBrowser VolumeBrowserServiceInterface
WebhookURLs WebhookURLServiceInterface
Webhooks WebhookServiceInterface
UserAPIKeys UserAPIKeyServiceInterface
NASServices NASServiceServiceInterface
NASServiceUsers NASServiceUserServiceInterface
VolumeSyncs VolumeSyncServiceInterface
VolumeSnapshots VolumeSnapshotServiceInterface
Permissions PermissionServiceInterface
Logs LogServiceInterface
StorageTiers StorageTierServiceInterface
ClusterTiers ClusterTierServiceInterface
MachineDrivePhys MachineDrivePhysServiceInterface
ClusterStatsHistory ClusterStatsHistoryServiceInterface
MachineStats MachineStatsServiceInterface
MachineDriveStats MachineDriveStatsServiceInterface
MachineNICs MachineNICServiceInterface
UpdateSettings UpdateSettingsServiceInterface
UpdateBranches UpdateBranchServiceInterface
UpdateSourcePackages UpdateSourcePackageServiceInterface
// contains filtered or unexported fields
}
Client is the VergeOS API client.
func NewClient ¶
func NewClient(opts ...ClientOption) (*Client, error)
NewClient creates a new VergeOS API client.
type ClientOption ¶
ClientOption is a function that configures a Client.
func WithAPIKey ¶
func WithAPIKey(apiKey string) ClientOption
WithAPIKey sets the API key for Bearer token authentication. This is an alternative to WithCredentials - use one or the other.
func WithBaseURL ¶
func WithBaseURL(baseURL string) ClientOption
WithBaseURL sets the base URL for the VergeOS API.
func WithCredentials ¶
func WithCredentials(username, password string) ClientOption
WithCredentials sets the username and password for API authentication. This uses HTTP Basic Authentication.
func WithEnvConfig ¶ added in v0.1.1
func WithEnvConfig() ClientOption
WithEnvConfig configures the client from environment variables. This option should typically be applied first, allowing subsequent options to override specific values.
Environment variables:
- VERGEOS_HOST: Base URL for the VergeOS API (required if not set via WithBaseURL)
- VERGEOS_USERNAME + VERGEOS_PASSWORD: Basic authentication
- VERGEOS_API_KEY: Bearer token authentication (alternative to username/password)
- VERGEOS_VERIFY_SSL: Verify TLS certificates, "true" or "false" (default: "true")
- VERGEOS_TIMEOUT: Request timeout in seconds (default: "30")
Example:
export VERGEOS_HOST=https://vergeos.example.com
export VERGEOS_USERNAME=admin
export VERGEOS_PASSWORD=secret
export VERGEOS_VERIFY_SSL=false
// Simple usage
client, err := vergeos.NewClient(vergeos.WithEnvConfig())
// With explicit override
client, err := vergeos.NewClient(
vergeos.WithEnvConfig(),
vergeos.WithTimeout(60*time.Second),
)
func WithHTTPClient ¶
func WithHTTPClient(httpClient *http.Client) ClientOption
WithHTTPClient sets a custom HTTP client.
func WithInsecureTLS ¶
func WithInsecureTLS(insecure bool) ClientOption
WithInsecureTLS configures whether to skip TLS certificate verification. This is useful for self-signed certificates.
func WithTimeout ¶
func WithTimeout(timeout time.Duration) ClientOption
WithTimeout sets the HTTP request timeout.
func WithUserAgent ¶
func WithUserAgent(userAgent string) ClientOption
WithUserAgent sets a custom User-Agent header.
type CloudInitFile ¶
type CloudInitFile struct {
// ID is the unique identifier for the file.
ID FlexInt `json:"$key,omitempty"`
// Owner is the owner of the file.
Owner string `json:"owner,omitempty"`
// Name is the file name.
Name string `json:"name"`
// FileSize is the file size in bytes.
FileSize int64 `json:"filesize,omitempty"`
// AllocatedBytes is the storage space allocated for the file.
AllocatedBytes int64 `json:"allocated_bytes,omitempty"`
// UsedBytes is the storage space used by the file.
UsedBytes int64 `json:"used_bytes,omitempty"`
// Modified is the last modified timestamp.
Modified int64 `json:"modified,omitempty"`
// Contents is the file contents (max 65536 bytes).
Contents string `json:"contents,omitempty"`
// ContainsVariables indicates whether the file contains variables.
// This is automatically set based on the Render field.
ContainsVariables bool `json:"contains_variables,omitempty"`
// Render specifies how the file should be rendered.
// Valid values: "no" (default), "variables", "jinja2"
Render string `json:"render,omitempty"`
// Creator is the username who created the file.
Creator string `json:"creator,omitempty"`
}
CloudInitFile represents a cloud-init file in VergeOS.
type CloudInitFileCreateRequest ¶
type CloudInitFileCreateRequest struct {
// Name is the file name (required).
Name string `json:"name"`
// Contents is the file contents (max 65536 bytes).
Contents string `json:"contents,omitempty"`
// Render specifies how the file should be rendered.
// Valid values: "no" (default), "variables", "jinja2"
// Note: Setting to "variables" automatically sets ContainsVariables to true.
Render *string `json:"render,omitempty"`
}
CloudInitFileCreateRequest is the request body for creating a cloud-init file.
type CloudInitFileRef ¶
type CloudInitFileRef struct {
// Name is the cloud-init file name.
Name string `json:"name"`
// Contents is the cloud-init file contents.
Contents string `json:"contents,omitempty"`
}
CloudInitFileRef is a reference to a cloud-init file within a VM.
type CloudInitFileUpdateRequest ¶
type CloudInitFileUpdateRequest struct {
// Name is the file name.
Name *string `json:"name,omitempty"`
// Contents is the file contents (max 65536 bytes).
Contents *string `json:"contents,omitempty"`
// Render specifies how the file should be rendered.
// Valid values: "no", "variables", "jinja2"
// Note: Setting to "variables" automatically sets ContainsVariables to true.
Render *string `json:"render,omitempty"`
}
CloudInitFileUpdateRequest is the request body for updating a cloud-init file.
type CloudInitService ¶
type CloudInitService struct {
// contains filtered or unexported fields
}
CloudInitService handles cloud-init file operations.
func (*CloudInitService) Create ¶
func (s *CloudInitService) Create(ctx context.Context, req *CloudInitFileCreateRequest) (*CloudInitFile, error)
Create creates a new cloud-init file and returns the created file.
func (*CloudInitService) Delete ¶
func (s *CloudInitService) Delete(ctx context.Context, id int) error
Delete deletes a cloud-init file.
func (*CloudInitService) Get ¶
func (s *CloudInitService) Get(ctx context.Context, id int) (*CloudInitFile, error)
Get returns a single cloud-init file by ID.
func (*CloudInitService) GetByName ¶
func (s *CloudInitService) GetByName(ctx context.Context, name string) (*CloudInitFile, error)
GetByName returns a cloud-init file by name.
func (*CloudInitService) List ¶
func (s *CloudInitService) List(ctx context.Context, opts ...ListOption) ([]CloudInitFile, error)
List returns all cloud-init files, with optional filtering and pagination.
func (*CloudInitService) Update ¶
func (s *CloudInitService) Update(ctx context.Context, id int, req *CloudInitFileUpdateRequest) (*CloudInitFile, error)
Update updates a cloud-init file and returns the updated file.
type CloudInitServiceInterface ¶
type CloudInitServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]CloudInitFile, error)
Get(ctx context.Context, id int) (*CloudInitFile, error)
GetByName(ctx context.Context, name string) (*CloudInitFile, error)
Create(ctx context.Context, req *CloudInitFileCreateRequest) (*CloudInitFile, error)
Update(ctx context.Context, id int, req *CloudInitFileUpdateRequest) (*CloudInitFile, error)
Delete(ctx context.Context, id int) error
}
CloudInitServiceInterface defines the interface for CloudInit operations.
type CloudSnapshot ¶
type CloudSnapshot struct {
Key FlexInt `json:"$key,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
SnapshotProfile FlexInt `json:"snapshot_profile,omitempty"` // FK to snapshot_profiles
SnapshotPeriod FlexInt `json:"snapshot_period,omitempty"` // FK to snapshot_profile_periods
ScheduleTask FlexInt `json:"schedule_task,omitempty"` // FK to schedule_tasks
Task FlexInt `json:"task,omitempty"` // FK to tasks (active task)
Expires int64 `json:"expires,omitempty"` // Expiration timestamp (0 = never)
Provider bool `json:"provider,omitempty"` // From provider tenant
Private bool `json:"private,omitempty"` // Hidden from tenants
RemoteSync bool `json:"remote_sync,omitempty"` // Synced from remote system
IncomingSync FlexInt `json:"incoming_sync,omitempty"` // FK to site_syncs_incoming
Immutable bool `json:"immutable,omitempty"` // Locked, read-only, cannot be deleted
ImmutableStatus string `json:"immutable_status,omitempty"` // unlocked, unlocking, locked
ImmutableLockExpires int64 `json:"immutable_lock_expires,omitempty"` // When immutable lock expires
Status string `json:"status,omitempty"` // normal, held
StatusInfo string `json:"status_info,omitempty"`
Created int64 `json:"created,omitempty"`
}
CloudSnapshot represents a system-wide snapshot in VergeOS. Cloud snapshots capture the entire system state including VMs and tenants.
type CloudSnapshotCloneOptions ¶
type CloudSnapshotCloneOptions struct {
Name string `json:"name"` // Required: name for the cloned snapshot
}
CloudSnapshotCloneOptions specifies options for cloning a cloud snapshot.
type CloudSnapshotCreateRequest ¶
type CloudSnapshotCreateRequest struct {
Name string `json:"name"` // Required: snapshot name (supports date format like "Snapshot_%Y%m%d_%H%M")
Description string `json:"description,omitempty"`
Retention *int `json:"retention,omitempty"` // Seconds until expiration (default 259200 = 3 days)
MinSnapshots *int `json:"min_snapshots,omitempty"` // Minimum snapshots to retain (default 1)
Immutable *bool `json:"immutable,omitempty"` // Lock snapshot
Private *bool `json:"private,omitempty"` // Hide from tenants
}
CloudSnapshotCreateRequest represents the request body for creating a cloud snapshot. Note: Cloud snapshots are typically created via table_actions/create, which uses different field names.
type CloudSnapshotService ¶
type CloudSnapshotService struct {
// contains filtered or unexported fields
}
CloudSnapshotService handles cloud snapshot (system snapshot) operations.
func (*CloudSnapshotService) Clone ¶
func (s *CloudSnapshotService) Clone(ctx context.Context, id int, opts *CloudSnapshotCloneOptions) error
Clone creates a copy of a cloud snapshot with a new name.
func (*CloudSnapshotService) Create ¶
func (s *CloudSnapshotService) Create(ctx context.Context, req *CloudSnapshotCreateRequest) (*CloudSnapshot, error)
Create creates a new cloud snapshot (system snapshot). This triggers the snapshot creation task, which runs asynchronously.
func (*CloudSnapshotService) Delete ¶
func (s *CloudSnapshotService) Delete(ctx context.Context, id int) error
Delete deletes a cloud snapshot.
func (*CloudSnapshotService) FindTenants ¶
func (s *CloudSnapshotService) FindTenants(ctx context.Context, id int) error
FindTenants discovers and lists tenants within a cloud snapshot.
func (*CloudSnapshotService) FindVMs ¶
func (s *CloudSnapshotService) FindVMs(ctx context.Context, id int) error
FindVMs discovers and lists VMs within a cloud snapshot.
func (*CloudSnapshotService) Get ¶
func (s *CloudSnapshotService) Get(ctx context.Context, id int) (*CloudSnapshot, error)
Get returns a single cloud snapshot by ID.
func (*CloudSnapshotService) GetByName ¶
func (s *CloudSnapshotService) GetByName(ctx context.Context, name string) (*CloudSnapshot, error)
GetByName returns a cloud snapshot by name.
func (*CloudSnapshotService) List ¶
func (s *CloudSnapshotService) List(ctx context.Context, opts ...ListOption) ([]CloudSnapshot, error)
List returns all cloud snapshots, with optional filtering and pagination.
func (*CloudSnapshotService) ListByProfile ¶
func (s *CloudSnapshotService) ListByProfile(ctx context.Context, profileID int, opts ...ListOption) ([]CloudSnapshot, error)
ListByProfile returns cloud snapshots created by a specific snapshot profile.
func (*CloudSnapshotService) ListExpiring ¶
func (s *CloudSnapshotService) ListExpiring(ctx context.Context, opts ...ListOption) ([]CloudSnapshot, error)
ListExpiring returns cloud snapshots that have an expiration date (non-zero expires).
func (*CloudSnapshotService) ListLocal ¶
func (s *CloudSnapshotService) ListLocal(ctx context.Context, opts ...ListOption) ([]CloudSnapshot, error)
ListLocal returns cloud snapshots that were created locally (not from provider).
func (*CloudSnapshotService) Refresh ¶
func (s *CloudSnapshotService) Refresh(ctx context.Context, id int) error
Refresh refreshes the cloud snapshot metadata.
func (*CloudSnapshotService) RequestFromProvider ¶
func (s *CloudSnapshotService) RequestFromProvider(ctx context.Context, id int) error
RequestFromProvider requests a cloud snapshot from the provider tenant.
func (*CloudSnapshotService) Update ¶
func (s *CloudSnapshotService) Update(ctx context.Context, id int, req *CloudSnapshotUpdateRequest) (*CloudSnapshot, error)
Update updates a cloud snapshot and returns the updated snapshot.
type CloudSnapshotServiceInterface ¶
type CloudSnapshotServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]CloudSnapshot, error)
ListExpiring(ctx context.Context, opts ...ListOption) ([]CloudSnapshot, error)
ListLocal(ctx context.Context, opts ...ListOption) ([]CloudSnapshot, error)
ListByProfile(ctx context.Context, profileID int, opts ...ListOption) ([]CloudSnapshot, error)
Get(ctx context.Context, id int) (*CloudSnapshot, error)
GetByName(ctx context.Context, name string) (*CloudSnapshot, error)
Create(ctx context.Context, req *CloudSnapshotCreateRequest) (*CloudSnapshot, error)
Update(ctx context.Context, id int, req *CloudSnapshotUpdateRequest) (*CloudSnapshot, error)
Delete(ctx context.Context, id int) error
Refresh(ctx context.Context, id int) error
Clone(ctx context.Context, id int, opts *CloudSnapshotCloneOptions) error
RequestFromProvider(ctx context.Context, id int) error
FindTenants(ctx context.Context, id int) error
FindVMs(ctx context.Context, id int) error
}
CloudSnapshotServiceInterface defines the interface for cloud snapshot (system snapshot) operations.
type CloudSnapshotTenant ¶
type CloudSnapshotTenant struct {
Key FlexInt `json:"$key,omitempty"`
CloudSnapshot FlexInt `json:"cloud_snapshot,omitempty"`
Tenant FlexInt `json:"tenant,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
}
CloudSnapshotTenant represents a tenant within a cloud snapshot.
type CloudSnapshotTenantService ¶
type CloudSnapshotTenantService struct {
// contains filtered or unexported fields
}
CloudSnapshotTenantService handles tenant listings within cloud snapshots.
func (*CloudSnapshotTenantService) Get ¶
func (s *CloudSnapshotTenantService) Get(ctx context.Context, id int) (*CloudSnapshotTenant, error)
Get returns a single cloud snapshot tenant by ID.
func (*CloudSnapshotTenantService) List ¶
func (s *CloudSnapshotTenantService) List(ctx context.Context, opts ...ListOption) ([]CloudSnapshotTenant, error)
List returns all tenants within cloud snapshots, with optional filtering.
func (*CloudSnapshotTenantService) ListBySnapshot ¶
func (s *CloudSnapshotTenantService) ListBySnapshot(ctx context.Context, snapshotID int, opts ...ListOption) ([]CloudSnapshotTenant, error)
ListBySnapshot returns all tenants within a specific cloud snapshot.
type CloudSnapshotTenantServiceInterface ¶
type CloudSnapshotTenantServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]CloudSnapshotTenant, error)
ListBySnapshot(ctx context.Context, snapshotID int, opts ...ListOption) ([]CloudSnapshotTenant, error)
Get(ctx context.Context, id int) (*CloudSnapshotTenant, error)
}
CloudSnapshotTenantServiceInterface defines the interface for tenant listings within cloud snapshots (read-only).
type CloudSnapshotUpdateRequest ¶
type CloudSnapshotUpdateRequest struct {
Description *string `json:"description,omitempty"`
Expires *int64 `json:"expires,omitempty"` // 0 = never expire
Private *bool `json:"private,omitempty"`
Immutable *bool `json:"immutable,omitempty"`
ImmutableLockExpires *int64 `json:"immutable_lock_expires,omitempty"`
}
CloudSnapshotUpdateRequest represents the request body for updating a cloud snapshot.
type CloudSnapshotVM ¶
type CloudSnapshotVM struct {
Key FlexInt `json:"$key,omitempty"`
CloudSnapshot FlexInt `json:"cloud_snapshot,omitempty"`
VM FlexInt `json:"vm,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Machine FlexInt `json:"machine,omitempty"`
CPUCores int `json:"cpu_cores,omitempty"`
RAM int `json:"ram,omitempty"`
OSFamily string `json:"os_family,omitempty"`
}
CloudSnapshotVM represents a VM within a cloud snapshot.
type CloudSnapshotVMService ¶
type CloudSnapshotVMService struct {
// contains filtered or unexported fields
}
CloudSnapshotVMService handles VM listings within cloud snapshots.
func (*CloudSnapshotVMService) Get ¶
func (s *CloudSnapshotVMService) Get(ctx context.Context, id int) (*CloudSnapshotVM, error)
Get returns a single cloud snapshot VM by ID.
func (*CloudSnapshotVMService) List ¶
func (s *CloudSnapshotVMService) List(ctx context.Context, opts ...ListOption) ([]CloudSnapshotVM, error)
List returns all VMs within cloud snapshots, with optional filtering.
func (*CloudSnapshotVMService) ListBySnapshot ¶
func (s *CloudSnapshotVMService) ListBySnapshot(ctx context.Context, snapshotID int, opts ...ListOption) ([]CloudSnapshotVM, error)
ListBySnapshot returns all VMs within a specific cloud snapshot.
type CloudSnapshotVMServiceInterface ¶
type CloudSnapshotVMServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]CloudSnapshotVM, error)
ListBySnapshot(ctx context.Context, snapshotID int, opts ...ListOption) ([]CloudSnapshotVM, error)
Get(ctx context.Context, id int) (*CloudSnapshotVM, error)
}
CloudSnapshotVMServiceInterface defines the interface for VM listings within cloud snapshots (read-only).
type Cluster ¶
type Cluster struct {
// Key is the unique identifier for the cluster (row key).
Key FlexInt `json:"$key,omitempty"`
// ID is the 40-character unique cluster identifier string.
ID string `json:"id,omitempty"`
// System is the parent system reference.
// Returns "self" for the local system, or potentially a row key for tenant hierarchies.
// Note: Schema defines as type "row" but API returns string "self".
System string `json:"system,omitempty"`
// Name is the cluster name.
Name string `json:"name"`
// Description is the cluster description.
Description string `json:"description,omitempty"`
// Enabled indicates whether the cluster is enabled.
Enabled bool `json:"enabled"`
// Created is the creation timestamp.
Created int64 `json:"created,omitempty"`
// Storage indicates whether this is a storage cluster.
Storage bool `json:"storage,omitempty"`
// Compute indicates whether this is a compute cluster.
Compute bool `json:"compute,omitempty"`
// KVMNested enables nested virtualization.
KVMNested bool `json:"kvm_nested,omitempty"`
// AllowNestedVirtMigration allows live migration of nested virtualization VMs.
AllowNestedVirtMigration bool `json:"allow_nested_virt_migration,omitempty"`
// AllowVGPUMigration allows live migration of vGPU VMs (experimental).
AllowVGPUMigration bool `json:"allow_vgpu_migration,omitempty"`
// EnableSplitLockDetection enables split lock detection (may impact VM performance).
EnableSplitLockDetection bool `json:"enable_split_lock_detection,omitempty"`
// RecommendedCPUType is the detected recommended CPU type for the cluster.
RecommendedCPUType string `json:"recommended_cpu_type,omitempty"`
// DefaultCPU is the default CPU type for VMs in this cluster.
DefaultCPU string `json:"default_cpu,omitempty"`
// DisableCPUSecurityMitigations disables CPU security mitigations.
DisableCPUSecurityMitigations bool `json:"disable_cpu_security_mitigations,omitempty"`
// SpecStoreBypassDisable disables speculative store bypass.
SpecStoreBypassDisable bool `json:"spec_store_bypass_disable,omitempty"`
// DisableSMT disables hyper-threading.
DisableSMT bool `json:"disable_smt,omitempty"`
// DisableSleep disables CPU sleep states.
DisableSleep bool `json:"disable_sleep,omitempty"`
// EnableNVMEPowerManagement enables NVMe power management.
EnableNVMEPowerManagement bool `json:"enable_nvme_power_management,omitempty"`
// X86EnergyPerfPolicy is the energy-performance policy.
// Valid values: "balance-performance", "balance-power", "normal", "performance", "power"
X86EnergyPerfPolicy string `json:"x86_energy_perf_policy,omitempty"`
// ScalingGovernor is the CPU scaling governor.
// Valid values: "ondemand", "performance", "powersave"
ScalingGovernor string `json:"scaling_governor,omitempty"`
// RAMPerUnit is the RAM per billing unit in MB.
RAMPerUnit int `json:"ram_per_unit,omitempty"`
// CoresPerUnit is the cores per billing unit.
CoresPerUnit int `json:"cores_per_unit,omitempty"`
// CostPerUnit is the cost per unit.
CostPerUnit float64 `json:"cost_per_unit,omitempty"`
// PricePerUnit is the price per unit.
PricePerUnit float64 `json:"price_per_unit,omitempty"`
// MaxRAMPerVM is the maximum RAM per VM in MB.
MaxRAMPerVM int `json:"max_ram_per_vm,omitempty"`
// MaxCoresPerVM is the maximum cores per VM.
MaxCoresPerVM int `json:"max_cores_per_vm,omitempty"`
// StorageCacheSize is the storage cache per node in MB.
StorageCacheSize int `json:"storage_cachesize,omitempty"`
// StorageBufferSize is the storage buffer per node in MB.
StorageBufferSize int `json:"storage_buffersize,omitempty"`
// StorageHugepages indicates whether to allocate hugepages for storage.
StorageHugepages bool `json:"storage_hugepages,omitempty"`
// TargetRAMPct is the target maximum RAM percentage (0-100).
TargetRAMPct float64 `json:"target_ram_pct,omitempty"`
// RAMOvercommitPct is the percentage of reserve RAM to use for machines (0-100).
RAMOvercommitPct float64 `json:"ram_overcommit_pct,omitempty"`
// SwapTier is the tier used for swap (-1 to 5, -1 = disabled).
SwapTier int `json:"swap_tier,omitempty"`
// SwapPerDrive is the swap space per drive in MB.
SwapPerDrive int `json:"swap_per_drive,omitempty"`
// LogFilter is the system log filter expression.
LogFilter string `json:"log_filter,omitempty"`
// MaxCoreTemp is the maximum core temperature in Celsius (0 = disabled).
MaxCoreTemp int `json:"max_core_temp,omitempty"`
// MaxCoreTempWarnPerc is the warning threshold percentage of max core temp.
MaxCoreTempWarnPerc int `json:"max_core_temp_warn_perc,omitempty"`
// CriticalCoreTemp is the critical core temperature in Celsius (0 = disabled).
CriticalCoreTemp int `json:"critical_core_temp,omitempty"`
// Status contains cluster status information.
Status *ClusterStatus `json:"status,omitempty"`
}
Cluster represents a VergeOS cluster.
type ClusterCreateRequest ¶
type ClusterCreateRequest struct {
// Name is the cluster name (required).
Name string `json:"name"`
// Description is the cluster description.
Description string `json:"description,omitempty"`
// Enabled indicates whether the cluster is enabled (default: true).
Enabled *bool `json:"enabled,omitempty"`
// Compute indicates whether this is a compute cluster.
Compute *bool `json:"compute,omitempty"`
// KVMNested enables nested virtualization.
KVMNested *bool `json:"kvm_nested,omitempty"`
// AllowNestedVirtMigration allows live migration of nested virtualization VMs.
AllowNestedVirtMigration *bool `json:"allow_nested_virt_migration,omitempty"`
// AllowVGPUMigration allows live migration of vGPU VMs (experimental).
AllowVGPUMigration *bool `json:"allow_vgpu_migration,omitempty"`
// EnableSplitLockDetection enables split lock detection.
EnableSplitLockDetection *bool `json:"enable_split_lock_detection,omitempty"`
// DefaultCPU is the default CPU type for VMs.
DefaultCPU *string `json:"default_cpu,omitempty"`
// DisableCPUSecurityMitigations disables CPU security mitigations.
DisableCPUSecurityMitigations *bool `json:"disable_cpu_security_mitigations,omitempty"`
// SpecStoreBypassDisable disables speculative store bypass.
SpecStoreBypassDisable *bool `json:"spec_store_bypass_disable,omitempty"`
// DisableSMT disables hyper-threading.
DisableSMT *bool `json:"disable_smt,omitempty"`
// DisableSleep disables CPU sleep states.
DisableSleep *bool `json:"disable_sleep,omitempty"`
// EnableNVMEPowerManagement enables NVMe power management.
EnableNVMEPowerManagement *bool `json:"enable_nvme_power_management,omitempty"`
// X86EnergyPerfPolicy is the energy-performance policy.
X86EnergyPerfPolicy *string `json:"x86_energy_perf_policy,omitempty"`
// ScalingGovernor is the CPU scaling governor.
ScalingGovernor *string `json:"scaling_governor,omitempty"`
// RAMPerUnit is the RAM per billing unit in MB.
RAMPerUnit *int `json:"ram_per_unit,omitempty"`
// CoresPerUnit is the cores per billing unit.
CoresPerUnit *int `json:"cores_per_unit,omitempty"`
// CostPerUnit is the cost per unit.
CostPerUnit *float64 `json:"cost_per_unit,omitempty"`
// PricePerUnit is the price per unit.
PricePerUnit *float64 `json:"price_per_unit,omitempty"`
// MaxRAMPerVM is the maximum RAM per VM in MB.
MaxRAMPerVM *int `json:"max_ram_per_vm,omitempty"`
// MaxCoresPerVM is the maximum cores per VM.
MaxCoresPerVM *int `json:"max_cores_per_vm,omitempty"`
// StorageCacheSize is the storage cache per node in MB.
StorageCacheSize *int `json:"storage_cachesize,omitempty"`
// StorageBufferSize is the storage buffer per node in MB.
StorageBufferSize *int `json:"storage_buffersize,omitempty"`
// StorageHugepages indicates whether to allocate hugepages for storage.
StorageHugepages *bool `json:"storage_hugepages,omitempty"`
// TargetRAMPct is the target maximum RAM percentage (0-100).
TargetRAMPct *float64 `json:"target_ram_pct,omitempty"`
// RAMOvercommitPct is the percentage of reserve RAM to use for machines (0-100).
RAMOvercommitPct *float64 `json:"ram_overcommit_pct,omitempty"`
// SwapTier is the tier used for swap (-1 to 5, -1 = disabled).
SwapTier *int `json:"swap_tier,omitempty"`
// SwapPerDrive is the swap space per drive in MB.
SwapPerDrive *int `json:"swap_per_drive,omitempty"`
// LogFilter is the system log filter expression.
LogFilter *string `json:"log_filter,omitempty"`
// MaxCoreTemp is the maximum core temperature in Celsius (0 = disabled).
MaxCoreTemp *int `json:"max_core_temp,omitempty"`
// MaxCoreTempWarnPerc is the warning threshold percentage of max core temp.
MaxCoreTempWarnPerc *int `json:"max_core_temp_warn_perc,omitempty"`
// CriticalCoreTemp is the critical core temperature in Celsius (0 = disabled).
CriticalCoreTemp *int `json:"critical_core_temp,omitempty"`
}
ClusterCreateRequest is the request body for creating a cluster.
type ClusterService ¶
type ClusterService struct {
// contains filtered or unexported fields
}
ClusterService handles cluster operations.
func (*ClusterService) Create ¶
func (s *ClusterService) Create(ctx context.Context, req *ClusterCreateRequest) (*Cluster, error)
Create creates a new cluster and returns the created cluster.
func (*ClusterService) Delete ¶
func (s *ClusterService) Delete(ctx context.Context, id int) error
Delete deletes a cluster. Note: A cluster cannot be deleted if it still has nodes or machines referencing it.
func (*ClusterService) GetStatus ¶
func (s *ClusterService) GetStatus(ctx context.Context, id int) (*ClusterStatus, error)
GetStatus returns detailed status for a cluster.
func (*ClusterService) List ¶
func (s *ClusterService) List(ctx context.Context, opts ...ListOption) ([]Cluster, error)
List returns all clusters, with optional filtering and pagination.
func (*ClusterService) Update ¶
func (s *ClusterService) Update(ctx context.Context, id int, req *ClusterUpdateRequest) (*Cluster, error)
Update updates a cluster and returns the updated cluster.
type ClusterServiceInterface ¶
type ClusterServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]Cluster, error)
Get(ctx context.Context, id int) (*Cluster, error)
GetByName(ctx context.Context, name string) (*Cluster, error)
GetStatus(ctx context.Context, id int) (*ClusterStatus, error)
Create(ctx context.Context, req *ClusterCreateRequest) (*Cluster, error)
Update(ctx context.Context, id int, req *ClusterUpdateRequest) (*Cluster, error)
Delete(ctx context.Context, id int) error
}
ClusterServiceInterface defines the interface for Cluster operations.
type ClusterStatsHistory ¶
type ClusterStatsHistory struct {
// Key is the unique identifier for this record.
Key FlexInt `json:"$key,omitempty"`
// Cluster is the parent cluster ID.
Cluster int `json:"cluster,omitempty"`
// Timestamp is the record timestamp (Unix epoch).
Timestamp uint32 `json:"timestamp,omitempty"`
// Node metrics
// TotalNodes is the total number of nodes in the cluster.
TotalNodes uint32 `json:"total_nodes,omitempty"`
// OnlineNodes is the number of online nodes.
OnlineNodes uint32 `json:"online_nodes,omitempty"`
// RunningMachines is the number of running machines.
RunningMachines uint32 `json:"running_machines,omitempty"`
// RAM metrics (in MB)
// TotalRAM is the total RAM in MB.
TotalRAM uint32 `json:"total_ram,omitempty"`
// OnlineRAM is the online RAM in MB.
OnlineRAM uint32 `json:"online_ram,omitempty"`
// UsedRAM is the used RAM in MB.
UsedRAM uint32 `json:"used_ram,omitempty"`
// Core metrics
// TotalCores is the total CPU cores.
TotalCores uint32 `json:"total_cores,omitempty"`
// OnlineCores is the online CPU cores.
OnlineCores uint32 `json:"online_cores,omitempty"`
// UsedCores is the used CPU cores.
UsedCores uint32 `json:"used_cores,omitempty"`
// Physical resource metrics
// PhysRAMUsed is the physical RAM used in bytes.
PhysRAMUsed uint64 `json:"phys_ram_used,omitempty"`
// PhysVRAMUsed is the physical VRAM used in bytes.
PhysVRAMUsed uint64 `json:"phys_vram_used,omitempty"`
// PhysTotalCPU is the physical CPU usage percentage.
PhysTotalCPU uint8 `json:"phys_total_cpu,omitempty"`
// GPU metrics
// GPUsTotal is the total physical GPUs.
GPUsTotal uint16 `json:"gpus_total,omitempty"`
// GPUs is the available GPUs.
GPUs uint16 `json:"gpus,omitempty"`
// GPUsIdle is the idle GPUs.
GPUsIdle uint16 `json:"gpus_idle,omitempty"`
// VGPUsTotal is the total vGPUs.
VGPUsTotal uint16 `json:"vgpus_total,omitempty"`
// VGPUs is the available vGPUs.
VGPUs uint16 `json:"vgpus,omitempty"`
// VGPUsIdle is the idle vGPUs.
VGPUsIdle uint16 `json:"vgpus_idle,omitempty"`
}
ClusterStatsHistory represents a historical cluster statistics record. These records are stored at regular intervals for monitoring.
type ClusterStatsHistoryService ¶
type ClusterStatsHistoryService struct {
// contains filtered or unexported fields
}
ClusterStatsHistoryService handles cluster statistics history read operations. This service provides historical metrics for cluster monitoring.
func (*ClusterStatsHistoryService) GetLatestShort ¶
func (s *ClusterStatsHistoryService) GetLatestShort(ctx context.Context, clusterID int) (*ClusterStatsHistory, error)
GetLatestShort returns the most recent short-term stats record for a cluster.
func (*ClusterStatsHistoryService) GetLong ¶
func (s *ClusterStatsHistoryService) GetLong(ctx context.Context, id int) (*ClusterStatsHistory, error)
GetLong returns a single long-term stats record by ID.
func (*ClusterStatsHistoryService) GetShort ¶
func (s *ClusterStatsHistoryService) GetShort(ctx context.Context, id int) (*ClusterStatsHistory, error)
GetShort returns a single short-term stats record by ID.
func (*ClusterStatsHistoryService) ListLong ¶
func (s *ClusterStatsHistoryService) ListLong(ctx context.Context, opts ...ListOption) ([]ClusterStatsHistory, error)
ListLong returns long-term historical stats for all clusters. Long-term history provides lower resolution data for longer timeframes.
func (*ClusterStatsHistoryService) ListLongByCluster ¶
func (s *ClusterStatsHistoryService) ListLongByCluster(ctx context.Context, clusterID int, opts ...ListOption) ([]ClusterStatsHistory, error)
ListLongByCluster returns long-term historical stats for a specific cluster.
func (*ClusterStatsHistoryService) ListShort ¶
func (s *ClusterStatsHistoryService) ListShort(ctx context.Context, opts ...ListOption) ([]ClusterStatsHistory, error)
ListShort returns short-term historical stats for all clusters. Short-term history provides higher resolution data for recent timeframes.
func (*ClusterStatsHistoryService) ListShortByCluster ¶
func (s *ClusterStatsHistoryService) ListShortByCluster(ctx context.Context, clusterID int, opts ...ListOption) ([]ClusterStatsHistory, error)
ListShortByCluster returns short-term historical stats for a specific cluster.
type ClusterStatsHistoryServiceInterface ¶
type ClusterStatsHistoryServiceInterface interface {
ListShort(ctx context.Context, opts ...ListOption) ([]ClusterStatsHistory, error)
ListShortByCluster(ctx context.Context, clusterID int, opts ...ListOption) ([]ClusterStatsHistory, error)
ListLong(ctx context.Context, opts ...ListOption) ([]ClusterStatsHistory, error)
ListLongByCluster(ctx context.Context, clusterID int, opts ...ListOption) ([]ClusterStatsHistory, error)
GetLatestShort(ctx context.Context, clusterID int) (*ClusterStatsHistory, error)
GetShort(ctx context.Context, id int) (*ClusterStatsHistory, error)
GetLong(ctx context.Context, id int) (*ClusterStatsHistory, error)
}
ClusterStatsHistoryServiceInterface defines the interface for cluster statistics history operations (read-only). This provides historical metrics for cluster monitoring.
type ClusterStatus ¶
type ClusterStatus struct {
// Cluster is the parent cluster reference.
Cluster int `json:"cluster,omitempty"`
// Status is the cluster status.
// Valid values: "online", "shutdown", "offline", "maintenance", "reduced", "noredundant", "error", "updating", "insufficient"
Status string `json:"status,omitempty"`
// StatusInfo provides additional status information.
StatusInfo string `json:"status_info,omitempty"`
// State is the cluster state (online, offline, warning, error).
State string `json:"state,omitempty"`
// LastUpdate is the last update timestamp.
LastUpdate int64 `json:"last_update,omitempty"`
// TotalNodes is the total number of nodes.
TotalNodes int `json:"total_nodes,omitempty"`
// OnlineNodes is the number of online nodes.
OnlineNodes int `json:"online_nodes,omitempty"`
// RunningMachines is the number of running machines.
RunningMachines int `json:"running_machines,omitempty"`
// TotalRAM is the total RAM in MB.
TotalRAM int64 `json:"total_ram,omitempty"`
// OnlineRAM is the online RAM in MB.
OnlineRAM int64 `json:"online_ram,omitempty"`
// UsedRAM is the used RAM in MB.
UsedRAM int64 `json:"used_ram,omitempty"`
// TotalCores is the total CPU cores.
TotalCores int `json:"total_cores,omitempty"`
// OnlineCores is the online CPU cores.
OnlineCores int `json:"online_cores,omitempty"`
// UsedCores is the used CPU cores.
UsedCores int `json:"used_cores,omitempty"`
// PhysRAMUsed is the physical RAM used in bytes.
PhysRAMUsed int64 `json:"phys_ram_used,omitempty"`
// PhysVRAMUsed is the physical virtual RAM used in bytes.
PhysVRAMUsed int64 `json:"phys_vram_used,omitempty"`
// PhysTotalCPU is the physical total CPU usage percentage.
PhysTotalCPU int `json:"phys_total_cpu,omitempty"`
}
ClusterStatus contains cluster status information.
type ClusterTier ¶
type ClusterTier struct {
// Key is the unique identifier for the cluster tier record.
Key FlexInt `json:"$key,omitempty"`
// Cluster is the parent cluster ID.
Cluster int `json:"cluster,omitempty"`
// Tier is the tier number (0-5).
Tier int `json:"tier,omitempty"`
// Description is the tier description.
Description string `json:"description,omitempty"`
// CostPerGB is the cost per GB for billing.
CostPerGB float64 `json:"cost_per_gb,omitempty"`
// PricePerGB is the price per GB for billing.
PricePerGB float64 `json:"price_per_gb,omitempty"`
// Status contains the tier status information.
Status *ClusterTierStatus `json:"status,omitempty"`
// Stats contains the tier statistics.
Stats *ClusterTierStats `json:"stats,omitempty"`
// NodesOnline contains the list of node states for this tier.
// Only populated when the API returns these nested objects (e.g., fields=all).
// Note: fields=all also expands FK fields like Cluster to objects, which may
// require custom deserialization. Not included in default field list.
NodesOnline *ClusterTierNodesOnline `json:"nodes_online,omitempty"`
// DrivesOnline contains the list of drive states for this tier.
// Only populated when the API returns these nested objects (e.g., fields=all).
DrivesOnline []ClusterTierDriveState `json:"drives_online,omitempty"`
}
ClusterTier represents a cluster-specific storage tier in VergeOS. Cluster tiers contain status information about the VSAN tier for a specific cluster.
func (*ClusterTier) CountOnlineDrives ¶ added in v0.1.4
func (ct *ClusterTier) CountOnlineDrives() int
CountOnlineDrives returns the number of drives with state "online".
func (*ClusterTier) CountOnlineNodes ¶ added in v0.1.4
func (ct *ClusterTier) CountOnlineNodes() int
CountOnlineNodes returns the number of nodes with state "online".
type ClusterTierDriveState ¶ added in v0.1.4
type ClusterTierDriveState struct {
// State is the drive state (e.g., "online", "offline", "repairing").
State string `json:"state,omitempty"`
}
ClusterTierDriveState represents the state of a drive within a cluster tier.
type ClusterTierNodeState ¶ added in v0.1.4
type ClusterTierNodeState struct {
// State is the node state (e.g., "online", "offline").
State string `json:"state,omitempty"`
}
ClusterTierNodeState represents the state of a node within a cluster tier.
type ClusterTierNodesOnline ¶ added in v0.1.4
type ClusterTierNodesOnline struct {
// Nodes is the list of node states.
Nodes []ClusterTierNodeState `json:"nodes,omitempty"`
}
ClusterTierNodesOnline contains the list of node states for a cluster tier.
type ClusterTierService ¶
type ClusterTierService struct {
// contains filtered or unexported fields
}
ClusterTierService handles cluster tier read operations. Cluster tiers provide cluster-specific VSAN tier status and statistics.
func (*ClusterTierService) Get ¶
func (s *ClusterTierService) Get(ctx context.Context, id int) (*ClusterTier, error)
Get returns a single cluster tier by ID.
func (*ClusterTierService) GetByClusterAndTier ¶
func (s *ClusterTierService) GetByClusterAndTier(ctx context.Context, clusterID int, tierNum int) (*ClusterTier, error)
GetByClusterAndTier returns a specific tier for a cluster by tier number.
func (*ClusterTierService) List ¶
func (s *ClusterTierService) List(ctx context.Context, opts ...ListOption) ([]ClusterTier, error)
List returns all cluster tiers, with optional filtering.
func (*ClusterTierService) ListByCluster ¶
func (s *ClusterTierService) ListByCluster(ctx context.Context, clusterID int, opts ...ListOption) ([]ClusterTier, error)
ListByCluster returns all tiers for a specific cluster.
type ClusterTierServiceInterface ¶
type ClusterTierServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]ClusterTier, error)
ListByCluster(ctx context.Context, clusterID int, opts ...ListOption) ([]ClusterTier, error)
Get(ctx context.Context, id int) (*ClusterTier, error)
GetByClusterAndTier(ctx context.Context, clusterID int, tierNum int) (*ClusterTier, error)
}
ClusterTierServiceInterface defines the interface for cluster tier operations (read-only). Cluster tiers provide cluster-specific VSAN tier status and statistics.
type ClusterTierStats ¶
type ClusterTierStats struct {
// Reads is the total read operations.
Reads uint64 `json:"reads,omitempty"`
// Writes is the total write operations.
Writes uint64 `json:"writes,omitempty"`
// ReadBytes is the total bytes read.
ReadBytes uint64 `json:"read_bytes,omitempty"`
// WriteBytes is the total bytes written.
WriteBytes uint64 `json:"write_bytes,omitempty"`
// Rops is the read operations per second.
Rops uint64 `json:"rops,omitempty"`
// Wops is the write operations per second.
Wops uint64 `json:"wops,omitempty"`
// Rbps is the read bytes per second.
Rbps uint64 `json:"rbps,omitempty"`
// Wbps is the write bytes per second.
Wbps uint64 `json:"wbps,omitempty"`
}
ClusterTierStats contains I/O statistics for a cluster tier.
type ClusterTierStatus ¶
type ClusterTierStatus struct {
// Tier is the parent cluster tier reference.
Tier int `json:"tier,omitempty"`
// Status is the tier status (online, offline, repairing, initializing, verifying, noredundant, outofspace).
Status string `json:"status,omitempty"`
// State is the tier state (online, offline, warning, error).
State string `json:"state,omitempty"`
// Capacity is the total capacity in bytes.
Capacity uint64 `json:"capacity,omitempty"`
// Used is the used space in bytes.
Used uint64 `json:"used,omitempty"`
// UsedPct is the used space percentage (0-100).
UsedPct uint32 `json:"used_pct,omitempty"`
// Allocated is the allocated space in bytes.
Allocated uint64 `json:"allocated,omitempty"`
// Redundant indicates whether the tier has redundancy.
Redundant bool `json:"redundant,omitempty"`
// Encrypted indicates whether the tier is encrypted.
Encrypted bool `json:"encrypted,omitempty"`
// Working indicates whether the tier is actively working (walking/repairing).
Working bool `json:"working,omitempty"`
// LastWalkTimeMs is the last walk time in milliseconds.
LastWalkTimeMs uint64 `json:"last_walk_time_ms,omitempty"`
// LastFullwalkTimeMs is the last full walk time in milliseconds.
LastFullwalkTimeMs uint64 `json:"last_fullwalk_time_ms,omitempty"`
// Transaction is the current transaction number.
Transaction uint64 `json:"transaction,omitempty"`
// Repairs is the number of repairs performed.
Repairs uint64 `json:"repairs,omitempty"`
// BadDrives is the number of unavailable drives.
BadDrives float64 `json:"bad_drives,omitempty"`
// Fullwalk indicates whether a full walk is in progress.
Fullwalk bool `json:"fullwalk,omitempty"`
// Progress is the walk progress (0.0-1.0).
Progress float64 `json:"progress,omitempty"`
// IndexUnique is the number of unique index entries.
IndexUnique uint64 `json:"index_unique,omitempty"`
// StateTimestamp is the timestamp when the state last changed.
StateTimestamp uint64 `json:"state_timestamp,omitempty"`
// CurSpaceThrottleMs is the current space throttle in milliseconds.
CurSpaceThrottleMs float64 `json:"cur_space_throttle_ms,omitempty"`
// TransactionStartStamp is the transaction start timestamp.
TransactionStartStamp uint32 `json:"transaction_start_stamp,omitempty"`
}
ClusterTierStatus contains status information for a cluster tier.
type ClusterUpdateRequest ¶
type ClusterUpdateRequest struct {
// Name is the cluster name.
Name *string `json:"name,omitempty"`
// Description is the cluster description.
Description *string `json:"description,omitempty"`
// Enabled indicates whether the cluster is enabled.
Enabled *bool `json:"enabled,omitempty"`
// Compute indicates whether this is a compute cluster.
Compute *bool `json:"compute,omitempty"`
// KVMNested enables nested virtualization.
KVMNested *bool `json:"kvm_nested,omitempty"`
// AllowNestedVirtMigration allows live migration of nested virtualization VMs.
AllowNestedVirtMigration *bool `json:"allow_nested_virt_migration,omitempty"`
// AllowVGPUMigration allows live migration of vGPU VMs (experimental).
AllowVGPUMigration *bool `json:"allow_vgpu_migration,omitempty"`
// EnableSplitLockDetection enables split lock detection.
EnableSplitLockDetection *bool `json:"enable_split_lock_detection,omitempty"`
// DefaultCPU is the default CPU type for VMs.
DefaultCPU *string `json:"default_cpu,omitempty"`
// DisableCPUSecurityMitigations disables CPU security mitigations.
DisableCPUSecurityMitigations *bool `json:"disable_cpu_security_mitigations,omitempty"`
// SpecStoreBypassDisable disables speculative store bypass.
SpecStoreBypassDisable *bool `json:"spec_store_bypass_disable,omitempty"`
// DisableSMT disables hyper-threading.
DisableSMT *bool `json:"disable_smt,omitempty"`
// DisableSleep disables CPU sleep states.
DisableSleep *bool `json:"disable_sleep,omitempty"`
// EnableNVMEPowerManagement enables NVMe power management.
EnableNVMEPowerManagement *bool `json:"enable_nvme_power_management,omitempty"`
// X86EnergyPerfPolicy is the energy-performance policy.
X86EnergyPerfPolicy *string `json:"x86_energy_perf_policy,omitempty"`
// ScalingGovernor is the CPU scaling governor.
ScalingGovernor *string `json:"scaling_governor,omitempty"`
// RAMPerUnit is the RAM per billing unit in MB.
RAMPerUnit *int `json:"ram_per_unit,omitempty"`
// CoresPerUnit is the cores per billing unit.
CoresPerUnit *int `json:"cores_per_unit,omitempty"`
// CostPerUnit is the cost per unit.
CostPerUnit *float64 `json:"cost_per_unit,omitempty"`
// PricePerUnit is the price per unit.
PricePerUnit *float64 `json:"price_per_unit,omitempty"`
// MaxRAMPerVM is the maximum RAM per VM in MB.
MaxRAMPerVM *int `json:"max_ram_per_vm,omitempty"`
// MaxCoresPerVM is the maximum cores per VM.
MaxCoresPerVM *int `json:"max_cores_per_vm,omitempty"`
// StorageCacheSize is the storage cache per node in MB.
StorageCacheSize *int `json:"storage_cachesize,omitempty"`
// StorageBufferSize is the storage buffer per node in MB.
StorageBufferSize *int `json:"storage_buffersize,omitempty"`
// StorageHugepages indicates whether to allocate hugepages for storage.
StorageHugepages *bool `json:"storage_hugepages,omitempty"`
// TargetRAMPct is the target maximum RAM percentage (0-100).
TargetRAMPct *float64 `json:"target_ram_pct,omitempty"`
// RAMOvercommitPct is the percentage of reserve RAM to use for machines (0-100).
RAMOvercommitPct *float64 `json:"ram_overcommit_pct,omitempty"`
// SwapTier is the tier used for swap (-1 to 5, -1 = disabled).
SwapTier *int `json:"swap_tier,omitempty"`
// SwapPerDrive is the swap space per drive in MB.
SwapPerDrive *int `json:"swap_per_drive,omitempty"`
// LogFilter is the system log filter expression.
LogFilter *string `json:"log_filter,omitempty"`
// MaxCoreTemp is the maximum core temperature in Celsius (0 = disabled).
MaxCoreTemp *int `json:"max_core_temp,omitempty"`
// MaxCoreTempWarnPerc is the warning threshold percentage of max core temp.
MaxCoreTempWarnPerc *int `json:"max_core_temp_warn_perc,omitempty"`
// CriticalCoreTemp is the critical core temperature in Celsius (0 = disabled).
CriticalCoreTemp *int `json:"critical_core_temp,omitempty"`
}
ClusterUpdateRequest is the request body for updating a cluster.
type File ¶
type File struct {
// ID is the unique identifier for the file.
ID FlexInt `json:"$key,omitempty"`
// Name is the file name.
Name string `json:"name"`
// Description is the description.
Description string `json:"description,omitempty"`
// Type is the file type (iso, img, qcow, qcow2, raw, vdi, vhd, vhdx, vmdk, ova, etc.).
Type string `json:"type,omitempty"`
// Owner is the owning machine drive ID.
Owner FlexInt `json:"owner,omitempty"`
// AllocatedBytes is the allocated size in bytes.
AllocatedBytes int64 `json:"allocated_bytes,omitempty"`
// UsedBytes is the actual size on disk in bytes.
UsedBytes int64 `json:"used_bytes,omitempty"`
// Filesize is the logical file size in bytes.
Filesize int64 `json:"filesize,omitempty"`
// Modified is the last modified timestamp (Unix epoch).
Modified int64 `json:"modified,omitempty"`
// PreferredTier is the preferred storage tier (1-5).
PreferredTier string `json:"preferred_tier,omitempty"`
// URL is the source URL if the file was imported from a URL.
URL string `json:"url,omitempty"`
// Creator is the username that created this file.
Creator string `json:"creator,omitempty"`
}
File represents a file (ISO, image, etc.) in VergeOS.
type FileCreateRequest ¶
type FileCreateRequest struct {
// Name is the file name (required).
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// AllocatedBytes is the expected file size in bytes (required for uploads).
// Pass as string to match API expectations.
AllocatedBytes string `json:"allocated_bytes,omitempty"`
// PreferredTier is the preferred storage tier (1-5).
PreferredTier string `json:"preferred_tier,omitempty"`
// URL is a source URL to import the file from (optional).
// If provided, VergeOS will download the file from this URL.
URL string `json:"url,omitempty"`
}
FileCreateRequest is the request body for creating a file entry. After creating the entry, use Upload() to upload the file content.
type FileService ¶
type FileService struct {
// contains filtered or unexported fields
}
FileService handles file read operations.
func (*FileService) Create ¶
func (s *FileService) Create(ctx context.Context, req *FileCreateRequest) (*File, error)
Create creates a new file entry in VergeOS. This creates the metadata entry; use Upload() or UploadFrom() to upload content. If URL is provided in the request, VergeOS will import the file from that URL.
func (*FileService) Delete ¶
func (s *FileService) Delete(ctx context.Context, id int) error
Delete removes a file from VergeOS. Files that are referenced by VM drives cannot be deleted until the reference is removed.
func (*FileService) Download ¶
func (s *FileService) Download(ctx context.Context, id int) (io.ReadCloser, *File, error)
Download downloads a file from VergeOS and returns an io.ReadCloser. The caller is responsible for closing the reader when done. Use the File.Filesize field to know the expected size.
func (*FileService) DownloadToFile ¶
DownloadToFile downloads a file from VergeOS and saves it to the specified path. If destPath is a directory, the file will be saved with its original name. Returns the full path to the saved file.
func (*FileService) List ¶
func (s *FileService) List(ctx context.Context, opts ...ListOption) ([]File, error)
List returns all files, with optional filtering and pagination.
func (*FileService) ListISOs ¶
func (s *FileService) ListISOs(ctx context.Context, opts ...ListOption) ([]File, error)
ListISOs returns all ISO files.
func (*FileService) Update ¶
func (s *FileService) Update(ctx context.Context, id int, req *FileUpdateRequest) (*File, error)
Update updates a file's metadata.
func (*FileService) Upload ¶
func (s *FileService) Upload(ctx context.Context, id int, reader io.Reader, size int64) (*File, error)
Upload uploads a file to VergeOS from an io.Reader. The file entry must be created first with Create(). The size parameter must match the allocated_bytes used when creating the file entry. Returns the updated File after upload completes.
func (*FileService) UploadFromFile ¶
func (s *FileService) UploadFromFile(ctx context.Context, localPath string, req *FileCreateRequest) (*File, error)
UploadFromFile uploads a local file to VergeOS. This is a convenience method that creates the file entry and uploads the content. Returns the created File after upload completes.
type FileServiceInterface ¶
type FileServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]File, error)
Get(ctx context.Context, id int) (*File, error)
GetByName(ctx context.Context, name string) (*File, error)
ListISOs(ctx context.Context, opts ...ListOption) ([]File, error)
Create(ctx context.Context, req *FileCreateRequest) (*File, error)
Update(ctx context.Context, id int, req *FileUpdateRequest) (*File, error)
Delete(ctx context.Context, id int) error
Download(ctx context.Context, id int) (io.ReadCloser, *File, error)
DownloadToFile(ctx context.Context, id int, destPath string) (string, error)
Upload(ctx context.Context, id int, reader io.Reader, size int64) (*File, error)
UploadWithChunkSize(ctx context.Context, id int, reader io.Reader, size int64, chunkSize int) (*File, error)
UploadFromFile(ctx context.Context, localPath string, req *FileCreateRequest) (*File, error)
}
FileServiceInterface defines the interface for File operations.
type FileUpdateRequest ¶
type FileUpdateRequest struct {
// Name is the file name.
Name *string `json:"name,omitempty"`
// Description is the description.
Description *string `json:"description,omitempty"`
// PreferredTier is the preferred storage tier (1-5).
PreferredTier *string `json:"preferred_tier,omitempty"`
}
FileUpdateRequest is the request body for updating a file.
type FlexInt ¶
type FlexInt int
FlexInt is an int that can be unmarshaled from either a JSON number or string. The VergeOS API sometimes returns IDs as strings when specific fields are requested.
func (FlexInt) MarshalJSON ¶
MarshalJSON implements json.Marshaler for FlexInt.
func (*FlexInt) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler for FlexInt.
type Group ¶
type Group struct {
// ID is the unique identifier for the group.
ID FlexInt `json:"$key,omitempty"`
// Name is the group name.
Name string `json:"name"`
// Description is the group description.
Description string `json:"description,omitempty"`
// Enabled indicates whether the group is enabled.
Enabled bool `json:"enabled"`
// Type is the group type.
Type string `json:"type,omitempty"`
// Email is the group email address.
Email string `json:"email,omitempty"`
// SystemGroup indicates whether this is a system-managed group.
SystemGroup bool `json:"system_group,omitempty"`
// AuthSource is the authentication source ID.
AuthSource int `json:"auth_source,omitempty"`
// Created is the creation timestamp (Unix epoch).
Created int64 `json:"created,omitempty"`
// Creator is the username that created this group.
Creator string `json:"creator,omitempty"`
}
Group represents a VergeOS group.
type GroupCreateRequest ¶
type GroupCreateRequest struct {
// Name is the group name (required).
Name string `json:"name"`
// Description is the group description.
Description string `json:"description,omitempty"`
// Enabled indicates whether the group is enabled.
Enabled *bool `json:"enabled,omitempty"`
// Email is the group email address.
Email string `json:"email,omitempty"`
// AuthSource is the authentication source ID.
AuthSource *int `json:"auth_source,omitempty"`
}
GroupCreateRequest is the request body for creating a group.
type GroupService ¶
type GroupService struct {
// contains filtered or unexported fields
}
GroupService handles group read operations.
func (*GroupService) Create ¶
func (s *GroupService) Create(ctx context.Context, req *GroupCreateRequest) (*Group, error)
Create creates a new group and returns it.
func (*GroupService) Delete ¶
func (s *GroupService) Delete(ctx context.Context, id int) error
Delete deletes a group by ID.
func (*GroupService) List ¶
func (s *GroupService) List(ctx context.Context, opts ...ListOption) ([]Group, error)
List returns all groups, with optional filtering and pagination.
func (*GroupService) Update ¶
func (s *GroupService) Update(ctx context.Context, id int, req *GroupUpdateRequest) (*Group, error)
Update updates an existing group and returns the updated group.
type GroupServiceInterface ¶
type GroupServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]Group, error)
Get(ctx context.Context, id int) (*Group, error)
GetByName(ctx context.Context, name string) (*Group, error)
Create(ctx context.Context, req *GroupCreateRequest) (*Group, error)
Update(ctx context.Context, id int, req *GroupUpdateRequest) (*Group, error)
Delete(ctx context.Context, id int) error
}
GroupServiceInterface defines the interface for Group operations.
type GroupUpdateRequest ¶
type GroupUpdateRequest struct {
// Name is the group name.
Name *string `json:"name,omitempty"`
// Description is the group description.
Description *string `json:"description,omitempty"`
// Enabled indicates whether the group is enabled.
Enabled *bool `json:"enabled,omitempty"`
// Email is the group email address.
Email *string `json:"email,omitempty"`
}
GroupUpdateRequest is the request body for updating a group.
type ListOption ¶
type ListOption func(*ListOptions)
ListOption is a function that modifies ListOptions.
func WithFields ¶
func WithFields(fields string) ListOption
WithFields sets which fields to return in a list operation.
Common values:
- "most" - returns most common fields (default)
- "all" - returns all fields
- "name,enabled,ram" - returns specific fields
func WithFilter ¶
func WithFilter(filter string) ListOption
WithFilter sets the filter expression for a list operation.
Example filters:
- "name eq 'my-vm'"
- "enabled eq true"
- "name eq 'vm1' and enabled eq true"
func WithLimit ¶
func WithLimit(limit int) ListOption
WithLimit sets the maximum number of results to return.
func WithOffset ¶
func WithOffset(offset int) ListOption
WithOffset sets the number of results to skip (for pagination).
func WithSort ¶
func WithSort(sort string) ListOption
WithSort sets the sort order for a list operation.
Examples:
- "name" - sort by name ascending
- "-created" - sort by created descending
type ListOptions ¶
type ListOptions struct {
// Filter is a filter expression (e.g., "name eq 'my-vm'").
Filter string
// Fields specifies which fields to return (e.g., "most", "all", "name,enabled").
Fields string
// Sort specifies the sort order (e.g., "name", "-created" for descending).
Sort string
// Limit is the maximum number of results to return.
Limit int
// Offset is the number of results to skip.
Offset int
}
ListOptions contains options for list operations.
type Log ¶
type Log struct {
// Key is the unique identifier for the log entry (row number).
Key FlexInt `json:"$key,omitempty"`
// Level is the log level (audit, message, warning, error, critical, summary, debug).
Level string `json:"level,omitempty"`
// Text is the log message text.
Text string `json:"text,omitempty"`
// Timestamp is the creation timestamp in microseconds (readonly).
Timestamp int64 `json:"timestamp,omitempty"`
// User is the username associated with the log entry.
User string `json:"user,omitempty"`
// ObjectType is the type of object this log relates to.
ObjectType string `json:"object_type,omitempty"`
// ObjectName is the name of the object this log relates to.
ObjectName string `json:"object_name,omitempty"`
}
Log represents a VergeOS system log entry. Logs are read-only and provide audit, error, and operational information.
type LogService ¶
type LogService struct {
// contains filtered or unexported fields
}
LogService handles system log operations. Logs are read-only and provide audit, error, and operational information.
func (*LogService) GetRecentErrors ¶
GetRecentErrors returns the most recent n error/critical logs.
func (*LogService) List ¶
func (s *LogService) List(ctx context.Context, opts ...ListOption) ([]Log, error)
List returns system logs, with optional filtering and pagination. Note: Logs are sorted by timestamp descending by default (newest first).
func (*LogService) ListAudit ¶
func (s *LogService) ListAudit(ctx context.Context, opts ...ListOption) ([]Log, error)
ListAudit returns audit logs.
func (*LogService) ListByLevel ¶
func (s *LogService) ListByLevel(ctx context.Context, level string, opts ...ListOption) ([]Log, error)
ListByLevel returns logs filtered by level.
func (*LogService) ListByObjectType ¶
func (s *LogService) ListByObjectType(ctx context.Context, objectType string, opts ...ListOption) ([]Log, error)
ListByObjectType returns logs filtered by object type.
func (*LogService) ListByUser ¶
func (s *LogService) ListByUser(ctx context.Context, username string, opts ...ListOption) ([]Log, error)
ListByUser returns logs filtered by username.
func (*LogService) ListErrors ¶
func (s *LogService) ListErrors(ctx context.Context, opts ...ListOption) ([]Log, error)
ListErrors returns logs with error or critical level.
func (*LogService) ListSince ¶
func (s *LogService) ListSince(ctx context.Context, timestampMicros int64, opts ...ListOption) ([]Log, error)
ListSince returns logs since the specified timestamp (microseconds since epoch).
func (*LogService) ListWarnings ¶
func (s *LogService) ListWarnings(ctx context.Context, opts ...ListOption) ([]Log, error)
ListWarnings returns warning logs.
func (*LogService) Search ¶
func (s *LogService) Search(ctx context.Context, pattern string, opts ...ListOption) ([]Log, error)
Search searches logs by text pattern. Uses the API's text contains filter.
type LogServiceInterface ¶
type LogServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]Log, error)
ListByLevel(ctx context.Context, level string, opts ...ListOption) ([]Log, error)
ListByObjectType(ctx context.Context, objectType string, opts ...ListOption) ([]Log, error)
ListErrors(ctx context.Context, opts ...ListOption) ([]Log, error)
ListAudit(ctx context.Context, opts ...ListOption) ([]Log, error)
ListWarnings(ctx context.Context, opts ...ListOption) ([]Log, error)
ListByUser(ctx context.Context, username string, opts ...ListOption) ([]Log, error)
ListSince(ctx context.Context, timestampMicros int64, opts ...ListOption) ([]Log, error)
Get(ctx context.Context, id int) (*Log, error)
GetRecent(ctx context.Context, count int) ([]Log, error)
GetRecentErrors(ctx context.Context, count int) ([]Log, error)
Search(ctx context.Context, pattern string, opts ...ListOption) ([]Log, error)
}
LogServiceInterface defines the interface for system log operations (read-only).
type MachineDrivePhys ¶
type MachineDrivePhys struct {
// Key is the unique identifier for this physical drive record.
Key FlexInt `json:"$key,omitempty"`
// ParentDrive is the parent machine drive ID.
ParentDrive int `json:"parent_drive,omitempty"`
// Path is the local drive path.
Path string `json:"path,omitempty"`
// AllPaths contains all drive paths.
AllPaths string `json:"all_paths,omitempty"`
// Modified is the last modified timestamp.
Modified int64 `json:"modified,omitempty"`
// Size is the disk size in bytes.
Size uint64 `json:"size,omitempty"`
// Model is the drive model.
Model string `json:"model,omitempty"`
// Fw is the firmware version.
Fw string `json:"fw,omitempty"`
// Serial is the serial number.
Serial string `json:"serial,omitempty"`
// Temperature metrics
// Temp is the current temperature in Celsius.
Temp uint16 `json:"temp,omitempty"`
// TempWarn indicates whether the temperature is in warning state.
TempWarn bool `json:"temp_warn,omitempty"`
// SMART metrics
// Encrypted indicates whether the drive is encrypted.
Encrypted bool `json:"encrypted,omitempty"`
// ReallocSectors is the number of reallocated sectors.
ReallocSectors uint32 `json:"realloc_sectors,omitempty"`
// ReallocSectorsWarn indicates a reallocated sectors warning.
ReallocSectorsWarn bool `json:"realloc_sectors_warn,omitempty"`
// WearLevel is the wear level percentage (for SSDs).
WearLevel uint32 `json:"wear_level,omitempty"`
// WearLevelWarn indicates a wear level warning.
WearLevelWarn bool `json:"wear_level_warn,omitempty"`
// Hours is the total power-on hours.
Hours uint32 `json:"hours,omitempty"`
// HoursWarn indicates a power-on hours warning.
HoursWarn bool `json:"hours_warn,omitempty"`
// CurrentPendingSector is the current pending sector count.
CurrentPendingSector float64 `json:"current_pending_sector,omitempty"`
// CurrentPendingSectorWarn indicates a pending sector warning.
CurrentPendingSectorWarn bool `json:"current_pending_sector_warn,omitempty"`
// OfflineUncorrectable is the offline uncorrectable sector count.
OfflineUncorrectable float64 `json:"offline_uncorrectable,omitempty"`
// OfflineUncorrectableWarn indicates an offline uncorrectable warning.
OfflineUncorrectableWarn bool `json:"offline_uncorrectable_warn,omitempty"`
// Smart indicates whether SMART status is available.
Smart bool `json:"smart,omitempty"`
// VSAN metrics
// VSANDriveID is the VSAN drive ID (-1 if not in VSAN).
VSANDriveID int8 `json:"vsan_driveid,omitempty"`
// VSANTier is the VSAN tier number (-1 if not in VSAN).
VSANTier int8 `json:"vsan_tier,omitempty"`
// VSANUsed is the VSAN used space in bytes.
VSANUsed uint64 `json:"vsan_used,omitempty"`
// VSANMax is the VSAN maximum space in bytes.
VSANMax uint64 `json:"vsan_max,omitempty"`
// VSANReadErrors is the VSAN read error count.
VSANReadErrors uint64 `json:"vsan_read_errors,omitempty"`
// VSANWriteErrors is the VSAN write error count.
VSANWriteErrors uint64 `json:"vsan_write_errors,omitempty"`
// VSANAvgLatency is the VSAN average latency in microseconds.
VSANAvgLatency uint32 `json:"vsan_avg_latency,omitempty"`
// VSANMaxLatency is the VSAN maximum latency in microseconds.
VSANMaxLatency uint32 `json:"vsan_max_latency,omitempty"`
// VSANRepairing is the number of blocks being repaired.
VSANRepairing uint64 `json:"vsan_repairing,omitempty"`
// VSANRepairEstimate is the estimated repair time in seconds.
VSANRepairEstimate uint64 `json:"vsan_repair_estimate,omitempty"`
// VSANLastError is the last VSAN error message.
VSANLastError string `json:"vsan_last_error,omitempty"`
// VSANThrottle is the VSAN write throttle in bytes per second.
VSANThrottle uint64 `json:"vsan_throttle,omitempty"`
// VSANPath is the VSAN drive path.
VSANPath string `json:"vsan_path,omitempty"`
// VSANOnlineSince is the timestamp when the drive came online.
VSANOnlineSince uint32 `json:"vsan_online_since,omitempty"`
// Physical drive configuration
// Spare indicates whether this is a VSAN spare drive.
Spare bool `json:"spare,omitempty"`
// Swap indicates whether this drive has a swap partition.
Swap bool `json:"swap,omitempty"`
// SwapSize is the swap partition size in bytes.
SwapSize uint64 `json:"swap_size,omitempty"`
// Boot indicates whether this drive has a boot partition.
Boot bool `json:"boot,omitempty"`
// BootSize is the boot partition size in bytes.
BootSize uint64 `json:"boot_size,omitempty"`
// YBPart indicates whether this drive has a VergeOS partition.
YBPart bool `json:"ybpart,omitempty"`
// YBPartSize is the VergeOS partition size in bytes.
YBPartSize uint64 `json:"ybpart_size,omitempty"`
// EncryptionKey indicates whether the drive holds the encryption key.
EncryptionKey bool `json:"encryption_key,omitempty"`
// Location information
// EnclosureSlot is the enclosure slot number.
EnclosureSlot string `json:"enclosure_slot,omitempty"`
// LocateStatus is the locate LED status (unsupported, on, off).
LocateStatus string `json:"locate_status,omitempty"`
// Location is the physical location description.
Location string `json:"location,omitempty"`
// Bus is the bus type.
Bus string `json:"bus,omitempty"`
// NodeDisplay is the name of the physical node containing this drive.
// Populated via computed field: parent_drive#machine#name
NodeDisplay string `json:"node_display,omitempty"`
// StatusList is the drive status (online, offline, repairing, initializing, verifying, noredundant, outofspace).
// Populated via computed field: parent_drive#status#status
StatusList string `json:"statuslist,omitempty"`
}
MachineDrivePhys represents physical drive information for a machine drive. This contains hardware-level information like temperature, wear level, and VSAN status.
type MachineDrivePhysService ¶
type MachineDrivePhysService struct {
// contains filtered or unexported fields
}
MachineDrivePhysService handles machine drive physical status read operations. This service provides hardware-level drive information including temperature, wear level, and VSAN-specific metrics.
func (*MachineDrivePhysService) Get ¶
func (s *MachineDrivePhysService) Get(ctx context.Context, id int) (*MachineDrivePhys, error)
Get returns a single machine drive physical record by ID.
func (*MachineDrivePhysService) GetByParentDrive ¶
func (s *MachineDrivePhysService) GetByParentDrive(ctx context.Context, driveID int) (*MachineDrivePhys, error)
GetByParentDrive returns the physical status for a specific machine drive.
func (*MachineDrivePhysService) List ¶
func (s *MachineDrivePhysService) List(ctx context.Context, opts ...ListOption) ([]MachineDrivePhys, error)
List returns all machine drive physical records, with optional filtering.
func (*MachineDrivePhysService) ListByVSANTier ¶
func (s *MachineDrivePhysService) ListByVSANTier(ctx context.Context, tier int, opts ...ListOption) ([]MachineDrivePhys, error)
ListByVSANTier returns all drives in a specific VSAN tier.
func (*MachineDrivePhysService) ListSpares ¶
func (s *MachineDrivePhysService) ListSpares(ctx context.Context, opts ...ListOption) ([]MachineDrivePhys, error)
ListSpares returns all VSAN spare drives.
func (*MachineDrivePhysService) ListWithWarnings ¶
func (s *MachineDrivePhysService) ListWithWarnings(ctx context.Context, opts ...ListOption) ([]MachineDrivePhys, error)
ListWithWarnings returns drives with any warning flags set.
type MachineDrivePhysServiceInterface ¶
type MachineDrivePhysServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]MachineDrivePhys, error)
ListByVSANTier(ctx context.Context, tier int, opts ...ListOption) ([]MachineDrivePhys, error)
ListSpares(ctx context.Context, opts ...ListOption) ([]MachineDrivePhys, error)
ListWithWarnings(ctx context.Context, opts ...ListOption) ([]MachineDrivePhys, error)
Get(ctx context.Context, id int) (*MachineDrivePhys, error)
GetByParentDrive(ctx context.Context, driveID int) (*MachineDrivePhys, error)
}
MachineDrivePhysServiceInterface defines the interface for machine drive physical status operations (read-only). This provides hardware-level drive information including temperature, wear level, and VSAN metrics.
type MachineDriveStats ¶ added in v0.1.4
type MachineDriveStats struct {
// Key is the unique identifier for this stats record.
Key FlexInt `json:"$key,omitempty"`
// ParentDrive is the parent machine drive ID.
ParentDrive int `json:"parent_drive,omitempty"`
// Reads is the total read operations.
Reads uint64 `json:"reads,omitempty"`
// Writes is the total write operations.
Writes uint64 `json:"writes,omitempty"`
// ReadBytes is the total bytes read.
ReadBytes uint64 `json:"read_bytes,omitempty"`
// WriteBytes is the total bytes written.
WriteBytes uint64 `json:"write_bytes,omitempty"`
// Rops is the read operations per second.
Rops uint64 `json:"rops,omitempty"`
// Wops is the write operations per second.
Wops uint64 `json:"wops,omitempty"`
// Rbps is the read bytes per second.
Rbps uint64 `json:"rbps,omitempty"`
// Wbps is the write bytes per second.
Wbps uint64 `json:"wbps,omitempty"`
// ServiceTime is the average I/O service time in milliseconds.
ServiceTime float64 `json:"service_time,omitempty"`
// Util is the I/O utilization percentage.
Util float64 `json:"util,omitempty"`
// Physical indicates whether these are physical drive stats.
Physical bool `json:"physical,omitempty"`
}
MachineDriveStats represents per-drive I/O statistics. There is one stats row per drive, linked via the parent_drive FK.
type MachineDriveStatsService ¶ added in v0.1.4
type MachineDriveStatsService struct {
// contains filtered or unexported fields
}
MachineDriveStatsService handles machine drive I/O statistics read operations. This service provides per-drive reads, writes, throughput, and utilization metrics.
func (*MachineDriveStatsService) Get ¶ added in v0.1.4
func (s *MachineDriveStatsService) Get(ctx context.Context, id int) (*MachineDriveStats, error)
Get returns a single machine drive stats record by ID.
func (*MachineDriveStatsService) GetByDrive ¶ added in v0.1.4
func (s *MachineDriveStatsService) GetByDrive(ctx context.Context, driveID int) (*MachineDriveStats, error)
GetByDrive retrieves stats for a specific drive by parent drive ID.
func (*MachineDriveStatsService) List ¶ added in v0.1.4
func (s *MachineDriveStatsService) List(ctx context.Context, opts ...ListOption) ([]MachineDriveStats, error)
List returns all machine drive stats, with optional filtering.
func (*MachineDriveStatsService) ListPhysical ¶ added in v0.1.4
func (s *MachineDriveStatsService) ListPhysical(ctx context.Context, opts ...ListOption) ([]MachineDriveStats, error)
ListPhysical returns stats for physical drives only.
type MachineDriveStatsServiceInterface ¶ added in v0.1.4
type MachineDriveStatsServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]MachineDriveStats, error)
ListPhysical(ctx context.Context, opts ...ListOption) ([]MachineDriveStats, error)
GetByDrive(ctx context.Context, driveID int) (*MachineDriveStats, error)
Get(ctx context.Context, id int) (*MachineDriveStats, error)
}
MachineDriveStatsServiceInterface defines the interface for machine drive stats operations (read-only). Machine drive stats provide per-drive I/O metrics including reads, writes, throughput, and utilization.
type MachineNIC ¶ added in v0.1.4
type MachineNIC struct {
// Key is the unique identifier for this NIC record.
Key FlexInt `json:"$key,omitempty"`
// Machine is the parent machine ID.
Machine int `json:"machine,omitempty"`
// Name is the interface name (e.g., "eno1", "eth0").
Name string `json:"name,omitempty"`
// Stats contains the NIC traffic statistics (populated via stats[all] expansion).
Stats *MachineNICStats `json:"stats,omitempty"`
// Status contains the NIC link status (populated via status[all] expansion).
Status *MachineNICStatus `json:"status,omitempty"`
}
MachineNIC represents a physical network interface on a machine.
type MachineNICService ¶ added in v0.1.4
type MachineNICService struct {
// contains filtered or unexported fields
}
MachineNICService handles machine NIC read operations. This service provides per-NIC traffic counters and link status for physical nodes.
func (*MachineNICService) Get ¶ added in v0.1.4
func (s *MachineNICService) Get(ctx context.Context, id int) (*MachineNIC, error)
Get returns a single machine NIC by ID.
func (*MachineNICService) List ¶ added in v0.1.4
func (s *MachineNICService) List(ctx context.Context, opts ...ListOption) ([]MachineNIC, error)
List returns all machine NICs with stats and status expanded, with optional filtering.
func (*MachineNICService) ListByMachine ¶ added in v0.1.4
func (s *MachineNICService) ListByMachine(ctx context.Context, machineID int, opts ...ListOption) ([]MachineNIC, error)
ListByMachine returns all NICs for a given machine, with stats and status expanded.
type MachineNICServiceInterface ¶ added in v0.1.4
type MachineNICServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]MachineNIC, error)
ListByMachine(ctx context.Context, machineID int, opts ...ListOption) ([]MachineNIC, error)
Get(ctx context.Context, id int) (*MachineNIC, error)
}
MachineNICServiceInterface defines the interface for machine NIC operations (read-only). Machine NICs provide per-NIC traffic counters and link status for physical nodes.
type MachineNICStats ¶ added in v0.1.4
type MachineNICStats struct {
// Key is the unique identifier for this stats record.
Key FlexInt `json:"$key,omitempty"`
// TxPckts is the total transmitted packets.
TxPckts uint64 `json:"tx_pckts,omitempty"`
// RxPckts is the total received packets.
RxPckts uint64 `json:"rx_pckts,omitempty"`
// TxBytes is the total transmitted bytes.
TxBytes uint64 `json:"tx_bytes,omitempty"`
// RxBytes is the total received bytes.
RxBytes uint64 `json:"rx_bytes,omitempty"`
}
MachineNICStats represents traffic counters for a machine NIC.
type MachineNICStatus ¶ added in v0.1.4
type MachineNICStatus struct {
// Key is the unique identifier for this status record.
Key FlexInt `json:"$key,omitempty"`
// Status is the link state ("up", "down", "unknown", "lowerlayerdown").
Status string `json:"status,omitempty"`
// Speed is the link speed in Mbps.
Speed uint32 `json:"speed,omitempty"`
}
MachineNICStatus represents the link status of a machine NIC.
type MachineStats ¶ added in v0.1.4
type MachineStats struct {
// Key is the unique identifier for this stats record.
Key FlexInt `json:"$key,omitempty"`
// Machine is the parent machine ID.
Machine int `json:"machine,omitempty"`
// TotalCPU is the total CPU usage percentage (0-100).
TotalCPU uint8 `json:"total_cpu,omitempty"`
// UserCPU is the user-space CPU usage percentage.
UserCPU uint8 `json:"user_cpu,omitempty"`
// SystemCPU is the system/kernel CPU usage percentage.
SystemCPU uint8 `json:"system_cpu,omitempty"`
// IOWaitCPU is the I/O wait CPU percentage.
IOWaitCPU uint8 `json:"iowait_cpu,omitempty"`
// RAMUsed is the RAM used in MB.
RAMUsed uint32 `json:"ram_used,omitempty"`
// RAMPct is the physical RAM used percentage (0-100).
RAMPct uint8 `json:"ram_pct,omitempty"`
// CoreUsageList is the per-core CPU usage as a JSON array of floats.
CoreUsageList json.RawMessage `json:"core_usagelist,omitempty"`
// CoreTemp is the average core temperature in Celsius.
CoreTemp uint16 `json:"core_temp,omitempty"`
// CoreTempTop is the maximum core temperature in Celsius.
CoreTempTop uint16 `json:"core_temp_top,omitempty"`
}
MachineStats represents per-machine statistics including CPU, RAM, and temperature metrics. There is one stats row per machine, linked via the machine FK.
func (*MachineStats) GetCoreUsages ¶ added in v0.1.4
func (ms *MachineStats) GetCoreUsages() ([]float64, error)
GetCoreUsages parses the CoreUsageList JSON into a slice of float64 values. Returns nil if CoreUsageList is empty or not set.
type MachineStatsService ¶ added in v0.1.4
type MachineStatsService struct {
// contains filtered or unexported fields
}
MachineStatsService handles machine statistics read operations. This service provides per-machine CPU, RAM, and temperature metrics.
func (*MachineStatsService) Get ¶ added in v0.1.4
func (s *MachineStatsService) Get(ctx context.Context, id int) (*MachineStats, error)
Get returns a single machine stats record by ID.
func (*MachineStatsService) GetByMachine ¶ added in v0.1.4
func (s *MachineStatsService) GetByMachine(ctx context.Context, machineID int) (*MachineStats, error)
GetByMachine retrieves stats for a specific machine by machine ID.
func (*MachineStatsService) List ¶ added in v0.1.4
func (s *MachineStatsService) List(ctx context.Context, opts ...ListOption) ([]MachineStats, error)
List returns all machine stats, with optional filtering.
type MachineStatsServiceInterface ¶ added in v0.1.4
type MachineStatsServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]MachineStats, error)
GetByMachine(ctx context.Context, machineID int) (*MachineStats, error)
Get(ctx context.Context, id int) (*MachineStats, error)
}
MachineStatsServiceInterface defines the interface for machine stats operations (read-only). Machine stats provide per-node CPU, RAM, and temperature metrics.
type Member ¶
type Member struct {
// ID is the unique identifier for the membership.
ID FlexInt `json:"$key,omitempty"`
// Group is the parent group ID.
Group FlexInt `json:"parent_group,omitempty"`
// Member is the member value (user or group reference).
Member string `json:"member,omitempty"`
// System indicates whether this is a system-managed membership.
System bool `json:"system,omitempty"`
// Creator is the username that created this membership.
Creator string `json:"creator,omitempty"`
}
Member represents a group membership in VergeOS.
type MemberCreateRequest ¶
type MemberCreateRequest struct {
// Group is the parent group ID (required).
Group int `json:"parent_group"`
// Member is the member value - user or group reference (required).
Member string `json:"member"`
}
MemberCreateRequest is the request body for creating a membership.
type MemberService ¶
type MemberService struct {
// contains filtered or unexported fields
}
MemberService handles group membership operations.
func (*MemberService) Create ¶
func (s *MemberService) Create(ctx context.Context, req *MemberCreateRequest) (*Member, error)
Create creates a new membership and returns the created member.
func (*MemberService) Delete ¶
func (s *MemberService) Delete(ctx context.Context, id int) error
Delete deletes a membership.
func (*MemberService) List ¶
func (s *MemberService) List(ctx context.Context, opts ...ListOption) ([]Member, error)
List returns all members, with optional filtering and pagination.
func (*MemberService) ListByGroup ¶
ListByGroup returns all members of a specific group.
func (*MemberService) Update ¶
func (s *MemberService) Update(ctx context.Context, id int, req *MemberUpdateRequest) (*Member, error)
Update updates a membership and returns the updated member.
type MemberServiceInterface ¶
type MemberServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]Member, error)
ListByGroup(ctx context.Context, groupID int) ([]Member, error)
Get(ctx context.Context, id int) (*Member, error)
Create(ctx context.Context, req *MemberCreateRequest) (*Member, error)
Update(ctx context.Context, id int, req *MemberUpdateRequest) (*Member, error)
Delete(ctx context.Context, id int) error
Add(ctx context.Context, groupID int, member string) (*Member, error)
Remove(ctx context.Context, groupID int, member string) error
}
MemberServiceInterface defines the interface for Member operations.
type MemberUpdateRequest ¶
type MemberUpdateRequest struct {
// Group is the parent group ID (readonly after creation).
Group *int `json:"parent_group,omitempty"`
// Member is the member value (readonly after creation).
Member *string `json:"member,omitempty"`
}
MemberUpdateRequest is the request body for updating a membership. Note: both parent_group and member are readonly after creation per schema.
type NASService ¶
type NASService struct {
// Key is the unique identifier for this NAS service.
Key FlexInt `json:"$key,omitempty"`
// VM is the underlying VM ID for this NAS service.
VM FlexInt `json:"vm,omitempty"`
// Name is the service name (derived from VM name).
Name string `json:"name,omitempty"`
// Enabled indicates whether the service is enabled.
Enabled bool `json:"enabled"`
// Created is the creation timestamp (Unix epoch).
Created int64 `json:"created,omitempty"`
// Modified is the last modified timestamp (Unix epoch).
Modified int64 `json:"modified,omitempty"`
// Service configuration
// MaxImports is the maximum number of concurrent imports (1-200, default 4).
MaxImports int `json:"max_imports,omitempty"`
// MaxSyncs is the maximum number of concurrent syncs (0-200, default 0 = disabled).
MaxSyncs int `json:"max_syncs,omitempty"`
// DisableSwap disables swap usage for this NAS service.
DisableSwap bool `json:"disable_swap,omitempty"`
// ReadAheadKBDefault is the default read-ahead buffer size (0, 64, 128, 256, 512, 1024, 2048, 4096 KB).
ReadAheadKBDefault string `json:"read_ahead_kb_default,omitempty"`
// Related row references (read-only)
// CIFS is the CIFS settings row reference.
CIFS FlexInt `json:"cifs,omitempty"`
// NFS is the NFS settings row reference.
NFS FlexInt `json:"nfs,omitempty"`
// Antivirus is the antivirus settings row reference.
Antivirus FlexInt `json:"antivirus,omitempty"`
}
NASService represents a VergeOS NAS service (VM providing NAS functionality). A NAS service is a specialized VM that hosts volumes, shares, and sync operations.
type NASServiceCreateRequest ¶
type NASServiceCreateRequest struct {
// VM is the underlying VM ID (required).
VM int `json:"vm"`
// MaxImports is the maximum number of concurrent imports (1-200).
MaxImports *int `json:"max_imports,omitempty"`
// MaxSyncs is the maximum number of concurrent syncs (0-200).
MaxSyncs *int `json:"max_syncs,omitempty"`
// DisableSwap disables swap usage for this NAS service.
DisableSwap *bool `json:"disable_swap,omitempty"`
// ReadAheadKBDefault is the default read-ahead buffer size.
ReadAheadKBDefault *string `json:"read_ahead_kb_default,omitempty"`
}
NASServiceCreateRequest is the request body for creating a NAS service. Note: NAS services are typically created by creating a NAS VM, but this endpoint allows direct service creation if the VM already exists.
type NASServiceService ¶
type NASServiceService struct {
// contains filtered or unexported fields
}
NASServiceService handles NAS service operations. A NAS service is a specialized VM that provides NAS functionality including volumes, CIFS/NFS shares, and sync operations.
func (*NASServiceService) Create ¶
func (s *NASServiceService) Create(ctx context.Context, req *NASServiceCreateRequest) (*NASService, error)
Create creates a new NAS service and returns the created service.
func (*NASServiceService) Delete ¶
func (s *NASServiceService) Delete(ctx context.Context, id int) error
Delete deletes a NAS service.
func (*NASServiceService) Get ¶
func (s *NASServiceService) Get(ctx context.Context, id int) (*NASService, error)
Get returns a single NAS service by ID.
func (*NASServiceService) GetByName ¶
func (s *NASServiceService) GetByName(ctx context.Context, name string) (*NASService, error)
GetByName returns a NAS service by name.
func (*NASServiceService) GetByVM ¶
func (s *NASServiceService) GetByVM(ctx context.Context, vmID int) (*NASService, error)
GetByVM returns the NAS service for a specific VM.
func (*NASServiceService) List ¶
func (s *NASServiceService) List(ctx context.Context, opts ...ListOption) ([]NASService, error)
List returns all NAS services, with optional filtering and pagination.
func (*NASServiceService) Update ¶
func (s *NASServiceService) Update(ctx context.Context, id int, req *NASServiceUpdateRequest) (*NASService, error)
Update updates a NAS service and returns the updated service.
type NASServiceServiceInterface ¶
type NASServiceServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]NASService, error)
Get(ctx context.Context, id int) (*NASService, error)
GetByVM(ctx context.Context, vmID int) (*NASService, error)
GetByName(ctx context.Context, name string) (*NASService, error)
Create(ctx context.Context, req *NASServiceCreateRequest) (*NASService, error)
Update(ctx context.Context, id int, req *NASServiceUpdateRequest) (*NASService, error)
Delete(ctx context.Context, id int) error
}
NASServiceServiceInterface defines the interface for NAS service operations.
type NASServiceUpdateRequest ¶
type NASServiceUpdateRequest struct {
// MaxImports is the maximum number of concurrent imports (1-200).
MaxImports *int `json:"max_imports,omitempty"`
// MaxSyncs is the maximum number of concurrent syncs (0-200).
MaxSyncs *int `json:"max_syncs,omitempty"`
// DisableSwap disables swap usage for this NAS service.
DisableSwap *bool `json:"disable_swap,omitempty"`
// ReadAheadKBDefault is the default read-ahead buffer size.
ReadAheadKBDefault *string `json:"read_ahead_kb_default,omitempty"`
}
NASServiceUpdateRequest is the request body for updating a NAS service.
type NASServiceUser ¶
type NASServiceUser struct {
// ID is the unique SHA1 hash identifier for this user.
ID string `json:"id,omitempty"`
// Key is the same as ID for vm_service_users.
Key string `json:"$key,omitempty"`
// Service is the NAS service ID this user belongs to.
Service FlexInt `json:"service,omitempty"`
// Name is the username (1-32 chars, alphanumeric with underscore/hyphen).
Name string `json:"name"`
// DisplayName is the display name for this user.
DisplayName string `json:"displayname,omitempty"`
// Description is an optional description of the user.
Description string `json:"description,omitempty"`
// Enabled indicates whether the user account is enabled.
Enabled bool `json:"enabled"`
// Created is the creation timestamp (Unix epoch).
Created int64 `json:"created,omitempty"`
// HomeShare is the CIFS share ID to use as home directory.
HomeShare FlexInt `json:"home_share,omitempty"`
// HomeDrive is the Windows drive letter for home directory (A-Z).
HomeDrive string `json:"home_drive,omitempty"`
}
NASServiceUser represents a user account for a NAS service. NAS service users can access CIFS shares and have optional home directories.
type NASServiceUserCreateRequest ¶
type NASServiceUserCreateRequest struct {
// Service is the NAS service ID (required).
Service int `json:"service"`
// Name is the username (required, 1-32 chars).
Name string `json:"name"`
// Password is the user password (required).
Password string `json:"password"`
// DisplayName is the display name for this user.
DisplayName string `json:"displayname,omitempty"`
// Description is an optional description of the user.
Description string `json:"description,omitempty"`
// Enabled indicates whether the user account is enabled.
Enabled *bool `json:"enabled,omitempty"`
HomeShare *int `json:"home_share,omitempty"`
// HomeDrive is the Windows drive letter for home directory (A-Z).
HomeDrive *string `json:"home_drive,omitempty"`
}
NASServiceUserCreateRequest is the request body for creating a NAS service user.
type NASServiceUserService ¶
type NASServiceUserService struct {
// contains filtered or unexported fields
}
NASServiceUserService handles NAS service user operations. NAS service users can access CIFS shares and have optional home directories.
func (*NASServiceUserService) Create ¶
func (s *NASServiceUserService) Create(ctx context.Context, req *NASServiceUserCreateRequest) (*NASServiceUser, error)
Create creates a new NAS service user and returns the created user.
func (*NASServiceUserService) Delete ¶
func (s *NASServiceUserService) Delete(ctx context.Context, id string) error
Delete deletes a NAS service user.
func (*NASServiceUserService) Disable ¶
func (s *NASServiceUserService) Disable(ctx context.Context, id string) error
Disable disables a NAS service user.
func (*NASServiceUserService) Enable ¶
func (s *NASServiceUserService) Enable(ctx context.Context, id string) error
Enable enables a NAS service user.
func (*NASServiceUserService) Get ¶
func (s *NASServiceUserService) Get(ctx context.Context, id string) (*NASServiceUser, error)
Get returns a single NAS service user by its SHA1 ID.
func (*NASServiceUserService) GetByName ¶
func (s *NASServiceUserService) GetByName(ctx context.Context, serviceID int, name string) (*NASServiceUser, error)
GetByName returns a NAS service user by name within a specific service.
func (*NASServiceUserService) List ¶
func (s *NASServiceUserService) List(ctx context.Context, opts ...ListOption) ([]NASServiceUser, error)
List returns all NAS service users, with optional filtering and pagination.
func (*NASServiceUserService) ListByService ¶
func (s *NASServiceUserService) ListByService(ctx context.Context, serviceID int) ([]NASServiceUser, error)
ListByService returns all users belonging to a specific NAS service.
func (*NASServiceUserService) Update ¶
func (s *NASServiceUserService) Update(ctx context.Context, id string, req *NASServiceUserUpdateRequest) (*NASServiceUser, error)
Update updates a NAS service user and returns the updated user.
type NASServiceUserServiceInterface ¶
type NASServiceUserServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]NASServiceUser, error)
ListByService(ctx context.Context, serviceID int) ([]NASServiceUser, error)
Get(ctx context.Context, id string) (*NASServiceUser, error)
GetByName(ctx context.Context, serviceID int, name string) (*NASServiceUser, error)
Create(ctx context.Context, req *NASServiceUserCreateRequest) (*NASServiceUser, error)
Update(ctx context.Context, id string, req *NASServiceUserUpdateRequest) (*NASServiceUser, error)
Delete(ctx context.Context, id string) error
Enable(ctx context.Context, id string) error
Disable(ctx context.Context, id string) error
}
NASServiceUserServiceInterface defines the interface for NAS service user operations. Note: Like volumes, NAS service users use SHA1 hash strings as IDs instead of integers.
type NASServiceUserUpdateRequest ¶
type NASServiceUserUpdateRequest struct {
// Password is the new user password.
Password *string `json:"password,omitempty"`
// DisplayName is the display name for this user.
DisplayName *string `json:"displayname,omitempty"`
// Description is an optional description of the user.
Description *string `json:"description,omitempty"`
// Enabled indicates whether the user account is enabled.
Enabled *bool `json:"enabled,omitempty"`
HomeShare *int `json:"home_share,omitempty"`
// HomeDrive is the Windows drive letter for home directory (A-Z).
HomeDrive *string `json:"home_drive,omitempty"`
}
NASServiceUserUpdateRequest is the request body for updating a NAS service user.
type Network ¶
type Network struct {
// ID is the unique identifier for the network.
ID FlexInt `json:"$key,omitempty"`
// Name is the network name.
Name string `json:"name"`
// Description is an optional description of the network.
Description string `json:"description,omitempty"`
// Enabled indicates whether the network is enabled.
Enabled bool `json:"enabled"`
// Creator is the username that created this network.
Creator string `json:"creator,omitempty"`
// IP configuration
// IPAddress is the network's router IP address.
IPAddress string `json:"ipaddress,omitempty"`
// DMZIPAddress is the DMZ IP address for this router.
DMZIPAddress string `json:"dmz_ipaddress,omitempty"`
// MACAddress is the router's MAC address (readonly).
MACAddress string `json:"macaddress,omitempty"`
// Network is the CIDR notation (e.g., "10.0.0.0/24").
Network string `json:"network,omitempty"`
// Gateway is the gateway IP address sent to DHCP clients.
Gateway string `json:"gateway,omitempty"`
// DefaultGateway is the default gateway network ID (0 = none).
DefaultGateway FlexInt `json:"vnet_default_gateway,omitempty"`
// IPAddressType is the IP address type (static, dynamic, bgp, none).
IPAddressType string `json:"ipaddress_type,omitempty"`
// Hostname is the router hostname.
Hostname string `json:"hostname,omitempty"`
// DNS configuration
// DNS is the DNS service mode (disabled, simple, bind, network).
DNS string `json:"dns,omitempty"`
// Domain is the domain name for the network.
Domain string `json:"domain,omitempty"`
// DNSList is the list of DNS servers (newline, space, or comma separated).
DNSList string `json:"dnslist,omitempty"`
// OverrideDHCPDNS indicates whether to ignore DNS servers from DHCP.
OverrideDHCPDNS bool `json:"override_dhcp_dns,omitempty"`
// NetworkDNS is the DNS network ID for forwarding (0 = none).
NetworkDNS FlexInt `json:"network_dns,omitempty"`
// DHCP configuration
// DHCPEnabled indicates whether DHCP is enabled.
DHCPEnabled bool `json:"dhcp_enabled,omitempty"`
// DHCPDynamic indicates whether dynamic DHCP is enabled.
DHCPDynamic bool `json:"dhcp_dynamic,omitempty"`
// DHCPSequential indicates whether DHCP assigns IPs sequentially.
DHCPSequential bool `json:"dhcp_sequential,omitempty"`
// DHCPStart is the start of the DHCP range.
DHCPStart string `json:"dhcp_start,omitempty"`
// DHCPStop is the end of the DHCP range.
DHCPStop string `json:"dhcp_stop,omitempty"`
// Network configuration
// Type is the network type (internal, external, bgp, dmz, core, physical, port_mirror, vpn).
Type string `json:"type,omitempty"`
// Layer2Type is the layer 2 type (vlan, vxlan, none, bond, bond_slave).
Layer2Type string `json:"layer2_type,omitempty"`
// VLAN is the VLAN/VXLAN tag (layer2_id).
VLAN int `json:"layer2_id,omitempty"`
// VXLANMulticast is the multicast address for VXLAN.
VXLANMulticast string `json:"vxlan_multicast,omitempty"`
// MTU is the maximum transmission unit.
MTU int `json:"mtu,omitempty"`
// InterfaceVnet is the interface vnet ID (0 = none).
InterfaceVnet FlexInt `json:"interface_vnet,omitempty"`
// PhysicalBridged indicates whether this is a bridged physical network.
PhysicalBridged bool `json:"physical_bridged,omitempty"`
// Power and scheduling
// OnPowerLoss is the behavior on power loss (power_on, last_state, leave_off).
OnPowerLoss string `json:"on_power_loss,omitempty"`
// PowerState indicates whether the network is running.
PowerState bool `json:"powerstate,omitempty"`
// Cluster is the cluster ID for this network.
Cluster FlexInt `json:"cluster,omitempty"`
// ClusterFailover is the failover cluster ID (0 = none).
ClusterFailover FlexInt `json:"cluster_failover,omitempty"`
// PreferredNode is the preferred node ID (0 = none).
PreferredNode FlexInt `json:"preferred_node,omitempty"`
// HAGroup is the HA group for anti-affinity.
HAGroup string `json:"ha_group,omitempty"`
// Bonding configuration
// EnableBonding indicates whether bonding is enabled.
EnableBonding bool `json:"enable_bonding,omitempty"`
// BondInterfacesArgs are the bonding interface arguments.
BondInterfacesArgs []int `json:"bond_interfaces_args,omitempty"`
// Port mirroring
// PortMirroring is the port mirroring mode (off, east_west, north_south).
PortMirroring string `json:"port_mirroring,omitempty"`
// PortMirroringVnet is the network ID for mirrored traffic (0 = none).
PortMirroringVnet FlexInt `json:"port_mirroring_vnet,omitempty"`
// Firewall and statistics
// Statistics indicates whether to track statistics for all rules.
Statistics bool `json:"statistics,omitempty"`
// DMZStatistics indicates whether to track DMZ statistics.
DMZStatistics bool `json:"dmz_statistics,omitempty"`
// Trace indicates whether to trace/debug firewall rules.
Trace bool `json:"trace,omitempty"`
// MirrorLogs indicates whether to mirror syslog to UI.
MirrorLogs bool `json:"mirror_logs,omitempty"`
// NeedRestart indicates whether the network needs a restart.
NeedRestart bool `json:"need_restart,omitempty"`
// NeedFWApply indicates whether firewall rules need to be applied.
NeedFWApply bool `json:"need_fw_apply,omitempty"`
// NeedDNSApply indicates whether DNS configuration needs to be applied.
NeedDNSApply bool `json:"need_dns_apply,omitempty"`
// NeedProxyApply indicates whether proxy configuration needs to be applied.
NeedProxyApply bool `json:"need_proxy_apply,omitempty"`
// Rate limiting
// RateLimit is the rate limit value.
RateLimit int64 `json:"rate_limit,omitempty"`
// RateLimitType is the rate limit unit type.
RateLimitType string `json:"rate_limit_type,omitempty"`
// RateLimitBurst is the rate limit burst value.
RateLimitBurst int64 `json:"rate_limit_burst,omitempty"`
// BGP configuration
// BGPASN is the BGP autonomous system number.
BGPASN int `json:"bgp_asn,omitempty"`
// IPsec
// IPsecEnabled indicates whether IPsec is enabled.
IPsecEnabled bool `json:"ipsec_enabled,omitempty"`
// Proxy
// ProxyEnabled indicates whether the proxy is enabled.
ProxyEnabled bool `json:"proxy_enabled,omitempty"`
// ProxyListenAddress is the proxy listen address.
ProxyListenAddress string `json:"proxy_listen_address,omitempty"`
// PXE boot
// PXE is the PXE boot mode (none, ybos, custom).
PXE string `json:"pxe,omitempty"`
// TFTPServer is the TFTP server IP for custom PXE.
TFTPServer string `json:"tftp_server,omitempty"`
// Gateway monitoring
// MonitorGateway indicates whether to monitor the gateway.
MonitorGateway bool `json:"monitor_gateway,omitempty"`
// MonitorIP is the IP to monitor (blank for default route).
MonitorIP string `json:"monitor_ip,omitempty"`
// MonitorIntervalMS is the monitoring interval in milliseconds.
MonitorIntervalMS int `json:"monitor_interval_ms,omitempty"`
// Notes
// Note is a free-form note about the network.
Note string `json:"note,omitempty"`
}
Network represents a VergeOS virtual network (vnet).
func (*Network) GetDNSServers ¶
GetDNSServers returns the DNS list as a slice of server addresses. The DNSList field can be newline, space, or comma separated.
type NetworkCreateRequest ¶
type NetworkCreateRequest struct {
// Name is the network name (required).
Name string `json:"name"`
// Description is an optional description of the network.
Description string `json:"description,omitempty"`
// Enabled indicates whether the network is enabled.
Enabled *bool `json:"enabled,omitempty"`
// IP configuration
// IPAddress is the network's IP address.
IPAddress string `json:"ipaddress,omitempty"`
// DMZIPAddress is the DMZ IP address.
DMZIPAddress string `json:"dmz_ipaddress,omitempty"`
// Network is the CIDR notation (e.g., "10.0.0.0/24").
Network string `json:"network,omitempty"`
// Gateway is the gateway IP address for the network.
Gateway string `json:"gateway,omitempty"`
// DefaultGateway is the default gateway network ID.
DefaultGateway *int `json:"vnet_default_gateway,omitempty"`
// IPAddressType is the IP address type.
IPAddressType string `json:"ipaddress_type,omitempty"`
// Hostname is the router hostname.
Hostname string `json:"hostname,omitempty"`
// DNS configuration
// DNS is the DNS service mode (disabled, simple, bind, network).
DNS string `json:"dns,omitempty"`
// Domain is the domain name for the network.
Domain string `json:"domain,omitempty"`
// DNSList is the list of DNS servers.
DNSList string `json:"dnslist,omitempty"`
// OverrideDHCPDNS indicates whether to ignore DNS servers from DHCP.
OverrideDHCPDNS *bool `json:"override_dhcp_dns,omitempty"`
// NetworkDNS is the DNS network ID for forwarding.
NetworkDNS *int `json:"network_dns,omitempty"`
// DHCP configuration
// DHCPEnabled indicates whether DHCP is enabled.
DHCPEnabled *bool `json:"dhcp_enabled,omitempty"`
// DHCPDynamic indicates whether dynamic DHCP is enabled.
DHCPDynamic *bool `json:"dhcp_dynamic,omitempty"`
// DHCPSequential indicates whether DHCP assigns IPs sequentially.
DHCPSequential *bool `json:"dhcp_sequential,omitempty"`
// DHCPStart is the start of the DHCP range.
DHCPStart string `json:"dhcp_start,omitempty"`
// DHCPStop is the end of the DHCP range.
DHCPStop string `json:"dhcp_stop,omitempty"`
// Network configuration
// Type is the network type (internal, external, bgp, dmz, core, physical, port_mirror, vpn).
Type string `json:"type,omitempty"`
// Layer2Type is the layer 2 type.
Layer2Type string `json:"layer2_type,omitempty"`
// VLAN is the VLAN tag (layer2_id).
VLAN *int `json:"layer2_id,omitempty"`
// VXLANMulticast is the multicast address for VXLAN.
VXLANMulticast string `json:"vxlan_multicast,omitempty"`
// MTU is the maximum transmission unit.
MTU *int `json:"mtu,omitempty"`
// InterfaceVnet is the interface vnet ID.
InterfaceVnet *int `json:"interface_vnet,omitempty"`
// PhysicalBridged indicates whether this is a bridged physical network.
PhysicalBridged *bool `json:"physical_bridged,omitempty"`
// Power and scheduling
// OnPowerLoss is the behavior on power loss.
OnPowerLoss string `json:"on_power_loss,omitempty"`
// Cluster is the cluster ID for this network.
Cluster *int `json:"cluster,omitempty"`
// ClusterFailover is the failover cluster ID.
ClusterFailover *int `json:"cluster_failover,omitempty"`
// PreferredNode is the preferred node ID.
PreferredNode *int `json:"preferred_node,omitempty"`
// HAGroup is the HA group for anti-affinity.
HAGroup string `json:"ha_group,omitempty"`
// Bonding configuration
// EnableBonding indicates whether bonding is enabled.
EnableBonding *bool `json:"enable_bonding,omitempty"`
// BondInterfacesArgs are the bonding interface arguments.
BondInterfacesArgs []int `json:"bond_interfaces_args,omitempty"`
// Port mirroring
// PortMirroring is the port mirroring mode.
PortMirroring string `json:"port_mirroring,omitempty"`
// PortMirroringVnet is the network ID for mirrored traffic.
PortMirroringVnet *int `json:"port_mirroring_vnet,omitempty"`
// Firewall and statistics
// Statistics indicates whether to track statistics for all rules.
Statistics *bool `json:"statistics,omitempty"`
// DMZStatistics indicates whether to track DMZ statistics.
DMZStatistics *bool `json:"dmz_statistics,omitempty"`
// Trace indicates whether to trace/debug firewall rules.
Trace *bool `json:"trace,omitempty"`
// MirrorLogs indicates whether to mirror syslog to UI.
MirrorLogs *bool `json:"mirror_logs,omitempty"`
// Rate limiting
// RateLimit is the rate limit value.
RateLimit *int64 `json:"rate_limit,omitempty"`
// RateLimitType is the rate limit unit type.
RateLimitType string `json:"rate_limit_type,omitempty"`
// RateLimitBurst is the rate limit burst value.
RateLimitBurst *int64 `json:"rate_limit_burst,omitempty"`
// BGP configuration
// BGPASN is the BGP autonomous system number.
BGPASN *int `json:"bgp_asn,omitempty"`
// Proxy
// ProxyEnabled indicates whether the proxy is enabled.
ProxyEnabled *bool `json:"proxy_enabled,omitempty"`
// ProxyListenAddress is the proxy listen address.
ProxyListenAddress string `json:"proxy_listen_address,omitempty"`
// PXE boot
// PXE is the PXE boot mode (none, ybos, custom).
PXE string `json:"pxe,omitempty"`
// TFTPServer is the TFTP server IP for custom PXE.
TFTPServer string `json:"tftp_server,omitempty"`
// Gateway monitoring
// MonitorGateway indicates whether to monitor the gateway.
MonitorGateway *bool `json:"monitor_gateway,omitempty"`
// MonitorIP is the IP to monitor.
MonitorIP string `json:"monitor_ip,omitempty"`
// MonitorIntervalMS is the monitoring interval in milliseconds.
MonitorIntervalMS *int `json:"monitor_interval_ms,omitempty"`
// Notes
// Note is a free-form note about the network.
Note string `json:"note,omitempty"`
}
NetworkCreateRequest is the request body for creating a network.
type NetworkMonitorStats ¶
type NetworkMonitorStats struct {
// Key is the unique identifier for the stats record.
Key FlexInt `json:"$key,omitempty"`
// VNet is the network ID.
VNet FlexInt `json:"vnet,omitempty"`
// Sent is the number of monitoring packets sent.
Sent int `json:"sent,omitempty"`
// Quality is the network quality percentage (100 - dropped_pct).
Quality int `json:"quality,omitempty"`
// DroppedPct is the percentage of dropped packets.
DroppedPct int `json:"dropped_pct,omitempty"`
// LatencyUSAvg is the average latency in microseconds.
LatencyUSAvg int `json:"latency_usec_avg,omitempty"`
// LatencyUSPeak is the peak latency in microseconds.
LatencyUSPeak int `json:"latency_usec_peak,omitempty"`
// Duplicates is the number of duplicate packets.
Duplicates int `json:"duplicates,omitempty"`
// Truncated is the number of truncated packets.
Truncated int `json:"truncated,omitempty"`
// Dropped is the number of dropped packets.
Dropped int `json:"dropped,omitempty"`
// BadChecksums is the number of packets with bad checksums.
BadChecksums int `json:"bad_checksums,omitempty"`
// BadData is the number of packets with bad data.
BadData int `json:"bad_data,omitempty"`
// Timestamp is the stats timestamp.
Timestamp int64 `json:"timestamp,omitempty"`
}
NetworkMonitorStats represents network monitoring statistics. These are collected when gateway monitoring is enabled on a network.
type NetworkQuery ¶
type NetworkQuery struct {
// ID is the unique identifier for the query (40-char SHA1 hash).
ID string `json:"id,omitempty"`
// VNet is the network ID the query is running against.
VNet FlexInt `json:"vnet,omitempty"`
// Query is the type of diagnostic query.
// Valid values: logs, top, top_if, tcpdump, ping, dns, traceroute, ip, ipsec,
// whatsmyip, arp, arp-scan, frr, trace, dhcp_release_renew, wireguard, firewall, nmap, tcp_connect
Query string `json:"query,omitempty"`
// Params contains query-specific parameters (JSON object).
Params map[string]interface{} `json:"params,omitempty"`
// Status is the query status (running, error, complete).
Status string `json:"status,omitempty"`
// Result is the query output.
Result string `json:"result,omitempty"`
// Command is the command used to execute the query.
Command string `json:"command,omitempty"`
// Created is the creation timestamp (microseconds).
Created int64 `json:"created,omitempty"`
// Modified is the last modified timestamp.
Modified int64 `json:"modified,omitempty"`
// Expires is the expiration timestamp.
Expires int64 `json:"expires,omitempty"`
}
NetworkQuery represents a network diagnostic query (vnet_queries). This is an async job system for running diagnostic commands on networks.
type NetworkQueryRequest ¶
type NetworkQueryRequest struct {
// VNet is the network ID to run the query against (required).
VNet int `json:"vnet"`
// Query is the type of diagnostic query (required).
// Valid values: logs, top, top_if, tcpdump, ping, dns, traceroute, ip, ipsec,
// whatsmyip, arp, arp-scan, frr, trace, dhcp_release_renew, wireguard, firewall, nmap, tcp_connect
Query string `json:"query"`
// Params contains query-specific parameters.
Params map[string]interface{} `json:"params,omitempty"`
}
NetworkQueryRequest is the request body for creating a diagnostic query.
type NetworkService ¶
type NetworkService struct {
// contains filtered or unexported fields
}
NetworkService handles network operations.
func (*NetworkService) ApplyDNS ¶
func (s *NetworkService) ApplyDNS(ctx context.Context, id int) error
ApplyDNS applies DNS configuration to a running network.
func (*NetworkService) ApplyRules ¶
func (s *NetworkService) ApplyRules(ctx context.Context, id int) error
ApplyRules applies firewall rules to a running network.
func (*NetworkService) Create ¶
func (s *NetworkService) Create(ctx context.Context, req *NetworkCreateRequest) (*Network, error)
Create creates a new network and returns the created network.
func (*NetworkService) DNSLookup ¶
func (s *NetworkService) DNSLookup(ctx context.Context, networkID int, hostname string) (*NetworkQuery, error)
DNSLookup runs a DNS lookup diagnostic on a network.
func (*NetworkService) Delete ¶
func (s *NetworkService) Delete(ctx context.Context, id int) error
Delete deletes a network.
func (*NetworkService) GetDiagnostics ¶
func (s *NetworkService) GetDiagnostics(ctx context.Context, id int) (*NetworkQuery, error)
GetDiagnostics is a convenience method that returns basic diagnostic info for a network. It runs a "whatsmyip" query to verify network connectivity.
func (*NetworkService) GetLatestStatistics ¶
func (s *NetworkService) GetLatestStatistics(ctx context.Context, id int) (*NetworkMonitorStats, error)
GetLatestStatistics returns the most recent monitoring statistics for a network. Returns nil if no statistics are available.
func (*NetworkService) GetQuery ¶
func (s *NetworkService) GetQuery(ctx context.Context, id string) (*NetworkQuery, error)
GetQuery returns a network diagnostic query by ID.
func (*NetworkService) GetStatistics ¶
func (s *NetworkService) GetStatistics(ctx context.Context, id int) ([]NetworkMonitorStats, error)
GetStatistics returns the latest monitoring statistics for a network. Requires gateway monitoring to be enabled on the network.
func (*NetworkService) Kill ¶
func (s *NetworkService) Kill(ctx context.Context, id int) error
Kill forcefully powers off a network (hard power off).
func (*NetworkService) List ¶
func (s *NetworkService) List(ctx context.Context, opts ...ListOption) ([]Network, error)
List returns all networks, with optional filtering and pagination.
func (*NetworkService) Ping ¶
func (s *NetworkService) Ping(ctx context.Context, networkID int, target string, count int) (*NetworkQuery, error)
Ping runs a ping diagnostic on a network. The target can be an IP address or hostname.
func (*NetworkService) PowerOff ¶
func (s *NetworkService) PowerOff(ctx context.Context, id int) error
PowerOff powers off a network and waits for it to stop.
func (*NetworkService) PowerOn ¶
func (s *NetworkService) PowerOn(ctx context.Context, id int) error
PowerOn powers on a network and waits for it to start.
func (*NetworkService) RunQuery ¶
func (s *NetworkService) RunQuery(ctx context.Context, req *NetworkQueryRequest) (*NetworkQuery, error)
RunQuery runs a diagnostic query on a network and returns the query job. The query runs asynchronously - use GetQuery to poll for results, or use RunQueryWait to wait for completion.
func (*NetworkService) RunQueryWait ¶
func (s *NetworkService) RunQueryWait(ctx context.Context, req *NetworkQueryRequest) (*NetworkQuery, error)
RunQueryWait runs a diagnostic query and waits for it to complete. It polls the query status until it reaches "complete" or "error", or until the context is cancelled.
func (*NetworkService) Traceroute ¶
func (s *NetworkService) Traceroute(ctx context.Context, networkID int, target string) (*NetworkQuery, error)
Traceroute runs a traceroute diagnostic on a network.
func (*NetworkService) Update ¶
func (s *NetworkService) Update(ctx context.Context, id int, req *NetworkUpdateRequest) (*Network, error)
Update updates a network and returns the updated network.
type NetworkServiceInterface ¶
type NetworkServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]Network, error)
Get(ctx context.Context, id int) (*Network, error)
Create(ctx context.Context, req *NetworkCreateRequest) (*Network, error)
Update(ctx context.Context, id int, req *NetworkUpdateRequest) (*Network, error)
Delete(ctx context.Context, id int) error
PowerOn(ctx context.Context, id int) error
PowerOff(ctx context.Context, id int) error
Kill(ctx context.Context, id int) error
Reset(ctx context.Context, id int, applyFirewall bool) error
ApplyRules(ctx context.Context, id int) error
ApplyDNS(ctx context.Context, id int) error
// Diagnostics
RunQuery(ctx context.Context, req *NetworkQueryRequest) (*NetworkQuery, error)
GetQuery(ctx context.Context, id string) (*NetworkQuery, error)
RunQueryWait(ctx context.Context, req *NetworkQueryRequest) (*NetworkQuery, error)
Ping(ctx context.Context, networkID int, target string, count int) (*NetworkQuery, error)
Traceroute(ctx context.Context, networkID int, target string) (*NetworkQuery, error)
DNSLookup(ctx context.Context, networkID int, hostname string) (*NetworkQuery, error)
GetDiagnostics(ctx context.Context, id int) (*NetworkQuery, error)
// Statistics
GetStatistics(ctx context.Context, id int) ([]NetworkMonitorStats, error)
GetLatestStatistics(ctx context.Context, id int) (*NetworkMonitorStats, error)
}
NetworkServiceInterface defines the interface for Network operations.
type NetworkUpdateRequest ¶
type NetworkUpdateRequest struct {
// Name is the network name.
Name *string `json:"name,omitempty"`
// Description is the network description.
Description *string `json:"description,omitempty"`
// Enabled indicates whether the network is enabled.
Enabled *bool `json:"enabled,omitempty"`
// IP configuration
// IPAddress is the network's IP address.
IPAddress *string `json:"ipaddress,omitempty"`
// DMZIPAddress is the DMZ IP address.
DMZIPAddress *string `json:"dmz_ipaddress,omitempty"`
// Network is the CIDR notation.
Network *string `json:"network,omitempty"`
// Gateway is the gateway IP address for the network.
Gateway *string `json:"gateway,omitempty"`
// DefaultGateway is the default gateway network ID.
DefaultGateway *int `json:"vnet_default_gateway,omitempty"`
// Hostname is the router hostname.
Hostname *string `json:"hostname,omitempty"`
// DNS configuration
// DNS is the DNS service mode (disabled, simple, bind, network).
DNS *string `json:"dns,omitempty"`
// Domain is the domain name for the network.
Domain *string `json:"domain,omitempty"`
// DNSList is the list of DNS servers.
DNSList *string `json:"dnslist,omitempty"`
// OverrideDHCPDNS indicates whether to ignore DNS servers from DHCP.
OverrideDHCPDNS *bool `json:"override_dhcp_dns,omitempty"`
// NetworkDNS is the DNS network ID for forwarding.
NetworkDNS *int `json:"network_dns,omitempty"`
// DHCP configuration
// DHCPEnabled indicates whether DHCP is enabled.
DHCPEnabled *bool `json:"dhcp_enabled,omitempty"`
// DHCPDynamic indicates whether dynamic DHCP is enabled.
DHCPDynamic *bool `json:"dhcp_dynamic,omitempty"`
// DHCPSequential indicates whether DHCP assigns IPs sequentially.
DHCPSequential *bool `json:"dhcp_sequential,omitempty"`
// DHCPStart is the start of the DHCP range.
DHCPStart *string `json:"dhcp_start,omitempty"`
// DHCPStop is the end of the DHCP range.
DHCPStop *string `json:"dhcp_stop,omitempty"`
// Network configuration
// Layer2Type is the layer 2 type.
Layer2Type *string `json:"layer2_type,omitempty"`
// VLAN is the VLAN tag (layer2_id).
VLAN *int `json:"layer2_id,omitempty"`
// VXLANMulticast is the multicast address for VXLAN.
VXLANMulticast *string `json:"vxlan_multicast,omitempty"`
// MTU is the maximum transmission unit.
MTU *int `json:"mtu,omitempty"`
// InterfaceVnet is the interface vnet ID.
InterfaceVnet *int `json:"interface_vnet,omitempty"`
// PhysicalBridged indicates whether this is a bridged physical network.
PhysicalBridged *bool `json:"physical_bridged,omitempty"`
// Power and scheduling
// OnPowerLoss is the behavior on power loss.
OnPowerLoss *string `json:"on_power_loss,omitempty"`
// Cluster is the cluster ID for this network.
Cluster *int `json:"cluster,omitempty"`
// ClusterFailover is the failover cluster ID.
ClusterFailover *int `json:"cluster_failover,omitempty"`
// PreferredNode is the preferred node ID.
PreferredNode *int `json:"preferred_node,omitempty"`
// HAGroup is the HA group for anti-affinity.
HAGroup *string `json:"ha_group,omitempty"`
// Bonding configuration
// EnableBonding indicates whether bonding is enabled.
EnableBonding *bool `json:"enable_bonding,omitempty"`
// BondInterfacesArgs are the bonding interface arguments.
BondInterfacesArgs []int `json:"bond_interfaces_args,omitempty"`
// Port mirroring
// PortMirroring is the port mirroring mode.
PortMirroring *string `json:"port_mirroring,omitempty"`
// PortMirroringVnet is the network ID for mirrored traffic.
PortMirroringVnet *int `json:"port_mirroring_vnet,omitempty"`
// Firewall and statistics
// Statistics indicates whether to track statistics for all rules.
Statistics *bool `json:"statistics,omitempty"`
// DMZStatistics indicates whether to track DMZ statistics.
DMZStatistics *bool `json:"dmz_statistics,omitempty"`
// Trace indicates whether to trace/debug firewall rules.
Trace *bool `json:"trace,omitempty"`
// MirrorLogs indicates whether to mirror syslog to UI.
MirrorLogs *bool `json:"mirror_logs,omitempty"`
// Rate limiting
// RateLimit is the rate limit value.
RateLimit *int64 `json:"rate_limit,omitempty"`
// RateLimitType is the rate limit unit type.
RateLimitType *string `json:"rate_limit_type,omitempty"`
// RateLimitBurst is the rate limit burst value.
RateLimitBurst *int64 `json:"rate_limit_burst,omitempty"`
// Proxy
// ProxyEnabled indicates whether the proxy is enabled.
ProxyEnabled *bool `json:"proxy_enabled,omitempty"`
// ProxyListenAddress is the proxy listen address.
ProxyListenAddress *string `json:"proxy_listen_address,omitempty"`
// PXE boot
// PXE is the PXE boot mode (none, ybos, custom).
PXE *string `json:"pxe,omitempty"`
// TFTPServer is the TFTP server IP for custom PXE.
TFTPServer *string `json:"tftp_server,omitempty"`
// Gateway monitoring
// MonitorGateway indicates whether to monitor the gateway.
MonitorGateway *bool `json:"monitor_gateway,omitempty"`
// MonitorIP is the IP to monitor.
MonitorIP *string `json:"monitor_ip,omitempty"`
// MonitorIntervalMS is the monitoring interval in milliseconds.
MonitorIntervalMS *int `json:"monitor_interval_ms,omitempty"`
// Notes
// Note is a free-form note about the network.
Note *string `json:"note,omitempty"`
}
NetworkUpdateRequest is the request body for updating a network.
type Node ¶
type Node struct {
// ID is the unique identifier for the node (same as $key).
ID int `json:"id,omitempty"`
// Name is the node hostname.
Name string `json:"name"`
// Description is the node description.
Description string `json:"description,omitempty"`
// Physical indicates whether this is a physical node.
Physical bool `json:"physical,omitempty"`
// Cluster is the cluster ID the node belongs to.
Cluster int `json:"cluster,omitempty"`
// Machine is the machine ID.
Machine int `json:"machine,omitempty"`
// Hardware information
// Model is the hardware model.
Model string `json:"model,omitempty"`
// AssetTag is the hardware asset tag.
AssetTag string `json:"asset_tag,omitempty"`
// CPU is the CPU description.
CPU string `json:"cpu,omitempty"`
// CPUSpeed is the CPU speed.
CPUSpeed string `json:"cpu_speed,omitempty"`
// Cores is the total CPU cores.
Cores int `json:"cores,omitempty"`
// IOMMU indicates whether IOMMU (VT-d) is supported.
IOMMU bool `json:"iommu,omitempty"`
// Memory configuration
// RAM is the total RAM in MB.
RAM int `json:"ram,omitempty"`
// Overcommit is the overcommit RAM in MB.
Overcommit int `json:"overcommit,omitempty"`
// VMRAM is the VM RAM limit in MB.
VMRAM int `json:"vm_ram,omitempty"`
// FailoverRAM is the failover RAM reserve in MB.
FailoverRAM int `json:"failover_ram,omitempty"`
// Software versions
// YBVersion is the VergeOS version.
YBVersion string `json:"yb_version,omitempty"`
// OSVersion is the OS version.
OSVersion string `json:"os_version,omitempty"`
// KernelVersion is the kernel version.
KernelVersion string `json:"kernel_version,omitempty"`
// AppserverVersion is the appserver version.
AppserverVersion string `json:"appserver_version,omitempty"`
// VSANVersion is the vSAN version.
VSANVersion string `json:"vsan_version,omitempty"`
// QEMUVersion is the QEMU version.
QEMUVersion string `json:"qemu_version,omitempty"`
// vSAN configuration
// VSANNodeID is the vSAN node ID (-1 if not in vSAN).
VSANNodeID int `json:"vsan_nodeid,omitempty"`
// VSANConnected indicates whether the node is connected to vSAN.
VSANConnected bool `json:"vsan_connected,omitempty"`
// Maintenance
// Maintenance indicates whether the node is in maintenance mode.
Maintenance bool `json:"maintenance,omitempty"`
// NeedRestart indicates whether the node needs to be rebooted.
NeedRestart bool `json:"need_restart,omitempty"`
// RestartReason explains why a restart is needed.
RestartReason string `json:"restart_reason,omitempty"`
// IPMI configuration
// IPMIAddress is the IPMI management IP address.
IPMIAddress string `json:"ipmi_address,omitempty"`
// IPMIUser is the IPMI username.
IPMIUser string `json:"ipmi_user,omitempty"`
// IPMIStatus is the IPMI connection status (offline, ready, connecting, error).
IPMIStatus string `json:"ipmi_status,omitempty"`
// IPMIStatusInfo provides additional IPMI status details.
IPMIStatusInfo string `json:"ipmi_status_info,omitempty"`
// Temperature thresholds
// MaxCoreTemp is the maximum core temperature in Celsius (0 = disabled, -1 = inherit from cluster).
MaxCoreTemp int `json:"max_core_temp,omitempty"`
// MaxCoreTempWarnPerc is the warning threshold percentage.
MaxCoreTempWarnPerc int `json:"max_core_temp_warn_perc,omitempty"`
// CriticalCoreTemp is the critical core temperature in Celsius.
CriticalCoreTemp int `json:"critical_core_temp,omitempty"`
// Networking
// PXEVnet is the PXE boot network ID (nullable).
PXEVnet *int `json:"pxe_vnet,omitempty"`
// CaptureLogs indicates whether to capture system logs.
CaptureLogs bool `json:"capture_logs,omitempty"`
// LLDP indicates whether to send/receive LLDP advertisements.
LLDP bool `json:"lldp,omitempty"`
// Notes
// Note is a free-form note about the node.
Note string `json:"note,omitempty"`
}
Node represents a VergeOS node.
type NodeService ¶
type NodeService struct {
// contains filtered or unexported fields
}
NodeService handles node read operations.
func (*NodeService) ClearPStore ¶
func (s *NodeService) ClearPStore(ctx context.Context, id int) error
ClearPStore clears the persistent storage on a node.
func (*NodeService) DisableMaintenance ¶
func (s *NodeService) DisableMaintenance(ctx context.Context, id int) error
DisableMaintenance takes a node out of maintenance mode.
func (*NodeService) EnableMaintenance ¶
func (s *NodeService) EnableMaintenance(ctx context.Context, id int) error
EnableMaintenance puts a node into maintenance mode. In maintenance mode, VMs are migrated off the node and no new VMs will be scheduled to it.
func (*NodeService) GetDashboard ¶
GetDashboard returns detailed dashboard information for a node.
func (*NodeService) List ¶
func (s *NodeService) List(ctx context.Context, opts ...ListOption) ([]Node, error)
List returns all nodes, with optional filtering and pagination.
func (*NodeService) ListPhysical ¶
func (s *NodeService) ListPhysical(ctx context.Context, opts ...ListOption) ([]Node, error)
ListPhysical returns all physical nodes.
func (*NodeService) MaintenanceReboot ¶
func (s *NodeService) MaintenanceReboot(ctx context.Context, id int) error
MaintenanceReboot reboots a node while in maintenance mode. The node must already be in maintenance mode.
type NodeServiceInterface ¶
type NodeServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]Node, error)
ListPhysical(ctx context.Context, opts ...ListOption) ([]Node, error)
Get(ctx context.Context, id int) (*Node, error)
GetByName(ctx context.Context, name string) (*Node, error)
GetDashboard(ctx context.Context, id int) (*Node, error)
EnableMaintenance(ctx context.Context, id int) error
DisableMaintenance(ctx context.Context, id int) error
MaintenanceReboot(ctx context.Context, id int) error
ClearPStore(ctx context.Context, id int) error
}
NodeServiceInterface defines the interface for Node operations.
type NodeStatus ¶
type NodeStatus struct {
// CPUTemp is the CPU temperature.
CPUTemp float64 `json:"cpu_temp,omitempty"`
// CPUUsage is the CPU usage percentage.
CPUUsage float64 `json:"cpu_usage,omitempty"`
// MemoryTotal is the total memory in bytes.
MemoryTotal int64 `json:"memory_total,omitempty"`
// MemoryUsed is the used memory in bytes.
MemoryUsed int64 `json:"memory_used,omitempty"`
// MemoryPct is the memory usage percentage.
MemoryPct float64 `json:"memory_pct,omitempty"`
}
NodeStatus contains node status information.
type NotFoundError ¶
type NotFoundError struct {
Resource string
ID interface{}
}
NotFoundError is returned when a resource is not found.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type Permission ¶
type Permission struct {
// Key is the unique identifier for this permission.
Key FlexInt `json:"$key,omitempty"`
// Identity is the user or group ID this permission is granted to.
Identity FlexInt `json:"identity,omitempty"`
// IdentityDisplay is the display name of the identity (read-only).
IdentityDisplay string `json:"identity_display,omitempty"`
// IdentityOwner is the owner of the identity (read-only).
IdentityOwner string `json:"identity_owner,omitempty"`
// Table is the resource type (e.g., "vms", "networks", "volumes").
Table string `json:"table,omitempty"`
// TableID is the internal ID of the target table (set automatically).
TableID int64 `json:"tableid,omitempty"`
// Row is the specific resource ID being granted permission to.
Row int64 `json:"row,omitempty"`
// RowDisplay is the display name of the resource (read-only).
RowDisplay string `json:"rowdisplay,omitempty"`
// Permission flags
// List grants permission to see the resource in listings.
List bool `json:"list"`
// Read grants permission to view/read the resource details.
Read bool `json:"read"`
// Create grants permission to create child/related resources.
Create bool `json:"create"`
// Modify grants permission to update the resource.
Modify bool `json:"modify"`
// Delete grants permission to delete the resource.
Delete bool `json:"delete"`
}
Permission represents a VergeOS permission granting an identity access to a resource. Permissions are row-based, granting specific access rights to a user or group for a specific resource instance (table + row).
type PermissionCreateRequest ¶
type PermissionCreateRequest struct {
// Identity is the user or group ID to grant permission to (required).
Identity int `json:"identity"`
// Table is the resource type (required, e.g., "vms", "networks").
Table string `json:"table"`
// Row is the specific resource ID (required).
Row int64 `json:"row"`
// Permission flags (all default to false if not specified)
// List grants permission to see the resource in listings.
List *bool `json:"list,omitempty"`
// Read grants permission to view/read the resource details.
// Note: Setting read=true automatically sets list=true.
Read *bool `json:"read,omitempty"`
// Create grants permission to create child/related resources.
Create *bool `json:"create,omitempty"`
// Modify grants permission to update the resource.
Modify *bool `json:"modify,omitempty"`
// Delete grants permission to delete the resource.
Delete *bool `json:"delete,omitempty"`
}
PermissionCreateRequest is the request body for creating a permission.
type PermissionService ¶
type PermissionService struct {
// contains filtered or unexported fields
}
PermissionService handles permission operations. Permissions grant identities (users/groups) access to specific resources.
func (*PermissionService) Create ¶
func (s *PermissionService) Create(ctx context.Context, req *PermissionCreateRequest) (*Permission, error)
Create creates a new permission and returns the created permission.
func (*PermissionService) Delete ¶
func (s *PermissionService) Delete(ctx context.Context, id int) error
Delete deletes a permission.
func (*PermissionService) Get ¶
func (s *PermissionService) Get(ctx context.Context, id int) (*Permission, error)
Get returns a single permission by ID.
func (*PermissionService) GetByIdentityAndResource ¶
func (s *PermissionService) GetByIdentityAndResource(ctx context.Context, identityID int, table string, rowID int64) (*Permission, error)
GetByIdentityAndResource returns the permission for a specific identity and resource.
func (*PermissionService) Grant ¶
func (s *PermissionService) Grant(ctx context.Context, identityID int, table string, rowID int64, read, modify, delete bool) (*Permission, error)
Grant creates a permission granting an identity access to a resource. This is a convenience method that creates a permission with common defaults.
func (*PermissionService) GrantFullAccess ¶
func (s *PermissionService) GrantFullAccess(ctx context.Context, identityID int, table string, rowID int64) (*Permission, error)
GrantFullAccess grants full access (read, modify, delete) to a resource.
func (*PermissionService) GrantReadOnly ¶
func (s *PermissionService) GrantReadOnly(ctx context.Context, identityID int, table string, rowID int64) (*Permission, error)
GrantReadOnly grants read-only access to a resource.
func (*PermissionService) List ¶
func (s *PermissionService) List(ctx context.Context, opts ...ListOption) ([]Permission, error)
List returns all permissions, with optional filtering and pagination.
func (*PermissionService) ListByIdentity ¶
func (s *PermissionService) ListByIdentity(ctx context.Context, identityID int, opts ...ListOption) ([]Permission, error)
ListByIdentity returns all permissions for a specific identity (user or group).
func (*PermissionService) ListByResource ¶
func (s *PermissionService) ListByResource(ctx context.Context, table string, rowID int64, opts ...ListOption) ([]Permission, error)
ListByResource returns all permissions for a specific resource instance.
func (*PermissionService) ListByTable ¶
func (s *PermissionService) ListByTable(ctx context.Context, table string, opts ...ListOption) ([]Permission, error)
ListByTable returns all permissions for a specific resource type.
func (*PermissionService) Revoke ¶
func (s *PermissionService) Revoke(ctx context.Context, identityID int, table string, rowID int64) error
Revoke deletes the permission for a specific identity and resource.
func (*PermissionService) Update ¶
func (s *PermissionService) Update(ctx context.Context, id int, req *PermissionUpdateRequest) (*Permission, error)
Update updates a permission and returns the updated permission.
type PermissionServiceInterface ¶
type PermissionServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]Permission, error)
ListByIdentity(ctx context.Context, identityID int, opts ...ListOption) ([]Permission, error)
ListByTable(ctx context.Context, table string, opts ...ListOption) ([]Permission, error)
ListByResource(ctx context.Context, table string, rowID int64, opts ...ListOption) ([]Permission, error)
Get(ctx context.Context, id int) (*Permission, error)
GetByIdentityAndResource(ctx context.Context, identityID int, table string, rowID int64) (*Permission, error)
Create(ctx context.Context, req *PermissionCreateRequest) (*Permission, error)
Update(ctx context.Context, id int, req *PermissionUpdateRequest) (*Permission, error)
Delete(ctx context.Context, id int) error
Grant(ctx context.Context, identityID int, table string, rowID int64, read, modify, delete bool) (*Permission, error)
GrantReadOnly(ctx context.Context, identityID int, table string, rowID int64) (*Permission, error)
GrantFullAccess(ctx context.Context, identityID int, table string, rowID int64) (*Permission, error)
Revoke(ctx context.Context, identityID int, table string, rowID int64) error
}
PermissionServiceInterface defines the interface for permission operations.
type PermissionUpdateRequest ¶
type PermissionUpdateRequest struct {
// Permission flags
// List grants permission to see the resource in listings.
List *bool `json:"list,omitempty"`
// Read grants permission to view/read the resource details.
Read *bool `json:"read,omitempty"`
// Create grants permission to create child/related resources.
Create *bool `json:"create,omitempty"`
// Modify grants permission to update the resource.
Modify *bool `json:"modify,omitempty"`
// Delete grants permission to delete the resource.
Delete *bool `json:"delete,omitempty"`
}
PermissionUpdateRequest is the request body for updating a permission.
type ResourceGroup ¶
type ResourceGroup struct {
// ID is the unique identifier for the resource group (UUID string).
ID string `json:"$key,omitempty"`
// Name is the resource group name.
Name string `json:"name"`
// Description is the description.
Description string `json:"description,omitempty"`
// Type is the resource group type.
Type string `json:"type,omitempty"`
// Enabled indicates whether the resource group is enabled.
Enabled bool `json:"enabled"`
}
ResourceGroup represents a resource group in VergeOS.
type ResourceGroupService ¶
type ResourceGroupService struct {
// contains filtered or unexported fields
}
ResourceGroupService handles resource group read operations.
func (*ResourceGroupService) Get ¶
func (s *ResourceGroupService) Get(ctx context.Context, id int) (*ResourceGroup, error)
Get returns a single resource group by ID.
func (*ResourceGroupService) GetByName ¶
func (s *ResourceGroupService) GetByName(ctx context.Context, name string) (*ResourceGroup, error)
GetByName returns a resource group by name.
func (*ResourceGroupService) List ¶
func (s *ResourceGroupService) List(ctx context.Context, opts ...ListOption) ([]ResourceGroup, error)
List returns all resource groups, with optional filtering and pagination.
type ResourceGroupServiceInterface ¶
type ResourceGroupServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]ResourceGroup, error)
Get(ctx context.Context, id int) (*ResourceGroup, error)
GetByName(ctx context.Context, name string) (*ResourceGroup, error)
}
ResourceGroupServiceInterface defines the interface for ResourceGroup operations.
type SchemaService ¶
type SchemaService struct {
// contains filtered or unexported fields
}
SchemaService handles schema discovery operations.
func (*SchemaService) GetTableSchema ¶
func (s *SchemaService) GetTableSchema(ctx context.Context, resource string) (*TableSchema, error)
GetTableSchema returns the schema for a resource type. This can be used to discover valid values for enum fields.
Example:
schema, err := client.Schema.GetTableSchema(ctx, "vms") machineTypes := schema.Fields["machine_type"].List // map of valid machine types
func (*SchemaService) GetVMMachineTypes ¶
GetVMMachineTypes returns valid machine types for VMs.
func (*SchemaService) GetVMOSFamilies ¶
GetVMOSFamilies returns valid OS families for VMs.
func (*SchemaService) GetValidValues ¶
func (s *SchemaService) GetValidValues(ctx context.Context, resource, field string) (map[string]string, error)
GetValidValues returns the valid values for a field in a resource type. Returns a map where keys are valid values and values are descriptions.
Example:
machineTypes, err := client.Schema.GetValidValues(ctx, "vms", "machine_type")
for value, description := range machineTypes {
fmt.Printf("%s: %s\n", value, description)
}
type SchemaServiceInterface ¶
type SchemaServiceInterface interface {
GetTableSchema(ctx context.Context, resource string) (*TableSchema, error)
GetValidValues(ctx context.Context, resource, field string) (map[string]string, error)
GetVMMachineTypes(ctx context.Context) (map[string]string, error)
GetVMOSFamilies(ctx context.Context) (map[string]string, error)
}
SchemaServiceInterface defines the interface for Schema operations.
type Setting ¶
type Setting struct {
// Key is the setting key/name (used as identifier).
Key string `json:"key,omitempty"`
// Value is the setting value.
Value string `json:"value,omitempty"`
// DefaultValue is the default value.
DefaultValue string `json:"default_value,omitempty"`
// Description is the setting description.
Description string `json:"description,omitempty"`
}
Setting represents a VergeOS system setting.
type SettingsService ¶
type SettingsService struct {
// contains filtered or unexported fields
}
SettingsService handles system settings read operations.
func (*SettingsService) GetCloudName ¶
func (s *SettingsService) GetCloudName(ctx context.Context) (string, error)
GetCloudName returns the cloud_name setting value.
func (*SettingsService) List ¶
func (s *SettingsService) List(ctx context.Context, opts ...ListOption) ([]Setting, error)
List returns all settings, with optional filtering and pagination.
type SettingsServiceInterface ¶
type SettingsServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]Setting, error)
Get(ctx context.Context, id int) (*Setting, error)
GetByKey(ctx context.Context, key string) (*Setting, error)
GetValue(ctx context.Context, key string) (string, error)
GetCloudName(ctx context.Context) (string, error)
}
SettingsServiceInterface defines the interface for Settings operations.
type Site ¶
type Site struct {
Key FlexInt `json:"$key,omitempty"`
Name string `json:"name,omitempty"`
ID string `json:"id,omitempty"` // 40-char SHA1 unique ID
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Domain string `json:"domain,omitempty"`
City string `json:"city,omitempty"`
Country string `json:"country,omitempty"` // 2-letter country code (e.g., "US")
Latitude float64 `json:"latitude,omitempty"`
Longitude float64 `json:"longitude,omitempty"`
Timezone string `json:"timezone,omitempty"`
URL string `json:"url,omitempty"` // Required: remote site URL
AllowInsecure bool `json:"allow_insecure,omitempty"` // Allow insecure SSL connection
Status string `json:"status,omitempty"` // idle, authenticating, syncing, error, warning
StatusInfo string `json:"status_info,omitempty"`
AuthenticationStatus string `json:"authentication_status,omitempty"` // unauthenticated, authenticated, legacy
VSANHost string `json:"vsan_host,omitempty"` // vSAN connection host
VSANPort int `json:"vsan_port,omitempty"` // vSAN port (default 14201)
IsTenant bool `json:"is_tenant,omitempty"` // Site is a tenant
ConfigCloudSnapshots string `json:"config_cloud_snapshots,omitempty"` // disabled, send, receive, both
ConfigStatistics string `json:"config_statistics,omitempty"` // disabled, send, receive, both
ConfigManagement string `json:"config_management,omitempty"` // disabled, manage, managed, both
ConfigRepairServer string `json:"config_repair_server,omitempty"` // disabled, send, receive, both
IncomingSyncsEnabled bool `json:"incoming_syncs_enabled,omitempty"` // Read-only
OutgoingSyncsEnabled bool `json:"outgoing_syncs_enabled,omitempty"` // Read-only
RepairsOutgoingEnabled bool `json:"repairs_outgoing_enabled,omitempty"` // Read-only
IncomingStatsEnabled bool `json:"incoming_stats_enabled,omitempty"` // Read-only
OutgoingStatsEnabled bool `json:"outgoing_stats_enabled,omitempty"` // Read-only
OutgoingManagementEnabled bool `json:"outgoing_management_enabled,omitempty"` // Read-only
IncomingManagementEnabled bool `json:"incoming_management_enabled,omitempty"` // Read-only
StatisticsInterval int `json:"statistics_interval,omitempty"` // Seconds (default 600, min 300)
StatisticsRetention int `json:"statistics_retention,omitempty"` // Seconds (default 3888000 = 45 days)
RequestURL string `json:"request_url,omitempty"` // URL remote system uses to connect
RemoteUser string `json:"remote_user,omitempty"` // Remote user for authentication
LogoURL string `json:"logo_url,omitempty"` // Logo URL (144x36)
HeaderBG string `json:"header_bg,omitempty"` // Logo background color
MapColor string `json:"map_color,omitempty"` // Map pin color
LastStatUpdate int64 `json:"last_stat_update,omitempty"`
Modified int64 `json:"modified,omitempty"`
Created int64 `json:"created,omitempty"`
Creator string `json:"creator,omitempty"`
}
Site represents a remote VergeOS site for DR, backup, and synchronization.
type SiteCreateRequest ¶
type SiteCreateRequest struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Domain string `json:"domain,omitempty"`
City string `json:"city,omitempty"`
Country string `json:"country,omitempty"` // 2-letter country code
Latitude *float64 `json:"latitude,omitempty"`
Longitude *float64 `json:"longitude,omitempty"`
Timezone string `json:"timezone,omitempty"`
URL string `json:"url"` // Required
AllowInsecure *bool `json:"allow_insecure,omitempty"`
AuthUser string `json:"auth_user,omitempty"` // User for site creation/verification (not stored)
AuthPassword string `json:"auth_password,omitempty"` // Password for site creation/verification (not stored)
ConfigCloudSnapshots *string `json:"config_cloud_snapshots,omitempty"` // disabled, send, receive, both
ConfigStatistics *string `json:"config_statistics,omitempty"` // disabled, send, receive, both
ConfigManagement *string `json:"config_management,omitempty"` // disabled, manage, managed, both
ConfigRepairServer *string `json:"config_repair_server,omitempty"` // disabled, send, receive, both
StatisticsInterval *int `json:"statistics_interval,omitempty"`
StatisticsRetention *int `json:"statistics_retention,omitempty"`
RequestURL *string `json:"request_url,omitempty"`
AutomaticallyCreateSyncs *bool `json:"automatically_create_syncs,omitempty"` // Default true
}
SiteCreateRequest represents the request body for creating a site.
type SiteService ¶
type SiteService struct {
// contains filtered or unexported fields
}
SiteService handles site operations for DR, backup, and synchronization.
func (*SiteService) ClearSyncedLogs ¶
func (s *SiteService) ClearSyncedLogs(ctx context.Context, id int) error
ClearSyncedLogs clears synced logs for the site.
func (*SiteService) Create ¶
func (s *SiteService) Create(ctx context.Context, req *SiteCreateRequest) (*Site, error)
Create creates a new site and returns the created site.
func (*SiteService) Delete ¶
func (s *SiteService) Delete(ctx context.Context, id int) error
Delete deletes a site.
func (*SiteService) GetBySiteID ¶
GetBySiteID returns a site by its 40-character SHA1 site ID.
func (*SiteService) List ¶
func (s *SiteService) List(ctx context.Context, opts ...ListOption) ([]Site, error)
List returns all sites, with optional filtering and pagination.
func (*SiteService) Reauthenticate ¶
func (s *SiteService) Reauthenticate(ctx context.Context, id int) error
Reauthenticate reauthenticates with the remote site.
func (*SiteService) Refresh ¶
func (s *SiteService) Refresh(ctx context.Context, id int) error
Refresh refreshes the site connection and settings.
func (*SiteService) RefreshSettings ¶
func (s *SiteService) RefreshSettings(ctx context.Context, id int) error
RefreshSettings refreshes only the site settings.
func (*SiteService) RunUpdates ¶
func (s *SiteService) RunUpdates(ctx context.Context, id int) error
RunUpdates runs system updates from the remote site.
func (*SiteService) Update ¶
func (s *SiteService) Update(ctx context.Context, id int, req *SiteUpdateRequest) (*Site, error)
Update updates a site and returns the updated site.
type SiteServiceInterface ¶
type SiteServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]Site, error)
Get(ctx context.Context, id int) (*Site, error)
GetByName(ctx context.Context, name string) (*Site, error)
GetBySiteID(ctx context.Context, siteID string) (*Site, error)
Create(ctx context.Context, req *SiteCreateRequest) (*Site, error)
Update(ctx context.Context, id int, req *SiteUpdateRequest) (*Site, error)
Delete(ctx context.Context, id int) error
Refresh(ctx context.Context, id int) error
RefreshSettings(ctx context.Context, id int) error
Reauthenticate(ctx context.Context, id int) error
RunUpdates(ctx context.Context, id int) error
ClearSyncedLogs(ctx context.Context, id int) error
}
SiteServiceInterface defines the interface for Site operations.
type SiteSyncIncoming ¶
type SiteSyncIncoming struct {
Key FlexInt `json:"$key,omitempty"`
Site FlexInt `json:"site,omitempty"`
Name string `json:"name,omitempty"`
SyncID string `json:"sync_id,omitempty"` // 40-char SHA1 unique ID
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Status string `json:"status,omitempty"` // generating_reg, syncing, offline, error, regeneration_needed
StatusInfo string `json:"status_info,omitempty"`
State string `json:"state,omitempty"` // online, offline, warning, error
PublicIP string `json:"public_ip,omitempty"` // IP/Domain of connecting system
RegistrationCode string `json:"registration_code,omitempty"` // Generated registration code
ForceTier string `json:"force_tier,omitempty"` // unspecified, 1-5
VSANHost string `json:"vsan_host,omitempty"`
VSANPort int `json:"vsan_port,omitempty"`
RequestURL string `json:"request_url,omitempty"`
MinSnapshots int `json:"min_snapshots,omitempty"` // Minimum snapshots to retain
LastSync int64 `json:"last_sync,omitempty"`
SystemCreated bool `json:"system_created,omitempty"` // Auto-created by system
}
SiteSyncIncoming represents an incoming sync configuration from a remote site.
type SiteSyncIncomingCreateRequest ¶
type SiteSyncIncomingCreateRequest struct {
Site int `json:"site"` // Required: parent site ID
Name string `json:"name"` // Required
Description string `json:"description,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
PublicIP *string `json:"public_ip,omitempty"`
ForceTier *string `json:"force_tier,omitempty"` // unspecified, 1-5
VSANHost *string `json:"vsan_host,omitempty"`
VSANPort *int `json:"vsan_port,omitempty"`
RequestURL *string `json:"request_url,omitempty"`
MinSnapshots *int `json:"min_snapshots,omitempty"`
}
SiteSyncIncomingCreateRequest represents the request body for creating an incoming sync.
type SiteSyncIncomingService ¶
type SiteSyncIncomingService struct {
// contains filtered or unexported fields
}
SiteSyncIncomingService handles incoming sync operations.
func (*SiteSyncIncomingService) Create ¶
func (s *SiteSyncIncomingService) Create(ctx context.Context, req *SiteSyncIncomingCreateRequest) (*SiteSyncIncoming, error)
Create creates a new incoming sync and returns it.
func (*SiteSyncIncomingService) Delete ¶
func (s *SiteSyncIncomingService) Delete(ctx context.Context, id int) error
Delete deletes an incoming sync.
func (*SiteSyncIncomingService) Disable ¶
func (s *SiteSyncIncomingService) Disable(ctx context.Context, id int) error
Disable disables an incoming sync.
func (*SiteSyncIncomingService) Enable ¶
func (s *SiteSyncIncomingService) Enable(ctx context.Context, id int) error
Enable enables an incoming sync.
func (*SiteSyncIncomingService) Get ¶
func (s *SiteSyncIncomingService) Get(ctx context.Context, id int) (*SiteSyncIncoming, error)
Get returns a single incoming sync by ID.
func (*SiteSyncIncomingService) GetByName ¶
func (s *SiteSyncIncomingService) GetByName(ctx context.Context, siteID int, name string) (*SiteSyncIncoming, error)
GetByName returns an incoming sync by name within a site.
func (*SiteSyncIncomingService) GetBySyncID ¶
func (s *SiteSyncIncomingService) GetBySyncID(ctx context.Context, syncID string) (*SiteSyncIncoming, error)
GetBySyncID returns an incoming sync by its 40-character sync ID.
func (*SiteSyncIncomingService) List ¶
func (s *SiteSyncIncomingService) List(ctx context.Context, opts ...ListOption) ([]SiteSyncIncoming, error)
List returns all incoming syncs, with optional filtering and pagination.
func (*SiteSyncIncomingService) ListBySite ¶
func (s *SiteSyncIncomingService) ListBySite(ctx context.Context, siteID int, opts ...ListOption) ([]SiteSyncIncoming, error)
ListBySite returns all incoming syncs for a specific site.
func (*SiteSyncIncomingService) Update ¶
func (s *SiteSyncIncomingService) Update(ctx context.Context, id int, req *SiteSyncIncomingUpdateRequest) (*SiteSyncIncoming, error)
Update updates an incoming sync and returns the updated sync.
type SiteSyncIncomingServiceInterface ¶
type SiteSyncIncomingServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]SiteSyncIncoming, error)
ListBySite(ctx context.Context, siteID int, opts ...ListOption) ([]SiteSyncIncoming, error)
Get(ctx context.Context, id int) (*SiteSyncIncoming, error)
GetByName(ctx context.Context, siteID int, name string) (*SiteSyncIncoming, error)
GetBySyncID(ctx context.Context, syncID string) (*SiteSyncIncoming, error)
Create(ctx context.Context, req *SiteSyncIncomingCreateRequest) (*SiteSyncIncoming, error)
Update(ctx context.Context, id int, req *SiteSyncIncomingUpdateRequest) (*SiteSyncIncoming, error)
Delete(ctx context.Context, id int) error
Enable(ctx context.Context, id int) error
Disable(ctx context.Context, id int) error
}
SiteSyncIncomingServiceInterface defines the interface for incoming sync operations.
type SiteSyncIncomingUpdateRequest ¶
type SiteSyncIncomingUpdateRequest struct {
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
PublicIP *string `json:"public_ip,omitempty"`
ForceTier *string `json:"force_tier,omitempty"`
VSANHost *string `json:"vsan_host,omitempty"`
VSANPort *int `json:"vsan_port,omitempty"`
RequestURL *string `json:"request_url,omitempty"`
MinSnapshots *int `json:"min_snapshots,omitempty"`
}
SiteSyncIncomingUpdateRequest represents the request body for updating an incoming sync.
type SiteSyncOutgoing ¶
type SiteSyncOutgoing struct {
Key FlexInt `json:"$key,omitempty"`
Site FlexInt `json:"site,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Status string `json:"status,omitempty"` // initializing, syncing, offline, error
StatusInfo string `json:"status_info,omitempty"`
State string `json:"state,omitempty"` // online, offline, warning, error
URL string `json:"url,omitempty"` // Remote URL
RegistrationCode string `json:"registration_code,omitempty"`
User string `json:"user,omitempty"` // Site user
DestinationTier string `json:"destination_tier,omitempty"` // unspecified, 1-5
RemoteSiteID string `json:"remote_site_id,omitempty"`
RemoteVSANHost string `json:"remote_vsan_host,omitempty"`
RemoteVSANPort int `json:"remote_vsan_port,omitempty"`
RemoteSyncID string `json:"remote_sync_id,omitempty"`
RemoteMinSnapshots int `json:"remote_min_snapshots,omitempty"`
Threads int `json:"threads,omitempty"` // Data threads (1-32, default 8)
FileThreads int `json:"file_threads,omitempty"` // File scanning threads (1-64, default 4)
Encryption bool `json:"encryption,omitempty"` // Default true
Compression bool `json:"compression,omitempty"` // Default true
NetInteg bool `json:"netinteg,omitempty"` // Checksum network traffic
SendThrottle int `json:"sendthrottle,omitempty"` // 0 = disabled
QueueRetryCount int `json:"queue_retry_count,omitempty"` // Default 10
QueueRetryIntervalSec int `json:"queue_retry_interval_seconds,omitempty"`
QueueRetryIntervalMult bool `json:"queue_retry_interval_multiplier,omitempty"`
RemoteSnapsLastRefresh int64 `json:"remote_snaps_last_refresh,omitempty"`
RemoteSnapsStatus string `json:"remote_snaps_status,omitempty"` // idle, unsupported, error, refreshing, updating
RemoteSnapsStatusInfo string `json:"remote_snaps_status_info,omitempty"`
LastRun int64 `json:"last_run,omitempty"`
Note string `json:"note,omitempty"`
}
SiteSyncOutgoing represents an outgoing sync configuration to a remote site.
type SiteSyncOutgoingCreateRequest ¶
type SiteSyncOutgoingCreateRequest struct {
Site int `json:"site"` // Required: parent site ID
Name string `json:"name"` // Required
Description string `json:"description,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
URL *string `json:"url,omitempty"`
RegistrationCode string `json:"registration_code,omitempty"` // From incoming sync
DestinationTier *string `json:"destination_tier,omitempty"` // unspecified, 1-5
Threads *int `json:"threads,omitempty"`
FileThreads *int `json:"file_threads,omitempty"`
Encryption *bool `json:"encryption,omitempty"`
Compression *bool `json:"compression,omitempty"`
NetInteg *bool `json:"netinteg,omitempty"`
SendThrottle *int `json:"sendthrottle,omitempty"`
QueueRetryCount *int `json:"queue_retry_count,omitempty"`
QueueRetryIntervalSec *int `json:"queue_retry_interval_seconds,omitempty"`
QueueRetryIntervalMult *bool `json:"queue_retry_interval_multiplier,omitempty"`
Note *string `json:"note,omitempty"`
}
SiteSyncOutgoingCreateRequest represents the request body for creating an outgoing sync.
type SiteSyncOutgoingService ¶
type SiteSyncOutgoingService struct {
// contains filtered or unexported fields
}
SiteSyncOutgoingService handles outgoing sync operations.
func (*SiteSyncOutgoingService) Create ¶
func (s *SiteSyncOutgoingService) Create(ctx context.Context, req *SiteSyncOutgoingCreateRequest) (*SiteSyncOutgoing, error)
Create creates a new outgoing sync and returns it.
func (*SiteSyncOutgoingService) Delete ¶
func (s *SiteSyncOutgoingService) Delete(ctx context.Context, id int) error
Delete deletes an outgoing sync.
func (*SiteSyncOutgoingService) Disable ¶
func (s *SiteSyncOutgoingService) Disable(ctx context.Context, id int) error
Disable disables an outgoing sync.
func (*SiteSyncOutgoingService) DisableThrottle ¶
func (s *SiteSyncOutgoingService) DisableThrottle(ctx context.Context, id int) error
DisableThrottle disables throttling for an outgoing sync.
func (*SiteSyncOutgoingService) Enable ¶
func (s *SiteSyncOutgoingService) Enable(ctx context.Context, id int) error
Enable enables an outgoing sync.
func (*SiteSyncOutgoingService) Get ¶
func (s *SiteSyncOutgoingService) Get(ctx context.Context, id int) (*SiteSyncOutgoing, error)
Get returns a single outgoing sync by ID.
func (*SiteSyncOutgoingService) GetByName ¶
func (s *SiteSyncOutgoingService) GetByName(ctx context.Context, siteID int, name string) (*SiteSyncOutgoing, error)
GetByName returns an outgoing sync by name within a site.
func (*SiteSyncOutgoingService) List ¶
func (s *SiteSyncOutgoingService) List(ctx context.Context, opts ...ListOption) ([]SiteSyncOutgoing, error)
List returns all outgoing syncs, with optional filtering and pagination.
func (*SiteSyncOutgoingService) ListBySite ¶
func (s *SiteSyncOutgoingService) ListBySite(ctx context.Context, siteID int, opts ...ListOption) ([]SiteSyncOutgoing, error)
ListBySite returns all outgoing syncs for a specific site.
func (*SiteSyncOutgoingService) RefreshSnapshots ¶
func (s *SiteSyncOutgoingService) RefreshSnapshots(ctx context.Context, id int) error
RefreshSnapshots refreshes the list of snapshots on the destination.
func (*SiteSyncOutgoingService) Throttle ¶
Throttle sets the send throttle for an outgoing sync. Set throttle to 0 to disable throttling.
func (*SiteSyncOutgoingService) Update ¶
func (s *SiteSyncOutgoingService) Update(ctx context.Context, id int, req *SiteSyncOutgoingUpdateRequest) (*SiteSyncOutgoing, error)
Update updates an outgoing sync and returns the updated sync.
type SiteSyncOutgoingServiceInterface ¶
type SiteSyncOutgoingServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]SiteSyncOutgoing, error)
ListBySite(ctx context.Context, siteID int, opts ...ListOption) ([]SiteSyncOutgoing, error)
Get(ctx context.Context, id int) (*SiteSyncOutgoing, error)
GetByName(ctx context.Context, siteID int, name string) (*SiteSyncOutgoing, error)
Create(ctx context.Context, req *SiteSyncOutgoingCreateRequest) (*SiteSyncOutgoing, error)
Update(ctx context.Context, id int, req *SiteSyncOutgoingUpdateRequest) (*SiteSyncOutgoing, error)
Delete(ctx context.Context, id int) error
Enable(ctx context.Context, id int) error
Disable(ctx context.Context, id int) error
Throttle(ctx context.Context, id int, throttle int) error
DisableThrottle(ctx context.Context, id int) error
RefreshSnapshots(ctx context.Context, id int) error
}
SiteSyncOutgoingServiceInterface defines the interface for outgoing sync operations.
type SiteSyncOutgoingUpdateRequest ¶
type SiteSyncOutgoingUpdateRequest struct {
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
URL *string `json:"url,omitempty"`
DestinationTier *string `json:"destination_tier,omitempty"`
Threads *int `json:"threads,omitempty"`
FileThreads *int `json:"file_threads,omitempty"`
Encryption *bool `json:"encryption,omitempty"`
Compression *bool `json:"compression,omitempty"`
NetInteg *bool `json:"netinteg,omitempty"`
SendThrottle *int `json:"sendthrottle,omitempty"`
QueueRetryCount *int `json:"queue_retry_count,omitempty"`
QueueRetryIntervalSec *int `json:"queue_retry_interval_seconds,omitempty"`
QueueRetryIntervalMult *bool `json:"queue_retry_interval_multiplier,omitempty"`
Note *string `json:"note,omitempty"`
}
SiteSyncOutgoingUpdateRequest represents the request body for updating an outgoing sync.
type SiteSyncProfilePeriod ¶
type SiteSyncProfilePeriod struct {
// Key is the unique identifier for this profile period.
Key FlexInt `json:"$key,omitempty"`
// SiteSyncsOutgoing is the parent outgoing sync ID.
SiteSyncsOutgoing FlexInt `json:"site_syncs_outgoing,omitempty"`
// ProfilePeriod is the snapshot profile period ID (FK to snapshot_profile_periods).
ProfilePeriod FlexInt `json:"profile_period,omitempty"`
// ScheduleTask is the associated schedule task ID.
ScheduleTask FlexInt `json:"schedule_task,omitempty"`
// Task is the associated task ID.
Task FlexInt `json:"task,omitempty"`
// Retention is the remote retention in seconds.
Retention int `json:"retention,omitempty"`
// Priority is the sync priority (lower = higher priority).
Priority int `json:"priority,omitempty"`
// DoNotExpire prevents the source snapshot from expiring until sent.
DoNotExpire bool `json:"do_not_expire,omitempty"`
// DestinationPrefix is prefixed to the snapshot name on the destination.
DestinationPrefix string `json:"destination_prefix,omitempty"`
}
SiteSyncProfilePeriod represents a schedule period for outgoing site syncs. This configures when snapshots are synced to remote sites based on snapshot profile periods.
type SiteSyncProfilePeriodCreateRequest ¶
type SiteSyncProfilePeriodCreateRequest struct {
// SiteSyncsOutgoing is the parent outgoing sync ID (required).
SiteSyncsOutgoing int `json:"site_syncs_outgoing"`
// ProfilePeriod is the snapshot profile period ID (required).
ProfilePeriod int `json:"profile_period"`
// Retention is the remote retention in seconds (required).
Retention int `json:"retention"`
// Priority is the sync priority.
Priority *int `json:"priority,omitempty"`
// DoNotExpire prevents the source snapshot from expiring until sent.
DoNotExpire *bool `json:"do_not_expire,omitempty"`
// DestinationPrefix is prefixed to the snapshot name on the destination.
DestinationPrefix *string `json:"destination_prefix,omitempty"`
}
SiteSyncProfilePeriodCreateRequest represents the request body for creating a site sync profile period.
type SiteSyncProfilePeriodService ¶
type SiteSyncProfilePeriodService struct {
// contains filtered or unexported fields
}
SiteSyncProfilePeriodService handles site sync profile period operations. Profile periods configure when snapshots are synced to remote sites based on snapshot profile periods.
func (*SiteSyncProfilePeriodService) Create ¶
func (s *SiteSyncProfilePeriodService) Create(ctx context.Context, req *SiteSyncProfilePeriodCreateRequest) (*SiteSyncProfilePeriod, error)
Create creates a new site sync profile period and returns it.
func (*SiteSyncProfilePeriodService) Delete ¶
func (s *SiteSyncProfilePeriodService) Delete(ctx context.Context, id int) error
Delete deletes a site sync profile period.
func (*SiteSyncProfilePeriodService) Get ¶
func (s *SiteSyncProfilePeriodService) Get(ctx context.Context, id int) (*SiteSyncProfilePeriod, error)
Get returns a single site sync profile period by ID.
func (*SiteSyncProfilePeriodService) List ¶
func (s *SiteSyncProfilePeriodService) List(ctx context.Context, opts ...ListOption) ([]SiteSyncProfilePeriod, error)
List returns all site sync profile periods, with optional filtering and pagination.
func (*SiteSyncProfilePeriodService) ListByOutgoingSync ¶
func (s *SiteSyncProfilePeriodService) ListByOutgoingSync(ctx context.Context, outgoingSyncID int, opts ...ListOption) ([]SiteSyncProfilePeriod, error)
ListByOutgoingSync returns all profile periods for a specific outgoing sync.
func (*SiteSyncProfilePeriodService) Update ¶
func (s *SiteSyncProfilePeriodService) Update(ctx context.Context, id int, req *SiteSyncProfilePeriodUpdateRequest) (*SiteSyncProfilePeriod, error)
Update updates a site sync profile period and returns the updated period.
type SiteSyncProfilePeriodServiceInterface ¶
type SiteSyncProfilePeriodServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]SiteSyncProfilePeriod, error)
ListByOutgoingSync(ctx context.Context, outgoingSyncID int, opts ...ListOption) ([]SiteSyncProfilePeriod, error)
Get(ctx context.Context, id int) (*SiteSyncProfilePeriod, error)
Create(ctx context.Context, req *SiteSyncProfilePeriodCreateRequest) (*SiteSyncProfilePeriod, error)
Update(ctx context.Context, id int, req *SiteSyncProfilePeriodUpdateRequest) (*SiteSyncProfilePeriod, error)
Delete(ctx context.Context, id int) error
}
SiteSyncProfilePeriodServiceInterface defines the interface for site sync profile period operations.
type SiteSyncProfilePeriodUpdateRequest ¶
type SiteSyncProfilePeriodUpdateRequest struct {
// Retention is the remote retention in seconds.
Retention *int `json:"retention,omitempty"`
// Priority is the sync priority.
Priority *int `json:"priority,omitempty"`
// DoNotExpire prevents the source snapshot from expiring until sent.
DoNotExpire *bool `json:"do_not_expire,omitempty"`
// DestinationPrefix is prefixed to the snapshot name on the destination.
DestinationPrefix *string `json:"destination_prefix,omitempty"`
}
SiteSyncProfilePeriodUpdateRequest represents the request body for updating a site sync profile period.
type SiteUpdateRequest ¶
type SiteUpdateRequest struct {
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Domain *string `json:"domain,omitempty"`
City *string `json:"city,omitempty"`
Country *string `json:"country,omitempty"`
Latitude *float64 `json:"latitude,omitempty"`
Longitude *float64 `json:"longitude,omitempty"`
Timezone *string `json:"timezone,omitempty"`
URL *string `json:"url,omitempty"`
AllowInsecure *bool `json:"allow_insecure,omitempty"`
ConfigCloudSnapshots *string `json:"config_cloud_snapshots,omitempty"`
ConfigStatistics *string `json:"config_statistics,omitempty"`
ConfigManagement *string `json:"config_management,omitempty"`
ConfigRepairServer *string `json:"config_repair_server,omitempty"`
StatisticsInterval *int `json:"statistics_interval,omitempty"`
StatisticsRetention *int `json:"statistics_retention,omitempty"`
RequestURL *string `json:"request_url,omitempty"`
RemoteUser *string `json:"remote_user,omitempty"`
RemotePassword *string `json:"remote_password,omitempty"`
LogoURL *string `json:"logo_url,omitempty"`
HeaderBG *string `json:"header_bg,omitempty"`
MapColor *string `json:"map_color,omitempty"`
ForceRefresh *bool `json:"force_refresh,omitempty"`
}
SiteUpdateRequest represents the request body for updating a site.
type SnapshotProfile ¶
type SnapshotProfile struct {
// Key is the unique identifier for the snapshot profile.
Key FlexInt `json:"$key,omitempty"`
// Name is the profile name (unique, required).
Name string `json:"name"`
// Description is an optional description of the profile.
Description string `json:"description,omitempty"`
// IgnoreWarnings suppresses warnings about snapshot count estimates.
IgnoreWarnings bool `json:"ignore_warnings,omitempty"`
}
SnapshotProfile represents a VergeOS snapshot profile. Snapshot profiles define automated backup schedules for VMs, volumes, and cloud snapshots.
type SnapshotProfileCreateRequest ¶
type SnapshotProfileCreateRequest struct {
// Name is the profile name (required, unique).
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// IgnoreWarnings suppresses warnings about snapshot count estimates.
IgnoreWarnings *bool `json:"ignore_warnings,omitempty"`
}
SnapshotProfileCreateRequest is the request body for creating a snapshot profile.
type SnapshotProfilePeriod ¶
type SnapshotProfilePeriod struct {
// Key is the unique identifier for the period.
Key FlexInt `json:"$key,omitempty"`
// Profile is the parent snapshot profile ID (required).
Profile FlexInt `json:"profile,omitempty"`
// Name is the period name (required, unique within profile).
Name string `json:"name"`
// Frequency is the snapshot frequency (custom, hourly, daily, weekly, monthly, yearly).
Frequency string `json:"frequency,omitempty"`
// Minute is the minute of the hour (0-59).
Minute int `json:"minute,omitempty"`
// Hour is the hour of the day (0-23). Set to 0 for hourly frequency.
Hour int `json:"hour,omitempty"`
// DayOfWeek is the day of the week (sun, mon, tue, wed, thu, fri, sat, any).
// Default is "any".
DayOfWeek string `json:"day_of_week,omitempty"`
// DayOfMonth is the day of the month (1-31, 0 for any).
DayOfMonth int `json:"day_of_month,omitempty"`
// Month is the month of the year (1-12, 0 for any).
Month int `json:"month,omitempty"`
// Retention is how long to keep snapshots in seconds (required).
Retention int `json:"retention,omitempty"`
// SkipMissed skips taking a snapshot if the schedule was missed.
SkipMissed bool `json:"skip_missed,omitempty"`
// MaxTier is the maximum storage tier for storing snapshots (1-5, default "1").
// Tiers higher than max will be demoted to this tier.
MaxTier string `json:"max_tier,omitempty"`
// Quiesce temporarily freezes disk activity while taking the snapshot.
// Requires guest agent support. Applies to VMs and volumes, not system snapshots.
Quiesce bool `json:"quiesce,omitempty"`
// MinSnapshots is the minimum number of snapshots to retain (default 1).
// Helps prevent all snapshots from expiring during a prolonged outage.
MinSnapshots int `json:"min_snapshots,omitempty"`
// Immutable makes snapshots locked and read-only until unlocked.
// Applies to system snapshots only.
Immutable bool `json:"immutable,omitempty"`
// EstimatedSnapshotCount is the estimated number of snapshots (readonly).
EstimatedSnapshotCount int `json:"estimated_snapshot_count,omitempty"`
}
SnapshotProfilePeriod represents a scheduling period within a snapshot profile. Each period defines when snapshots are taken and how long they are retained.
type SnapshotProfilePeriodCreateRequest ¶
type SnapshotProfilePeriodCreateRequest struct {
// Profile is the parent snapshot profile ID (required).
Profile int `json:"profile"`
// Name is the period name (required, unique within profile).
Name string `json:"name"`
// Frequency is the snapshot frequency (custom, hourly, daily, weekly, monthly, yearly).
Frequency string `json:"frequency,omitempty"`
// Minute is the minute of the hour (0-59).
Minute *int `json:"minute,omitempty"`
// Hour is the hour of the day (0-23).
Hour *int `json:"hour,omitempty"`
// DayOfWeek is the day of the week (sun, mon, tue, wed, thu, fri, sat, any).
DayOfWeek *string `json:"day_of_week,omitempty"`
// DayOfMonth is the day of the month (1-31, 0 for any).
DayOfMonth *int `json:"day_of_month,omitempty"`
// Month is the month of the year (1-12, 0 for any).
Month *int `json:"month,omitempty"`
// Retention is how long to keep snapshots in seconds (required).
Retention int `json:"retention"`
// SkipMissed skips taking a snapshot if the schedule was missed.
SkipMissed *bool `json:"skip_missed,omitempty"`
// MaxTier is the maximum storage tier (1-5).
MaxTier *string `json:"max_tier,omitempty"`
// Quiesce temporarily freezes disk activity while taking the snapshot.
Quiesce *bool `json:"quiesce,omitempty"`
// MinSnapshots is the minimum number of snapshots to retain.
MinSnapshots *int `json:"min_snapshots,omitempty"`
// Immutable makes snapshots locked and read-only.
Immutable *bool `json:"immutable,omitempty"`
}
SnapshotProfilePeriodCreateRequest is the request body for creating a snapshot profile period.
type SnapshotProfilePeriodService ¶
type SnapshotProfilePeriodService struct {
// contains filtered or unexported fields
}
SnapshotProfilePeriodService handles snapshot profile period operations.
func (*SnapshotProfilePeriodService) Create ¶
func (s *SnapshotProfilePeriodService) Create(ctx context.Context, req *SnapshotProfilePeriodCreateRequest) (*SnapshotProfilePeriod, error)
Create creates a new snapshot profile period and returns the created period.
func (*SnapshotProfilePeriodService) Delete ¶
func (s *SnapshotProfilePeriodService) Delete(ctx context.Context, id int) error
Delete deletes a snapshot profile period.
func (*SnapshotProfilePeriodService) Get ¶
func (s *SnapshotProfilePeriodService) Get(ctx context.Context, id int) (*SnapshotProfilePeriod, error)
Get returns a single snapshot profile period by ID.
func (*SnapshotProfilePeriodService) GetByName ¶
func (s *SnapshotProfilePeriodService) GetByName(ctx context.Context, profileID int, name string) (*SnapshotProfilePeriod, error)
GetByName returns a snapshot profile period by name within a specific profile.
func (*SnapshotProfilePeriodService) List ¶
func (s *SnapshotProfilePeriodService) List(ctx context.Context, opts ...ListOption) ([]SnapshotProfilePeriod, error)
List returns all snapshot profile periods, with optional filtering and pagination.
func (*SnapshotProfilePeriodService) ListByProfile ¶
func (s *SnapshotProfilePeriodService) ListByProfile(ctx context.Context, profileID int, opts ...ListOption) ([]SnapshotProfilePeriod, error)
ListByProfile returns all periods for a specific snapshot profile.
func (*SnapshotProfilePeriodService) Update ¶
func (s *SnapshotProfilePeriodService) Update(ctx context.Context, id int, req *SnapshotProfilePeriodUpdateRequest) (*SnapshotProfilePeriod, error)
Update updates a snapshot profile period and returns the updated period.
type SnapshotProfilePeriodServiceInterface ¶
type SnapshotProfilePeriodServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]SnapshotProfilePeriod, error)
ListByProfile(ctx context.Context, profileID int, opts ...ListOption) ([]SnapshotProfilePeriod, error)
Get(ctx context.Context, id int) (*SnapshotProfilePeriod, error)
GetByName(ctx context.Context, profileID int, name string) (*SnapshotProfilePeriod, error)
Create(ctx context.Context, req *SnapshotProfilePeriodCreateRequest) (*SnapshotProfilePeriod, error)
Update(ctx context.Context, id int, req *SnapshotProfilePeriodUpdateRequest) (*SnapshotProfilePeriod, error)
Delete(ctx context.Context, id int) error
}
SnapshotProfilePeriodServiceInterface defines the interface for SnapshotProfilePeriod operations.
type SnapshotProfilePeriodUpdateRequest ¶
type SnapshotProfilePeriodUpdateRequest struct {
// Name is the period name.
Name *string `json:"name,omitempty"`
// Frequency is the snapshot frequency.
Frequency *string `json:"frequency,omitempty"`
// Minute is the minute of the hour (0-59).
Minute *int `json:"minute,omitempty"`
// Hour is the hour of the day (0-23).
Hour *int `json:"hour,omitempty"`
// DayOfWeek is the day of the week.
DayOfWeek *string `json:"day_of_week,omitempty"`
// DayOfMonth is the day of the month (1-31, 0 for any).
DayOfMonth *int `json:"day_of_month,omitempty"`
// Month is the month of the year (1-12, 0 for any).
Month *int `json:"month,omitempty"`
// Retention is how long to keep snapshots in seconds.
Retention *int `json:"retention,omitempty"`
// SkipMissed skips taking a snapshot if the schedule was missed.
SkipMissed *bool `json:"skip_missed,omitempty"`
// MaxTier is the maximum storage tier (1-5).
MaxTier *string `json:"max_tier,omitempty"`
// Quiesce temporarily freezes disk activity while taking the snapshot.
Quiesce *bool `json:"quiesce,omitempty"`
// MinSnapshots is the minimum number of snapshots to retain.
MinSnapshots *int `json:"min_snapshots,omitempty"`
// Immutable makes snapshots locked and read-only.
Immutable *bool `json:"immutable,omitempty"`
}
SnapshotProfilePeriodUpdateRequest is the request body for updating a snapshot profile period.
type SnapshotProfileService ¶
type SnapshotProfileService struct {
// contains filtered or unexported fields
}
SnapshotProfileService handles snapshot profile operations.
func (*SnapshotProfileService) Create ¶
func (s *SnapshotProfileService) Create(ctx context.Context, req *SnapshotProfileCreateRequest) (*SnapshotProfile, error)
Create creates a new snapshot profile and returns the created profile.
func (*SnapshotProfileService) Delete ¶
func (s *SnapshotProfileService) Delete(ctx context.Context, id int) error
Delete deletes a snapshot profile.
func (*SnapshotProfileService) Get ¶
func (s *SnapshotProfileService) Get(ctx context.Context, id int) (*SnapshotProfile, error)
Get returns a single snapshot profile by ID.
func (*SnapshotProfileService) GetByName ¶
func (s *SnapshotProfileService) GetByName(ctx context.Context, name string) (*SnapshotProfile, error)
GetByName returns a snapshot profile by name.
func (*SnapshotProfileService) List ¶
func (s *SnapshotProfileService) List(ctx context.Context, opts ...ListOption) ([]SnapshotProfile, error)
List returns all snapshot profiles, with optional filtering and pagination.
func (*SnapshotProfileService) Update ¶
func (s *SnapshotProfileService) Update(ctx context.Context, id int, req *SnapshotProfileUpdateRequest) (*SnapshotProfile, error)
Update updates a snapshot profile and returns the updated profile.
type SnapshotProfileServiceInterface ¶
type SnapshotProfileServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]SnapshotProfile, error)
Get(ctx context.Context, id int) (*SnapshotProfile, error)
GetByName(ctx context.Context, name string) (*SnapshotProfile, error)
Create(ctx context.Context, req *SnapshotProfileCreateRequest) (*SnapshotProfile, error)
Update(ctx context.Context, id int, req *SnapshotProfileUpdateRequest) (*SnapshotProfile, error)
Delete(ctx context.Context, id int) error
}
SnapshotProfileServiceInterface defines the interface for SnapshotProfile operations.
type SnapshotProfileUpdateRequest ¶
type SnapshotProfileUpdateRequest struct {
// Name is the profile name.
Name *string `json:"name,omitempty"`
// Description is the profile description.
Description *string `json:"description,omitempty"`
// IgnoreWarnings suppresses warnings about snapshot count estimates.
IgnoreWarnings *bool `json:"ignore_warnings,omitempty"`
}
SnapshotProfileUpdateRequest is the request body for updating a snapshot profile.
type StorageTier ¶
type StorageTier struct {
// Key is the unique identifier for the tier (the tier number 0-5).
Key int `json:"$key,omitempty"`
// Tier is the tier number (0-5).
Tier int `json:"tier,omitempty"`
// Description is the tier description.
Description string `json:"description,omitempty"`
// Capacity is the total capacity in bytes.
Capacity uint64 `json:"capacity,omitempty"`
// Used is the used space in bytes.
Used uint64 `json:"used,omitempty"`
// Allocated is the allocated space in bytes.
Allocated uint64 `json:"allocated,omitempty"`
// UsedInflated is the used space before deduplication in bytes.
UsedInflated uint64 `json:"used_inflated,omitempty"`
// DedupeRatio is the deduplication ratio (multiply by 0.01 for percentage).
DedupeRatio uint32 `json:"dedupe_ratio,omitempty"`
// UsedPct is the used space percentage (0-100).
UsedPct uint32 `json:"used_pct,omitempty"`
// Modified is the last modified timestamp (Unix epoch).
Modified int64 `json:"modified,omitempty"`
// Stats contains the tier statistics (I/O operations, bytes, etc.).
Stats *StorageTierStats `json:"stats,omitempty"`
}
StorageTier represents a system-wide storage tier in VergeOS. Storage tiers are at the system level (not cluster-specific). Use ClusterTier for cluster-specific tier information.
type StorageTierService ¶
type StorageTierService struct {
// contains filtered or unexported fields
}
StorageTierService handles storage tier read operations. Storage tiers provide system-wide VSAN storage information.
func (*StorageTierService) Get ¶
func (s *StorageTierService) Get(ctx context.Context, tier int) (*StorageTier, error)
Get returns a single storage tier by tier number (0-5).
func (*StorageTierService) List ¶
func (s *StorageTierService) List(ctx context.Context, opts ...ListOption) ([]StorageTier, error)
List returns all storage tiers, with optional filtering.
type StorageTierServiceInterface ¶
type StorageTierServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]StorageTier, error)
Get(ctx context.Context, tier int) (*StorageTier, error)
}
StorageTierServiceInterface defines the interface for storage tier operations (read-only). Storage tiers provide system-wide VSAN storage capacity and usage information.
type StorageTierStats ¶
type StorageTierStats struct {
// Reads is the total read operations.
Reads uint64 `json:"reads,omitempty"`
// Writes is the total write operations.
Writes uint64 `json:"writes,omitempty"`
// ReadBytes is the total bytes read.
ReadBytes uint64 `json:"read_bytes,omitempty"`
// WriteBytes is the total bytes written.
WriteBytes uint64 `json:"write_bytes,omitempty"`
// Rops is the read operations per second.
Rops uint64 `json:"rops,omitempty"`
// Wops is the write operations per second.
Wops uint64 `json:"wops,omitempty"`
// Rbps is the read bytes per second.
Rbps uint64 `json:"rbps,omitempty"`
// Wbps is the write bytes per second.
Wbps uint64 `json:"wbps,omitempty"`
}
StorageTierStats contains I/O statistics for a storage tier.
type SystemInfo ¶
type SystemInfo struct {
// Name is the API name (e.g., "v4").
Name string `json:"name,omitempty"`
// Version is the VergeOS version.
Version string `json:"version,omitempty"`
// Hash is the build hash.
Hash string `json:"hash,omitempty"`
}
SystemInfo represents VergeOS system information.
type SystemService ¶
type SystemService struct {
// contains filtered or unexported fields
}
SystemService handles system information operations.
func (*SystemService) GetInfo ¶
func (s *SystemService) GetInfo(ctx context.Context) (*SystemInfo, error)
GetInfo returns system version information. This uses the /version.json endpoint which is outside the standard API path.
func (*SystemService) GetVersion ¶
func (s *SystemService) GetVersion(ctx context.Context) (string, error)
GetVersion returns the VergeOS version string.
type SystemServiceInterface ¶
type SystemServiceInterface interface {
GetInfo(ctx context.Context) (*SystemInfo, error)
GetVersion(ctx context.Context) (string, error)
}
SystemServiceInterface defines the interface for System operations.
type TPMDeviceSettings ¶
type TPMDeviceSettings struct {
// ID is the settings ID.
ID int `json:"$key,omitempty"`
// MachineDevice is the parent device ID.
MachineDevice int `json:"machine_device,omitempty"`
// Model is the TPM model.
Model string `json:"model,omitempty"`
// Version is the TPM version.
Version string `json:"version,omitempty"`
}
TPMDeviceSettings contains TPM device-specific settings.
type TableField ¶
type TableField struct {
// Type is the field type.
Type string `json:"type,omitempty"`
// List contains valid values and their descriptions.
List map[string]string `json:"list,omitempty"`
// Required indicates whether the field is required.
Required bool `json:"required,omitempty"`
}
TableField represents a field definition in a table schema.
type TableSchema ¶
type TableSchema struct {
// Fields contains field definitions.
Fields map[string]TableField `json:"fields,omitempty"`
}
TableSchema represents the schema for an API resource.
type Tag ¶
type Tag struct {
// Key is the unique identifier for the tag.
Key FlexInt `json:"$key,omitempty"`
// Name is the tag name.
Name string `json:"name"`
// Description is the tag description.
Description string `json:"description,omitempty"`
// Category is the tag category ID.
Category FlexInt `json:"category,omitempty"`
// CategoryDisplay is the display name of the category (from join).
CategoryDisplay string `json:"category_display,omitempty"`
// Created is the creation timestamp (Unix epoch).
Created int64 `json:"created,omitempty"`
// Modified is the last modification timestamp (Unix epoch).
Modified int64 `json:"modified,omitempty"`
}
Tag represents a tag in VergeOS. Tags are used to categorize and organize resources.
type TagCategory ¶
type TagCategory struct {
// Key is the unique identifier for the category.
Key FlexInt `json:"$key,omitempty"`
// Name is the category name.
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// SingleTagSelection indicates whether only one tag from this category can be selected.
SingleTagSelection bool `json:"single_tag_selection,omitempty"`
// Created is the creation timestamp (Unix epoch).
Created int64 `json:"created,omitempty"`
// Modified is the last modification timestamp (Unix epoch).
Modified int64 `json:"modified,omitempty"`
// Taggable resource types - which resources can use tags from this category
// TaggableVolumes indicates whether volumes can be tagged.
TaggableVolumes bool `json:"taggable_volumes,omitempty"`
// TaggableVNets indicates whether networks can be tagged.
TaggableVNets bool `json:"taggable_vnets,omitempty"`
// TaggableVNetRules indicates whether network rules can be tagged.
TaggableVNetRules bool `json:"taggable_vnet_rules,omitempty"`
// TaggableVMwareContainers indicates whether VMware containers can be tagged.
TaggableVMwareContainers bool `json:"taggable_vmware_containers,omitempty"`
// TaggableVMs indicates whether VMs can be tagged.
TaggableVMs bool `json:"taggable_vms,omitempty"`
// TaggableUsers indicates whether users can be tagged.
TaggableUsers bool `json:"taggable_users,omitempty"`
// TaggableTenantNodes indicates whether tenant nodes can be tagged.
TaggableTenantNodes bool `json:"taggable_tenant_nodes,omitempty"`
// TaggableSites indicates whether sites can be tagged.
TaggableSites bool `json:"taggable_sites,omitempty"`
// TaggableNodes indicates whether nodes can be tagged.
TaggableNodes bool `json:"taggable_nodes,omitempty"`
// TaggableGroups indicates whether groups can be tagged.
TaggableGroups bool `json:"taggable_groups,omitempty"`
// TaggableClusters indicates whether clusters can be tagged.
TaggableClusters bool `json:"taggable_clusters,omitempty"`
// TaggableTenants indicates whether tenants can be tagged.
TaggableTenants bool `json:"taggable_tenants,omitempty"`
}
TagCategory represents a tag category in VergeOS. Tag categories organize tags and define which resource types can be tagged.
type TagCategoryCreateRequest ¶
type TagCategoryCreateRequest struct {
// Name is the category name (required).
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// SingleTagSelection indicates whether only one tag from this category can be selected.
SingleTagSelection *bool `json:"single_tag_selection,omitempty"`
// Taggable resource types
// TaggableVolumes indicates whether volumes can be tagged.
TaggableVolumes *bool `json:"taggable_volumes,omitempty"`
// TaggableVNets indicates whether networks can be tagged.
TaggableVNets *bool `json:"taggable_vnets,omitempty"`
// TaggableVNetRules indicates whether network rules can be tagged.
TaggableVNetRules *bool `json:"taggable_vnet_rules,omitempty"`
// TaggableVMwareContainers indicates whether VMware containers can be tagged.
TaggableVMwareContainers *bool `json:"taggable_vmware_containers,omitempty"`
// TaggableVMs indicates whether VMs can be tagged.
TaggableVMs *bool `json:"taggable_vms,omitempty"`
// TaggableUsers indicates whether users can be tagged.
TaggableUsers *bool `json:"taggable_users,omitempty"`
// TaggableTenantNodes indicates whether tenant nodes can be tagged.
TaggableTenantNodes *bool `json:"taggable_tenant_nodes,omitempty"`
// TaggableSites indicates whether sites can be tagged.
TaggableSites *bool `json:"taggable_sites,omitempty"`
// TaggableNodes indicates whether nodes can be tagged.
TaggableNodes *bool `json:"taggable_nodes,omitempty"`
// TaggableGroups indicates whether groups can be tagged.
TaggableGroups *bool `json:"taggable_groups,omitempty"`
// TaggableClusters indicates whether clusters can be tagged.
TaggableClusters *bool `json:"taggable_clusters,omitempty"`
// TaggableTenants indicates whether tenants can be tagged.
TaggableTenants *bool `json:"taggable_tenants,omitempty"`
}
TagCategoryCreateRequest is the request body for creating a tag category.
type TagCategoryService ¶
type TagCategoryService struct {
// contains filtered or unexported fields
}
TagCategoryService handles tag category operations. Tag categories organize tags and define which resource types can be tagged.
func (*TagCategoryService) Create ¶
func (s *TagCategoryService) Create(ctx context.Context, req *TagCategoryCreateRequest) (*TagCategory, error)
Create creates a new tag category and returns the created category.
func (*TagCategoryService) Delete ¶
func (s *TagCategoryService) Delete(ctx context.Context, id int) error
Delete deletes a tag category. Note: Deleting a category also deletes all tags within it.
func (*TagCategoryService) Get ¶
func (s *TagCategoryService) Get(ctx context.Context, id int) (*TagCategory, error)
Get returns a single tag category by ID.
func (*TagCategoryService) GetByName ¶
func (s *TagCategoryService) GetByName(ctx context.Context, name string) (*TagCategory, error)
GetByName returns a tag category by name.
func (*TagCategoryService) List ¶
func (s *TagCategoryService) List(ctx context.Context, opts ...ListOption) ([]TagCategory, error)
List returns all tag categories, with optional filtering and pagination.
func (*TagCategoryService) Update ¶
func (s *TagCategoryService) Update(ctx context.Context, id int, req *TagCategoryUpdateRequest) (*TagCategory, error)
Update updates a tag category and returns the updated category.
type TagCategoryServiceInterface ¶
type TagCategoryServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]TagCategory, error)
Get(ctx context.Context, id int) (*TagCategory, error)
GetByName(ctx context.Context, name string) (*TagCategory, error)
Create(ctx context.Context, req *TagCategoryCreateRequest) (*TagCategory, error)
Update(ctx context.Context, id int, req *TagCategoryUpdateRequest) (*TagCategory, error)
Delete(ctx context.Context, id int) error
}
TagCategoryServiceInterface defines the interface for TagCategory operations.
type TagCategoryUpdateRequest ¶
type TagCategoryUpdateRequest struct {
// Name is the category name.
Name *string `json:"name,omitempty"`
// Description is the category description.
Description *string `json:"description,omitempty"`
// SingleTagSelection indicates whether only one tag from this category can be selected.
SingleTagSelection *bool `json:"single_tag_selection,omitempty"`
// Taggable resource types
// TaggableVolumes indicates whether volumes can be tagged.
TaggableVolumes *bool `json:"taggable_volumes,omitempty"`
// TaggableVNets indicates whether networks can be tagged.
TaggableVNets *bool `json:"taggable_vnets,omitempty"`
// TaggableVNetRules indicates whether network rules can be tagged.
TaggableVNetRules *bool `json:"taggable_vnet_rules,omitempty"`
// TaggableVMwareContainers indicates whether VMware containers can be tagged.
TaggableVMwareContainers *bool `json:"taggable_vmware_containers,omitempty"`
// TaggableVMs indicates whether VMs can be tagged.
TaggableVMs *bool `json:"taggable_vms,omitempty"`
// TaggableUsers indicates whether users can be tagged.
TaggableUsers *bool `json:"taggable_users,omitempty"`
// TaggableTenantNodes indicates whether tenant nodes can be tagged.
TaggableTenantNodes *bool `json:"taggable_tenant_nodes,omitempty"`
// TaggableSites indicates whether sites can be tagged.
TaggableSites *bool `json:"taggable_sites,omitempty"`
// TaggableNodes indicates whether nodes can be tagged.
TaggableNodes *bool `json:"taggable_nodes,omitempty"`
// TaggableGroups indicates whether groups can be tagged.
TaggableGroups *bool `json:"taggable_groups,omitempty"`
// TaggableClusters indicates whether clusters can be tagged.
TaggableClusters *bool `json:"taggable_clusters,omitempty"`
// TaggableTenants indicates whether tenants can be tagged.
TaggableTenants *bool `json:"taggable_tenants,omitempty"`
}
TagCategoryUpdateRequest is the request body for updating a tag category.
type TagCreateRequest ¶
type TagCreateRequest struct {
// Category is the tag category ID (required).
Category int `json:"category"`
// Name is the tag name (required).
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
}
TagCreateRequest is the request body for creating a tag.
type TagMember ¶
type TagMember struct {
// Key is the unique identifier for the tag member.
Key FlexInt `json:"$key,omitempty"`
// Tag is the tag ID this member belongs to.
Tag FlexInt `json:"tag,omitempty"`
// Member is the object reference in format "object_type/object_id" (e.g., "vms/123").
Member string `json:"member,omitempty"`
}
TagMember represents a tag assignment to a resource in VergeOS. TagMembers link tags to objects like VMs, networks, etc.
type TagMemberCreateRequest ¶
type TagMemberCreateRequest struct {
// Tag is the tag ID to assign (required).
Tag int `json:"tag"`
// Member is the object reference in format "object_type/object_id" (required).
// Examples: "vms/123", "vnets/456", "users/789"
Member string `json:"member"`
}
TagMemberCreateRequest is the request body for creating a tag member.
type TagMemberService ¶
type TagMemberService struct {
// contains filtered or unexported fields
}
TagMemberService handles tag member (tag assignment) operations. TagMembers link tags to objects like VMs, networks, etc.
func (*TagMemberService) Assign ¶
func (s *TagMemberService) Assign(ctx context.Context, tagID int, member string) (*TagMember, error)
Assign is a convenience method to assign a tag to an object. member should be in format "object_type/object_id" (e.g., "vms/123").
func (*TagMemberService) Create ¶
func (s *TagMemberService) Create(ctx context.Context, req *TagMemberCreateRequest) (*TagMember, error)
Create creates a new tag member and returns the created tag member.
func (*TagMemberService) Delete ¶
func (s *TagMemberService) Delete(ctx context.Context, id int) error
Delete deletes a tag member.
func (*TagMemberService) List ¶
func (s *TagMemberService) List(ctx context.Context, opts ...ListOption) ([]TagMember, error)
List returns all tag members, with optional filtering and pagination.
func (*TagMemberService) ListByMember ¶
ListByMember returns all tag members for a specific object. member should be in format "object_type/object_id" (e.g., "vms/123").
func (*TagMemberService) Unassign ¶
Unassign is a convenience method to remove a tag from an object. member should be in format "object_type/object_id" (e.g., "vms/123").
func (*TagMemberService) Update ¶
func (s *TagMemberService) Update(ctx context.Context, id int, req *TagMemberUpdateRequest) (*TagMember, error)
Update updates a tag member and returns the updated tag member.
type TagMemberServiceInterface ¶
type TagMemberServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]TagMember, error)
ListByTag(ctx context.Context, tagID int) ([]TagMember, error)
ListByMember(ctx context.Context, member string) ([]TagMember, error)
Get(ctx context.Context, id int) (*TagMember, error)
Create(ctx context.Context, req *TagMemberCreateRequest) (*TagMember, error)
Update(ctx context.Context, id int, req *TagMemberUpdateRequest) (*TagMember, error)
Delete(ctx context.Context, id int) error
Assign(ctx context.Context, tagID int, member string) (*TagMember, error)
Unassign(ctx context.Context, tagID int, member string) error
}
TagMemberServiceInterface defines the interface for TagMember operations.
type TagMemberUpdateRequest ¶
type TagMemberUpdateRequest struct {
// Tag is the tag ID (readonly after creation).
Tag *int `json:"tag,omitempty"`
// Member is the object reference (readonly after creation).
Member *string `json:"member,omitempty"`
}
TagMemberUpdateRequest is the request body for updating a tag member. Note: Both tag and member fields are readonly after creation per API schema. Updates are supported by the SDK but may have no effect.
type TagService ¶
type TagService struct {
// contains filtered or unexported fields
}
TagService handles tag read operations. Tags are used to categorize and organize resources in VergeOS.
func (*TagService) Create ¶
func (s *TagService) Create(ctx context.Context, req *TagCreateRequest) (*Tag, error)
Create creates a new tag and returns the created tag.
func (*TagService) Delete ¶
func (s *TagService) Delete(ctx context.Context, id int) error
Delete deletes a tag. Note: Deleting a tag also removes all tag member associations.
func (*TagService) List ¶
func (s *TagService) List(ctx context.Context, opts ...ListOption) ([]Tag, error)
List returns all tags, with optional filtering and pagination.
func (*TagService) ListByCategory ¶
ListByCategory returns all tags in a specific category.
func (*TagService) Update ¶
func (s *TagService) Update(ctx context.Context, id int, req *TagUpdateRequest) (*Tag, error)
Update updates a tag and returns the updated tag.
type TagServiceInterface ¶
type TagServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]Tag, error)
Get(ctx context.Context, id int) (*Tag, error)
GetByName(ctx context.Context, name string) (*Tag, error)
ListByCategory(ctx context.Context, categoryID int) ([]Tag, error)
Create(ctx context.Context, req *TagCreateRequest) (*Tag, error)
Update(ctx context.Context, id int, req *TagUpdateRequest) (*Tag, error)
Delete(ctx context.Context, id int) error
}
TagServiceInterface defines the interface for Tag operations.
type TagUpdateRequest ¶
type TagUpdateRequest struct {
// Name is the tag name.
Name *string `json:"name,omitempty"`
// Description is the tag description.
Description *string `json:"description,omitempty"`
}
TagUpdateRequest is the request body for updating a tag.
type Task ¶
type Task struct {
// Key is the unique identifier for the task.
Key FlexInt `json:"$key,omitempty"`
// ID is a 40-character SHA1 hash identifier for the task.
ID string `json:"id,omitempty"`
// Owner is the resource path that owns this task (e.g., "vms/123").
Owner string `json:"owner,omitempty"`
// Table is the API table/resource type for the action.
Table string `json:"table,omitempty"`
// Action is the action to perform (e.g., "poweron", "snapshot").
Action string `json:"action,omitempty"`
// ActionDisplay is the human-readable action name (readonly).
ActionDisplay string `json:"action_display,omitempty"`
// Name is the task name (required, 1-64 characters).
Name string `json:"name"`
// Description is an optional description of the task.
Description string `json:"description,omitempty"`
// Enabled indicates whether the task is active.
Enabled bool `json:"enabled,omitempty"`
// LastRun is the timestamp of the last execution.
LastRun string `json:"last_run,omitempty"`
// DeleteAfterRun deletes the task after successful execution.
DeleteAfterRun bool `json:"delete_after_run,omitempty"`
// Status is the current task status.
// Valid values: idle, running
Status string `json:"status,omitempty"`
// SystemCreated indicates whether this task was created by the system.
SystemCreated bool `json:"system_created,omitempty"`
// Creator is the user who created the task.
Creator string `json:"creator,omitempty"`
// Expanded fields from views
// OwnerDisplay is the display name of the owner resource.
OwnerDisplay string `json:"owner_display,omitempty"`
// StatusDisplay is the human-readable status.
StatusDisplay string `json:"status_display,omitempty"`
// TriggersCount is the number of schedule triggers.
TriggersCount int `json:"triggers_count,omitempty"`
// EventsCount is the number of event triggers.
EventsCount int `json:"events_count,omitempty"`
}
Task represents a scheduled task in VergeOS. Tasks are automated jobs that can be triggered on schedule or by events.
type TaskCreateRequest ¶
type TaskCreateRequest struct {
// Owner is the resource path that owns this task (required).
Owner string `json:"owner"`
// Table is the API table/resource type for the action.
Table string `json:"table,omitempty"`
// Action is the action to perform (required).
Action string `json:"action"`
// Name is the task name (required, 1-64 characters).
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// Enabled indicates whether the task is active.
Enabled *bool `json:"enabled,omitempty"`
// DeleteAfterRun deletes the task after successful execution.
DeleteAfterRun *bool `json:"delete_after_run,omitempty"`
}
TaskCreateRequest is the request body for creating a task.
type TaskExecuteOptions ¶
type TaskExecuteOptions struct {
// Params are optional parameters to pass to the task action.
Params map[string]interface{} `json:"params,omitempty"`
}
TaskExecuteOptions are options for executing a task.
type TaskService ¶
type TaskService struct {
// contains filtered or unexported fields
}
TaskService handles scheduled task operations.
func (*TaskService) Create ¶
func (s *TaskService) Create(ctx context.Context, req *TaskCreateRequest) (*Task, error)
Create creates a new task and returns the created task.
func (*TaskService) Delete ¶
func (s *TaskService) Delete(ctx context.Context, id int) error
Delete deletes a task.
func (*TaskService) Disable ¶
func (s *TaskService) Disable(ctx context.Context, id int) error
Disable disables a task.
func (*TaskService) Enable ¶
func (s *TaskService) Enable(ctx context.Context, id int) error
Enable enables a task.
func (*TaskService) Execute ¶
func (s *TaskService) Execute(ctx context.Context, id int, opts *TaskExecuteOptions) error
Execute triggers immediate execution of a task.
func (*TaskService) List ¶
func (s *TaskService) List(ctx context.Context, opts ...ListOption) ([]Task, error)
List returns all tasks, with optional filtering and pagination.
func (*TaskService) ListByOwner ¶
func (s *TaskService) ListByOwner(ctx context.Context, owner string, opts ...ListOption) ([]Task, error)
ListByOwner returns all tasks for a specific owner resource. owner should be a resource path like "vms/123".
func (*TaskService) ListEnabled ¶
func (s *TaskService) ListEnabled(ctx context.Context, opts ...ListOption) ([]Task, error)
ListEnabled returns all enabled tasks.
func (*TaskService) ListRunning ¶
func (s *TaskService) ListRunning(ctx context.Context, opts ...ListOption) ([]Task, error)
ListRunning returns all currently running tasks.
func (*TaskService) Update ¶
func (s *TaskService) Update(ctx context.Context, id int, req *TaskUpdateRequest) (*Task, error)
Update updates a task and returns the updated task.
type TaskServiceInterface ¶
type TaskServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]Task, error)
ListRunning(ctx context.Context, opts ...ListOption) ([]Task, error)
ListByOwner(ctx context.Context, owner string, opts ...ListOption) ([]Task, error)
ListEnabled(ctx context.Context, opts ...ListOption) ([]Task, error)
Get(ctx context.Context, id int) (*Task, error)
GetByID(ctx context.Context, taskID string) (*Task, error)
GetByName(ctx context.Context, owner, name string) (*Task, error)
Create(ctx context.Context, req *TaskCreateRequest) (*Task, error)
Update(ctx context.Context, id int, req *TaskUpdateRequest) (*Task, error)
Delete(ctx context.Context, id int) error
Execute(ctx context.Context, id int, opts *TaskExecuteOptions) error
Enable(ctx context.Context, id int) error
Disable(ctx context.Context, id int) error
}
TaskServiceInterface defines the interface for Task operations.
type TaskUpdateRequest ¶
type TaskUpdateRequest struct {
// Name is the task name.
Name *string `json:"name,omitempty"`
// Description is the task description.
Description *string `json:"description,omitempty"`
// Enabled indicates whether the task is active.
Enabled *bool `json:"enabled,omitempty"`
// DeleteAfterRun deletes the task after successful execution.
DeleteAfterRun *bool `json:"delete_after_run,omitempty"`
}
TaskUpdateRequest is the request body for updating a task.
type Tenant ¶
type Tenant struct {
// Key is the unique identifier for the tenant.
Key FlexInt `json:"$key,omitempty"`
// Name is the tenant name (unique, required).
Name string `json:"name"`
// Description is an optional description of the tenant.
Description string `json:"description,omitempty"`
// URL is the optional URL for the tenant.
URL string `json:"url,omitempty"`
// UUID is the unique identifier (readonly, auto-generated).
UUID string `json:"uuid,omitempty"`
// VNet is the auto-created network ID for the tenant (readonly).
VNet FlexInt `json:"vnet,omitempty"`
// UIAddress is the IP address row ID for the tenant UI (readonly).
UIAddress FlexInt `json:"ui_address,omitempty"`
// OIDCApplication is the OIDC application ID for SSO configuration.
OIDCApplication *FlexInt `json:"oidc_application,omitempty"`
// IsSnapshot indicates whether this is a snapshot of a tenant.
IsSnapshot bool `json:"is_snapshot,omitempty"`
// Isolate indicates whether network isolation is enabled (readonly).
Isolate bool `json:"isolate,omitempty"`
// ExposeCloudSnapshots allows the tenant to request system snapshots.
ExposeCloudSnapshots bool `json:"expose_cloud_snapshots,omitempty"`
// AllowBranding allows the tenant to customize colors and logo.
AllowBranding bool `json:"allow_branding,omitempty"`
// ChangePassword requires password change on first login.
ChangePassword bool `json:"change_password,omitempty"`
// ThemeAccess determines theme visibility (specified, host_only, local_only, both).
ThemeAccess string `json:"theme_access,omitempty"`
// HelpURL is a custom help URL (blank to disable, "default" for default).
HelpURL string `json:"help_url,omitempty"`
// Note is a free-form note about the tenant.
Note string `json:"note,omitempty"`
// Meta stores arbitrary JSON metadata.
Meta json.RawMessage `json:"meta,omitempty"`
// Creator is the username that created this tenant (readonly).
Creator string `json:"creator,omitempty"`
// Created is the creation timestamp (Unix epoch, readonly).
Created int64 `json:"created,omitempty"`
}
Tenant represents a VergeOS tenant (virtual data center). Tenants are isolated environments that can contain their own VMs, networks, and storage.
type TenantCloneOptions ¶
type TenantCloneOptions struct {
// Name is the name for the cloned tenant (required).
Name string `json:"name"`
// NoVNet skips cloning the network.
NoVNet bool `json:"no_vnet,omitempty"`
// NoStorage skips cloning the storage.
NoStorage bool `json:"no_storage,omitempty"`
// NoNodes skips cloning the nodes.
NoNodes bool `json:"no_nodes,omitempty"`
}
TenantCloneOptions are options for cloning a tenant.
type TenantCreateRequest ¶
type TenantCreateRequest struct {
// Name is the tenant name (required, unique).
Name string `json:"name"`
// Password is the admin user password for the tenant.
Password string `json:"password,omitempty"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// URL is the optional URL for the tenant.
URL string `json:"url,omitempty"`
// OIDCApplication is the OIDC application ID for SSO.
OIDCApplication *int `json:"oidc_application,omitempty"`
// ExposeCloudSnapshots allows the tenant to request system snapshots.
ExposeCloudSnapshots *bool `json:"expose_cloud_snapshots,omitempty"`
// AllowBranding allows the tenant to customize colors and logo.
AllowBranding *bool `json:"allow_branding,omitempty"`
// ChangePassword requires password change on first login.
ChangePassword *bool `json:"change_password,omitempty"`
// ThemeAccess determines theme visibility.
ThemeAccess *string `json:"theme_access,omitempty"`
// HelpURL is a custom help URL.
HelpURL *string `json:"help_url,omitempty"`
// Note is a free-form note.
Note *string `json:"note,omitempty"`
}
TenantCreateRequest is the request body for creating a tenant.
type TenantLayer2Network ¶
type TenantLayer2Network struct {
// Key is the unique identifier for this tenant layer2 network assignment.
Key FlexInt `json:"$key,omitempty"`
// Tenant is the tenant ID this network is assigned to.
Tenant FlexInt `json:"tenant,omitempty"`
// VNet is the network ID being assigned.
VNet FlexInt `json:"vnet,omitempty"`
// Enabled indicates whether this assignment is active.
Enabled bool `json:"enabled,omitempty"`
}
TenantLayer2Network represents a Layer 2 network exposed to a tenant. This allows tenants to access host networks at Layer 2 for direct connectivity.
type TenantLayer2NetworkCreateRequest ¶
type TenantLayer2NetworkCreateRequest struct {
// Tenant is the tenant ID (required).
Tenant int `json:"tenant"`
// VNet is the network ID to assign (required).
VNet int `json:"vnet"`
// Enabled indicates whether the assignment is active (default: true).
Enabled *bool `json:"enabled,omitempty"`
}
TenantLayer2NetworkCreateRequest represents the request body for creating a tenant layer2 network assignment.
type TenantLayer2NetworkService ¶
type TenantLayer2NetworkService struct {
// contains filtered or unexported fields
}
TenantLayer2NetworkService handles tenant layer2 network assignment operations. Layer 2 networks allow tenants to access host networks directly.
func (*TenantLayer2NetworkService) Assign ¶
func (s *TenantLayer2NetworkService) Assign(ctx context.Context, tenantID, vnetID int) (*TenantLayer2Network, error)
Assign is a convenience method to assign a network to a tenant. If the assignment already exists, it returns the existing assignment.
func (*TenantLayer2NetworkService) Create ¶
func (s *TenantLayer2NetworkService) Create(ctx context.Context, req *TenantLayer2NetworkCreateRequest) (*TenantLayer2Network, error)
Create creates a new tenant layer2 network assignment and returns it.
func (*TenantLayer2NetworkService) Delete ¶
func (s *TenantLayer2NetworkService) Delete(ctx context.Context, id int) error
Delete deletes a tenant layer2 network assignment.
func (*TenantLayer2NetworkService) Disable ¶
func (s *TenantLayer2NetworkService) Disable(ctx context.Context, id int) (*TenantLayer2Network, error)
Disable disables a tenant layer2 network assignment.
func (*TenantLayer2NetworkService) Enable ¶
func (s *TenantLayer2NetworkService) Enable(ctx context.Context, id int) (*TenantLayer2Network, error)
Enable enables a tenant layer2 network assignment.
func (*TenantLayer2NetworkService) Get ¶
func (s *TenantLayer2NetworkService) Get(ctx context.Context, id int) (*TenantLayer2Network, error)
Get returns a single tenant layer2 network assignment by ID.
func (*TenantLayer2NetworkService) GetByTenantAndNetwork ¶
func (s *TenantLayer2NetworkService) GetByTenantAndNetwork(ctx context.Context, tenantID, vnetID int) (*TenantLayer2Network, error)
GetByTenantAndNetwork returns a tenant layer2 network assignment by tenant and network IDs.
func (*TenantLayer2NetworkService) List ¶
func (s *TenantLayer2NetworkService) List(ctx context.Context, opts ...ListOption) ([]TenantLayer2Network, error)
List returns all tenant layer2 network assignments, with optional filtering and pagination.
func (*TenantLayer2NetworkService) ListByNetwork ¶
func (s *TenantLayer2NetworkService) ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]TenantLayer2Network, error)
ListByNetwork returns all tenant assignments for a specific network.
func (*TenantLayer2NetworkService) ListByTenant ¶
func (s *TenantLayer2NetworkService) ListByTenant(ctx context.Context, tenantID int, opts ...ListOption) ([]TenantLayer2Network, error)
ListByTenant returns all layer2 network assignments for a specific tenant.
func (*TenantLayer2NetworkService) Unassign ¶
func (s *TenantLayer2NetworkService) Unassign(ctx context.Context, tenantID, vnetID int) error
Unassign is a convenience method to remove a network assignment from a tenant.
func (*TenantLayer2NetworkService) Update ¶
func (s *TenantLayer2NetworkService) Update(ctx context.Context, id int, req *TenantLayer2NetworkUpdateRequest) (*TenantLayer2Network, error)
Update updates a tenant layer2 network assignment and returns the updated assignment.
type TenantLayer2NetworkServiceInterface ¶
type TenantLayer2NetworkServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]TenantLayer2Network, error)
ListByTenant(ctx context.Context, tenantID int, opts ...ListOption) ([]TenantLayer2Network, error)
ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]TenantLayer2Network, error)
Get(ctx context.Context, id int) (*TenantLayer2Network, error)
GetByTenantAndNetwork(ctx context.Context, tenantID, vnetID int) (*TenantLayer2Network, error)
Create(ctx context.Context, req *TenantLayer2NetworkCreateRequest) (*TenantLayer2Network, error)
Update(ctx context.Context, id int, req *TenantLayer2NetworkUpdateRequest) (*TenantLayer2Network, error)
Delete(ctx context.Context, id int) error
Enable(ctx context.Context, id int) (*TenantLayer2Network, error)
Disable(ctx context.Context, id int) (*TenantLayer2Network, error)
Assign(ctx context.Context, tenantID, vnetID int) (*TenantLayer2Network, error)
Unassign(ctx context.Context, tenantID, vnetID int) error
}
TenantLayer2NetworkServiceInterface defines the interface for tenant layer2 network operations.
type TenantLayer2NetworkUpdateRequest ¶
type TenantLayer2NetworkUpdateRequest struct {
// Enabled indicates whether the assignment is active.
Enabled *bool `json:"enabled,omitempty"`
}
TenantLayer2NetworkUpdateRequest represents the request body for updating a tenant layer2 network assignment.
type TenantNode ¶
type TenantNode struct {
// Key is the unique identifier for the tenant node.
Key FlexInt `json:"$key,omitempty"`
// Tenant is the parent tenant ID (readonly).
Tenant FlexInt `json:"tenant,omitempty"`
// NodeID is the node identifier within the tenant (1-65535).
NodeID int `json:"nodeid,omitempty"`
// Name is the node name (unique within tenant).
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// Enabled indicates whether the node is enabled.
Enabled bool `json:"enabled,omitempty"`
// Machine is the underlying machine row ID (readonly).
Machine FlexInt `json:"machine,omitempty"`
// IsSnapshot indicates whether this is a snapshot.
IsSnapshot bool `json:"is_snapshot,omitempty"`
// CPUCores is the number of CPU cores allocated.
CPUCores int `json:"cpu_cores,omitempty"`
// RAM is the amount of RAM in MB.
RAM int `json:"ram,omitempty"`
// Cluster is the target cluster ID.
Cluster *FlexInt `json:"cluster,omitempty"`
// ClusterFailover is the failover cluster ID.
ClusterFailover *FlexInt `json:"cluster_failover,omitempty"`
// PreferredNode is the preferred host node ID.
PreferredNode *FlexInt `json:"preferred_node,omitempty"`
// HAGroup is the high-availability group name.
HAGroup string `json:"ha_group,omitempty"`
// OnPowerLoss determines behavior on power loss (power_on, last_state, leave_off).
OnPowerLoss string `json:"on_power_loss,omitempty"`
// Creator is the username that created this node (readonly).
Creator string `json:"creator,omitempty"`
// Created is the creation timestamp (Unix epoch, readonly).
Created int64 `json:"created,omitempty"`
// Modified is the last modification timestamp (Unix epoch, readonly).
Modified int64 `json:"modified,omitempty"`
}
TenantNode represents a VergeOS tenant node. Tenant nodes are virtual nodes that run within a tenant environment.
type TenantNodeCreateRequest ¶
type TenantNodeCreateRequest struct {
// Tenant is the parent tenant ID (required).
Tenant int `json:"tenant"`
// Name is the node name (optional, auto-generated if not provided).
Name string `json:"name,omitempty"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// Enabled indicates whether the node is enabled.
Enabled *bool `json:"enabled,omitempty"`
// CPUCores is the number of CPU cores (required).
CPUCores int `json:"cpu_cores"`
// RAM is the amount of RAM in MB (required, minimum 2048).
RAM int `json:"ram"`
// Cluster is the target cluster ID.
Cluster *int `json:"cluster,omitempty"`
// ClusterFailover is the failover cluster ID.
ClusterFailover *int `json:"cluster_failover,omitempty"`
// PreferredNode is the preferred host node ID.
PreferredNode *int `json:"preferred_node,omitempty"`
// HAGroup is the high-availability group name.
HAGroup *string `json:"ha_group,omitempty"`
// OnPowerLoss determines behavior on power loss.
OnPowerLoss *string `json:"on_power_loss,omitempty"`
}
TenantNodeCreateRequest is the request body for creating a tenant node.
type TenantNodeService ¶
type TenantNodeService struct {
// contains filtered or unexported fields
}
TenantNodeService handles tenant node operations.
func (*TenantNodeService) Create ¶
func (s *TenantNodeService) Create(ctx context.Context, req *TenantNodeCreateRequest) (*TenantNode, error)
Create creates a new tenant node and returns the created node.
func (*TenantNodeService) Delete ¶
func (s *TenantNodeService) Delete(ctx context.Context, id int) error
Delete deletes a tenant node.
func (*TenantNodeService) Get ¶
func (s *TenantNodeService) Get(ctx context.Context, id int) (*TenantNode, error)
Get returns a single tenant node by ID.
func (*TenantNodeService) GetByName ¶
func (s *TenantNodeService) GetByName(ctx context.Context, tenantID int, name string) (*TenantNode, error)
GetByName returns a tenant node by name within a specific tenant.
func (*TenantNodeService) Kill ¶
func (s *TenantNodeService) Kill(ctx context.Context, id int) error
Kill forcefully terminates a tenant node.
func (*TenantNodeService) List ¶
func (s *TenantNodeService) List(ctx context.Context, opts ...ListOption) ([]TenantNode, error)
List returns all tenant nodes, with optional filtering and pagination.
func (*TenantNodeService) ListByTenant ¶
func (s *TenantNodeService) ListByTenant(ctx context.Context, tenantID int, opts ...ListOption) ([]TenantNode, error)
ListByTenant returns all nodes for a specific tenant.
func (*TenantNodeService) PowerOff ¶
func (s *TenantNodeService) PowerOff(ctx context.Context, id int) error
PowerOff powers off a tenant node.
func (*TenantNodeService) PowerOn ¶
func (s *TenantNodeService) PowerOn(ctx context.Context, id int) error
PowerOn powers on a tenant node.
func (*TenantNodeService) Reset ¶
func (s *TenantNodeService) Reset(ctx context.Context, id int) error
Reset resets a tenant node.
func (*TenantNodeService) Update ¶
func (s *TenantNodeService) Update(ctx context.Context, id int, req *TenantNodeUpdateRequest) (*TenantNode, error)
Update updates a tenant node and returns the updated node.
type TenantNodeServiceInterface ¶
type TenantNodeServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]TenantNode, error)
ListByTenant(ctx context.Context, tenantID int, opts ...ListOption) ([]TenantNode, error)
Get(ctx context.Context, id int) (*TenantNode, error)
GetByName(ctx context.Context, tenantID int, name string) (*TenantNode, error)
Create(ctx context.Context, req *TenantNodeCreateRequest) (*TenantNode, error)
Update(ctx context.Context, id int, req *TenantNodeUpdateRequest) (*TenantNode, error)
Delete(ctx context.Context, id int) error
PowerOn(ctx context.Context, id int) error
PowerOff(ctx context.Context, id int) error
Reset(ctx context.Context, id int) error
Kill(ctx context.Context, id int) error
Migrate(ctx context.Context, id int, targetNode int) error
}
TenantNodeServiceInterface defines the interface for TenantNode operations.
type TenantNodeUpdateRequest ¶
type TenantNodeUpdateRequest struct {
// Name is the node name.
Name *string `json:"name,omitempty"`
// Description is the node description.
Description *string `json:"description,omitempty"`
// Enabled indicates whether the node is enabled.
Enabled *bool `json:"enabled,omitempty"`
// CPUCores is the number of CPU cores.
CPUCores *int `json:"cpu_cores,omitempty"`
// RAM is the amount of RAM in MB.
RAM *int `json:"ram,omitempty"`
// Cluster is the target cluster ID.
Cluster *int `json:"cluster,omitempty"`
// ClusterFailover is the failover cluster ID.
ClusterFailover *int `json:"cluster_failover,omitempty"`
// PreferredNode is the preferred host node ID.
PreferredNode *int `json:"preferred_node,omitempty"`
// HAGroup is the high-availability group name.
HAGroup *string `json:"ha_group,omitempty"`
// OnPowerLoss determines behavior on power loss.
OnPowerLoss *string `json:"on_power_loss,omitempty"`
}
TenantNodeUpdateRequest is the request body for updating a tenant node.
type TenantService ¶
type TenantService struct {
// contains filtered or unexported fields
}
TenantService handles tenant operations.
func (*TenantService) Clone ¶
func (s *TenantService) Clone(ctx context.Context, id int, opts *TenantCloneOptions) error
Clone clones a tenant.
func (*TenantService) Create ¶
func (s *TenantService) Create(ctx context.Context, req *TenantCreateRequest) (*Tenant, error)
Create creates a new tenant and returns the created tenant.
func (*TenantService) Delete ¶
func (s *TenantService) Delete(ctx context.Context, id int) error
Delete deletes a tenant.
func (*TenantService) IsolateOff ¶
func (s *TenantService) IsolateOff(ctx context.Context, id int) error
IsolateOff disables network isolation for a tenant.
func (*TenantService) IsolateOn ¶
func (s *TenantService) IsolateOn(ctx context.Context, id int) error
IsolateOn enables network isolation for a tenant.
func (*TenantService) List ¶
func (s *TenantService) List(ctx context.Context, opts ...ListOption) ([]Tenant, error)
List returns all tenants, with optional filtering and pagination.
func (*TenantService) PowerOff ¶
func (s *TenantService) PowerOff(ctx context.Context, id int) error
PowerOff powers off a tenant.
func (*TenantService) PowerOn ¶
func (s *TenantService) PowerOn(ctx context.Context, id int) error
PowerOn powers on a tenant.
func (*TenantService) PowerOnWithNode ¶
PowerOnWithNode powers on a tenant on a specific preferred node. If preferredNode is 0, the system chooses the node.
func (*TenantService) Reset ¶
func (s *TenantService) Reset(ctx context.Context, id int) error
Reset resets a tenant (restart).
func (*TenantService) Update ¶
func (s *TenantService) Update(ctx context.Context, id int, req *TenantUpdateRequest) (*Tenant, error)
Update updates a tenant and returns the updated tenant.
type TenantServiceInterface ¶
type TenantServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]Tenant, error)
Get(ctx context.Context, id int) (*Tenant, error)
GetByName(ctx context.Context, name string) (*Tenant, error)
Create(ctx context.Context, req *TenantCreateRequest) (*Tenant, error)
Update(ctx context.Context, id int, req *TenantUpdateRequest) (*Tenant, error)
Delete(ctx context.Context, id int) error
PowerOn(ctx context.Context, id int) error
PowerOnWithNode(ctx context.Context, id int, preferredNode int) error
PowerOff(ctx context.Context, id int) error
Reset(ctx context.Context, id int) error
Clone(ctx context.Context, id int, opts *TenantCloneOptions) error
IsolateOn(ctx context.Context, id int) error
IsolateOff(ctx context.Context, id int) error
}
TenantServiceInterface defines the interface for Tenant operations.
type TenantSnapshot ¶
type TenantSnapshot struct {
// Key is the unique identifier for the snapshot.
Key FlexInt `json:"$key,omitempty"`
// Tenant is the parent tenant ID.
Tenant FlexInt `json:"tenant,omitempty"`
// Name is the snapshot name (readonly, auto-generated from profile).
Name string `json:"name,omitempty"`
// Description is an optional description of the snapshot.
Description string `json:"description,omitempty"`
// Profile is the snapshot profile name used to create this snapshot.
Profile string `json:"profile,omitempty"`
// Period is the profile period name.
Period string `json:"period,omitempty"`
// MinSnapshots is the minimum number of snapshots to retain.
MinSnapshots int `json:"min_snapshots,omitempty"`
// Created is the creation timestamp (Unix epoch, readonly).
Created int64 `json:"created,omitempty"`
// Expires is the expiration timestamp (Unix epoch, 0 = never).
Expires int64 `json:"expires,omitempty"`
}
TenantSnapshot represents a VergeOS tenant snapshot. Tenant snapshots capture the state of a tenant at a point in time.
type TenantSnapshotService ¶
type TenantSnapshotService struct {
// contains filtered or unexported fields
}
TenantSnapshotService handles tenant snapshot operations. Tenant snapshots are created automatically by snapshot profiles or manually via tenant actions.
func (*TenantSnapshotService) Delete ¶
func (s *TenantSnapshotService) Delete(ctx context.Context, id int) error
Delete deletes a tenant snapshot.
func (*TenantSnapshotService) Get ¶
func (s *TenantSnapshotService) Get(ctx context.Context, id int) (*TenantSnapshot, error)
Get returns a single tenant snapshot by ID.
func (*TenantSnapshotService) GetByName ¶
func (s *TenantSnapshotService) GetByName(ctx context.Context, tenantID int, name string) (*TenantSnapshot, error)
GetByName returns a tenant snapshot by name within a specific tenant.
func (*TenantSnapshotService) List ¶
func (s *TenantSnapshotService) List(ctx context.Context, opts ...ListOption) ([]TenantSnapshot, error)
List returns all tenant snapshots, with optional filtering and pagination.
func (*TenantSnapshotService) ListByTenant ¶
func (s *TenantSnapshotService) ListByTenant(ctx context.Context, tenantID int, opts ...ListOption) ([]TenantSnapshot, error)
ListByTenant returns all snapshots for a specific tenant.
func (*TenantSnapshotService) ListExpiring ¶
func (s *TenantSnapshotService) ListExpiring(ctx context.Context, days int, opts ...ListOption) ([]TenantSnapshot, error)
ListExpiring returns snapshots expiring within the specified number of days.
func (*TenantSnapshotService) Refresh ¶
func (s *TenantSnapshotService) Refresh(ctx context.Context, tenantID int) error
Refresh refreshes the tenant snapshots list from the snapshot profile. This triggers a refresh of snapshots for the specified tenant.
func (*TenantSnapshotService) SetExpires ¶
func (s *TenantSnapshotService) SetExpires(ctx context.Context, id int, expires int64) (*TenantSnapshot, error)
SetExpires sets the expiration timestamp for a tenant snapshot.
func (*TenantSnapshotService) SetNeverExpires ¶
func (s *TenantSnapshotService) SetNeverExpires(ctx context.Context, id int) (*TenantSnapshot, error)
SetNeverExpires sets a tenant snapshot to never expire.
func (*TenantSnapshotService) Update ¶
func (s *TenantSnapshotService) Update(ctx context.Context, id int, req *TenantSnapshotUpdateRequest) (*TenantSnapshot, error)
Update updates a tenant snapshot and returns the updated snapshot.
type TenantSnapshotServiceInterface ¶
type TenantSnapshotServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]TenantSnapshot, error)
ListByTenant(ctx context.Context, tenantID int, opts ...ListOption) ([]TenantSnapshot, error)
ListExpiring(ctx context.Context, days int, opts ...ListOption) ([]TenantSnapshot, error)
Get(ctx context.Context, id int) (*TenantSnapshot, error)
GetByName(ctx context.Context, tenantID int, name string) (*TenantSnapshot, error)
Update(ctx context.Context, id int, req *TenantSnapshotUpdateRequest) (*TenantSnapshot, error)
Delete(ctx context.Context, id int) error
Refresh(ctx context.Context, tenantID int) error
SetNeverExpires(ctx context.Context, id int) (*TenantSnapshot, error)
SetExpires(ctx context.Context, id int, expires int64) (*TenantSnapshot, error)
}
TenantSnapshotServiceInterface defines the interface for tenant snapshot operations.
type TenantSnapshotUpdateRequest ¶
type TenantSnapshotUpdateRequest struct {
// Description is the snapshot description.
Description *string `json:"description,omitempty"`
// Expires is the expiration timestamp (0 = never expires).
Expires *int64 `json:"expires,omitempty"`
}
TenantSnapshotUpdateRequest is the request body for updating a tenant snapshot.
type TenantStorage ¶
type TenantStorage struct {
// Key is the unique identifier for the storage allocation.
Key FlexInt `json:"$key,omitempty"`
// Tenant is the parent tenant ID.
Tenant FlexInt `json:"tenant,omitempty"`
// Tier is the storage tier ID (readonly after creation).
Tier FlexInt `json:"tier,omitempty"`
// Provisioned is the provisioned storage in bytes.
Provisioned int64 `json:"provisioned,omitempty"`
// Used is the used storage in bytes (readonly).
Used int64 `json:"used,omitempty"`
// Allocated is the allocated storage in bytes (readonly).
Allocated int64 `json:"allocated,omitempty"`
// UsedPct is the percentage of provisioned storage used (readonly).
UsedPct int `json:"used_pct,omitempty"`
// LastUpdate is the last update timestamp (Unix epoch, readonly).
LastUpdate int64 `json:"last_update,omitempty"`
}
TenantStorage represents a VergeOS tenant storage allocation. Each tenant can have storage allocated from different storage tiers.
type TenantStorageCreateRequest ¶
type TenantStorageCreateRequest struct {
// Tenant is the parent tenant ID (required).
Tenant int `json:"tenant"`
// Tier is the storage tier ID (required).
Tier int `json:"tier"`
// Provisioned is the provisioned storage in bytes (required).
Provisioned int64 `json:"provisioned"`
}
TenantStorageCreateRequest is the request body for creating a tenant storage allocation.
type TenantStorageService ¶
type TenantStorageService struct {
// contains filtered or unexported fields
}
TenantStorageService handles tenant storage allocation operations.
func (*TenantStorageService) Create ¶
func (s *TenantStorageService) Create(ctx context.Context, req *TenantStorageCreateRequest) (*TenantStorage, error)
Create creates a new tenant storage allocation and returns the created allocation.
func (*TenantStorageService) Delete ¶
func (s *TenantStorageService) Delete(ctx context.Context, id int) error
Delete deletes a tenant storage allocation.
func (*TenantStorageService) Get ¶
func (s *TenantStorageService) Get(ctx context.Context, id int) (*TenantStorage, error)
Get returns a single tenant storage allocation by ID.
func (*TenantStorageService) List ¶
func (s *TenantStorageService) List(ctx context.Context, opts ...ListOption) ([]TenantStorage, error)
List returns all tenant storage allocations, with optional filtering and pagination.
func (*TenantStorageService) ListByTenant ¶
func (s *TenantStorageService) ListByTenant(ctx context.Context, tenantID int, opts ...ListOption) ([]TenantStorage, error)
ListByTenant returns all storage allocations for a specific tenant.
func (*TenantStorageService) Update ¶
func (s *TenantStorageService) Update(ctx context.Context, id int, req *TenantStorageUpdateRequest) (*TenantStorage, error)
Update updates a tenant storage allocation and returns the updated allocation.
type TenantStorageServiceInterface ¶
type TenantStorageServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]TenantStorage, error)
ListByTenant(ctx context.Context, tenantID int, opts ...ListOption) ([]TenantStorage, error)
Get(ctx context.Context, id int) (*TenantStorage, error)
Create(ctx context.Context, req *TenantStorageCreateRequest) (*TenantStorage, error)
Update(ctx context.Context, id int, req *TenantStorageUpdateRequest) (*TenantStorage, error)
Delete(ctx context.Context, id int) error
}
TenantStorageServiceInterface defines the interface for TenantStorage operations.
type TenantStorageUpdateRequest ¶
type TenantStorageUpdateRequest struct {
// Provisioned is the provisioned storage in bytes.
Provisioned *int64 `json:"provisioned,omitempty"`
}
TenantStorageUpdateRequest is the request body for updating a tenant storage allocation.
type TenantUpdateRequest ¶
type TenantUpdateRequest struct {
// Name is the tenant name.
Name *string `json:"name,omitempty"`
// Password is the admin user password.
Password *string `json:"password,omitempty"`
// Description is the tenant description.
Description *string `json:"description,omitempty"`
// URL is the tenant URL.
URL *string `json:"url,omitempty"`
// OIDCApplication is the OIDC application ID.
OIDCApplication *int `json:"oidc_application,omitempty"`
// ExposeCloudSnapshots allows the tenant to request system snapshots.
ExposeCloudSnapshots *bool `json:"expose_cloud_snapshots,omitempty"`
// AllowBranding allows the tenant to customize colors and logo.
AllowBranding *bool `json:"allow_branding,omitempty"`
// ThemeAccess determines theme visibility.
ThemeAccess *string `json:"theme_access,omitempty"`
// HelpURL is a custom help URL.
HelpURL *string `json:"help_url,omitempty"`
// Note is a free-form note.
Note *string `json:"note,omitempty"`
}
TenantUpdateRequest is the request body for updating a tenant.
type USBDeviceSettings ¶
type USBDeviceSettings struct {
// ID is the settings ID.
ID int `json:"$key,omitempty"`
// MachineDevice is the parent device ID.
MachineDevice int `json:"machine_device,omitempty"`
// GuestReset indicates whether guest reset is allowed.
GuestReset bool `json:"guest_reset,omitempty"`
// GuestResetsAll indicates whether guest can reset all devices.
GuestResetsAll bool `json:"guest_resets_all,omitempty"`
}
USBDeviceSettings contains USB device-specific settings.
type UnsupportedVersionError ¶ added in v0.1.1
UnsupportedVersionError is returned when the server version is not supported.
func (*UnsupportedVersionError) Error ¶ added in v0.1.1
func (e *UnsupportedVersionError) Error() string
type UpdateBranch ¶ added in v0.1.4
type UpdateBranch struct {
// Key is the unique identifier for this branch.
Key FlexInt `json:"$key,omitempty"`
// Name is the branch name (e.g., "stable-4.13").
Name string `json:"name,omitempty"`
// Description is the branch description.
Description string `json:"description,omitempty"`
}
UpdateBranch represents an update branch (e.g., "stable-4.13").
type UpdateBranchService ¶ added in v0.1.4
type UpdateBranchService struct {
// contains filtered or unexported fields
}
UpdateBranchService handles update branch read operations.
func (*UpdateBranchService) Get ¶ added in v0.1.4
func (s *UpdateBranchService) Get(ctx context.Context, id int) (*UpdateBranch, error)
Get retrieves a specific update branch by key.
func (*UpdateBranchService) List ¶ added in v0.1.4
func (s *UpdateBranchService) List(ctx context.Context, opts ...ListOption) ([]UpdateBranch, error)
List returns all update branches.
type UpdateBranchServiceInterface ¶ added in v0.1.4
type UpdateBranchServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]UpdateBranch, error)
Get(ctx context.Context, id int) (*UpdateBranch, error)
}
UpdateBranchServiceInterface defines the interface for update branch operations (read-only).
type UpdateSettings ¶ added in v0.1.4
type UpdateSettings struct {
// Key is the unique identifier (always 1).
Key FlexInt `json:"$key,omitempty"`
// Source is the update source ID.
Source int `json:"source,omitempty"`
// Branch is the update branch ID (FK to update_branches).
Branch int `json:"branch,omitempty"`
// BranchName is the branch name (computed field: branch#name).
BranchName string `json:"branch_name,omitempty"`
// AutoRefresh indicates whether to automatically refresh update info.
AutoRefresh bool `json:"auto_refresh,omitempty"`
// AutoUpdate indicates whether to automatically apply updates.
AutoUpdate bool `json:"auto_update,omitempty"`
// RebootRequired indicates whether a reboot is needed after update.
RebootRequired bool `json:"reboot_required,omitempty"`
// Installed indicates whether updates have been installed.
Installed bool `json:"installed,omitempty"`
// SnapshotCloudOnUpdate indicates whether to snapshot before updating.
SnapshotCloudOnUpdate bool `json:"snapshot_cloud_on_update,omitempty"`
// SnapshotCloudExpireSeconds is the snapshot expiration time in seconds.
SnapshotCloudExpireSeconds uint32 `json:"snapshot_cloud_expire_seconds,omitempty"`
}
UpdateSettings represents the system update configuration (singleton, key=1).
type UpdateSettingsService ¶ added in v0.1.4
type UpdateSettingsService struct {
// contains filtered or unexported fields
}
UpdateSettingsService handles update settings read operations. Update settings is a singleton resource (key=1).
func (*UpdateSettingsService) Get ¶ added in v0.1.4
func (s *UpdateSettingsService) Get(ctx context.Context) (*UpdateSettings, error)
Get retrieves the update settings (singleton, key=1). The BranchName field is populated via computed field alias (branch#name).
type UpdateSettingsServiceInterface ¶ added in v0.1.4
type UpdateSettingsServiceInterface interface {
Get(ctx context.Context) (*UpdateSettings, error)
}
UpdateSettingsServiceInterface defines the interface for update settings operations (read-only singleton).
type UpdateSourcePackage ¶ added in v0.1.4
type UpdateSourcePackage struct {
// Key is the unique identifier for this package record.
Key FlexInt `json:"$key,omitempty"`
// Name is the package name (e.g., "ybos").
Name string `json:"name,omitempty"`
// Branch is the branch ID (FK to update_branches).
Branch int `json:"branch,omitempty"`
// Source is the update source ID.
Source int `json:"source,omitempty"`
// Version is the package version string (e.g., "4.13.1").
Version string `json:"version,omitempty"`
// Downloaded indicates whether the package has been downloaded.
Downloaded bool `json:"downloaded,omitempty"`
}
UpdateSourcePackage represents a package available from an update source.
type UpdateSourcePackageService ¶ added in v0.1.4
type UpdateSourcePackageService struct {
// contains filtered or unexported fields
}
UpdateSourcePackageService handles update source package read operations.
func (*UpdateSourcePackageService) Get ¶ added in v0.1.4
func (s *UpdateSourcePackageService) Get(ctx context.Context, id int) (*UpdateSourcePackage, error)
Get retrieves a specific update source package by key.
func (*UpdateSourcePackageService) List ¶ added in v0.1.4
func (s *UpdateSourcePackageService) List(ctx context.Context, opts ...ListOption) ([]UpdateSourcePackage, error)
List returns all update source packages, with optional filtering.
func (*UpdateSourcePackageService) ListByBranchAndSource ¶ added in v0.1.4
func (s *UpdateSourcePackageService) ListByBranchAndSource(ctx context.Context, branch, source int) ([]UpdateSourcePackage, error)
ListByBranchAndSource returns packages for a specific branch and source.
type UpdateSourcePackageServiceInterface ¶ added in v0.1.4
type UpdateSourcePackageServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]UpdateSourcePackage, error)
ListByBranchAndSource(ctx context.Context, branch, source int) ([]UpdateSourcePackage, error)
Get(ctx context.Context, id int) (*UpdateSourcePackage, error)
}
UpdateSourcePackageServiceInterface defines the interface for update source package operations (read-only).
type User ¶
type User struct {
// Key is the row key (unique identifier).
Key FlexInt `json:"$key,omitempty"`
// ID is the 40-character unique user identifier string.
ID string `json:"id,omitempty"`
// AuthSource is the authentication source ID.
AuthSource int `json:"auth_source,omitempty"`
// Name is the username.
Name string `json:"name"`
// RemoteName is the remote username (for external auth).
RemoteName string `json:"remote_name,omitempty"`
// Enabled indicates whether the user is enabled.
Enabled bool `json:"enabled"`
// DisplayName is the user's display name.
DisplayName string `json:"displayname,omitempty"`
// Email is the user's email address.
Email string `json:"email,omitempty"`
// Type is the user type (normal, api, vdi, site_sync, site_user).
Type string `json:"type,omitempty"`
// Created is the creation timestamp (Unix epoch).
Created int64 `json:"created,omitempty"`
// Creator is the username that created this user.
Creator string `json:"creator,omitempty"`
// Password and authentication
// ChangePassword indicates whether the user must change their password.
ChangePassword bool `json:"change_password,omitempty"`
// FailedAttempts is the number of failed login attempts.
FailedAttempts int `json:"failed_attempts,omitempty"`
// AccountLocked is the timestamp when the account was locked (0 = not locked).
AccountLocked int64 `json:"account_locked,omitempty"`
// LastLogin is the timestamp of the last successful login.
LastLogin int64 `json:"last_login,omitempty"`
// Two-factor authentication
// TwoFactorAuthentication indicates whether 2FA is enabled.
TwoFactorAuthentication bool `json:"two_factor_authentication,omitempty"`
// TwoFactorType is the 2FA method (email, authenticator).
TwoFactorType string `json:"two_factor_type,omitempty"`
// Advanced access
// PhysicalAccess indicates whether console/SSH access is enabled.
PhysicalAccess bool `json:"physical_access,omitempty"`
// SSHKeys contains the user's SSH public keys (newline separated).
SSHKeys string `json:"ssh_keys,omitempty"`
// UI customization
// Theme is the theme ID override (string hash).
Theme string `json:"theme,omitempty"`
}
User represents a VergeOS user.
func (*User) GetSSHKeys ¶
GetSSHKeys returns the SSH keys as a slice of public key strings. SSH keys are stored as newline-separated values.
type UserAPIKey ¶
type UserAPIKey struct {
// Key is the unique identifier.
Key FlexInt `json:"$key,omitempty"`
// User is the user ID this API key belongs to.
User FlexInt `json:"user,omitempty"`
// UserName is the name of the user (joined field).
UserName string `json:"user_name,omitempty"`
// Name is the API key name.
Name string `json:"name,omitempty"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// IPAllowList is a comma-separated list of allowed IP addresses or CIDRs.
IPAllowList string `json:"ip_allow_list,omitempty"`
// IPDenyList is a comma-separated list of denied IP addresses or CIDRs.
IPDenyList string `json:"ip_deny_list,omitempty"`
// LastLoginStamp is the timestamp of the last API key usage (Unix epoch).
LastLoginStamp int64 `json:"lastlogin_stamp,omitempty"`
// LastLoginIP is the IP address of the last API key usage.
LastLoginIP string `json:"lastlogin_ip,omitempty"`
// Created is the creation timestamp (Unix epoch).
Created int64 `json:"created,omitempty"`
// ExpiresType is the expiration type: never, date.
ExpiresType string `json:"expires_type,omitempty"`
// Expires is the expiration timestamp (Unix epoch). 0 means never expires.
Expires int64 `json:"expires,omitempty"`
}
UserAPIKey represents a VergeOS user API key. API keys allow programmatic access to the API without using username/password.
type UserAPIKeyCreateRequest ¶
type UserAPIKeyCreateRequest struct {
// User is the user ID this API key belongs to (required).
User int `json:"user"`
// Name is the API key name (required).
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// IPAllowList is a comma-separated list of allowed IP addresses or CIDRs.
IPAllowList string `json:"ip_allow_list,omitempty"`
// IPDenyList is a comma-separated list of denied IP addresses or CIDRs.
IPDenyList string `json:"ip_deny_list,omitempty"`
// ExpiresType is the expiration type: never, date.
ExpiresType string `json:"expires_type,omitempty"`
// Expires is the expiration timestamp (Unix epoch).
Expires *int64 `json:"expires,omitempty"`
}
UserAPIKeyCreateRequest is the request body for creating an API key.
type UserAPIKeyCreateResponse ¶
type UserAPIKeyCreateResponse struct {
// Key is the unique identifier.
Key FlexInt `json:"$key,omitempty"`
// Token is the API key token. This is only returned on creation and cannot be retrieved later.
Token string `json:"token,omitempty"`
}
UserAPIKeyCreateResponse is the response from creating an API key. This includes the token which is only returned on creation.
type UserAPIKeyService ¶
type UserAPIKeyService struct {
// contains filtered or unexported fields
}
UserAPIKeyService handles user API key operations.
func (*UserAPIKeyService) Create ¶
func (s *UserAPIKeyService) Create(ctx context.Context, req *UserAPIKeyCreateRequest) (*UserAPIKey, string, error)
Create creates a new API key and returns the created key with its token. IMPORTANT: The token is only returned on creation and cannot be retrieved later.
func (*UserAPIKeyService) Delete ¶
func (s *UserAPIKeyService) Delete(ctx context.Context, id int) error
Delete deletes an API key.
func (*UserAPIKeyService) Get ¶
func (s *UserAPIKeyService) Get(ctx context.Context, id int) (*UserAPIKey, error)
Get returns a single API key by ID.
func (*UserAPIKeyService) GetByName ¶
func (s *UserAPIKeyService) GetByName(ctx context.Context, userID int, name string) (*UserAPIKey, error)
GetByName returns an API key by name within a user's keys.
func (*UserAPIKeyService) List ¶
func (s *UserAPIKeyService) List(ctx context.Context, opts ...ListOption) ([]UserAPIKey, error)
List returns all user API keys, with optional filtering and pagination.
func (*UserAPIKeyService) ListByUser ¶
func (s *UserAPIKeyService) ListByUser(ctx context.Context, userID int, opts ...ListOption) ([]UserAPIKey, error)
ListByUser returns all API keys for a specific user.
func (*UserAPIKeyService) ListExpired ¶
func (s *UserAPIKeyService) ListExpired(ctx context.Context, opts ...ListOption) ([]UserAPIKey, error)
ListExpired returns all expired API keys.
func (*UserAPIKeyService) Update ¶
func (s *UserAPIKeyService) Update(ctx context.Context, id int, req *UserAPIKeyUpdateRequest) (*UserAPIKey, error)
Update updates an API key and returns the updated key.
type UserAPIKeyServiceInterface ¶
type UserAPIKeyServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]UserAPIKey, error)
ListByUser(ctx context.Context, userID int, opts ...ListOption) ([]UserAPIKey, error)
Get(ctx context.Context, id int) (*UserAPIKey, error)
GetByName(ctx context.Context, userID int, name string) (*UserAPIKey, error)
Create(ctx context.Context, req *UserAPIKeyCreateRequest) (*UserAPIKey, string, error)
Update(ctx context.Context, id int, req *UserAPIKeyUpdateRequest) (*UserAPIKey, error)
Delete(ctx context.Context, id int) error
ListExpired(ctx context.Context, opts ...ListOption) ([]UserAPIKey, error)
}
UserAPIKeyServiceInterface defines the interface for user API key operations.
type UserAPIKeyUpdateRequest ¶
type UserAPIKeyUpdateRequest struct {
// Name is the API key name.
Name *string `json:"name,omitempty"`
// Description is the description.
Description *string `json:"description,omitempty"`
// IPAllowList is a comma-separated list of allowed IP addresses or CIDRs.
IPAllowList *string `json:"ip_allow_list,omitempty"`
// IPDenyList is a comma-separated list of denied IP addresses or CIDRs.
IPDenyList *string `json:"ip_deny_list,omitempty"`
// ExpiresType is the expiration type: never, date.
ExpiresType *string `json:"expires_type,omitempty"`
// Expires is the expiration timestamp (Unix epoch).
Expires *int64 `json:"expires,omitempty"`
}
UserAPIKeyUpdateRequest is the request body for updating an API key.
type UserCreateRequest ¶
type UserCreateRequest struct {
// AuthSource is the authentication source ID.
AuthSource *int `json:"auth_source,omitempty"`
// Name is the username (required).
Name string `json:"name"`
// RemoteName is the remote username (for external auth).
RemoteName string `json:"remote_name,omitempty"`
// Enabled indicates whether the user is enabled.
Enabled *bool `json:"enabled,omitempty"`
// DisplayName is the user's display name.
DisplayName string `json:"displayname,omitempty"`
// Email is the user's email address.
Email string `json:"email,omitempty"`
// Type is the user type (normal, api, vdi).
Type string `json:"type,omitempty"`
// Password is the user's password.
Password string `json:"password,omitempty"`
// ChangePassword indicates whether the user must change their password.
ChangePassword *bool `json:"change_password,omitempty"`
// Two-factor authentication
// TwoFactorAuthentication indicates whether 2FA is enabled.
TwoFactorAuthentication *bool `json:"two_factor_authentication,omitempty"`
// TwoFactorType is the 2FA method (email, authenticator).
TwoFactorType string `json:"two_factor_type,omitempty"`
// TwoFactorSetupNextLogin requires 2FA setup on next login.
TwoFactorSetupNextLogin *bool `json:"two_factor_setup_next_login,omitempty"`
// Advanced access
// PhysicalAccess indicates whether console/SSH access is enabled.
PhysicalAccess *bool `json:"physical_access,omitempty"`
// SSHKeys contains the user's SSH public keys.
SSHKeys string `json:"ssh_keys,omitempty"`
// UI customization
// Theme is the theme ID override (string hash).
Theme string `json:"theme,omitempty"`
}
UserCreateRequest is the request body for creating a user.
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
UserService handles user operations.
func (*UserService) Create ¶
func (s *UserService) Create(ctx context.Context, req *UserCreateRequest) (*User, error)
Create creates a new user and returns the created user.
func (*UserService) Delete ¶
func (s *UserService) Delete(ctx context.Context, id int) error
Delete deletes a user.
func (*UserService) Disable ¶
func (s *UserService) Disable(ctx context.Context, id int) error
Disable disables a user account.
func (*UserService) Enable ¶
func (s *UserService) Enable(ctx context.Context, id int) error
Enable enables a user account.
func (*UserService) List ¶
func (s *UserService) List(ctx context.Context, opts ...ListOption) ([]User, error)
List returns all users, with optional filtering and pagination.
func (*UserService) Update ¶
func (s *UserService) Update(ctx context.Context, id int, req *UserUpdateRequest) (*User, error)
Update updates a user and returns the updated user.
type UserServiceInterface ¶
type UserServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]User, error)
Get(ctx context.Context, id int) (*User, error)
GetByName(ctx context.Context, name string) (*User, error)
Create(ctx context.Context, req *UserCreateRequest) (*User, error)
Update(ctx context.Context, id int, req *UserUpdateRequest) (*User, error)
Delete(ctx context.Context, id int) error
Enable(ctx context.Context, id int) error
Disable(ctx context.Context, id int) error
}
UserServiceInterface defines the interface for User operations.
type UserUpdateRequest ¶
type UserUpdateRequest struct {
// Name is the username.
Name *string `json:"name,omitempty"`
// RemoteName is the remote username.
RemoteName *string `json:"remote_name,omitempty"`
// Enabled indicates whether the user is enabled.
Enabled *bool `json:"enabled,omitempty"`
// DisplayName is the user's display name.
DisplayName *string `json:"displayname,omitempty"`
// Email is the user's email address.
Email *string `json:"email,omitempty"`
// Password management
// Password is the user's password (argument field).
Password *string `json:"password,omitempty"`
// ChangePassword indicates whether the user must change their password.
ChangePassword *bool `json:"change_password,omitempty"`
// Two-factor authentication
// TwoFactorAuthentication indicates whether 2FA is enabled.
TwoFactorAuthentication *bool `json:"two_factor_authentication,omitempty"`
// TwoFactorType is the 2FA method (email, authenticator).
TwoFactorType *string `json:"two_factor_type,omitempty"`
// TwoFactorSetupNextLogin requires 2FA setup on next login.
TwoFactorSetupNextLogin *bool `json:"two_factor_setup_next_login,omitempty"`
// Advanced access
// PhysicalAccess indicates whether console/SSH access is enabled.
PhysicalAccess *bool `json:"physical_access,omitempty"`
// SSHKeys contains the user's SSH public keys.
SSHKeys *string `json:"ssh_keys,omitempty"`
// UI customization
// Theme is the theme ID override (string hash).
Theme *string `json:"theme,omitempty"`
}
UserUpdateRequest is the request body for updating a user. Note: auth_source and type are readonly after creation.
type VGPUDeviceSettings ¶
type VGPUDeviceSettings struct {
// ID is the settings ID.
ID int `json:"$key,omitempty"`
// MachineDevice is the parent device ID.
MachineDevice int `json:"machine_device,omitempty"`
// ProfileType is the vGPU profile type.
ProfileType string `json:"profile_type,omitempty"`
// FrameRateLimiter is the frame rate limiter setting.
FrameRateLimiter int `json:"frame_rate_limiter,omitempty"`
// DisableVNC indicates whether VNC is disabled.
DisableVNC bool `json:"disable_vnc,omitempty"`
// EnableUVM indicates whether UVM is enabled.
EnableUVM bool `json:"enable_uvm,omitempty"`
// EnableDebugging indicates whether debugging is enabled.
EnableDebugging bool `json:"enable_debugging,omitempty"`
// EnableProfiling indicates whether profiling is enabled.
EnableProfiling bool `json:"enable_profiling,omitempty"`
}
VGPUDeviceSettings contains NVIDIA vGPU device-specific settings.
type VM ¶
type VM struct {
// ID is the unique identifier for the VM.
ID FlexInt `json:"$key,omitempty"`
// UUID is the universally unique identifier for the VM.
UUID string `json:"uuid,omitempty"`
// Machine is the machine reference ID.
Machine int `json:"machine,omitempty"`
// Name is the VM name.
Name string `json:"name"`
// Description is an optional description of the VM.
Description string `json:"description,omitempty"`
// Enabled indicates whether the VM is enabled.
Enabled bool `json:"enabled"`
// Created is the creation timestamp (Unix epoch).
Created int64 `json:"created,omitempty"`
// Modified is the last modified timestamp (Unix epoch).
Modified int64 `json:"modified,omitempty"`
// IsSnapshot indicates whether this VM is a snapshot.
IsSnapshot bool `json:"is_snapshot,omitempty"`
// Owner is the owner reference path (e.g., "vm_recipes/...", "vms/...").
Owner string `json:"owner,omitempty"`
// OwnerUser is the owner user ID (nullable).
OwnerUser *int `json:"owner_user,omitempty"`
// Creator is the username that created this VM.
Creator string `json:"creator,omitempty"`
// Cluster configuration
// Cluster is the cluster the VM belongs to.
Cluster FlexInt `json:"cluster,omitempty"`
// ClusterFailover is the failover cluster ID (0 = none).
ClusterFailover FlexInt `json:"cluster_failover,omitempty"`
// Hardware configuration
// CPUCores is the number of CPU cores.
CPUCores int `json:"cpu_cores"`
// CPUType is the CPU type (e.g., "host", "qemu64").
CPUType string `json:"cpu_type,omitempty"`
// RAM is the amount of RAM in MB.
RAM int `json:"ram"`
// MachineType is the machine type (e.g., "pc-i440fx-10.0", "pc-q35-10.0").
MachineType string `json:"machine_type,omitempty"`
// IOMMU indicates whether IOMMU is enabled.
IOMMU bool `json:"iommu,omitempty"`
// USBLegacy indicates whether to use a legacy USB controller.
USBLegacy bool `json:"usb_legacy,omitempty"`
// Boot configuration
// UEFI indicates whether UEFI boot is enabled.
UEFI bool `json:"uefi,omitempty"`
// SecureBoot indicates whether Secure Boot is enabled.
SecureBoot bool `json:"secure_boot,omitempty"`
// BootOrder specifies the boot device order.
BootOrder string `json:"boot_order,omitempty"`
// BootDelay is the boot delay in seconds.
BootDelay int `json:"boot_delay,omitempty"`
// Display and console
// Console is the console type.
Console string `json:"console,omitempty"`
// Display is the display type.
Display string `json:"display,omitempty"`
// Video is the video adapter type.
Video string `json:"video,omitempty"`
// Sound is the sound device type.
Sound string `json:"sound,omitempty"`
// SerialPort indicates whether the serial port is enabled.
SerialPort bool `json:"serial_port,omitempty"`
// ConsolePassEnabled indicates whether console password is enabled.
ConsolePassEnabled bool `json:"console_pass_enabled,omitempty"`
// ConsolePass is the console password.
ConsolePass string `json:"console_pass,omitempty"`
// OS configuration
// OSFamily is the operating system family.
OSFamily string `json:"os_family,omitempty"`
// OSDescription is the operating system description.
OSDescription string `json:"os_description,omitempty"`
// RTCBase is the RTC base setting.
RTCBase string `json:"rtc_base,omitempty"`
// Features
// AllowHotplug indicates whether hotplug is allowed.
AllowHotplug bool `json:"allow_hotplug,omitempty"`
// DisablePowercycle indicates whether power cycling is disabled.
DisablePowercycle bool `json:"disable_powercycle,omitempty"`
// USBTablet indicates whether USB tablet is enabled.
USBTablet bool `json:"usb_tablet,omitempty"`
// GuestAgent indicates whether the guest agent is enabled.
GuestAgent bool `json:"guest_agent,omitempty"`
// NestedVirtualization indicates whether nested virtualization is enabled.
NestedVirtualization bool `json:"nested_virtualization,omitempty"`
// DisableHypervisor indicates whether the hypervisor is disabled.
DisableHypervisor bool `json:"disable_hypervisor,omitempty"`
// AllowExport indicates whether this VM can be exported to NAS.
AllowExport bool `json:"allow_export,omitempty"`
// Cloud-Init configuration
// CloudInitDataSource is the cloud-init data source.
CloudInitDataSource string `json:"cloudinit_datasource,omitempty"`
// CloudInitFiles are the cloud-init files.
CloudInitFiles []CloudInitFileRef `json:"cloudinit_files,omitempty"`
// Scheduling and availability
// PreferredNode is the preferred node for the VM (0 = none).
PreferredNode FlexInt `json:"preferred_node,omitempty"`
// HAGroup is the HA group the VM belongs to.
HAGroup string `json:"ha_group,omitempty"`
// SnapshotProfile is the snapshot profile ID (0 = none).
SnapshotProfile FlexInt `json:"snapshot_profile,omitempty"`
// OnPowerLoss is the behavior when power is restored.
// Valid values: "power_on", "last_state", "leave_off"
OnPowerLoss string `json:"on_power_loss,omitempty"`
// MigrationMethod is the migration method.
// Valid values: "auto", "live"
MigrationMethod string `json:"migration_method,omitempty"`
// PowerCycleTimeout is the migration power-cycle timeout (0 = use system setting).
PowerCycleTimeout int `json:"power_cycle_timeout,omitempty"`
// State
// PowerState indicates whether the VM is running (true) or stopped (false).
PowerState bool `json:"powerstate,omitempty"`
// NeedRestart indicates whether the VM needs to be restarted.
NeedRestart bool `json:"need_restart,omitempty"`
// Origin tracking
// CreatedFrom indicates how the VM was created.
// Valid values: "import", "import_vmx", "import_ovf", "import_vmware", "import_shared", "clone", "recipe", "custom", "terraform"
CreatedFrom string `json:"created_from,omitempty"`
// Imported indicates whether this VM was imported.
Imported bool `json:"imported,omitempty"`
// Advanced configuration
// Advanced is the advanced configuration (key=value pairs, newline separated).
Advanced string `json:"advanced,omitempty"`
// Note is a free-form note about the VM.
Note string `json:"note,omitempty"`
// Meta contains metadata (raw JSON, typically recipe data).
Meta json.RawMessage `json:"meta,omitempty"`
// PasteKeyConfig is the paste key mapping configuration ID (nullable).
PasteKeyConfig *int `json:"paste_key_config,omitempty"`
}
VM represents a VergeOS virtual machine.
type VMCloneOptions ¶
type VMCloneOptions struct {
// Name is the name for the cloned VM. Defaults to "${NAME}_${TIMESTAMP}".
Name string
// PreserveMACs indicates whether to preserve MAC addresses from the source VM.
PreserveMACs bool
}
VMCloneOptions contains options for cloning a VM.
type VMCreateRequest ¶
type VMCreateRequest struct {
// Name is the VM name (required).
Name string `json:"name"`
// Description is an optional description of the VM.
Description string `json:"description,omitempty"`
// Enabled indicates whether the VM is enabled.
Enabled *bool `json:"enabled,omitempty"`
// OwnerUser is the owner user ID.
OwnerUser *int `json:"owner_user,omitempty"`
// Cluster configuration
// Cluster is the cluster to create the VM in.
Cluster *int `json:"cluster,omitempty"`
// ClusterFailover is the failover cluster ID.
ClusterFailover *int `json:"cluster_failover,omitempty"`
// Hardware configuration
// CPUCores is the number of CPU cores (required).
CPUCores int `json:"cpu_cores"`
// CPUType is the CPU type.
CPUType string `json:"cpu_type,omitempty"`
// RAM is the amount of RAM in MB (required).
RAM int `json:"ram"`
// MachineType is the machine type.
MachineType string `json:"machine_type,omitempty"`
// IOMMU indicates whether IOMMU is enabled.
IOMMU *bool `json:"iommu,omitempty"`
// USBLegacy indicates whether to use a legacy USB controller.
USBLegacy *bool `json:"usb_legacy,omitempty"`
// Boot configuration
// UEFI indicates whether UEFI boot is enabled.
UEFI *bool `json:"uefi,omitempty"`
// SecureBoot indicates whether Secure Boot is enabled.
SecureBoot *bool `json:"secure_boot,omitempty"`
// BootOrder specifies the boot device order.
BootOrder string `json:"boot_order,omitempty"`
// BootDelay is the boot delay in seconds.
BootDelay *int `json:"boot_delay,omitempty"`
// Display and console
// Console is the console type.
Console string `json:"console,omitempty"`
// Display is the display type.
Display string `json:"display,omitempty"`
// Video is the video adapter type.
Video string `json:"video,omitempty"`
// Sound is the sound device type.
Sound string `json:"sound,omitempty"`
// SerialPort indicates whether the serial port is enabled.
SerialPort *bool `json:"serial_port,omitempty"`
// ConsolePassEnabled indicates whether console password is enabled.
ConsolePassEnabled *bool `json:"console_pass_enabled,omitempty"`
// ConsolePass is the console password.
ConsolePass string `json:"console_pass,omitempty"`
// OS configuration
// OSFamily is the operating system family.
OSFamily string `json:"os_family,omitempty"`
// OSDescription is the operating system description.
OSDescription string `json:"os_description,omitempty"`
// RTCBase is the RTC base setting.
RTCBase string `json:"rtc_base,omitempty"`
// Features
// AllowHotplug indicates whether hotplug is allowed.
AllowHotplug *bool `json:"allow_hotplug,omitempty"`
// DisablePowercycle indicates whether power cycling is disabled.
DisablePowercycle *bool `json:"disable_powercycle,omitempty"`
// USBTablet indicates whether USB tablet is enabled.
USBTablet *bool `json:"usb_tablet,omitempty"`
// GuestAgent indicates whether the guest agent is enabled.
GuestAgent *bool `json:"guest_agent,omitempty"`
// NestedVirtualization indicates whether nested virtualization is enabled.
NestedVirtualization *bool `json:"nested_virtualization,omitempty"`
// DisableHypervisor indicates whether the hypervisor is disabled.
DisableHypervisor *bool `json:"disable_hypervisor,omitempty"`
// AllowExport indicates whether this VM can be exported to NAS.
AllowExport *bool `json:"allow_export,omitempty"`
// Cloud-Init configuration
// CloudInitDataSource is the cloud-init data source.
CloudInitDataSource string `json:"cloudinit_datasource,omitempty"`
// CloudInitFiles are the cloud-init files.
CloudInitFiles []CloudInitFileRef `json:"cloudinit_files,omitempty"`
// Scheduling and availability
// PreferredNode is the preferred node for the VM.
PreferredNode *int `json:"preferred_node,omitempty"`
// HAGroup is the HA group the VM belongs to.
HAGroup string `json:"ha_group,omitempty"`
// SnapshotProfile is the snapshot profile ID.
SnapshotProfile *int `json:"snapshot_profile,omitempty"`
// OnPowerLoss is the behavior when power is restored.
OnPowerLoss string `json:"on_power_loss,omitempty"`
// MigrationMethod is the migration method (auto/live).
MigrationMethod string `json:"migration_method,omitempty"`
// PowerCycleTimeout is the migration power-cycle timeout.
PowerCycleTimeout *int `json:"power_cycle_timeout,omitempty"`
// Origin tracking
// CreatedFrom indicates how the VM was created.
CreatedFrom string `json:"created_from,omitempty"`
// Advanced configuration
// Advanced is the advanced configuration.
Advanced string `json:"advanced,omitempty"`
// Note is a free-form note about the VM.
Note string `json:"note,omitempty"`
// PasteKeyConfig is the paste key mapping configuration ID.
PasteKeyConfig *int `json:"paste_key_config,omitempty"`
}
VMCreateRequest is the request body for creating a VM.
type VMDevice ¶
type VMDevice struct {
// ID is the unique identifier for the device.
ID FlexInt `json:"$key,omitempty"`
// Machine is the machine reference ID.
Machine int `json:"machine,omitempty"`
// MachineType is the machine type (vm, container, node, etc.) - read-only.
MachineType string `json:"machine_type,omitempty"`
// OrderID is the device order (0-64).
OrderID int `json:"orderid,omitempty"`
// Type is the device type (tpm, node_usb_devices, node_pci_devices, node_nvidia_vgpu_devices, etc.).
Type string `json:"type"`
// Name is the device name.
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// ResourceGroup is the resource group ID.
ResourceGroup FlexInt `json:"resource_group,omitempty"`
// UUID is the device UUID.
UUID string `json:"uuid,omitempty"`
// Enabled indicates whether the device is enabled.
Enabled bool `json:"enabled"`
// Optional allows the machine to start without this device if unavailable.
Optional bool `json:"optional,omitempty"`
// Asset is the asset tag (used for recipe/snapshot identification).
Asset string `json:"asset,omitempty"`
// Created is the creation timestamp (Unix epoch).
Created int64 `json:"created,omitempty"`
// Modified is the last modification timestamp (Unix epoch).
Modified int64 `json:"modified,omitempty"`
// Settings contains device-specific settings based on Type.
// For USB devices: USBSettings
// For TPM devices: TPMSettings
// For vGPU devices: VGPUSettings
USBSettings *USBDeviceSettings `json:"-"`
TPMSettings *TPMDeviceSettings `json:"-"`
VGPUSettings *VGPUDeviceSettings `json:"-"`
}
VMDevice represents a device attached to a VM.
type VMDeviceCreateRequest ¶
type VMDeviceCreateRequest struct {
// Machine is the VM's machine ID.
Machine int `json:"machine"`
// OrderID is the device order (0-64, auto-assigned if not specified).
OrderID *int `json:"orderid,omitempty"`
// Type is the device type (tpm, node_usb_devices, node_pci_devices, node_nvidia_vgpu_devices, etc.).
Type string `json:"type"`
// Name is the device name (auto-generated if blank).
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// ResourceGroup is the resource group ID.
ResourceGroup int `json:"resource_group,omitempty"`
// UUID is the device UUID (leave blank for system-generated).
UUID string `json:"uuid,omitempty"`
// Enabled indicates whether the device is enabled.
Enabled *bool `json:"enabled,omitempty"`
// Optional allows the machine to start without this device if unavailable.
Optional *bool `json:"optional,omitempty"`
// Asset is the asset tag.
Asset string `json:"asset,omitempty"`
// Count creates X copies of this device (1-16).
Count *int `json:"count,omitempty"`
// USB settings (only for USB devices)
USBSettings *USBDeviceSettings `json:"-"`
// TPM settings (only for TPM devices)
TPMSettings *TPMDeviceSettings `json:"-"`
// vGPU settings (only for vGPU devices)
VGPUSettings *VGPUDeviceSettings `json:"-"`
}
VMDeviceCreateRequest is the request body for creating a device.
type VMDeviceService ¶
type VMDeviceService struct {
// contains filtered or unexported fields
}
VMDeviceService handles VM device operations.
func (*VMDeviceService) Create ¶
func (s *VMDeviceService) Create(ctx context.Context, vmID int, req *VMDeviceCreateRequest) (*VMDevice, error)
Create creates a new device and returns the created device.
func (*VMDeviceService) Delete ¶
func (s *VMDeviceService) Delete(ctx context.Context, deviceID int) error
Delete deletes a device.
func (*VMDeviceService) Update ¶
func (s *VMDeviceService) Update(ctx context.Context, deviceID int, req *VMDeviceUpdateRequest) (*VMDevice, error)
Update updates a device and returns the updated device.
type VMDeviceServiceInterface ¶
type VMDeviceServiceInterface interface {
List(ctx context.Context, vmID int) ([]VMDevice, error)
Get(ctx context.Context, deviceID int) (*VMDevice, error)
Create(ctx context.Context, vmID int, req *VMDeviceCreateRequest) (*VMDevice, error)
Update(ctx context.Context, deviceID int, req *VMDeviceUpdateRequest) (*VMDevice, error)
Delete(ctx context.Context, deviceID int) error
}
VMDeviceServiceInterface defines the interface for VM Device operations.
type VMDeviceUpdateRequest ¶
type VMDeviceUpdateRequest struct {
// OrderID is the device order (0-64).
OrderID *int `json:"orderid,omitempty"`
// Name is the device name.
Name *string `json:"name,omitempty"`
// Description is the description.
Description *string `json:"description,omitempty"`
// ResourceGroup is the resource group ID.
ResourceGroup *int `json:"resource_group,omitempty"`
// UUID is the device UUID.
UUID *string `json:"uuid,omitempty"`
// Enabled indicates whether the device is enabled.
Enabled *bool `json:"enabled,omitempty"`
// Optional allows the machine to start without this device if unavailable.
Optional *bool `json:"optional,omitempty"`
// Asset is the asset tag.
Asset *string `json:"asset,omitempty"`
// USB settings (only for USB devices)
USBSettings *USBDeviceSettings `json:"-"`
// TPM settings (only for TPM devices)
TPMSettings *TPMDeviceSettings `json:"-"`
// vGPU settings (only for vGPU devices)
VGPUSettings *VGPUDeviceSettings `json:"-"`
}
VMDeviceUpdateRequest is the request body for updating a device.
type VMDrive ¶
type VMDrive struct {
// ID is the unique identifier for the drive.
ID FlexInt `json:"$key,omitempty"`
// Machine is the machine reference ID.
Machine int `json:"machine,omitempty"`
// OrderID is the boot order ID.
OrderID int `json:"orderid,omitempty"`
// Name is the drive name.
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// Interface is the disk interface. Valid values:
// - virtio-scsi (default, recommended)
// - virtio (legacy paravirtual)
// - ide, ahci (SATA), nvme
// - lsi53c895a, megasas, megasas-gen2, mptsas1068 (SCSI)
// - cifs, nfs, vsan (pass-through)
// - usb, pflash, direct, tpm_state
Interface string `json:"interface,omitempty"`
// Media is the media type (disk, cdrom, efidisk, import, 9p, dir, clone, nonpersistent, etc.).
Media string `json:"media,omitempty"`
// File is the file ID (for cdrom/import).
File FlexInt `json:"media_source,omitempty"`
// SizeGB is the disk size in GB.
SizeGB int64 `json:"-"`
// SizeBytes is the disk size in bytes.
SizeBytes int64 `json:"disksize,omitempty"`
// UsedBytes is the actual used space in bytes (read-only).
UsedBytes int64 `json:"used_bytes,omitempty"`
// PreferredTier is the preferred storage tier (1-5).
PreferredTier string `json:"preferred_tier,omitempty"`
// Enabled indicates whether the drive is enabled.
Enabled bool `json:"enabled"`
// ReadOnly indicates whether the drive is read-only.
ReadOnly bool `json:"readonly,omitempty"`
// Optimize is the optimization setting (general, large).
Optimize string `json:"optimize,omitempty"`
// Serial is the drive serial number.
Serial string `json:"serial,omitempty"`
// Fsync is the strict fsync setting ("" = system default, "0" = off, "1" = on).
Fsync string `json:"fsync,omitempty"`
// Discard enables TRIM/discard support (default true).
Discard bool `json:"discard,omitempty"`
// Advanced contains advanced properties (newline-delimited key=value pairs).
Advanced string `json:"advanced,omitempty"`
// Asset is the asset tag (used for recipe/snapshot identification).
Asset string `json:"asset,omitempty"`
// PreserveDriveFormat indicates whether to preserve the drive format.
PreserveDriveFormat bool `json:"preserve_drive_format,omitempty"`
// PowerState is the drive power state ("online" or "offline").
PowerState string `json:"powerState,omitempty"`
// Status is the drive status (e.g., "importing").
Status string `json:"status,omitempty"`
}
VMDrive represents a virtual disk attached to a VM.
type VMDriveCreateRequest ¶
type VMDriveCreateRequest struct {
// Machine is the VM's machine ID.
Machine int `json:"machine"`
// OrderID is the boot order ID (auto-assigned if not specified).
OrderID *int `json:"orderid,omitempty"`
// Name is the drive name.
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// Interface is the disk interface. Valid values: virtio-scsi (default), virtio, ide, ahci, nvme, usb, etc.
Interface string `json:"interface,omitempty"`
// Media is the media type (disk, cdrom, efidisk, import, etc.).
Media string `json:"media,omitempty"`
// File is the file ID (for cdrom/import).
File int `json:"media_source,omitempty"`
// SizeGB is the disk size in GB.
SizeGB int64 `json:"-"`
// SizeBytes is the disk size in bytes (set from SizeGB).
SizeBytes int64 `json:"disksize,omitempty"`
// PreferredTier is the preferred storage tier (1-5).
PreferredTier string `json:"preferred_tier,omitempty"`
// Enabled indicates whether the drive is enabled.
Enabled *bool `json:"enabled,omitempty"`
// ReadOnly indicates whether the drive is read-only.
ReadOnly *bool `json:"readonly,omitempty"`
// Optimize is the optimization setting (general, large).
Optimize string `json:"optimize,omitempty"`
// Serial is the drive serial number.
Serial string `json:"serial,omitempty"`
// Fsync is the strict fsync setting ("" = system default, "0" = off, "1" = on).
Fsync string `json:"fsync,omitempty"`
// Discard enables TRIM/discard support.
Discard *bool `json:"discard,omitempty"`
// Advanced contains advanced properties (newline-delimited key=value pairs).
Advanced string `json:"advanced,omitempty"`
// Asset is the asset tag.
Asset string `json:"asset,omitempty"`
// PreserveDriveFormat indicates whether to preserve the drive format.
PreserveDriveFormat *bool `json:"preserve_drive_format,omitempty"`
}
VMDriveCreateRequest is the request body for creating a drive.
type VMDriveService ¶
type VMDriveService struct {
// contains filtered or unexported fields
}
VMDriveService handles VM drive operations.
func (*VMDriveService) Create ¶
func (s *VMDriveService) Create(ctx context.Context, vmID int, req *VMDriveCreateRequest) (*VMDrive, error)
Create creates a new drive and returns the created drive. For import media, this method waits for the import to complete.
func (*VMDriveService) Delete ¶
func (s *VMDriveService) Delete(ctx context.Context, driveID int) error
Delete deletes a drive. If the drive is currently attached (VM running), it will be hot-unplugged first.
func (*VMDriveService) HotUnplugDrive ¶ added in v0.1.6
func (s *VMDriveService) HotUnplugDrive(ctx context.Context, vmID, driveID int) error
HotUnplugDrive hot-unplugs a drive from a running VM. vmID is the VM's $key (not the internal machine reference).
func (*VMDriveService) HotplugDrive ¶ added in v0.1.6
func (s *VMDriveService) HotplugDrive(ctx context.Context, vmID, driveID int) error
HotplugDrive hot-plugs a drive into a running VM, making it visible to the guest OS. vmID is the VM's $key (not the internal machine reference). The drive must already be assigned to the VM (machine field set) before calling this.
func (*VMDriveService) Update ¶
func (s *VMDriveService) Update(ctx context.Context, driveID int, req *VMDriveUpdateRequest) (*VMDrive, error)
Update updates a drive and returns the updated drive.
type VMDriveServiceInterface ¶
type VMDriveServiceInterface interface {
List(ctx context.Context, vmID int) ([]VMDrive, error)
Get(ctx context.Context, driveID int) (*VMDrive, error)
Create(ctx context.Context, vmID int, req *VMDriveCreateRequest) (*VMDrive, error)
Update(ctx context.Context, driveID int, req *VMDriveUpdateRequest) (*VMDrive, error)
Delete(ctx context.Context, driveID int) error
HotplugDrive(ctx context.Context, vmID, driveID int) error
HotUnplugDrive(ctx context.Context, vmID, driveID int) error
}
VMDriveServiceInterface defines the interface for VM Drive operations.
type VMDriveUpdateRequest ¶
type VMDriveUpdateRequest struct {
// Machine is the VM to move this drive to. Used for hotplug attach/detach.
Machine *int `json:"machine,omitempty"`
// OrderID is the boot order ID.
OrderID *int `json:"orderid,omitempty"`
// Name is the drive name.
Name *string `json:"name,omitempty"`
// Description is the description.
Description *string `json:"description,omitempty"`
// Interface is the disk interface. Valid values: virtio-scsi (default), virtio, ide, ahci, nvme, usb, etc.
Interface *string `json:"interface,omitempty"`
// SizeGB is the disk size in GB (can only increase).
SizeGB *int64 `json:"-"`
// SizeBytes is the disk size in bytes.
SizeBytes *int64 `json:"disksize,omitempty"`
// PreferredTier is the preferred storage tier (1-5).
PreferredTier *string `json:"preferred_tier,omitempty"`
// Enabled indicates whether the drive is enabled.
Enabled *bool `json:"enabled,omitempty"`
// ReadOnly indicates whether the drive is read-only.
ReadOnly *bool `json:"readonly,omitempty"`
// Optimize is the optimization setting (general, large).
Optimize *string `json:"optimize,omitempty"`
// Serial is the drive serial number.
Serial *string `json:"serial,omitempty"`
// Fsync is the strict fsync setting ("" = system default, "0" = off, "1" = on).
Fsync *string `json:"fsync,omitempty"`
// Discard enables TRIM/discard support.
Discard *bool `json:"discard,omitempty"`
// Advanced contains advanced properties (newline-delimited key=value pairs).
Advanced *string `json:"advanced,omitempty"`
// Asset is the asset tag.
Asset *string `json:"asset,omitempty"`
// PreserveDriveFormat indicates whether to preserve the drive format.
PreserveDriveFormat *bool `json:"preserve_drive_format,omitempty"`
}
VMDriveUpdateRequest is the request body for updating a drive.
type VMMigrateOptions ¶
type VMMigrateOptions struct {
// TargetNode is the destination node ID (required).
TargetNode int
// Live indicates whether to perform a live migration (default: true).
Live *bool
}
VMMigrateOptions contains options for migrating a VM to another node.
type VMNIC ¶
type VMNIC struct {
// ID is the unique identifier for the NIC.
ID FlexInt `json:"$key,omitempty"`
// Machine is the machine reference ID.
Machine int `json:"machine,omitempty"`
// OrderID is the NIC order (0-30).
OrderID int `json:"orderid,omitempty"`
// Name is the NIC name.
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// Interface is the interface type (virtio, e1000, e1000e, rtl8139, pcnet, igb, vmxnet3, direct).
Interface string `json:"interface,omitempty"`
// Driver is the network driver.
Driver string `json:"driver,omitempty"`
// Model is the NIC model.
Model string `json:"model,omitempty"`
// Vendor is the NIC vendor.
Vendor string `json:"vendor,omitempty"`
// Port is the port number.
Port int `json:"port,omitempty"`
// Enabled indicates whether the NIC is enabled.
Enabled bool `json:"enabled"`
// DisableMQ disables multiqueue for this NIC.
DisableMQ bool `json:"disable_mq,omitempty"`
// VNET is the virtual network ID.
VNET FlexInt `json:"vnet,omitempty"`
// MAC is the MAC address.
MAC string `json:"macaddress,omitempty"`
// IPAddress is the assigned IP address.
IPAddress string `json:"ipaddress,omitempty"`
// Asset is the asset tag (used for recipe/snapshot identification).
Asset string `json:"asset,omitempty"`
// Device is the device name (read-only).
Device string `json:"device,omitempty"`
// PowerState is the NIC power state ("up" or "down").
PowerState string `json:"powerState,omitempty"`
}
VMNIC represents a network interface attached to a VM.
type VMNICCreateRequest ¶
type VMNICCreateRequest struct {
// Machine is the VM's machine ID.
Machine int `json:"machine"`
// OrderID is the NIC order (0-30, auto-assigned if not specified).
OrderID *int `json:"orderid,omitempty"`
// Name is the NIC name.
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// Interface is the interface type (virtio, e1000, e1000e, rtl8139, pcnet, igb, vmxnet3, direct).
Interface string `json:"interface,omitempty"`
// Driver is the network driver.
Driver string `json:"driver,omitempty"`
// Model is the NIC model.
Model string `json:"model,omitempty"`
// Vendor is the NIC vendor.
Vendor string `json:"vendor,omitempty"`
// Port is the port number.
Port *int `json:"port,omitempty"`
// Enabled indicates whether the NIC is enabled.
Enabled *bool `json:"enabled,omitempty"`
// DisableMQ disables multiqueue for this NIC.
DisableMQ *bool `json:"disable_mq,omitempty"`
// VNET is the virtual network ID.
VNET int `json:"vnet,omitempty"`
// MAC is the MAC address (optional, auto-generated if not specified).
MAC string `json:"macaddress,omitempty"`
// AssignIPAddress indicates whether to assign an IP address.
AssignIPAddress bool `json:"-"` // Handled separately via vnet_addresses
// Asset is the asset tag (used for recipe/snapshot identification).
Asset string `json:"asset,omitempty"`
}
VMNICCreateRequest is the request body for creating a NIC.
type VMNICService ¶
type VMNICService struct {
// contains filtered or unexported fields
}
VMNICService handles VM NIC operations.
func (*VMNICService) Create ¶
func (s *VMNICService) Create(ctx context.Context, vmID int, req *VMNICCreateRequest) (*VMNIC, error)
Create creates a new NIC and returns the created NIC.
func (*VMNICService) Delete ¶
func (s *VMNICService) Delete(ctx context.Context, nicID int) error
Delete deletes a NIC. If the NIC is currently plugged in (VM running), it will be hot-unplugged first.
func (*VMNICService) Update ¶
func (s *VMNICService) Update(ctx context.Context, nicID int, req *VMNICUpdateRequest) (*VMNIC, error)
Update updates a NIC and returns the updated NIC.
type VMNICServiceInterface ¶
type VMNICServiceInterface interface {
List(ctx context.Context, vmID int) ([]VMNIC, error)
Get(ctx context.Context, nicID int) (*VMNIC, error)
Create(ctx context.Context, vmID int, req *VMNICCreateRequest) (*VMNIC, error)
Update(ctx context.Context, nicID int, req *VMNICUpdateRequest) (*VMNIC, error)
Delete(ctx context.Context, nicID int) error
}
VMNICServiceInterface defines the interface for VM NIC operations.
type VMNICUpdateRequest ¶
type VMNICUpdateRequest struct {
// OrderID is the NIC order (0-30).
OrderID *int `json:"orderid,omitempty"`
// Name is the NIC name.
Name *string `json:"name,omitempty"`
// Description is the description.
Description *string `json:"description,omitempty"`
// Interface is the interface type (virtio, e1000, e1000e, rtl8139, pcnet, igb, vmxnet3, direct).
Interface *string `json:"interface,omitempty"`
// Driver is the network driver.
Driver *string `json:"driver,omitempty"`
// Model is the NIC model.
Model *string `json:"model,omitempty"`
// Vendor is the NIC vendor.
Vendor *string `json:"vendor,omitempty"`
// Port is the port number.
Port *int `json:"port,omitempty"`
// Enabled indicates whether the NIC is enabled.
Enabled *bool `json:"enabled,omitempty"`
// DisableMQ disables multiqueue for this NIC.
DisableMQ *bool `json:"disable_mq,omitempty"`
// VNET is the virtual network ID.
VNET *int `json:"vnet,omitempty"`
// Asset is the asset tag.
Asset *string `json:"asset,omitempty"`
}
VMNICUpdateRequest is the request body for updating a NIC.
type VMService ¶
type VMService struct {
// contains filtered or unexported fields
}
VMService handles VM operations.
func (*VMService) GetConsoleURL ¶
GetConsoleURL returns the console URL for a VM.
func (*VMService) GuestReboot ¶
GuestReboot sends a reboot request to the guest OS via ACPI.
func (*VMService) GuestShutdown ¶
GuestShutdown sends a graceful shutdown request to the guest OS via ACPI (poweroff action).
func (*VMService) Migrate ¶
Migrate migrates a VM to another node. Live migration moves the VM without downtime if Live is true (default).
func (*VMService) Reset ¶
Reset sends a reset signal to a running VM (equivalent to pressing the reset button).
type VMServiceInterface ¶
type VMServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]VM, error)
Get(ctx context.Context, id int) (*VM, error)
Create(ctx context.Context, req *VMCreateRequest) (*VM, error)
Update(ctx context.Context, id int, req *VMUpdateRequest) (*VM, error)
Delete(ctx context.Context, id int) error
PowerOn(ctx context.Context, id int) error
PowerOff(ctx context.Context, id int) error
Reset(ctx context.Context, id int) error
GuestReboot(ctx context.Context, id int) error
GuestShutdown(ctx context.Context, id int) error
Clone(ctx context.Context, id int, opts *VMCloneOptions) error
Snapshot(ctx context.Context, id int, opts *VMSnapshotOptions) error
Migrate(ctx context.Context, id int, opts *VMMigrateOptions) error
GetConsoleURL(ctx context.Context, id int) (string, error)
}
VMServiceInterface defines the interface for VM operations.
type VMSnapshot ¶
type VMSnapshot struct {
// Key is the unique identifier for the snapshot.
Key FlexInt `json:"$key,omitempty"`
// Machine is the VM ID this snapshot belongs to.
Machine FlexInt `json:"machine,omitempty"`
// SnapMachine is the internal snapshot machine reference.
SnapMachine FlexInt `json:"snap_machine,omitempty"`
// Name is the snapshot name.
Name string `json:"name"`
// Description is an optional description of the snapshot.
Description string `json:"description,omitempty"`
// Created is the creation timestamp (Unix epoch).
Created int64 `json:"created,omitempty"`
// Expires is the expiration timestamp (Unix epoch). 0 means never expires.
Expires int64 `json:"expires,omitempty"`
// ExpiresType is the expiration type ("never" or "date").
ExpiresType string `json:"expires_type,omitempty"`
// CreatedManually indicates whether the snapshot was created manually.
CreatedManually bool `json:"created_manually,omitempty"`
// Quiesce indicates whether the snapshot should quiesce the filesystem.
Quiesce bool `json:"quiesce,omitempty"`
// Quiesced indicates whether the snapshot was quiesced.
Quiesced bool `json:"quiesced,omitempty"`
// QueueDelete indicates whether the snapshot is queued for deletion.
QueueDelete bool `json:"queue_delete,omitempty"`
// SnapshotPeriod is the snapshot profile period ID (if scheduled).
SnapshotPeriod FlexInt `json:"snapshot_period,omitempty"`
// MachineDisplay is the display name of the parent machine.
MachineDisplay string `json:"machine_display,omitempty"`
// SnapshotProfile is the snapshot profile name (from join).
SnapshotProfile string `json:"snapshot_profile,omitempty"`
}
VMSnapshot represents a snapshot of a virtual machine in VergeOS. VM Snapshots are point-in-time copies of a VM's state that can be restored.
type VMSnapshotCreateRequest ¶
type VMSnapshotCreateRequest struct {
// Machine is the VM ID to snapshot (required).
Machine int `json:"machine"`
// Name is the snapshot name (required).
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// ExpiresType is the expiration type ("never" or "date"). Defaults to "date".
ExpiresType string `json:"expires_type,omitempty"`
// Expires is the expiration timestamp (Unix epoch). Defaults to 3 days from creation.
Expires *int64 `json:"expires,omitempty"`
// Quiesce indicates whether to quiesce the filesystem (requires guest agent).
Quiesce *bool `json:"quiesce,omitempty"`
}
VMSnapshotCreateRequest is the request body for creating a VM snapshot.
type VMSnapshotOptions ¶
type VMSnapshotOptions struct {
// Retention is the snapshot retention duration in seconds. Defaults to 86400 (24 hours).
Retention int
// Quiesce indicates whether to quiesce the filesystem before snapshot (requires guest agent).
Quiesce bool
}
VMSnapshotOptions contains options for taking a VM snapshot.
type VMSnapshotRestoreOptions ¶
type VMSnapshotRestoreOptions struct {
// PowerOn indicates whether to power on the VM after restore.
PowerOn bool
}
VMSnapshotRestoreOptions contains options for restoring a VM snapshot.
type VMSnapshotService ¶
type VMSnapshotService struct {
// contains filtered or unexported fields
}
VMSnapshotService handles VM snapshot operations. VM Snapshots are point-in-time copies of a VM's state.
func (*VMSnapshotService) Create ¶
func (s *VMSnapshotService) Create(ctx context.Context, req *VMSnapshotCreateRequest) (*VMSnapshot, error)
Create creates a new VM snapshot and returns the created snapshot.
func (*VMSnapshotService) Delete ¶
func (s *VMSnapshotService) Delete(ctx context.Context, id int) error
Delete deletes a VM snapshot.
func (*VMSnapshotService) Get ¶
func (s *VMSnapshotService) Get(ctx context.Context, id int) (*VMSnapshot, error)
Get returns a single VM snapshot by ID.
func (*VMSnapshotService) GetByName ¶
func (s *VMSnapshotService) GetByName(ctx context.Context, vmID int, name string) (*VMSnapshot, error)
GetByName returns a VM snapshot by name within a specific VM.
func (*VMSnapshotService) List ¶
func (s *VMSnapshotService) List(ctx context.Context, opts ...ListOption) ([]VMSnapshot, error)
List returns all VM snapshots, with optional filtering and pagination.
func (*VMSnapshotService) ListByVM ¶
func (s *VMSnapshotService) ListByVM(ctx context.Context, vmID int, opts ...ListOption) ([]VMSnapshot, error)
ListByVM returns all snapshots for a specific VM.
func (*VMSnapshotService) ListExpiring ¶
func (s *VMSnapshotService) ListExpiring(ctx context.Context, days int, opts ...ListOption) ([]VMSnapshot, error)
ListExpiring returns snapshots expiring within the specified number of days.
func (*VMSnapshotService) Restore ¶
func (s *VMSnapshotService) Restore(ctx context.Context, id int, opts *VMSnapshotRestoreOptions) error
Restore restores a VM from a snapshot. The VM will be reverted to the state at the time of the snapshot.
func (*VMSnapshotService) SetExpires ¶
func (s *VMSnapshotService) SetExpires(ctx context.Context, id int, expires int64) (*VMSnapshot, error)
SetExpires sets the expiration timestamp for a snapshot.
func (*VMSnapshotService) SetNeverExpires ¶
func (s *VMSnapshotService) SetNeverExpires(ctx context.Context, id int) (*VMSnapshot, error)
SetNeverExpires sets a snapshot to never expire.
func (*VMSnapshotService) Update ¶
func (s *VMSnapshotService) Update(ctx context.Context, id int, req *VMSnapshotUpdateRequest) (*VMSnapshot, error)
Update updates a VM snapshot and returns the updated snapshot.
type VMSnapshotServiceInterface ¶
type VMSnapshotServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]VMSnapshot, error)
ListByVM(ctx context.Context, vmID int, opts ...ListOption) ([]VMSnapshot, error)
ListExpiring(ctx context.Context, days int, opts ...ListOption) ([]VMSnapshot, error)
Get(ctx context.Context, id int) (*VMSnapshot, error)
GetByName(ctx context.Context, vmID int, name string) (*VMSnapshot, error)
Create(ctx context.Context, req *VMSnapshotCreateRequest) (*VMSnapshot, error)
Update(ctx context.Context, id int, req *VMSnapshotUpdateRequest) (*VMSnapshot, error)
Delete(ctx context.Context, id int) error
Restore(ctx context.Context, id int, opts *VMSnapshotRestoreOptions) error
SetNeverExpires(ctx context.Context, id int) (*VMSnapshot, error)
SetExpires(ctx context.Context, id int, expires int64) (*VMSnapshot, error)
}
VMSnapshotServiceInterface defines the interface for VM Snapshot operations.
type VMSnapshotUpdateRequest ¶
type VMSnapshotUpdateRequest struct {
// Name is the snapshot name.
Name *string `json:"name,omitempty"`
// Description is the snapshot description.
Description *string `json:"description,omitempty"`
// ExpiresType is the expiration type ("never" or "date").
ExpiresType *string `json:"expires_type,omitempty"`
// Expires is the expiration timestamp (Unix epoch).
Expires *int64 `json:"expires,omitempty"`
}
VMSnapshotUpdateRequest is the request body for updating a VM snapshot.
type VMUpdateRequest ¶
type VMUpdateRequest struct {
// Name is the VM name.
Name *string `json:"name,omitempty"`
// Description is the VM description.
Description *string `json:"description,omitempty"`
// Enabled indicates whether the VM is enabled.
Enabled *bool `json:"enabled,omitempty"`
// OwnerUser is the owner user ID.
OwnerUser *int `json:"owner_user,omitempty"`
// Cluster configuration
// Cluster is the cluster the VM belongs to.
Cluster *int `json:"cluster,omitempty"`
// ClusterFailover is the failover cluster ID.
ClusterFailover *int `json:"cluster_failover,omitempty"`
// Hardware configuration
// CPUCores is the number of CPU cores.
CPUCores *int `json:"cpu_cores,omitempty"`
// CPUType is the CPU type.
CPUType *string `json:"cpu_type,omitempty"`
// RAM is the amount of RAM in MB.
RAM *int `json:"ram,omitempty"`
// MachineType is the machine type.
MachineType *string `json:"machine_type,omitempty"`
// IOMMU indicates whether IOMMU is enabled.
IOMMU *bool `json:"iommu,omitempty"`
// USBLegacy indicates whether to use a legacy USB controller.
USBLegacy *bool `json:"usb_legacy,omitempty"`
// Boot configuration
// UEFI indicates whether UEFI boot is enabled.
UEFI *bool `json:"uefi,omitempty"`
// SecureBoot indicates whether Secure Boot is enabled.
SecureBoot *bool `json:"secure_boot,omitempty"`
// BootOrder specifies the boot device order.
BootOrder *string `json:"boot_order,omitempty"`
// BootDelay is the boot delay in seconds.
BootDelay *int `json:"boot_delay,omitempty"`
// Display and console
// Console is the console type.
Console *string `json:"console,omitempty"`
// Display is the display type.
Display *string `json:"display,omitempty"`
// Video is the video adapter type.
Video *string `json:"video,omitempty"`
// Sound is the sound device type.
Sound *string `json:"sound,omitempty"`
// SerialPort indicates whether the serial port is enabled.
SerialPort *bool `json:"serial_port,omitempty"`
// ConsolePassEnabled indicates whether console password is enabled.
ConsolePassEnabled *bool `json:"console_pass_enabled,omitempty"`
// ConsolePass is the console password.
ConsolePass *string `json:"console_pass,omitempty"`
// OS configuration
// OSFamily is the operating system family.
OSFamily *string `json:"os_family,omitempty"`
// OSDescription is the operating system description.
OSDescription *string `json:"os_description,omitempty"`
// RTCBase is the RTC base setting.
RTCBase *string `json:"rtc_base,omitempty"`
// Features
// AllowHotplug indicates whether hotplug is allowed.
AllowHotplug *bool `json:"allow_hotplug,omitempty"`
// DisablePowercycle indicates whether power cycling is disabled.
DisablePowercycle *bool `json:"disable_powercycle,omitempty"`
// USBTablet indicates whether USB tablet is enabled.
USBTablet *bool `json:"usb_tablet,omitempty"`
// GuestAgent indicates whether the guest agent is enabled.
GuestAgent *bool `json:"guest_agent,omitempty"`
// NestedVirtualization indicates whether nested virtualization is enabled.
NestedVirtualization *bool `json:"nested_virtualization,omitempty"`
// DisableHypervisor indicates whether the hypervisor is disabled.
DisableHypervisor *bool `json:"disable_hypervisor,omitempty"`
// AllowExport indicates whether this VM can be exported to NAS.
AllowExport *bool `json:"allow_export,omitempty"`
// Cloud-Init configuration
// CloudInitDataSource is the cloud-init data source.
CloudInitDataSource *string `json:"cloudinit_datasource,omitempty"`
// Scheduling and availability
// PreferredNode is the preferred node for the VM.
PreferredNode *int `json:"preferred_node,omitempty"`
// HAGroup is the HA group the VM belongs to.
HAGroup *string `json:"ha_group,omitempty"`
// SnapshotProfile is the snapshot profile ID.
SnapshotProfile *int `json:"snapshot_profile,omitempty"`
// OnPowerLoss is the behavior when power is restored.
OnPowerLoss *string `json:"on_power_loss,omitempty"`
// MigrationMethod is the migration method (auto/live).
MigrationMethod *string `json:"migration_method,omitempty"`
// PowerCycleTimeout is the migration power-cycle timeout.
PowerCycleTimeout *int `json:"power_cycle_timeout,omitempty"`
// Advanced configuration
// Advanced is the advanced configuration.
Advanced *string `json:"advanced,omitempty"`
// Note is a free-form note about the VM.
Note *string `json:"note,omitempty"`
// PasteKeyConfig is the paste key mapping configuration ID.
PasteKeyConfig *int `json:"paste_key_config,omitempty"`
}
VMUpdateRequest is the request body for updating a VM.
type VNetAddress ¶
type VNetAddress struct {
// Key is the unique identifier for the address.
Key FlexInt `json:"$key,omitempty"`
// VNet is the parent network ID.
VNet FlexInt `json:"vnet,omitempty"`
// IP is the IP address (e.g., "192.168.1.100").
IP string `json:"ip,omitempty"`
// MAC is the MAC address associated with this IP.
MAC string `json:"mac,omitempty"`
// Type indicates the address type (dynamic, static, ipalias, proxy, virtual).
Type string `json:"type,omitempty"`
// Hostname is the hostname associated with this IP.
Hostname string `json:"hostname,omitempty"`
// Expiration is the lease expiration timestamp for dynamic addresses (Unix epoch).
Expiration int64 `json:"expiration,omitempty"`
// Owner is the owner reference path (e.g., "machine_nics/123") (readonly).
Owner string `json:"owner,omitempty"`
// Vendor is the NIC vendor name derived from the MAC address (readonly).
Vendor string `json:"vendor,omitempty"`
// Description is an optional description for the address.
Description string `json:"description,omitempty"`
}
VNetAddress represents a VergeOS network IP address. Addresses can be dynamic (DHCP), static, IP aliases, proxy ARP, or virtual IPs.
type VNetAddressCreateRequest ¶
type VNetAddressCreateRequest struct {
// VNet is the parent network ID (required).
VNet int `json:"vnet"`
// IP is the IP address (required for static addresses, auto-assigned for dynamic).
IP string `json:"ip,omitempty"`
// MAC is the MAC address (optional).
MAC string `json:"mac,omitempty"`
// Type indicates the address type (required: dynamic, static, ipalias, proxy, virtual).
Type string `json:"type"`
// Hostname is the hostname (optional).
Hostname string `json:"hostname,omitempty"`
// Description is an optional description.
Description string `json:"description,omitempty"`
}
VNetAddressCreateRequest is the request body for creating a network address.
type VNetAddressService ¶
type VNetAddressService struct {
// contains filtered or unexported fields
}
VNetAddressService handles network IP address operations.
func (*VNetAddressService) Create ¶
func (s *VNetAddressService) Create(ctx context.Context, req *VNetAddressCreateRequest) (*VNetAddress, error)
Create creates a new network address and returns the created address.
func (*VNetAddressService) Delete ¶
func (s *VNetAddressService) Delete(ctx context.Context, id int) error
Delete deletes a network address.
func (*VNetAddressService) Get ¶
func (s *VNetAddressService) Get(ctx context.Context, id int) (*VNetAddress, error)
Get returns a single address by ID.
func (*VNetAddressService) GetByIP ¶
func (s *VNetAddressService) GetByIP(ctx context.Context, vnetID int, ip string) (*VNetAddress, error)
GetByIP returns an address by IP within a specific network.
func (*VNetAddressService) GetByMAC ¶
func (s *VNetAddressService) GetByMAC(ctx context.Context, vnetID int, mac string) (*VNetAddress, error)
GetByMAC returns an address by MAC address within a specific network.
func (*VNetAddressService) List ¶
func (s *VNetAddressService) List(ctx context.Context, opts ...ListOption) ([]VNetAddress, error)
List returns all network addresses, with optional filtering and pagination.
func (*VNetAddressService) ListByNetwork ¶
func (s *VNetAddressService) ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]VNetAddress, error)
ListByNetwork returns all addresses for a specific network.
func (*VNetAddressService) ListByType ¶
func (s *VNetAddressService) ListByType(ctx context.Context, vnetID int, addrType string, opts ...ListOption) ([]VNetAddress, error)
ListByType returns all addresses of a specific type within a network.
func (*VNetAddressService) Update ¶
func (s *VNetAddressService) Update(ctx context.Context, id int, req *VNetAddressUpdateRequest) (*VNetAddress, error)
Update updates an address and returns the updated address.
type VNetAddressServiceInterface ¶
type VNetAddressServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]VNetAddress, error)
ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]VNetAddress, error)
ListByType(ctx context.Context, vnetID int, addrType string, opts ...ListOption) ([]VNetAddress, error)
Get(ctx context.Context, id int) (*VNetAddress, error)
GetByIP(ctx context.Context, vnetID int, ip string) (*VNetAddress, error)
GetByMAC(ctx context.Context, vnetID int, mac string) (*VNetAddress, error)
Create(ctx context.Context, req *VNetAddressCreateRequest) (*VNetAddress, error)
Update(ctx context.Context, id int, req *VNetAddressUpdateRequest) (*VNetAddress, error)
Delete(ctx context.Context, id int) error
}
VNetAddressServiceInterface defines the interface for network IP address operations.
type VNetAddressUpdateRequest ¶
type VNetAddressUpdateRequest struct {
// IP is the IP address.
IP *string `json:"ip,omitempty"`
// MAC is the MAC address.
MAC *string `json:"mac,omitempty"`
// Type indicates the address type.
Type *string `json:"type,omitempty"`
// Hostname is the hostname.
Hostname *string `json:"hostname,omitempty"`
// Description is the description.
Description *string `json:"description,omitempty"`
}
VNetAddressUpdateRequest is the request body for updating a network address.
type VNetDNSRecord ¶
type VNetDNSRecord struct {
// Key is the unique identifier for the record.
Key FlexInt `json:"$key,omitempty"`
// Zone is the parent DNS zone ID.
Zone FlexInt `json:"zone,omitempty"`
// Host is the record hostname (empty inherits from previous record or domain).
Host string `json:"host,omitempty"`
// TTL is the record time-to-live (e.g., "1h", "30m").
TTL string `json:"ttl,omitempty"`
// Type is the record type (A, AAAA, CNAME, MX, NS, PTR, SRV, TXT, CAA).
Type string `json:"type,omitempty"`
// Value is the record value (IP for A, hostname for CNAME, etc.).
Value string `json:"value"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// MXPreference is the MX record preference (0-65535).
MXPreference int `json:"mx_preference,omitempty"`
// Weight is the SRV record weight (0-65535).
Weight int `json:"weight,omitempty"`
// Port is the SRV record port (0-65535).
Port int `json:"port,omitempty"`
// IssueWildcard is for CAA records - issue only wildcard certificates.
IssueWildcard bool `json:"issue_wildcard,omitempty"`
// OrderID determines the record display order.
OrderID int `json:"orderid,omitempty"`
// Modified is the last modification timestamp (Unix epoch).
Modified int64 `json:"modified,omitempty"`
}
VNetDNSRecord represents a VergeOS network DNS zone record.
type VNetDNSRecordCreateRequest ¶
type VNetDNSRecordCreateRequest struct {
// Zone is the parent DNS zone ID (required).
Zone int `json:"zone"`
// Host is the record hostname.
Host string `json:"host,omitempty"`
// TTL is the record time-to-live.
TTL *string `json:"ttl,omitempty"`
// Type is the record type (required: A, AAAA, CNAME, MX, NS, PTR, SRV, TXT, CAA).
Type string `json:"type"`
// Value is the record value (required).
Value string `json:"value"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// MXPreference is the MX record preference.
MXPreference *int `json:"mx_preference,omitempty"`
// Weight is the SRV record weight.
Weight *int `json:"weight,omitempty"`
// Port is the SRV record port.
Port *int `json:"port,omitempty"`
// IssueWildcard is for CAA records.
IssueWildcard *bool `json:"issue_wildcard,omitempty"`
// OrderID determines the record display order.
OrderID *int `json:"orderid,omitempty"`
}
VNetDNSRecordCreateRequest is the request body for creating a DNS record.
type VNetDNSRecordService ¶
type VNetDNSRecordService struct {
// contains filtered or unexported fields
}
VNetDNSRecordService handles network DNS record operations.
func (*VNetDNSRecordService) Create ¶
func (s *VNetDNSRecordService) Create(ctx context.Context, req *VNetDNSRecordCreateRequest) (*VNetDNSRecord, error)
Create creates a new DNS record and returns the created record.
func (*VNetDNSRecordService) Delete ¶
func (s *VNetDNSRecordService) Delete(ctx context.Context, id int) error
Delete deletes a DNS record.
func (*VNetDNSRecordService) Get ¶
func (s *VNetDNSRecordService) Get(ctx context.Context, id int) (*VNetDNSRecord, error)
Get returns a single DNS record by ID.
func (*VNetDNSRecordService) GetByHostAndType ¶
func (s *VNetDNSRecordService) GetByHostAndType(ctx context.Context, zoneID int, host, recordType string) (*VNetDNSRecord, error)
GetByHostAndType returns a DNS record by host and type within a zone.
func (*VNetDNSRecordService) List ¶
func (s *VNetDNSRecordService) List(ctx context.Context, opts ...ListOption) ([]VNetDNSRecord, error)
List returns all DNS records, with optional filtering and pagination.
func (*VNetDNSRecordService) ListByType ¶
func (s *VNetDNSRecordService) ListByType(ctx context.Context, zoneID int, recordType string, opts ...ListOption) ([]VNetDNSRecord, error)
ListByType returns all DNS records of a specific type within a zone.
func (*VNetDNSRecordService) ListByZone ¶
func (s *VNetDNSRecordService) ListByZone(ctx context.Context, zoneID int, opts ...ListOption) ([]VNetDNSRecord, error)
ListByZone returns all DNS records for a specific zone.
func (*VNetDNSRecordService) Update ¶
func (s *VNetDNSRecordService) Update(ctx context.Context, id int, req *VNetDNSRecordUpdateRequest) (*VNetDNSRecord, error)
Update updates a DNS record and returns the updated record.
type VNetDNSRecordServiceInterface ¶
type VNetDNSRecordServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]VNetDNSRecord, error)
ListByZone(ctx context.Context, zoneID int, opts ...ListOption) ([]VNetDNSRecord, error)
ListByType(ctx context.Context, zoneID int, recordType string, opts ...ListOption) ([]VNetDNSRecord, error)
Get(ctx context.Context, id int) (*VNetDNSRecord, error)
GetByHostAndType(ctx context.Context, zoneID int, host, recordType string) (*VNetDNSRecord, error)
Create(ctx context.Context, req *VNetDNSRecordCreateRequest) (*VNetDNSRecord, error)
Update(ctx context.Context, id int, req *VNetDNSRecordUpdateRequest) (*VNetDNSRecord, error)
Delete(ctx context.Context, id int) error
}
VNetDNSRecordServiceInterface defines the interface for network DNS record operations.
type VNetDNSRecordUpdateRequest ¶
type VNetDNSRecordUpdateRequest struct {
// Host is the record hostname.
Host *string `json:"host,omitempty"`
// TTL is the record time-to-live.
TTL *string `json:"ttl,omitempty"`
// Type is the record type.
Type *string `json:"type,omitempty"`
// Value is the record value.
Value *string `json:"value,omitempty"`
// Description is the record description.
Description *string `json:"description,omitempty"`
// MXPreference is the MX record preference.
MXPreference *int `json:"mx_preference,omitempty"`
// Weight is the SRV record weight.
Weight *int `json:"weight,omitempty"`
// Port is the SRV record port.
Port *int `json:"port,omitempty"`
// IssueWildcard is for CAA records.
IssueWildcard *bool `json:"issue_wildcard,omitempty"`
// OrderID determines the record display order.
OrderID *int `json:"orderid,omitempty"`
}
VNetDNSRecordUpdateRequest is the request body for updating a DNS record.
type VNetDNSView ¶
type VNetDNSView struct {
// Key is the unique identifier for the view.
Key FlexInt `json:"$key,omitempty"`
// VNet is the parent network ID.
VNet FlexInt `json:"vnet,omitempty"`
// Name is the view name.
Name string `json:"name"`
// Recursion enables recursive DNS queries for this view.
Recursion bool `json:"recursion,omitempty"`
// MatchClients specifies which clients use this view (e.g., "10/8;172.16/16;").
MatchClients string `json:"match_clients,omitempty"`
// MatchDestinations specifies destination-based view matching.
MatchDestinations string `json:"match_destinations,omitempty"`
// MaxCacheSize is the maximum RAM for caching records in bytes (0 = unlimited).
MaxCacheSize int64 `json:"max_cache_size,omitempty"`
// OrderID determines the view processing order.
OrderID int `json:"orderid,omitempty"`
// QuerySource is the source IP address for outgoing queries.
QuerySource FlexInt `json:"query_source,omitempty"`
// Modified is the last modification timestamp (Unix epoch).
Modified int64 `json:"modified,omitempty"`
}
VNetDNSView represents a VergeOS network DNS view. DNS views allow different DNS responses based on client IP addresses.
type VNetDNSViewCreateRequest ¶
type VNetDNSViewCreateRequest struct {
// VNet is the parent network ID (required).
VNet int `json:"vnet"`
// Name is the view name (required).
Name string `json:"name"`
// Recursion enables recursive DNS queries.
Recursion *bool `json:"recursion,omitempty"`
// MatchClients specifies which clients use this view.
MatchClients *string `json:"match_clients,omitempty"`
// MatchDestinations specifies destination-based view matching.
MatchDestinations *string `json:"match_destinations,omitempty"`
// MaxCacheSize is the maximum RAM for caching records in bytes.
MaxCacheSize *int64 `json:"max_cache_size,omitempty"`
// OrderID determines the view processing order.
OrderID *int `json:"orderid,omitempty"`
// QuerySource is the source IP address for outgoing queries.
QuerySource *int `json:"query_source,omitempty"`
}
VNetDNSViewCreateRequest is the request body for creating a DNS view.
type VNetDNSViewService ¶
type VNetDNSViewService struct {
// contains filtered or unexported fields
}
VNetDNSViewService handles network DNS view operations.
func (*VNetDNSViewService) Create ¶
func (s *VNetDNSViewService) Create(ctx context.Context, req *VNetDNSViewCreateRequest) (*VNetDNSView, error)
Create creates a new DNS view and returns the created view.
func (*VNetDNSViewService) Delete ¶
func (s *VNetDNSViewService) Delete(ctx context.Context, id int) error
Delete deletes a DNS view.
func (*VNetDNSViewService) Get ¶
func (s *VNetDNSViewService) Get(ctx context.Context, id int) (*VNetDNSView, error)
Get returns a single DNS view by ID.
func (*VNetDNSViewService) GetByName ¶
func (s *VNetDNSViewService) GetByName(ctx context.Context, vnetID int, name string) (*VNetDNSView, error)
GetByName returns a DNS view by name within a specific network.
func (*VNetDNSViewService) List ¶
func (s *VNetDNSViewService) List(ctx context.Context, opts ...ListOption) ([]VNetDNSView, error)
List returns all DNS views, with optional filtering and pagination.
func (*VNetDNSViewService) ListByNetwork ¶
func (s *VNetDNSViewService) ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]VNetDNSView, error)
ListByNetwork returns all DNS views for a specific network.
func (*VNetDNSViewService) Update ¶
func (s *VNetDNSViewService) Update(ctx context.Context, id int, req *VNetDNSViewUpdateRequest) (*VNetDNSView, error)
Update updates a DNS view and returns the updated view.
type VNetDNSViewServiceInterface ¶
type VNetDNSViewServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]VNetDNSView, error)
ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]VNetDNSView, error)
Get(ctx context.Context, id int) (*VNetDNSView, error)
GetByName(ctx context.Context, vnetID int, name string) (*VNetDNSView, error)
Create(ctx context.Context, req *VNetDNSViewCreateRequest) (*VNetDNSView, error)
Update(ctx context.Context, id int, req *VNetDNSViewUpdateRequest) (*VNetDNSView, error)
Delete(ctx context.Context, id int) error
}
VNetDNSViewServiceInterface defines the interface for network DNS view operations.
type VNetDNSViewUpdateRequest ¶
type VNetDNSViewUpdateRequest struct {
// Name is the view name.
Name *string `json:"name,omitempty"`
// Recursion enables recursive DNS queries.
Recursion *bool `json:"recursion,omitempty"`
// MatchClients specifies which clients use this view.
MatchClients *string `json:"match_clients,omitempty"`
// MatchDestinations specifies destination-based view matching.
MatchDestinations *string `json:"match_destinations,omitempty"`
// MaxCacheSize is the maximum RAM for caching records in bytes.
MaxCacheSize *int64 `json:"max_cache_size,omitempty"`
// OrderID determines the view processing order.
OrderID *int `json:"orderid,omitempty"`
// QuerySource is the source IP address for outgoing queries.
QuerySource *int `json:"query_source,omitempty"`
}
VNetDNSViewUpdateRequest is the request body for updating a DNS view.
type VNetDNSZone ¶
type VNetDNSZone struct {
// Key is the unique identifier for the zone.
Key FlexInt `json:"$key,omitempty"`
// View is the parent DNS view ID.
View FlexInt `json:"view,omitempty"`
// Domain is the zone domain name.
Domain string `json:"domain"`
// Type is the zone type (master, slave, redirect, forward, static-stub, stub).
Type string `json:"type,omitempty"`
// Nameserver is the primary name server for SOA record.
Nameserver string `json:"nameserver,omitempty"`
// Email is the admin email for SOA record.
Email string `json:"email,omitempty"`
// Notify controls NOTIFY messages (yes, no, explicit).
Notify string `json:"notify,omitempty"`
// AllowNotify specifies servers allowed to send NOTIFY (e.g., "none;").
AllowNotify string `json:"allow_notify,omitempty"`
// AlsoNotify specifies additional servers to send NOTIFY to.
AlsoNotify string `json:"also_notify,omitempty"`
// Masters specifies master servers for slave zones.
Masters string `json:"masters,omitempty"`
// AllowTransfer specifies servers allowed zone transfers (e.g., "none;").
AllowTransfer string `json:"allow_transfer,omitempty"`
// SerialNumber is the SOA serial number (readonly, auto-incremented).
SerialNumber int64 `json:"serial_number,omitempty"`
// DefaultTTL is the default record TTL (e.g., "1h", "30m", "2d").
DefaultTTL string `json:"default_ttl,omitempty"`
// RefreshInterval is the SOA refresh interval.
RefreshInterval string `json:"refresh_interval,omitempty"`
// RetryInterval is the SOA retry interval.
RetryInterval string `json:"retry_interval,omitempty"`
// ExpiryPeriod is the SOA expiry period.
ExpiryPeriod string `json:"expiry_period,omitempty"`
// NegativeTTL is the negative cache TTL.
NegativeTTL string `json:"negative_ttl,omitempty"`
// Forwarders is the list of forwarder servers (e.g., "8.8.8.8;8.8.4.4;").
Forwarders string `json:"forwarders,omitempty"`
// Modified is the last modification timestamp (Unix epoch).
Modified int64 `json:"modified,omitempty"`
}
VNetDNSZone represents a VergeOS network DNS zone.
type VNetDNSZoneCreateRequest ¶
type VNetDNSZoneCreateRequest struct {
// View is the parent DNS view ID (required).
View int `json:"view"`
// Domain is the zone domain name (required).
Domain string `json:"domain"`
// Type is the zone type (default: master).
Type *string `json:"type,omitempty"`
// Nameserver is the primary name server.
Nameserver *string `json:"nameserver,omitempty"`
// Email is the admin email.
Email *string `json:"email,omitempty"`
// Notify controls NOTIFY messages.
Notify *string `json:"notify,omitempty"`
// AllowNotify specifies servers allowed to send NOTIFY.
AllowNotify *string `json:"allow_notify,omitempty"`
// AlsoNotify specifies additional servers to send NOTIFY to.
AlsoNotify *string `json:"also_notify,omitempty"`
// Masters specifies master servers for slave zones.
Masters *string `json:"masters,omitempty"`
// AllowTransfer specifies servers allowed zone transfers.
AllowTransfer *string `json:"allow_transfer,omitempty"`
// DefaultTTL is the default record TTL.
DefaultTTL *string `json:"default_ttl,omitempty"`
// RefreshInterval is the SOA refresh interval.
RefreshInterval *string `json:"refresh_interval,omitempty"`
// RetryInterval is the SOA retry interval.
RetryInterval *string `json:"retry_interval,omitempty"`
// ExpiryPeriod is the SOA expiry period.
ExpiryPeriod *string `json:"expiry_period,omitempty"`
// NegativeTTL is the negative cache TTL.
NegativeTTL *string `json:"negative_ttl,omitempty"`
// Forwarders is the list of forwarder servers.
Forwarders *string `json:"forwarders,omitempty"`
}
VNetDNSZoneCreateRequest is the request body for creating a DNS zone.
type VNetDNSZoneService ¶
type VNetDNSZoneService struct {
// contains filtered or unexported fields
}
VNetDNSZoneService handles network DNS zone operations.
func (*VNetDNSZoneService) Create ¶
func (s *VNetDNSZoneService) Create(ctx context.Context, req *VNetDNSZoneCreateRequest) (*VNetDNSZone, error)
Create creates a new DNS zone and returns the created zone.
func (*VNetDNSZoneService) Delete ¶
func (s *VNetDNSZoneService) Delete(ctx context.Context, id int) error
Delete deletes a DNS zone.
func (*VNetDNSZoneService) Get ¶
func (s *VNetDNSZoneService) Get(ctx context.Context, id int) (*VNetDNSZone, error)
Get returns a single DNS zone by ID.
func (*VNetDNSZoneService) GetByDomain ¶
func (s *VNetDNSZoneService) GetByDomain(ctx context.Context, viewID int, domain string) (*VNetDNSZone, error)
GetByDomain returns a DNS zone by domain name within a specific view.
func (*VNetDNSZoneService) List ¶
func (s *VNetDNSZoneService) List(ctx context.Context, opts ...ListOption) ([]VNetDNSZone, error)
List returns all DNS zones, with optional filtering and pagination.
func (*VNetDNSZoneService) ListByView ¶
func (s *VNetDNSZoneService) ListByView(ctx context.Context, viewID int, opts ...ListOption) ([]VNetDNSZone, error)
ListByView returns all DNS zones for a specific view.
func (*VNetDNSZoneService) Update ¶
func (s *VNetDNSZoneService) Update(ctx context.Context, id int, req *VNetDNSZoneUpdateRequest) (*VNetDNSZone, error)
Update updates a DNS zone and returns the updated zone.
type VNetDNSZoneServiceInterface ¶
type VNetDNSZoneServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]VNetDNSZone, error)
ListByView(ctx context.Context, viewID int, opts ...ListOption) ([]VNetDNSZone, error)
Get(ctx context.Context, id int) (*VNetDNSZone, error)
GetByDomain(ctx context.Context, viewID int, domain string) (*VNetDNSZone, error)
Create(ctx context.Context, req *VNetDNSZoneCreateRequest) (*VNetDNSZone, error)
Update(ctx context.Context, id int, req *VNetDNSZoneUpdateRequest) (*VNetDNSZone, error)
Delete(ctx context.Context, id int) error
}
VNetDNSZoneServiceInterface defines the interface for network DNS zone operations.
type VNetDNSZoneUpdateRequest ¶
type VNetDNSZoneUpdateRequest struct {
// Domain is the zone domain name.
Domain *string `json:"domain,omitempty"`
// Type is the zone type.
Type *string `json:"type,omitempty"`
// Nameserver is the primary name server.
Nameserver *string `json:"nameserver,omitempty"`
// Email is the admin email.
Email *string `json:"email,omitempty"`
// Notify controls NOTIFY messages.
Notify *string `json:"notify,omitempty"`
// AllowNotify specifies servers allowed to send NOTIFY.
AllowNotify *string `json:"allow_notify,omitempty"`
// AlsoNotify specifies additional servers to send NOTIFY to.
AlsoNotify *string `json:"also_notify,omitempty"`
// Masters specifies master servers for slave zones.
Masters *string `json:"masters,omitempty"`
// AllowTransfer specifies servers allowed zone transfers.
AllowTransfer *string `json:"allow_transfer,omitempty"`
// DefaultTTL is the default record TTL.
DefaultTTL *string `json:"default_ttl,omitempty"`
// RefreshInterval is the SOA refresh interval.
RefreshInterval *string `json:"refresh_interval,omitempty"`
// RetryInterval is the SOA retry interval.
RetryInterval *string `json:"retry_interval,omitempty"`
// ExpiryPeriod is the SOA expiry period.
ExpiryPeriod *string `json:"expiry_period,omitempty"`
// NegativeTTL is the negative cache TTL.
NegativeTTL *string `json:"negative_ttl,omitempty"`
// Forwarders is the list of forwarder servers.
Forwarders *string `json:"forwarders,omitempty"`
}
VNetDNSZoneUpdateRequest is the request body for updating a DNS zone.
type VNetHost ¶
type VNetHost struct {
// Key is the unique identifier for the host.
Key FlexInt `json:"$key,omitempty"`
// VNet is the parent network ID.
VNet FlexInt `json:"vnet,omitempty"`
// Type is the override type (host, domain).
Type string `json:"type,omitempty"`
// Host is the hostname or domain name.
Host string `json:"host"`
// IP is the IP address to resolve to.
IP string `json:"ip"`
}
VNetHost represents a VergeOS network DNS/DHCP host override. Host overrides provide static hostname-to-IP mappings for DNS and DHCP reservations.
type VNetHostCreateRequest ¶
type VNetHostCreateRequest struct {
// VNet is the parent network ID (required).
VNet int `json:"vnet"`
// Type is the override type (host, domain). Default: host.
Type *string `json:"type,omitempty"`
// Host is the hostname or domain name (required).
Host string `json:"host"`
// IP is the IP address (required).
IP string `json:"ip"`
}
VNetHostCreateRequest is the request body for creating a host override.
type VNetHostService ¶
type VNetHostService struct {
// contains filtered or unexported fields
}
VNetHostService handles network host override operations. Host overrides provide static hostname-to-IP mappings for DNS and DHCP.
func (*VNetHostService) Create ¶
func (s *VNetHostService) Create(ctx context.Context, req *VNetHostCreateRequest) (*VNetHost, error)
Create creates a new host override and returns the created host.
func (*VNetHostService) Delete ¶
func (s *VNetHostService) Delete(ctx context.Context, id int) error
Delete deletes a host override.
func (*VNetHostService) GetByHost ¶
func (s *VNetHostService) GetByHost(ctx context.Context, vnetID int, hostname string) (*VNetHost, error)
GetByHost returns a host override by hostname within a specific network.
func (*VNetHostService) GetByIP ¶
GetByIP returns a host override by IP address within a specific network.
func (*VNetHostService) List ¶
func (s *VNetHostService) List(ctx context.Context, opts ...ListOption) ([]VNetHost, error)
List returns all host overrides, with optional filtering and pagination.
func (*VNetHostService) ListByNetwork ¶
func (s *VNetHostService) ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]VNetHost, error)
ListByNetwork returns all host overrides for a specific network.
func (*VNetHostService) Update ¶
func (s *VNetHostService) Update(ctx context.Context, id int, req *VNetHostUpdateRequest) (*VNetHost, error)
Update updates a host override and returns the updated host.
type VNetHostServiceInterface ¶
type VNetHostServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]VNetHost, error)
ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]VNetHost, error)
Get(ctx context.Context, id int) (*VNetHost, error)
GetByHost(ctx context.Context, vnetID int, hostname string) (*VNetHost, error)
GetByIP(ctx context.Context, vnetID int, ip string) (*VNetHost, error)
Create(ctx context.Context, req *VNetHostCreateRequest) (*VNetHost, error)
Update(ctx context.Context, id int, req *VNetHostUpdateRequest) (*VNetHost, error)
Delete(ctx context.Context, id int) error
}
VNetHostServiceInterface defines the interface for network host override operations.
type VNetHostUpdateRequest ¶
type VNetHostUpdateRequest struct {
// Type is the override type.
Type *string `json:"type,omitempty"`
// Host is the hostname or domain name.
Host *string `json:"host,omitempty"`
// IP is the IP address.
IP *string `json:"ip,omitempty"`
}
VNetHostUpdateRequest is the request body for updating a host override.
type VNetIPSec ¶
type VNetIPSec struct {
// Key is the unique identifier for the IPSec configuration.
Key FlexInt `json:"$key,omitempty"`
// VNet is the parent network ID.
VNet FlexInt `json:"vnet,omitempty"`
// Enabled indicates if IPSec is active on this network.
Enabled bool `json:"enabled,omitempty"`
// Mode is the configuration mode: normal or advanced.
Mode string `json:"mode,omitempty"`
// StrongswanConf is the raw strongswan.conf content (advanced mode).
StrongswanConf string `json:"strongswan_conf,omitempty"`
// IPSecConf is the raw ipsec.conf content (advanced mode).
IPSecConf string `json:"ipsec_conf,omitempty"`
// IPSecSecrets is the raw ipsec.secrets content (advanced mode).
IPSecSecrets string `json:"ipsec_secrets,omitempty"`
// UniqueIDs controls unique participant ID handling: yes, no, never, replace, keep.
UniqueIDs string `json:"uniqueids,omitempty"`
// Compress proposes IPComp compression.
Compress bool `json:"compress,omitempty"`
// ExcludeNetwork excludes local subnet traffic from IPsec.
ExcludeNetwork bool `json:"exclude_network,omitempty"`
// CiscoUnity sends Cisco Unity vendor ID payload (IKEv1 only).
CiscoUnity bool `json:"charon.cisco_unity,omitempty"`
// AcceptUnencryptedMainMode accepts unencrypted ID/HASH in IKEv1 Main Mode.
AcceptUnencryptedMainMode bool `json:"charon.accept_unencrypted_mainmode_messages,omitempty"`
// MSSClamp is the MSS to set on installed routes (0 = disabled).
MSSClamp int `json:"charon.plugins.kernel-netlink.mss,omitempty"`
// StrictCRLPolicy defines CRL validation: yes, ifuri, no.
StrictCRLPolicy string `json:"strictcrlpolicy,omitempty"`
// MakeBeforeBreak uses make-before-break reauthentication (IKEv2).
MakeBeforeBreak bool `json:"charon.make_before_break,omitempty"`
// Modified is the last modification timestamp (Unix epoch).
Modified int64 `json:"modified,omitempty"`
}
VNetIPSec represents IPSec VPN configuration for a network.
type VNetIPSecConnection ¶
type VNetIPSecConnection struct {
// Key is the unique identifier for the connection.
Key FlexInt `json:"$key,omitempty"`
// VNet is the network ID.
VNet FlexInt `json:"vnet,omitempty"`
// Phase1 is the Phase 1 configuration ID.
Phase1 FlexInt `json:"phase1,omitempty"`
// Phase2 is the Phase 2 configuration ID.
Phase2 FlexInt `json:"phase2,omitempty"`
// UniqueID is the IKE SA unique identifier.
UniqueID int `json:"uniqueid,omitempty"`
// Local is the local endpoint IP.
Local string `json:"local,omitempty"`
// Remote is the remote endpoint IP.
Remote string `json:"remote,omitempty"`
// LocalNetwork is the local subnet.
LocalNetwork string `json:"local_network,omitempty"`
// RemoteNetwork is the remote subnet.
RemoteNetwork string `json:"remote_network,omitempty"`
// Connection is the connection name.
Connection string `json:"connection,omitempty"`
// ReqID is the request ID.
ReqID string `json:"reqid,omitempty"`
// Interface is the network interface.
Interface string `json:"interface,omitempty"`
// Protocol is the IPsec protocol in use.
Protocol string `json:"protocol,omitempty"`
// Created is the connection establishment timestamp (Unix epoch).
Created int64 `json:"created,omitempty"`
}
VNetIPSecConnection represents an active IPsec connection (read-only status).
type VNetIPSecConnectionService ¶
type VNetIPSecConnectionService struct {
// contains filtered or unexported fields
}
VNetIPSecConnectionService handles IPSec connection status operations (read-only).
func (*VNetIPSecConnectionService) Get ¶
func (s *VNetIPSecConnectionService) Get(ctx context.Context, id int) (*VNetIPSecConnection, error)
Get returns a single IPSec connection by ID.
func (*VNetIPSecConnectionService) List ¶
func (s *VNetIPSecConnectionService) List(ctx context.Context, opts ...ListOption) ([]VNetIPSecConnection, error)
List returns all active IPSec connections, with optional filtering.
func (*VNetIPSecConnectionService) ListByNetwork ¶
func (s *VNetIPSecConnectionService) ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]VNetIPSecConnection, error)
ListByNetwork returns all active connections for a specific network.
func (*VNetIPSecConnectionService) ListByPhase1 ¶
func (s *VNetIPSecConnectionService) ListByPhase1(ctx context.Context, phase1ID int, opts ...ListOption) ([]VNetIPSecConnection, error)
ListByPhase1 returns all active connections for a specific Phase 1.
type VNetIPSecConnectionServiceInterface ¶
type VNetIPSecConnectionServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]VNetIPSecConnection, error)
ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]VNetIPSecConnection, error)
ListByPhase1(ctx context.Context, phase1ID int, opts ...ListOption) ([]VNetIPSecConnection, error)
Get(ctx context.Context, id int) (*VNetIPSecConnection, error)
}
VNetIPSecConnectionServiceInterface defines the interface for IPSec connection status operations (read-only).
type VNetIPSecCreateRequest ¶
type VNetIPSecCreateRequest struct {
// VNet is the parent network ID (required).
VNet int `json:"vnet"`
// Enabled indicates if IPSec is active (default: true).
Enabled *bool `json:"enabled,omitempty"`
// Mode is the configuration mode: normal or advanced (default: normal).
Mode *string `json:"mode,omitempty"`
// StrongswanConf is the raw strongswan.conf content.
StrongswanConf *string `json:"strongswan_conf,omitempty"`
// IPSecConf is the raw ipsec.conf content.
IPSecConf *string `json:"ipsec_conf,omitempty"`
// IPSecSecrets is the raw ipsec.secrets content.
IPSecSecrets *string `json:"ipsec_secrets,omitempty"`
// UniqueIDs controls unique participant ID handling.
UniqueIDs *string `json:"uniqueids,omitempty"`
// Compress proposes IPComp compression.
Compress *bool `json:"compress,omitempty"`
// ExcludeNetwork excludes local subnet traffic from IPsec.
ExcludeNetwork *bool `json:"exclude_network,omitempty"`
}
VNetIPSecCreateRequest is the request body for creating an IPSec configuration.
type VNetIPSecPhase1 ¶
type VNetIPSecPhase1 struct {
// Key is the unique identifier for the Phase 1 configuration.
Key FlexInt `json:"$key,omitempty"`
// IPSec is the parent IPSec configuration ID.
IPSec FlexInt `json:"ipsec,omitempty"`
// Name is the Phase 1 configuration name.
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// Enabled indicates if this Phase 1 is active.
Enabled bool `json:"enabled,omitempty"`
// KeyExchange is the IKE version: ikev1, ikev2, ike (auto).
KeyExchange string `json:"keyexchange,omitempty"`
// RemoteGateway is the remote peer IP or hostname.
RemoteGateway string `json:"remote_gateway,omitempty"`
// Auth is the authentication method: psk (mutual PSK), pubkey (mutual RSA).
Auth string `json:"auth,omitempty"`
// Negotiation is the negotiation mode: main, aggressive.
Negotiation string `json:"negotiation,omitempty"`
// Identifier is the local identifier (blank = current IP).
Identifier string `json:"identifier,omitempty"`
// PeerIdentifier is the peer identifier (blank = remote gateway).
PeerIdentifier string `json:"peer_identifier,omitempty"`
// PSK is the pre-shared key (hidden in responses).
PSK string `json:"psk,omitempty"`
// IKE is the encryption algorithm(s) for IKE SA.
IKE string `json:"ike,omitempty"`
// IKELifetime is how long the IKE SA lasts before rekeying (seconds).
IKELifetime int `json:"ikelifetime,omitempty"`
// Auto is the connection behavior: add, route, start.
Auto string `json:"auto,omitempty"`
// MOBIKE enables IKEv2 MOBIKE protocol.
MOBIKE bool `json:"mobike,omitempty"`
// SplitConnections creates separate connections for each Phase 2.
SplitConnections bool `json:"split_connections,omitempty"`
// ForceEncaps forces UDP encapsulation even without NAT.
ForceEncaps bool `json:"forceencaps,omitempty"`
// KeyingTries is the number of negotiation attempts (0 = never give up).
KeyingTries int `json:"keyingtries,omitempty"`
// Rekey enables renegotiation before expiry.
Rekey bool `json:"rekey,omitempty"`
// Reauth enables reauthentication during rekey (IKEv2).
Reauth bool `json:"reauth,omitempty"`
// MarginTime is how long before expiry to start rekeying (seconds).
MarginTime int `json:"margintime,omitempty"`
// DPDAction is the dead peer detection action: none, clear, hold, restart.
DPDAction string `json:"dpdaction,omitempty"`
// DPDDelay is the DPD check interval (seconds).
DPDDelay int `json:"dpddelay,omitempty"`
// DPDFailures is the max DPD failures before disconnect (IKEv1).
DPDFailures int `json:"dpdfailures,omitempty"`
// Modified is the last modification timestamp (Unix epoch).
Modified int64 `json:"modified,omitempty"`
}
VNetIPSecPhase1 represents an IKE SA (Phase 1) configuration.
type VNetIPSecPhase1CreateRequest ¶
type VNetIPSecPhase1CreateRequest struct {
// IPSec is the parent IPSec configuration ID (required).
IPSec int `json:"ipsec"`
// Name is the Phase 1 configuration name (required).
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// Enabled indicates if this Phase 1 is active (default: true).
Enabled *bool `json:"enabled,omitempty"`
// KeyExchange is the IKE version (default: ike).
KeyExchange *string `json:"keyexchange,omitempty"`
// RemoteGateway is the remote peer IP or hostname (required).
RemoteGateway string `json:"remote_gateway"`
// Auth is the authentication method (default: psk).
Auth *string `json:"auth,omitempty"`
// Negotiation is the negotiation mode (default: main).
Negotiation *string `json:"negotiation,omitempty"`
// Identifier is the local identifier.
Identifier *string `json:"identifier,omitempty"`
// PeerIdentifier is the peer identifier.
PeerIdentifier *string `json:"peer_identifier,omitempty"`
// PSK is the pre-shared key (required for psk auth).
PSK *string `json:"psk,omitempty"`
// IKE is the encryption algorithm(s) (default: aes256-sha256-modp2048).
IKE *string `json:"ike,omitempty"`
// IKELifetime is the IKE SA lifetime in seconds (default: 10800).
IKELifetime *int `json:"ikelifetime,omitempty"`
// Auto is the connection behavior (default: route).
Auto *string `json:"auto,omitempty"`
// MOBIKE enables IKEv2 MOBIKE protocol.
MOBIKE *bool `json:"mobike,omitempty"`
// SplitConnections creates separate connections for each Phase 2.
SplitConnections *bool `json:"split_connections,omitempty"`
// ForceEncaps forces UDP encapsulation.
ForceEncaps *bool `json:"forceencaps,omitempty"`
// KeyingTries is the number of negotiation attempts (default: 3).
KeyingTries *int `json:"keyingtries,omitempty"`
// Rekey enables renegotiation (default: true).
Rekey *bool `json:"rekey,omitempty"`
// Reauth enables reauthentication (default: true).
Reauth *bool `json:"reauth,omitempty"`
// MarginTime is rekeying margin time in seconds (default: 540).
MarginTime *int `json:"margintime,omitempty"`
// DPDAction is the dead peer detection action (default: restart).
DPDAction *string `json:"dpdaction,omitempty"`
// DPDDelay is the DPD check interval (default: 30).
DPDDelay *int `json:"dpddelay,omitempty"`
// DPDFailures is the max DPD failures (default: 5).
DPDFailures *int `json:"dpdfailures,omitempty"`
}
VNetIPSecPhase1CreateRequest is the request body for creating a Phase 1 configuration.
type VNetIPSecPhase1Service ¶
type VNetIPSecPhase1Service struct {
// contains filtered or unexported fields
}
VNetIPSecPhase1Service handles IPSec Phase 1 (IKE SA) configuration operations.
func (*VNetIPSecPhase1Service) Create ¶
func (s *VNetIPSecPhase1Service) Create(ctx context.Context, req *VNetIPSecPhase1CreateRequest) (*VNetIPSecPhase1, error)
Create creates a new Phase 1 configuration and returns it.
func (*VNetIPSecPhase1Service) Delete ¶
func (s *VNetIPSecPhase1Service) Delete(ctx context.Context, id int) error
Delete deletes a Phase 1 configuration.
func (*VNetIPSecPhase1Service) Get ¶
func (s *VNetIPSecPhase1Service) Get(ctx context.Context, id int) (*VNetIPSecPhase1, error)
Get returns a single Phase 1 configuration by ID.
func (*VNetIPSecPhase1Service) GetByName ¶
func (s *VNetIPSecPhase1Service) GetByName(ctx context.Context, ipsecID int, name string) (*VNetIPSecPhase1, error)
GetByName returns a Phase 1 configuration by name within an IPSec configuration.
func (*VNetIPSecPhase1Service) List ¶
func (s *VNetIPSecPhase1Service) List(ctx context.Context, opts ...ListOption) ([]VNetIPSecPhase1, error)
List returns all Phase 1 configurations, with optional filtering and pagination.
func (*VNetIPSecPhase1Service) ListByIPSec ¶
func (s *VNetIPSecPhase1Service) ListByIPSec(ctx context.Context, ipsecID int, opts ...ListOption) ([]VNetIPSecPhase1, error)
ListByIPSec returns all Phase 1 configurations for a specific IPSec configuration.
func (*VNetIPSecPhase1Service) Update ¶
func (s *VNetIPSecPhase1Service) Update(ctx context.Context, id int, req *VNetIPSecPhase1UpdateRequest) (*VNetIPSecPhase1, error)
Update updates a Phase 1 configuration and returns the updated configuration.
type VNetIPSecPhase1ServiceInterface ¶
type VNetIPSecPhase1ServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]VNetIPSecPhase1, error)
ListByIPSec(ctx context.Context, ipsecID int, opts ...ListOption) ([]VNetIPSecPhase1, error)
Get(ctx context.Context, id int) (*VNetIPSecPhase1, error)
GetByName(ctx context.Context, ipsecID int, name string) (*VNetIPSecPhase1, error)
Create(ctx context.Context, req *VNetIPSecPhase1CreateRequest) (*VNetIPSecPhase1, error)
Update(ctx context.Context, id int, req *VNetIPSecPhase1UpdateRequest) (*VNetIPSecPhase1, error)
Delete(ctx context.Context, id int) error
}
VNetIPSecPhase1ServiceInterface defines the interface for IPSec Phase 1 (IKE SA) operations.
type VNetIPSecPhase1UpdateRequest ¶
type VNetIPSecPhase1UpdateRequest struct {
// Name is the Phase 1 configuration name.
Name *string `json:"name,omitempty"`
// Description is the description.
Description *string `json:"description,omitempty"`
// Enabled indicates if this Phase 1 is active.
Enabled *bool `json:"enabled,omitempty"`
// KeyExchange is the IKE version.
KeyExchange *string `json:"keyexchange,omitempty"`
// RemoteGateway is the remote peer IP or hostname.
RemoteGateway *string `json:"remote_gateway,omitempty"`
// Auth is the authentication method.
Auth *string `json:"auth,omitempty"`
// Negotiation is the negotiation mode.
Negotiation *string `json:"negotiation,omitempty"`
// Identifier is the local identifier.
Identifier *string `json:"identifier,omitempty"`
// PeerIdentifier is the peer identifier.
PeerIdentifier *string `json:"peer_identifier,omitempty"`
// PSK is the pre-shared key.
PSK *string `json:"psk,omitempty"`
// IKE is the encryption algorithm(s).
IKE *string `json:"ike,omitempty"`
// IKELifetime is the IKE SA lifetime in seconds.
IKELifetime *int `json:"ikelifetime,omitempty"`
// Auto is the connection behavior.
Auto *string `json:"auto,omitempty"`
// MOBIKE enables IKEv2 MOBIKE protocol.
MOBIKE *bool `json:"mobike,omitempty"`
// SplitConnections creates separate connections for each Phase 2.
SplitConnections *bool `json:"split_connections,omitempty"`
// ForceEncaps forces UDP encapsulation.
ForceEncaps *bool `json:"forceencaps,omitempty"`
// KeyingTries is the number of negotiation attempts.
KeyingTries *int `json:"keyingtries,omitempty"`
// Rekey enables renegotiation.
Rekey *bool `json:"rekey,omitempty"`
// Reauth enables reauthentication.
Reauth *bool `json:"reauth,omitempty"`
// MarginTime is rekeying margin time in seconds.
MarginTime *int `json:"margintime,omitempty"`
// DPDAction is the dead peer detection action.
DPDAction *string `json:"dpdaction,omitempty"`
// DPDDelay is the DPD check interval.
DPDDelay *int `json:"dpddelay,omitempty"`
// DPDFailures is the max DPD failures.
DPDFailures *int `json:"dpdfailures,omitempty"`
}
VNetIPSecPhase1UpdateRequest is the request body for updating a Phase 1 configuration.
type VNetIPSecPhase2 ¶
type VNetIPSecPhase2 struct {
// Key is the unique identifier for the Phase 2 configuration.
Key FlexInt `json:"$key,omitempty"`
// Phase1 is the parent Phase 1 configuration ID.
Phase1 FlexInt `json:"phase1,omitempty"`
// Name is the Phase 2 configuration name.
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// Enabled indicates if this Phase 2 is active.
Enabled bool `json:"enabled,omitempty"`
// Mode is the IPsec mode: tunnel or transport.
Mode string `json:"mode,omitempty"`
// Local is the local network/subnet.
Local string `json:"local,omitempty"`
// Remote is the remote network/subnet.
Remote string `json:"remote,omitempty"`
// Lifetime is how long the IPsec SA lasts (seconds).
Lifetime int `json:"lifetime,omitempty"`
// Protocol is the IPsec protocol: esp (encryption) or ah (auth only).
Protocol string `json:"protocol,omitempty"`
// Ciphers is the cipher suites for IPsec SA.
Ciphers string `json:"ciphers,omitempty"`
// Modified is the last modification timestamp (Unix epoch).
Modified int64 `json:"modified,omitempty"`
}
VNetIPSecPhase2 represents an IPsec SA (Phase 2) configuration.
type VNetIPSecPhase2CreateRequest ¶
type VNetIPSecPhase2CreateRequest struct {
// Phase1 is the parent Phase 1 configuration ID (required).
Phase1 int `json:"phase1"`
// Name is the Phase 2 configuration name (required).
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// Enabled indicates if this Phase 2 is active (default: true).
Enabled *bool `json:"enabled,omitempty"`
// Mode is the IPsec mode (default: tunnel).
Mode *string `json:"mode,omitempty"`
// Local is the local network/subnet (required).
Local string `json:"local"`
// Remote is the remote network/subnet.
Remote string `json:"remote,omitempty"`
// Lifetime is the IPsec SA lifetime in seconds (default: 3600).
Lifetime *int `json:"lifetime,omitempty"`
// Protocol is the IPsec protocol (default: esp).
Protocol *string `json:"protocol,omitempty"`
// Ciphers is the cipher suites (default: aes128-sha256-modp2048,aes128gcm128-sha256-modp2048).
Ciphers *string `json:"ciphers,omitempty"`
}
VNetIPSecPhase2CreateRequest is the request body for creating a Phase 2 configuration.
type VNetIPSecPhase2Service ¶
type VNetIPSecPhase2Service struct {
// contains filtered or unexported fields
}
VNetIPSecPhase2Service handles IPSec Phase 2 (IPsec SA) configuration operations.
func (*VNetIPSecPhase2Service) Create ¶
func (s *VNetIPSecPhase2Service) Create(ctx context.Context, req *VNetIPSecPhase2CreateRequest) (*VNetIPSecPhase2, error)
Create creates a new Phase 2 configuration and returns it.
func (*VNetIPSecPhase2Service) Delete ¶
func (s *VNetIPSecPhase2Service) Delete(ctx context.Context, id int) error
Delete deletes a Phase 2 configuration.
func (*VNetIPSecPhase2Service) Get ¶
func (s *VNetIPSecPhase2Service) Get(ctx context.Context, id int) (*VNetIPSecPhase2, error)
Get returns a single Phase 2 configuration by ID.
func (*VNetIPSecPhase2Service) GetByName ¶
func (s *VNetIPSecPhase2Service) GetByName(ctx context.Context, phase1ID int, name string) (*VNetIPSecPhase2, error)
GetByName returns a Phase 2 configuration by name within a Phase 1.
func (*VNetIPSecPhase2Service) List ¶
func (s *VNetIPSecPhase2Service) List(ctx context.Context, opts ...ListOption) ([]VNetIPSecPhase2, error)
List returns all Phase 2 configurations, with optional filtering and pagination.
func (*VNetIPSecPhase2Service) ListByPhase1 ¶
func (s *VNetIPSecPhase2Service) ListByPhase1(ctx context.Context, phase1ID int, opts ...ListOption) ([]VNetIPSecPhase2, error)
ListByPhase1 returns all Phase 2 configurations for a specific Phase 1.
func (*VNetIPSecPhase2Service) Update ¶
func (s *VNetIPSecPhase2Service) Update(ctx context.Context, id int, req *VNetIPSecPhase2UpdateRequest) (*VNetIPSecPhase2, error)
Update updates a Phase 2 configuration and returns the updated configuration.
type VNetIPSecPhase2ServiceInterface ¶
type VNetIPSecPhase2ServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]VNetIPSecPhase2, error)
ListByPhase1(ctx context.Context, phase1ID int, opts ...ListOption) ([]VNetIPSecPhase2, error)
Get(ctx context.Context, id int) (*VNetIPSecPhase2, error)
GetByName(ctx context.Context, phase1ID int, name string) (*VNetIPSecPhase2, error)
Create(ctx context.Context, req *VNetIPSecPhase2CreateRequest) (*VNetIPSecPhase2, error)
Update(ctx context.Context, id int, req *VNetIPSecPhase2UpdateRequest) (*VNetIPSecPhase2, error)
Delete(ctx context.Context, id int) error
}
VNetIPSecPhase2ServiceInterface defines the interface for IPSec Phase 2 (IPsec SA) operations.
type VNetIPSecPhase2UpdateRequest ¶
type VNetIPSecPhase2UpdateRequest struct {
// Name is the Phase 2 configuration name.
Name *string `json:"name,omitempty"`
// Description is the description.
Description *string `json:"description,omitempty"`
// Enabled indicates if this Phase 2 is active.
Enabled *bool `json:"enabled,omitempty"`
// Mode is the IPsec mode.
Mode *string `json:"mode,omitempty"`
// Local is the local network/subnet.
Local *string `json:"local,omitempty"`
// Remote is the remote network/subnet.
Remote *string `json:"remote,omitempty"`
// Lifetime is the IPsec SA lifetime in seconds.
Lifetime *int `json:"lifetime,omitempty"`
// Protocol is the IPsec protocol.
Protocol *string `json:"protocol,omitempty"`
// Ciphers is the cipher suites.
Ciphers *string `json:"ciphers,omitempty"`
}
VNetIPSecPhase2UpdateRequest is the request body for updating a Phase 2 configuration.
type VNetIPSecService ¶
type VNetIPSecService struct {
// contains filtered or unexported fields
}
VNetIPSecService handles IPSec VPN configuration operations.
func (*VNetIPSecService) Create ¶
func (s *VNetIPSecService) Create(ctx context.Context, req *VNetIPSecCreateRequest) (*VNetIPSec, error)
Create creates a new IPSec configuration and returns it.
func (*VNetIPSecService) Delete ¶
func (s *VNetIPSecService) Delete(ctx context.Context, id int) error
Delete deletes an IPSec configuration.
func (*VNetIPSecService) GetByNetwork ¶
GetByNetwork returns the IPSec configuration for a specific network.
func (*VNetIPSecService) List ¶
func (s *VNetIPSecService) List(ctx context.Context, opts ...ListOption) ([]VNetIPSec, error)
List returns all IPSec configurations, with optional filtering and pagination.
func (*VNetIPSecService) Update ¶
func (s *VNetIPSecService) Update(ctx context.Context, id int, req *VNetIPSecUpdateRequest) (*VNetIPSec, error)
Update updates an IPSec configuration and returns the updated configuration.
type VNetIPSecServiceInterface ¶
type VNetIPSecServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]VNetIPSec, error)
Get(ctx context.Context, id int) (*VNetIPSec, error)
GetByNetwork(ctx context.Context, vnetID int) (*VNetIPSec, error)
Create(ctx context.Context, req *VNetIPSecCreateRequest) (*VNetIPSec, error)
Update(ctx context.Context, id int, req *VNetIPSecUpdateRequest) (*VNetIPSec, error)
Delete(ctx context.Context, id int) error
}
VNetIPSecServiceInterface defines the interface for IPSec VPN configuration operations.
type VNetIPSecUpdateRequest ¶
type VNetIPSecUpdateRequest struct {
// Enabled indicates if IPSec is active.
Enabled *bool `json:"enabled,omitempty"`
// Mode is the configuration mode.
Mode *string `json:"mode,omitempty"`
// StrongswanConf is the raw strongswan.conf content.
StrongswanConf *string `json:"strongswan_conf,omitempty"`
// IPSecConf is the raw ipsec.conf content.
IPSecConf *string `json:"ipsec_conf,omitempty"`
// IPSecSecrets is the raw ipsec.secrets content.
IPSecSecrets *string `json:"ipsec_secrets,omitempty"`
// UniqueIDs controls unique participant ID handling.
UniqueIDs *string `json:"uniqueids,omitempty"`
// Compress proposes IPComp compression.
Compress *bool `json:"compress,omitempty"`
// ExcludeNetwork excludes local subnet traffic from IPsec.
ExcludeNetwork *bool `json:"exclude_network,omitempty"`
// CiscoUnity sends Cisco Unity vendor ID payload.
CiscoUnity *bool `json:"charon.cisco_unity,omitempty"`
// AcceptUnencryptedMainMode accepts unencrypted ID/HASH in IKEv1.
AcceptUnencryptedMainMode *bool `json:"charon.accept_unencrypted_mainmode_messages,omitempty"`
// MSSClamp is the MSS to set on installed routes.
MSSClamp *int `json:"charon.plugins.kernel-netlink.mss,omitempty"`
// StrictCRLPolicy defines CRL validation.
StrictCRLPolicy *string `json:"strictcrlpolicy,omitempty"`
// MakeBeforeBreak uses make-before-break reauthentication.
MakeBeforeBreak *bool `json:"charon.make_before_break,omitempty"`
}
VNetIPSecUpdateRequest is the request body for updating an IPSec configuration.
type VNetRule ¶
type VNetRule struct {
// Key is the unique identifier for the rule.
Key FlexInt `json:"$key,omitempty"`
// VNet is the parent network ID (readonly after creation).
VNet FlexInt `json:"vnet,omitempty"`
// Name is the rule name (unique per network).
Name string `json:"name"`
// Description is an optional description of the rule.
Description string `json:"description,omitempty"`
// OrderID determines the rule processing order (lower = earlier).
OrderID int `json:"orderid,omitempty"`
// Pin automatically moves this rule above/below non-pinned rules (no, top, bottom).
Pin string `json:"pin,omitempty"`
// Enabled indicates whether the rule is active.
Enabled bool `json:"enabled"`
// Trace enables packet tracing for diagnostic purposes.
Trace bool `json:"trace,omitempty"`
// SystemRule indicates this is a system-managed rule (readonly).
SystemRule bool `json:"system_rule,omitempty"`
// Owner is the owner reference path (e.g., "vnet_addresses/28") (readonly).
Owner string `json:"owner,omitempty"`
// Traffic matching criteria
// Protocol to match (tcp, tcpudp, udp, icmp, 89=OSPF, 2=IGMP, 47=GRE, 50=ESP, 51=AH, any).
Protocol string `json:"protocol,omitempty"`
// Direction of traffic (incoming, outgoing).
Direction string `json:"direction,omitempty"`
// CTState is the connection tracking state filter (new, established, related, untracked).
CTState string `json:"ct_state,omitempty"`
// Interface to match (auto, router, dmz, wireguard, any).
Interface string `json:"interface,omitempty"`
// Source filtering
// SourceIP is the source IP filter (e.g., "192.168.0.1,192.168.1.0/24,vnetself,router").
SourceIP string `json:"source_ip,omitempty"`
// SourcePorts is the source port filter (e.g., "80,22,1600-1800").
SourcePorts string `json:"source_ports,omitempty"`
// Destination filtering
// DestinationIP is the destination IP filter.
DestinationIP string `json:"destination_ip,omitempty"`
// DestinationPorts is the destination port filter.
DestinationPorts string `json:"destination_ports,omitempty"`
// Action determines what happens to matched traffic (accept, drop, reject, translate, route).
Action string `json:"action,omitempty"`
// NAT/Routing targets (for translate/route actions)
// TargetIP is the target IP for translation/routing.
TargetIP string `json:"target_ip,omitempty"`
// TargetPorts is the target port for translation.
TargetPorts string `json:"target_ports,omitempty"`
// Rate limiting
// Throttle defines rate limiting (e.g., "1000 kbytes/second", "100/minute burst 10").
Throttle string `json:"throttle,omitempty"`
// DropThrottle creates an automatic drop rule when throttle is exceeded.
DropThrottle bool `json:"drop_throttle,omitempty"`
// Logging and statistics
// Statistics enables rule hit tracking.
Statistics bool `json:"statistics,omitempty"`
// Log enables logging of matched traffic.
Log bool `json:"log,omitempty"`
// Packets is the number of packets matched (when statistics enabled).
Packets int64 `json:"packets,omitempty"`
// Bytes is the number of bytes matched (when statistics enabled).
Bytes int64 `json:"bytes,omitempty"`
// Metadata
// Modified is the last modification timestamp (Unix epoch).
Modified int64 `json:"modified,omitempty"`
// Creator is the username that created this rule.
Creator string `json:"creator,omitempty"`
}
VNetRule represents a VergeOS network firewall rule.
type VNetRuleAlias ¶
type VNetRuleAlias struct {
// Key is the unique identifier for the alias.
Key FlexInt `json:"$key,omitempty"`
// Name is the alias name (unique globally).
Name string `json:"name"`
// ID is the unique SHA1 hash identifier (readonly).
ID string `json:"id,omitempty"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// Value is the comma-delimited list of addresses (e.g., "192.168.1.1,10.0.0.0/8").
// Each entry can have a description separated by pipe: "192.168.1.1|Server1,10.0.0.0/8|Internal".
Value string `json:"value"`
// PublishingScope determines visibility (private, global, tenant, none).
PublishingScope string `json:"publishing_scope,omitempty"`
// Owner is the owner reference path (readonly).
Owner string `json:"owner,omitempty"`
}
VNetRuleAlias represents a VergeOS network rule alias. Aliases allow you to define reusable address lists for firewall rules.
type VNetRuleAliasCreateRequest ¶
type VNetRuleAliasCreateRequest struct {
// Name is the alias name (required, unique globally).
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// Value is the comma-delimited list of addresses (required).
Value string `json:"value"`
// PublishingScope determines visibility (private, global, tenant, none).
PublishingScope *string `json:"publishing_scope,omitempty"`
}
VNetRuleAliasCreateRequest is the request body for creating a rule alias.
type VNetRuleAliasService ¶
type VNetRuleAliasService struct {
// contains filtered or unexported fields
}
VNetRuleAliasService handles network rule alias operations. Aliases allow you to define reusable address lists for firewall rules.
func (*VNetRuleAliasService) Create ¶
func (s *VNetRuleAliasService) Create(ctx context.Context, req *VNetRuleAliasCreateRequest) (*VNetRuleAlias, error)
Create creates a new rule alias and returns the created alias.
func (*VNetRuleAliasService) Delete ¶
func (s *VNetRuleAliasService) Delete(ctx context.Context, id int) error
Delete deletes a rule alias.
func (*VNetRuleAliasService) Get ¶
func (s *VNetRuleAliasService) Get(ctx context.Context, id int) (*VNetRuleAlias, error)
Get returns a single rule alias by ID.
func (*VNetRuleAliasService) GetByName ¶
func (s *VNetRuleAliasService) GetByName(ctx context.Context, name string) (*VNetRuleAlias, error)
GetByName returns a rule alias by name.
func (*VNetRuleAliasService) List ¶
func (s *VNetRuleAliasService) List(ctx context.Context, opts ...ListOption) ([]VNetRuleAlias, error)
List returns all rule aliases, with optional filtering and pagination.
func (*VNetRuleAliasService) Update ¶
func (s *VNetRuleAliasService) Update(ctx context.Context, id int, req *VNetRuleAliasUpdateRequest) (*VNetRuleAlias, error)
Update updates a rule alias and returns the updated alias.
type VNetRuleAliasServiceInterface ¶
type VNetRuleAliasServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]VNetRuleAlias, error)
Get(ctx context.Context, id int) (*VNetRuleAlias, error)
GetByName(ctx context.Context, name string) (*VNetRuleAlias, error)
Create(ctx context.Context, req *VNetRuleAliasCreateRequest) (*VNetRuleAlias, error)
Update(ctx context.Context, id int, req *VNetRuleAliasUpdateRequest) (*VNetRuleAlias, error)
Delete(ctx context.Context, id int) error
}
VNetRuleAliasServiceInterface defines the interface for network rule alias operations.
type VNetRuleAliasUpdateRequest ¶
type VNetRuleAliasUpdateRequest struct {
// Name is the alias name.
Name *string `json:"name,omitempty"`
// Description is the alias description.
Description *string `json:"description,omitempty"`
// Value is the comma-delimited list of addresses.
Value *string `json:"value,omitempty"`
// PublishingScope determines visibility.
PublishingScope *string `json:"publishing_scope,omitempty"`
}
VNetRuleAliasUpdateRequest is the request body for updating a rule alias.
type VNetRuleCreateRequest ¶
type VNetRuleCreateRequest struct {
// VNet is the parent network ID (required).
VNet int `json:"vnet"`
// Name is the rule name (required, unique per network).
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// OrderID determines the rule processing order.
OrderID *int `json:"orderid,omitempty"`
// Pin automatically moves this rule (no, top, bottom).
Pin *string `json:"pin,omitempty"`
// Enabled indicates whether the rule is active.
Enabled *bool `json:"enabled,omitempty"`
// Trace enables packet tracing.
Trace *bool `json:"trace,omitempty"`
// Traffic matching
// Protocol to match.
Protocol *string `json:"protocol,omitempty"`
// Direction of traffic.
Direction *string `json:"direction,omitempty"`
// CTState is the connection tracking state filter.
CTState *string `json:"ct_state,omitempty"`
// Interface to match.
Interface *string `json:"interface,omitempty"`
// Source filtering
// SourceIP is the source IP filter.
SourceIP *string `json:"source_ip,omitempty"`
// SourcePorts is the source port filter.
SourcePorts *string `json:"source_ports,omitempty"`
// Destination filtering
// DestinationIP is the destination IP filter.
DestinationIP *string `json:"destination_ip,omitempty"`
// DestinationPorts is the destination port filter.
DestinationPorts *string `json:"destination_ports,omitempty"`
// Action determines what happens to matched traffic.
Action *string `json:"action,omitempty"`
// NAT/Routing targets
// TargetIP is the target IP for translation/routing.
TargetIP *string `json:"target_ip,omitempty"`
// TargetPorts is the target port for translation.
TargetPorts *string `json:"target_ports,omitempty"`
// Rate limiting
// Throttle defines rate limiting.
Throttle *string `json:"throttle,omitempty"`
// DropThrottle creates an automatic drop rule when throttle exceeded.
DropThrottle *bool `json:"drop_throttle,omitempty"`
// Logging and statistics
// Statistics enables rule hit tracking.
Statistics *bool `json:"statistics,omitempty"`
// Log enables logging of matched traffic.
Log *bool `json:"log,omitempty"`
}
VNetRuleCreateRequest is the request body for creating a firewall rule.
type VNetRuleService ¶
type VNetRuleService struct {
// contains filtered or unexported fields
}
VNetRuleService handles network firewall rule operations.
func (*VNetRuleService) Create ¶
func (s *VNetRuleService) Create(ctx context.Context, req *VNetRuleCreateRequest) (*VNetRule, error)
Create creates a new firewall rule and returns the created rule.
func (*VNetRuleService) Delete ¶
func (s *VNetRuleService) Delete(ctx context.Context, id int) error
Delete deletes a firewall rule.
func (*VNetRuleService) Disable ¶
Disable disables a firewall rule by setting its enabled field to false. If apply is true, firewall rules are automatically applied to the network.
Note: The VergeOS API does not expose a vnet_rule_actions endpoint, so this method updates the enabled field directly via PUT and optionally applies rules via vnet_actions. See ADR-015 for details.
func (*VNetRuleService) Enable ¶
Enable enables a firewall rule by setting its enabled field to true. If apply is true, firewall rules are automatically applied to the network.
Note: The VergeOS API does not expose a vnet_rule_actions endpoint, so this method updates the enabled field directly via PUT and optionally applies rules via vnet_actions. See ADR-015 for details.
func (*VNetRuleService) GetByName ¶
func (s *VNetRuleService) GetByName(ctx context.Context, vnetID int, name string) (*VNetRule, error)
GetByName returns a firewall rule by name within a specific network.
func (*VNetRuleService) List ¶
func (s *VNetRuleService) List(ctx context.Context, opts ...ListOption) ([]VNetRule, error)
List returns all firewall rules, with optional filtering and pagination.
func (*VNetRuleService) ListByNetwork ¶
func (s *VNetRuleService) ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]VNetRule, error)
ListByNetwork returns all firewall rules for a specific network.
func (*VNetRuleService) Update ¶
func (s *VNetRuleService) Update(ctx context.Context, id int, req *VNetRuleUpdateRequest) (*VNetRule, error)
Update updates a firewall rule and returns the updated rule.
type VNetRuleServiceInterface ¶
type VNetRuleServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]VNetRule, error)
ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]VNetRule, error)
Get(ctx context.Context, id int) (*VNetRule, error)
GetByName(ctx context.Context, vnetID int, name string) (*VNetRule, error)
Create(ctx context.Context, req *VNetRuleCreateRequest) (*VNetRule, error)
Update(ctx context.Context, id int, req *VNetRuleUpdateRequest) (*VNetRule, error)
Delete(ctx context.Context, id int) error
Enable(ctx context.Context, id int, apply bool) error
Disable(ctx context.Context, id int, apply bool) error
}
VNetRuleServiceInterface defines the interface for network firewall rule operations.
type VNetRuleUpdateRequest ¶
type VNetRuleUpdateRequest struct {
// Name is the rule name.
Name *string `json:"name,omitempty"`
// Description is the rule description.
Description *string `json:"description,omitempty"`
// OrderID determines the rule processing order.
OrderID *int `json:"orderid,omitempty"`
// Pin automatically moves this rule (no, top, bottom).
Pin *string `json:"pin,omitempty"`
// Enabled indicates whether the rule is active.
Enabled *bool `json:"enabled,omitempty"`
// Trace enables packet tracing.
Trace *bool `json:"trace,omitempty"`
// Traffic matching
// Protocol to match.
Protocol *string `json:"protocol,omitempty"`
// Direction of traffic.
Direction *string `json:"direction,omitempty"`
// CTState is the connection tracking state filter.
CTState *string `json:"ct_state,omitempty"`
// Interface to match.
Interface *string `json:"interface,omitempty"`
// Source filtering
// SourceIP is the source IP filter.
SourceIP *string `json:"source_ip,omitempty"`
// SourcePorts is the source port filter.
SourcePorts *string `json:"source_ports,omitempty"`
// Destination filtering
// DestinationIP is the destination IP filter.
DestinationIP *string `json:"destination_ip,omitempty"`
// DestinationPorts is the destination port filter.
DestinationPorts *string `json:"destination_ports,omitempty"`
// Action determines what happens to matched traffic.
Action *string `json:"action,omitempty"`
// NAT/Routing targets
// TargetIP is the target IP for translation/routing.
TargetIP *string `json:"target_ip,omitempty"`
// TargetPorts is the target port for translation.
TargetPorts *string `json:"target_ports,omitempty"`
// Rate limiting
// Throttle defines rate limiting.
Throttle *string `json:"throttle,omitempty"`
// DropThrottle creates an automatic drop rule when throttle exceeded.
DropThrottle *bool `json:"drop_throttle,omitempty"`
// Logging and statistics
// Statistics enables rule hit tracking.
Statistics *bool `json:"statistics,omitempty"`
// Log enables logging of matched traffic.
Log *bool `json:"log,omitempty"`
}
VNetRuleUpdateRequest is the request body for updating a firewall rule.
type VNetWireGuard ¶
type VNetWireGuard struct {
// Key is the unique identifier for the WireGuard interface.
Key FlexInt `json:"$key,omitempty"`
// VNet is the parent network ID.
VNet FlexInt `json:"vnet,omitempty"`
// Name is the interface name.
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// Enabled indicates if the interface is active.
Enabled bool `json:"enabled,omitempty"`
// IP is the WireGuard interface IP address with CIDR (e.g., "192.168.255.1/24").
IP string `json:"ip,omitempty"`
// ListenPort is the UDP port for WireGuard (default: 51820).
ListenPort int `json:"listenport,omitempty"`
// MTU is the interface MTU (0 = auto-configure).
MTU int `json:"mtu,omitempty"`
// PublicKey is the WireGuard public key (base64, read-only).
PublicKey string `json:"public_key,omitempty"`
// PrivateKey is the WireGuard private key (base64, hidden in responses).
PrivateKey string `json:"private_key,omitempty"`
// EndpointIP is the public-facing endpoint IP for peer configurations.
EndpointIP string `json:"endpoint_ip,omitempty"`
// NIC is the underlying machine NIC ID (read-only).
NIC FlexInt `json:"nic,omitempty"`
// Modified is the last modification timestamp (Unix epoch).
Modified int64 `json:"modified,omitempty"`
}
VNetWireGuard represents a VergeOS WireGuard VPN interface on a network.
type VNetWireGuardCreateRequest ¶
type VNetWireGuardCreateRequest struct {
// VNet is the parent network ID (required).
VNet int `json:"vnet"`
// Name is the interface name (required, max 128 chars).
Name string `json:"name"`
// Description is an optional description (max 2048 chars).
Description string `json:"description,omitempty"`
// Enabled indicates if the interface is active (default: true).
Enabled *bool `json:"enabled,omitempty"`
// IP is the WireGuard interface IP address with CIDR (required, e.g., "192.168.255.1/24").
IP string `json:"ip"`
// ListenPort is the UDP port for WireGuard (default: 51820).
ListenPort *int `json:"listenport,omitempty"`
// MTU is the interface MTU (0 = auto-configure).
MTU *int `json:"mtu,omitempty"`
// PrivateKey is the WireGuard private key (base64, leave blank to auto-generate).
PrivateKey string `json:"private_key,omitempty"`
// EndpointIP is the public-facing endpoint IP (auto-detected if blank).
EndpointIP string `json:"endpoint_ip,omitempty"`
// ConfigureFirewall creates a PAT rule on the external network.
ConfigureFirewall *bool `json:"configure_firewall,omitempty"`
// ExternalIP is the external IP address ID for firewall configuration.
ExternalIP *int `json:"external_ip,omitempty"`
// AutoApplyFirewall automatically applies firewall rules.
AutoApplyFirewall *bool `json:"auto_apply_firewall,omitempty"`
}
VNetWireGuardCreateRequest is the request body for creating a WireGuard interface.
type VNetWireGuardPeer ¶
type VNetWireGuardPeer struct {
// Key is the unique identifier for the peer.
Key FlexInt `json:"$key,omitempty"`
// WireGuard is the parent WireGuard interface ID.
WireGuard FlexInt `json:"wireguard,omitempty"`
// Name is the peer name.
Name string `json:"name"`
// Description is an optional description.
Description string `json:"description,omitempty"`
// Enabled indicates if the peer is active.
Enabled bool `json:"enabled,omitempty"`
// Endpoint is the peer's external IP or hostname (blank for roaming clients).
Endpoint string `json:"endpoint,omitempty"`
// Port is the peer's WireGuard port (default: 51820).
Port int `json:"port,omitempty"`
// PeerIP is the IP address for routing between endpoints.
PeerIP string `json:"peer_ip,omitempty"`
// PublicKey is the peer's WireGuard public key (base64, required).
PublicKey string `json:"public_key,omitempty"`
// PrivateKey is the peer's WireGuard private key (hidden).
PrivateKey string `json:"private_key,omitempty"`
PresharedKey string `json:"preshared_key,omitempty"`
// AllowedIPs is the list of allowed IP ranges (e.g., "10.1.2.0/24,192.168.0.0/16").
AllowedIPs string `json:"allowed_ips,omitempty"`
// ConfigureFirewall defines automatic firewall rule creation.
// Options: "site-to-site", "remote-user", "none"
ConfigureFirewall string `json:"configure_firewall,omitempty"`
// Keepalive is the persistent keepalive interval in seconds (0 = disabled).
Keepalive int `json:"keepalive,omitempty"`
// AutogeneratePeer enables downloadable peer configuration generation.
AutogeneratePeer bool `json:"autogenerate_peer,omitempty"`
// Status is the peer status reference (read-only).
Status FlexInt `json:"status,omitempty"`
// Modified is the last modification timestamp (Unix epoch).
Modified int64 `json:"modified,omitempty"`
}
VNetWireGuardPeer represents a WireGuard peer connection.
type VNetWireGuardPeerCreateRequest ¶
type VNetWireGuardPeerCreateRequest struct {
// WireGuard is the parent WireGuard interface ID (required).
WireGuard int `json:"wireguard"`
// Name is the peer name (required, max 128 chars).
Name string `json:"name"`
// Description is an optional description (max 2048 chars).
Description string `json:"description,omitempty"`
// Enabled indicates if the peer is active (default: true).
Enabled *bool `json:"enabled,omitempty"`
// Endpoint is the peer's external IP or hostname.
Endpoint string `json:"endpoint,omitempty"`
// Port is the peer's WireGuard port (default: 51820).
Port *int `json:"port,omitempty"`
// PeerIP is the IP address for routing between endpoints (required).
PeerIP string `json:"peer_ip"`
// PublicKey is the peer's WireGuard public key (required).
PublicKey string `json:"public_key"`
PresharedKey string `json:"preshared_key,omitempty"`
// AllowedIPs is the list of allowed IP ranges (required).
AllowedIPs string `json:"allowed_ips"`
// ConfigureFirewall defines automatic firewall rule creation.
// Options: "site-to-site" (default), "remote-user", "none"
ConfigureFirewall *string `json:"configure_firewall,omitempty"`
// Keepalive is the persistent keepalive interval in seconds.
Keepalive *int `json:"keepalive,omitempty"`
// AutogeneratePeer enables downloadable peer configuration generation.
AutogeneratePeer *bool `json:"autogenerate_peer,omitempty"`
}
VNetWireGuardPeerCreateRequest is the request body for creating a WireGuard peer.
type VNetWireGuardPeerService ¶
type VNetWireGuardPeerService struct {
// contains filtered or unexported fields
}
VNetWireGuardPeerService handles WireGuard peer operations.
func (*VNetWireGuardPeerService) Create ¶
func (s *VNetWireGuardPeerService) Create(ctx context.Context, req *VNetWireGuardPeerCreateRequest) (*VNetWireGuardPeer, error)
Create creates a new WireGuard peer and returns the created peer.
func (*VNetWireGuardPeerService) Delete ¶
func (s *VNetWireGuardPeerService) Delete(ctx context.Context, id int) error
Delete deletes a WireGuard peer.
func (*VNetWireGuardPeerService) Get ¶
func (s *VNetWireGuardPeerService) Get(ctx context.Context, id int) (*VNetWireGuardPeer, error)
Get returns a single WireGuard peer by ID.
func (*VNetWireGuardPeerService) GetByName ¶
func (s *VNetWireGuardPeerService) GetByName(ctx context.Context, wireguardID int, name string) (*VNetWireGuardPeer, error)
GetByName returns a WireGuard peer by name within a specific WireGuard interface.
func (*VNetWireGuardPeerService) GetConfig ¶
GetConfig retrieves the peer's WireGuard configuration file content. This is only available if autogenerate_peer is enabled on the peer.
func (*VNetWireGuardPeerService) List ¶
func (s *VNetWireGuardPeerService) List(ctx context.Context, opts ...ListOption) ([]VNetWireGuardPeer, error)
List returns all WireGuard peers, with optional filtering and pagination.
func (*VNetWireGuardPeerService) ListByWireGuard ¶
func (s *VNetWireGuardPeerService) ListByWireGuard(ctx context.Context, wireguardID int, opts ...ListOption) ([]VNetWireGuardPeer, error)
ListByWireGuard returns all peers for a specific WireGuard interface.
func (*VNetWireGuardPeerService) Update ¶
func (s *VNetWireGuardPeerService) Update(ctx context.Context, id int, req *VNetWireGuardPeerUpdateRequest) (*VNetWireGuardPeer, error)
Update updates a WireGuard peer and returns the updated peer.
type VNetWireGuardPeerServiceInterface ¶
type VNetWireGuardPeerServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]VNetWireGuardPeer, error)
ListByWireGuard(ctx context.Context, wireguardID int, opts ...ListOption) ([]VNetWireGuardPeer, error)
Get(ctx context.Context, id int) (*VNetWireGuardPeer, error)
GetByName(ctx context.Context, wireguardID int, name string) (*VNetWireGuardPeer, error)
Create(ctx context.Context, req *VNetWireGuardPeerCreateRequest) (*VNetWireGuardPeer, error)
Update(ctx context.Context, id int, req *VNetWireGuardPeerUpdateRequest) (*VNetWireGuardPeer, error)
Delete(ctx context.Context, id int) error
GetConfig(ctx context.Context, id int) (string, error)
}
VNetWireGuardPeerServiceInterface defines the interface for WireGuard peer operations.
type VNetWireGuardPeerStatus ¶
type VNetWireGuardPeerStatus struct {
// Key is the unique identifier for the status record.
Key FlexInt `json:"$key,omitempty"`
// Peer is the parent peer ID.
Peer FlexInt `json:"peer,omitempty"`
// LastHandshake is the timestamp of the last successful handshake (Unix epoch).
LastHandshake int64 `json:"last_handshake,omitempty"`
// TXBytes is the total bytes transmitted to this peer.
TXBytes int64 `json:"tx_bytes,omitempty"`
// RXBytes is the total bytes received from this peer.
RXBytes int64 `json:"rx_bytes,omitempty"`
// LastUpdate is the timestamp of the last status update (Unix epoch).
LastUpdate int64 `json:"last_update,omitempty"`
}
VNetWireGuardPeerStatus represents the status of a WireGuard peer connection.
type VNetWireGuardPeerStatusService ¶
type VNetWireGuardPeerStatusService struct {
// contains filtered or unexported fields
}
VNetWireGuardPeerStatusService handles WireGuard peer status operations (read-only).
func (*VNetWireGuardPeerStatusService) Get ¶
func (s *VNetWireGuardPeerStatusService) Get(ctx context.Context, id int) (*VNetWireGuardPeerStatus, error)
Get returns a single WireGuard peer status by ID.
func (*VNetWireGuardPeerStatusService) GetByPeer ¶
func (s *VNetWireGuardPeerStatusService) GetByPeer(ctx context.Context, peerID int) (*VNetWireGuardPeerStatus, error)
GetByPeer returns the status for a specific WireGuard peer.
func (*VNetWireGuardPeerStatusService) List ¶
func (s *VNetWireGuardPeerStatusService) List(ctx context.Context, opts ...ListOption) ([]VNetWireGuardPeerStatus, error)
List returns all WireGuard peer statuses, with optional filtering.
type VNetWireGuardPeerStatusServiceInterface ¶
type VNetWireGuardPeerStatusServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]VNetWireGuardPeerStatus, error)
Get(ctx context.Context, id int) (*VNetWireGuardPeerStatus, error)
GetByPeer(ctx context.Context, peerID int) (*VNetWireGuardPeerStatus, error)
}
VNetWireGuardPeerStatusServiceInterface defines the interface for WireGuard peer status operations (read-only).
type VNetWireGuardPeerUpdateRequest ¶
type VNetWireGuardPeerUpdateRequest struct {
// Name is the peer name.
Name *string `json:"name,omitempty"`
// Description is the peer description.
Description *string `json:"description,omitempty"`
// Enabled indicates if the peer is active.
Enabled *bool `json:"enabled,omitempty"`
// Endpoint is the peer's external IP or hostname.
Endpoint *string `json:"endpoint,omitempty"`
// Port is the peer's WireGuard port.
Port *int `json:"port,omitempty"`
// PeerIP is the IP address for routing between endpoints.
PeerIP *string `json:"peer_ip,omitempty"`
// PublicKey is the peer's WireGuard public key.
PublicKey *string `json:"public_key,omitempty"`
PresharedKey *string `json:"preshared_key,omitempty"`
// AllowedIPs is the list of allowed IP ranges.
AllowedIPs *string `json:"allowed_ips,omitempty"`
// ConfigureFirewall defines automatic firewall rule creation.
ConfigureFirewall *string `json:"configure_firewall,omitempty"`
// Keepalive is the persistent keepalive interval in seconds.
Keepalive *int `json:"keepalive,omitempty"`
// AutogeneratePeer enables downloadable peer configuration generation.
AutogeneratePeer *bool `json:"autogenerate_peer,omitempty"`
}
VNetWireGuardPeerUpdateRequest is the request body for updating a WireGuard peer.
type VNetWireGuardService ¶
type VNetWireGuardService struct {
// contains filtered or unexported fields
}
VNetWireGuardService handles WireGuard VPN interface operations.
func (*VNetWireGuardService) Create ¶
func (s *VNetWireGuardService) Create(ctx context.Context, req *VNetWireGuardCreateRequest) (*VNetWireGuard, error)
Create creates a new WireGuard interface and returns the created interface.
func (*VNetWireGuardService) Delete ¶
func (s *VNetWireGuardService) Delete(ctx context.Context, id int) error
Delete deletes a WireGuard interface.
func (*VNetWireGuardService) Get ¶
func (s *VNetWireGuardService) Get(ctx context.Context, id int) (*VNetWireGuard, error)
Get returns a single WireGuard interface by ID.
func (*VNetWireGuardService) GetByName ¶
func (s *VNetWireGuardService) GetByName(ctx context.Context, vnetID int, name string) (*VNetWireGuard, error)
GetByName returns a WireGuard interface by name within a specific network.
func (*VNetWireGuardService) List ¶
func (s *VNetWireGuardService) List(ctx context.Context, opts ...ListOption) ([]VNetWireGuard, error)
List returns all WireGuard interfaces, with optional filtering and pagination.
func (*VNetWireGuardService) ListByNetwork ¶
func (s *VNetWireGuardService) ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]VNetWireGuard, error)
ListByNetwork returns all WireGuard interfaces for a specific network.
func (*VNetWireGuardService) Update ¶
func (s *VNetWireGuardService) Update(ctx context.Context, id int, req *VNetWireGuardUpdateRequest) (*VNetWireGuard, error)
Update updates a WireGuard interface and returns the updated interface.
type VNetWireGuardServiceInterface ¶
type VNetWireGuardServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]VNetWireGuard, error)
ListByNetwork(ctx context.Context, vnetID int, opts ...ListOption) ([]VNetWireGuard, error)
Get(ctx context.Context, id int) (*VNetWireGuard, error)
GetByName(ctx context.Context, vnetID int, name string) (*VNetWireGuard, error)
Create(ctx context.Context, req *VNetWireGuardCreateRequest) (*VNetWireGuard, error)
Update(ctx context.Context, id int, req *VNetWireGuardUpdateRequest) (*VNetWireGuard, error)
Delete(ctx context.Context, id int) error
}
VNetWireGuardServiceInterface defines the interface for WireGuard VPN interface operations.
type VNetWireGuardUpdateRequest ¶
type VNetWireGuardUpdateRequest struct {
// Name is the interface name.
Name *string `json:"name,omitempty"`
// Description is the interface description.
Description *string `json:"description,omitempty"`
// Enabled indicates if the interface is active.
Enabled *bool `json:"enabled,omitempty"`
// IP is the WireGuard interface IP address with CIDR.
IP *string `json:"ip,omitempty"`
// ListenPort is the UDP port for WireGuard.
ListenPort *int `json:"listenport,omitempty"`
// MTU is the interface MTU.
MTU *int `json:"mtu,omitempty"`
// PrivateKey is the WireGuard private key.
PrivateKey *string `json:"private_key,omitempty"`
// EndpointIP is the public-facing endpoint IP.
EndpointIP *string `json:"endpoint_ip,omitempty"`
}
VNetWireGuardUpdateRequest is the request body for updating a WireGuard interface.
type ValidationError ¶
ValidationError is returned when request validation fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
type Volume ¶
type Volume struct {
// Key is the unique SHA1 hash key (same as ID for volumes).
Key string `json:"$key,omitempty"`
// ID is the unique SHA1 hash identifier for the volume (same as Key).
ID string `json:"id,omitempty"`
// Name is the volume name (alphanumeric without spaces).
Name string `json:"name"`
// Description is an optional description of the volume.
Description string `json:"description,omitempty"`
// Enabled indicates whether the volume is enabled.
Enabled bool `json:"enabled"`
// Created is the creation timestamp (Unix epoch).
Created int64 `json:"created,omitempty"`
// Modified is the last modified timestamp (Unix epoch).
Modified int64 `json:"modified,omitempty"`
// Creator is the username that created this volume.
Creator string `json:"creator,omitempty"`
// Service is the NAS service ID this volume belongs to.
Service FlexInt `json:"service,omitempty"`
// Drive is the underlying machine drive ID.
Drive FlexInt `json:"drive,omitempty"`
// IsSnapshot indicates whether this volume is a snapshot.
IsSnapshot bool `json:"is_snapshot,omitempty"`
// Storage configuration
// MaxSize is the maximum size in bytes.
MaxSize int64 `json:"maxsize,omitempty"`
// PreferredTier is the preferred storage tier (1-5).
PreferredTier string `json:"preferred_tier,omitempty"`
// SnapshotProfile is the snapshot profile ID (0 = none).
SnapshotProfile FlexInt `json:"snapshot_profile,omitempty"`
// FSType is the filesystem type (ext4, ybfs, cifs, nfs, fc_nimble, verge_vm_export).
FSType string `json:"fs_type,omitempty"`
// Discard indicates whether TRIM/discard is enabled.
Discard bool `json:"discard,omitempty"`
// ReadOnly indicates whether the volume is read-only.
ReadOnly bool `json:"read_only,omitempty"`
// Optimize is the optimization mode (general, large).
Optimize string `json:"optimize,omitempty"`
// Ownership
// OwnerUser is the Unix user that owns the volume directory.
OwnerUser string `json:"owner_user,omitempty"`
// OwnerGroup is the Unix group that owns the volume directory.
OwnerGroup string `json:"owner_group,omitempty"`
// Snapshots
// AutomountSnapshots indicates whether to automatically mount snapshots.
AutomountSnapshots bool `json:"automount_snapshots,omitempty"`
// Encryption
// Encrypt indicates whether the volume is encrypted.
Encrypt bool `json:"encrypt,omitempty"`
// Remote volume configuration (for CIFS/NFS remote mounts)
// RemoteTarget is the remote server and path (e.g., "//server/share" or "server:/path").
RemoteTarget string `json:"remote_target,omitempty"`
// CIFSUser is the username for CIFS authentication.
CIFSUser string `json:"cifs_user,omitempty"`
// CIFSProtocol is the SMB protocol version (1.0, 2.0, 2.1, 3.0).
CIFSProtocol string `json:"cifs_protocol,omitempty"`
// NFSProtocol is the NFS protocol version ("", 2, 3, 4).
NFSProtocol string `json:"nfs_protocol,omitempty"`
// MountOptions contains additional mount options.
MountOptions string `json:"mount_options,omitempty"`
// ReadAheadKB is the read-ahead buffer size (0, 64, 128, 256, 512, 1024, 2048, 4096).
ReadAheadKB string `json:"read_ahead_kb,omitempty"`
// Note is a free-form note about the volume.
Note string `json:"note,omitempty"`
}
Volume represents a VergeOS NAS volume. Note: Unlike other resources, Volume uses a SHA1 hash string as its key ($key and id are the same).
type VolumeBrowserEntry ¶
type VolumeBrowserEntry struct {
// Name is the file or directory name.
Name string `json:"name"`
// NName is the normalized name (lowercase).
NName string `json:"n_name,omitempty"`
// Size is the size in bytes.
Size int64 `json:"size"`
// Date is the modification time (Unix timestamp).
Date int64 `json:"date"`
// Type is "file" or "directory".
Type string `json:"type"`
}
VolumeBrowserEntry represents a file or directory entry in browse results.
type VolumeBrowserFilter ¶
type VolumeBrowserFilter struct {
// Extensions filters by file extensions (empty for all).
Extensions string `json:"extensions"`
}
VolumeBrowserFilter contains filter options for browse operations.
type VolumeBrowserJob ¶
type VolumeBrowserJob struct {
// Key is the unique SHA1 hash job ID.
Key string `json:"$key,omitempty"`
// ID is the unique SHA1 hash identifier (same as Key).
ID string `json:"id,omitempty"`
// Volume is the volume SHA1 key being browsed.
Volume string `json:"volume,omitempty"`
// Query is the operation type: get-dir, rename, delete, paste.
Query string `json:"query,omitempty"`
// Params contains the query parameters.
Params json.RawMessage `json:"params,omitempty"`
// Status is the job status: running, complete, error.
Status string `json:"status,omitempty"`
// Result contains the operation result (must be explicitly requested with fields param).
Result json.RawMessage `json:"result,omitempty"`
// Command is the command used to execute the query (read-only).
Command string `json:"command,omitempty"`
// Created is the creation timestamp in microseconds.
Created int64 `json:"created,omitempty"`
// Modified is the last modified timestamp.
Modified int64 `json:"modified,omitempty"`
// Expires is when the job expires.
Expires int64 `json:"expires,omitempty"`
}
VolumeBrowserJob represents a volume browser job. The volume browser API is asynchronous - you create a job and poll for results.
type VolumeBrowserParams ¶
type VolumeBrowserParams struct {
// Dir is the directory path to browse. Use "" for root, NOT "/".
Dir string `json:"dir"`
// Limit is the maximum number of entries to return.
Limit int `json:"limit"`
// Offset is the pagination offset (nil for first page).
Offset *int `json:"offset"`
// Filter contains filter options.
Filter *VolumeBrowserFilter `json:"filter"`
// Volume is the volume SHA1 key (must match top-level Volume).
Volume string `json:"volume"`
// Sort is the sort field (empty for default).
Sort string `json:"sort"`
// Additional params for rename/delete/paste operations
// Name is the new name (for rename).
Name string `json:"name,omitempty"`
// Items is the list of items to operate on (for delete/paste).
Items []string `json:"items,omitempty"`
// DestDir is the destination directory (for paste).
DestDir string `json:"dest_dir,omitempty"`
// Mode is the paste mode: copy, move.
Mode string `json:"mode,omitempty"`
}
VolumeBrowserParams contains parameters for browse operations.
type VolumeBrowserRequest ¶
type VolumeBrowserRequest struct {
// Volume is the volume SHA1 key to browse (required).
Volume string `json:"volume"`
// Query is the operation type (required): get-dir, rename, delete, paste.
Query string `json:"query"`
// Params contains the query-specific parameters (required).
Params *VolumeBrowserParams `json:"params"`
}
VolumeBrowserRequest is the request body for creating a browse job.
type VolumeBrowserService ¶
type VolumeBrowserService struct {
// contains filtered or unexported fields
}
VolumeBrowserService handles volume file browsing operations. The volume browser API is asynchronous: create a job, then poll for results. Note: The NAS service VM must be running to browse volumes.
func (*VolumeBrowserService) Browse ¶
func (s *VolumeBrowserService) Browse(ctx context.Context, volumeID, dir string, limit int) ([]VolumeBrowserEntry, error)
Browse browses a directory in a volume and returns the entries. This is a convenience method that handles the async job creation and polling. Use "" for dir to browse the root directory, NOT "/".
func (*VolumeBrowserService) BrowseWithOptions ¶
func (s *VolumeBrowserService) BrowseWithOptions(ctx context.Context, volumeID, dir string, limit int, offset *int, extensions string) ([]VolumeBrowserEntry, error)
BrowseWithOptions browses a directory with additional options.
func (*VolumeBrowserService) CreateJob ¶
func (s *VolumeBrowserService) CreateJob(ctx context.Context, req *VolumeBrowserRequest) (*VolumeBrowserJob, error)
CreateJob creates a new browse job. Use GetJob or WaitForResult to poll for the job result.
func (*VolumeBrowserService) GetJob ¶
func (s *VolumeBrowserService) GetJob(ctx context.Context, id string) (*VolumeBrowserJob, error)
GetJob returns a browse job by ID. IMPORTANT: You must request the "result" field explicitly to get the actual results.
func (*VolumeBrowserService) List ¶
func (s *VolumeBrowserService) List(ctx context.Context, opts ...ListOption) ([]VolumeBrowserJob, error)
List returns all browse jobs, with optional filtering.
func (*VolumeBrowserService) ListByVolume ¶
func (s *VolumeBrowserService) ListByVolume(ctx context.Context, volumeID string, opts ...ListOption) ([]VolumeBrowserJob, error)
ListByVolume returns all browse jobs for a specific volume.
func (*VolumeBrowserService) WaitForResult ¶
func (s *VolumeBrowserService) WaitForResult(ctx context.Context, jobID string, timeout time.Duration) ([]VolumeBrowserEntry, error)
WaitForResult polls a browse job until it completes or times out. Returns the parsed file/directory entries.
type VolumeBrowserServiceInterface ¶
type VolumeBrowserServiceInterface interface {
Browse(ctx context.Context, volumeID, dir string, limit int) ([]VolumeBrowserEntry, error)
BrowseWithOptions(ctx context.Context, volumeID, dir string, limit int, offset *int, extensions string) ([]VolumeBrowserEntry, error)
CreateJob(ctx context.Context, req *VolumeBrowserRequest) (*VolumeBrowserJob, error)
GetJob(ctx context.Context, id string) (*VolumeBrowserJob, error)
WaitForResult(ctx context.Context, jobID string, timeout time.Duration) ([]VolumeBrowserEntry, error)
List(ctx context.Context, opts ...ListOption) ([]VolumeBrowserJob, error)
ListByVolume(ctx context.Context, volumeID string, opts ...ListOption) ([]VolumeBrowserJob, error)
}
VolumeBrowserServiceInterface defines the interface for volume file browsing operations. The volume browser API is asynchronous: create a job, then poll for results.
type VolumeCIFSShare ¶
type VolumeCIFSShare struct {
Key string `json:"$key,omitempty"`
ID string `json:"id,omitempty"`
Name string `json:"name"`
Volume string `json:"volume,omitempty"`
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled"`
Created int64 `json:"created,omitempty"`
Modified int64 `json:"modified,omitempty"`
// SharePath is the path within the volume to share (empty = entire volume).
SharePath string `json:"share_path,omitempty"`
Comment string `json:"comment,omitempty"`
// ValidUsers is the list of users who can connect (one per line).
ValidUsers string `json:"valid_users,omitempty"`
ValidGroups string `json:"valid_groups,omitempty"`
AdminUsers string `json:"admin_users,omitempty"`
AdminGroups string `json:"admin_groups,omitempty"`
// HostAllow is the list of allowed hosts (one per line).
HostAllow string `json:"host_allow,omitempty"`
HostDeny string `json:"host_deny,omitempty"`
// ForceUser forces all operations as this user.
ForceUser string `json:"force_user,omitempty"`
ForceGroup string `json:"force_group,omitempty"`
// Browseable indicates whether the share is visible in network browsing.
Browseable bool `json:"browseable,omitempty"`
ReadOnly bool `json:"read_only,omitempty"`
GuestOK bool `json:"guest_ok,omitempty"`
GuestOnly bool `json:"guest_only,omitempty"`
// Advanced contains additional smb.conf share section options.
Advanced string `json:"advanced,omitempty"`
VFSShadowCopy2 bool `json:"vfs_shadow_copy2,omitempty"`
Status FlexInt `json:"status,omitempty"`
}
VolumeCIFSShare represents a CIFS (SMB) share on a NAS volume. Note: Like volumes, CIFS shares use SHA1 hash strings as their key.
type VolumeCIFSShareCreateRequest ¶
type VolumeCIFSShareCreateRequest struct {
Name string `json:"name"`
Volume string `json:"volume"`
Description string `json:"description,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
// SharePath is the path within the volume to share.
SharePath *string `json:"share_path,omitempty"`
Comment *string `json:"comment,omitempty"`
// ValidUsers is the list of users who can connect (newline-delimited).
ValidUsers *string `json:"valid_users,omitempty"`
ValidGroups *string `json:"valid_groups,omitempty"`
AdminUsers *string `json:"admin_users,omitempty"`
AdminGroups *string `json:"admin_groups,omitempty"`
HostAllow *string `json:"host_allow,omitempty"`
HostDeny *string `json:"host_deny,omitempty"`
// ForceUser forces all operations as this user.
ForceUser *string `json:"force_user,omitempty"`
ForceGroup *string `json:"force_group,omitempty"`
// Browseable indicates whether the share is visible.
Browseable *bool `json:"browseable,omitempty"`
ReadOnly *bool `json:"read_only,omitempty"`
GuestOK *bool `json:"guest_ok,omitempty"`
GuestOnly *bool `json:"guest_only,omitempty"`
// Advanced contains additional smb.conf options.
Advanced *string `json:"advanced,omitempty"`
VFSShadowCopy2 *bool `json:"vfs_shadow_copy2,omitempty"`
}
VolumeCIFSShareCreateRequest is the request body for creating a CIFS share.
type VolumeCIFSShareService ¶
type VolumeCIFSShareService struct {
// contains filtered or unexported fields
}
VolumeCIFSShareService handles CIFS (SMB) share operations on NAS volumes. Note: Like volumes, CIFS shares use SHA1 hash strings as keys instead of integers.
func (*VolumeCIFSShareService) Create ¶
func (s *VolumeCIFSShareService) Create(ctx context.Context, req *VolumeCIFSShareCreateRequest) (*VolumeCIFSShare, error)
Create creates a new CIFS share and returns the created share.
func (*VolumeCIFSShareService) Delete ¶
func (s *VolumeCIFSShareService) Delete(ctx context.Context, id string) error
Delete deletes a CIFS share.
func (*VolumeCIFSShareService) Get ¶
func (s *VolumeCIFSShareService) Get(ctx context.Context, id string) (*VolumeCIFSShare, error)
Get returns a single CIFS share by its SHA1 ID.
func (*VolumeCIFSShareService) GetByName ¶
func (s *VolumeCIFSShareService) GetByName(ctx context.Context, volumeID, name string) (*VolumeCIFSShare, error)
GetByName returns a single CIFS share by name within a volume.
func (*VolumeCIFSShareService) List ¶
func (s *VolumeCIFSShareService) List(ctx context.Context, opts ...ListOption) ([]VolumeCIFSShare, error)
List returns all CIFS shares, with optional filtering and pagination.
func (*VolumeCIFSShareService) ListByVolume ¶
func (s *VolumeCIFSShareService) ListByVolume(ctx context.Context, volumeID string, opts ...ListOption) ([]VolumeCIFSShare, error)
ListByVolume returns all CIFS shares belonging to a specific volume.
func (*VolumeCIFSShareService) Update ¶
func (s *VolumeCIFSShareService) Update(ctx context.Context, id string, req *VolumeCIFSShareUpdateRequest) (*VolumeCIFSShare, error)
Update updates a CIFS share and returns the updated share.
type VolumeCIFSShareServiceInterface ¶
type VolumeCIFSShareServiceInterface interface {
}
VolumeCIFSShareServiceInterface defines the interface for CIFS share operations. Note: Like volumes, CIFS shares use SHA1 hash strings as IDs instead of integers.
type VolumeCIFSShareUpdateRequest ¶
type VolumeCIFSShareUpdateRequest struct {
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
// SharePath is the path within the volume.
SharePath *string `json:"share_path,omitempty"`
Comment *string `json:"comment,omitempty"`
// ValidUsers is the list of users who can connect.
ValidUsers *string `json:"valid_users,omitempty"`
ValidGroups *string `json:"valid_groups,omitempty"`
AdminUsers *string `json:"admin_users,omitempty"`
AdminGroups *string `json:"admin_groups,omitempty"`
HostAllow *string `json:"host_allow,omitempty"`
HostDeny *string `json:"host_deny,omitempty"`
// ForceUser forces all operations as this user.
ForceUser *string `json:"force_user,omitempty"`
ForceGroup *string `json:"force_group,omitempty"`
// Browseable indicates whether the share is visible.
Browseable *bool `json:"browseable,omitempty"`
ReadOnly *bool `json:"read_only,omitempty"`
GuestOK *bool `json:"guest_ok,omitempty"`
GuestOnly *bool `json:"guest_only,omitempty"`
// Advanced contains additional smb.conf options.
Advanced *string `json:"advanced,omitempty"`
VFSShadowCopy2 *bool `json:"vfs_shadow_copy2,omitempty"`
}
VolumeCIFSShareUpdateRequest is the request body for updating a CIFS share.
type VolumeCreateRequest ¶
type VolumeCreateRequest struct {
// Name is the volume name (required, alphanumeric without spaces).
Name string `json:"name"`
// Service is the NAS service ID (required).
Service int `json:"service"`
// Description is an optional description of the volume.
Description string `json:"description,omitempty"`
// Enabled indicates whether the volume is enabled.
Enabled *bool `json:"enabled,omitempty"`
// Storage configuration
// MaxSize is the maximum size in bytes (min 1MB).
MaxSize *int64 `json:"maxsize,omitempty"`
// PreferredTier is the preferred storage tier (1-5).
PreferredTier *string `json:"preferred_tier,omitempty"`
// SnapshotProfile is the snapshot profile ID.
SnapshotProfile *int `json:"snapshot_profile,omitempty"`
// Discard indicates whether TRIM/discard is enabled.
Discard *bool `json:"discard,omitempty"`
// ReadOnly indicates whether the volume is read-only.
ReadOnly *bool `json:"read_only,omitempty"`
// Optimize is the optimization mode (general, large).
Optimize *string `json:"optimize,omitempty"`
// Ownership
// OwnerUser is the Unix user that owns the volume directory.
OwnerUser *string `json:"owner_user,omitempty"`
// OwnerGroup is the Unix group that owns the volume directory.
OwnerGroup *string `json:"owner_group,omitempty"`
// Snapshots
// AutomountSnapshots indicates whether to automatically mount snapshots.
AutomountSnapshots *bool `json:"automount_snapshots,omitempty"`
// Encryption (only at creation time)
// Encrypt indicates whether to encrypt the volume.
Encrypt *bool `json:"encrypt,omitempty"`
// EncryptionKey is the encryption key/passphrase.
EncryptionKey *string `json:"encryption_key,omitempty"`
// Remote volume configuration (for CIFS/NFS remote mounts)
// RemoteTarget is the remote server and path.
RemoteTarget *string `json:"remote_target,omitempty"`
// CIFSUser is the username for CIFS authentication.
CIFSUser *string `json:"cifs_user,omitempty"`
// CIFSPassword is the password for CIFS authentication.
CIFSPassword *string `json:"cifs_password,omitempty"`
// CIFSProtocol is the SMB protocol version (1.0, 2.0, 2.1, 3.0).
CIFSProtocol *string `json:"cifs_protocol,omitempty"`
// NFSProtocol is the NFS protocol version ("", 2, 3, 4).
NFSProtocol *string `json:"nfs_protocol,omitempty"`
// MountOptions contains additional mount options.
MountOptions *string `json:"mount_options,omitempty"`
// ReadAheadKB is the read-ahead buffer size.
ReadAheadKB *string `json:"read_ahead_kb,omitempty"`
// Note is a free-form note about the volume.
Note *string `json:"note,omitempty"`
}
VolumeCreateRequest is the request body for creating a volume.
type VolumeNFSShare ¶
type VolumeNFSShare struct {
Key string `json:"$key,omitempty"`
ID string `json:"id,omitempty"`
Name string `json:"name"`
Volume string `json:"volume,omitempty"`
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled"`
Created int64 `json:"created,omitempty"`
Modified int64 `json:"modified,omitempty"`
// SharePath is the path within the volume to share (empty = entire volume).
SharePath string `json:"share_path,omitempty"`
// AllowedHosts is a comma-delimited list of allowed hosts/networks.
AllowedHosts string `json:"allowed_hosts,omitempty"`
AllowAll bool `json:"allow_all,omitempty"`
// FSID is the filesystem ID (must be unique; valid: number|root|uuid).
FSID string `json:"fsid,omitempty"`
AnonUID string `json:"anonuid,omitempty"`
AnonGID string `json:"anongid,omitempty"`
// NoACL disables access control lists.
NoACL bool `json:"no_acl,omitempty"`
Insecure bool `json:"insecure,omitempty"`
Async bool `json:"async,omitempty"`
// Squash controls user/group ID mapping: root_squash, all_squash, no_root_squash.
Squash string `json:"squash,omitempty"`
// DataAccess controls read/write permissions: ro, rw.
DataAccess string `json:"data_access,omitempty"`
Status FlexInt `json:"status,omitempty"`
}
VolumeNFSShare represents an NFS share on a NAS volume. Note: Like volumes, NFS shares use SHA1 hash strings as their key.
type VolumeNFSShareCreateRequest ¶
type VolumeNFSShareCreateRequest struct {
Name string `json:"name"`
Volume string `json:"volume"`
Description string `json:"description,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
// SharePath is the path within the volume to share.
SharePath *string `json:"share_path,omitempty"`
// AllowedHosts is a comma-delimited list of allowed hosts/networks.
AllowedHosts *string `json:"allowed_hosts,omitempty"`
AllowAll *bool `json:"allow_all,omitempty"`
// FSID is the filesystem ID.
FSID *string `json:"fsid,omitempty"`
AnonUID *string `json:"anonuid,omitempty"`
AnonGID *string `json:"anongid,omitempty"`
// NoACL disables access control lists.
NoACL *bool `json:"no_acl,omitempty"`
Insecure *bool `json:"insecure,omitempty"`
Async *bool `json:"async,omitempty"`
// Squash controls user/group ID mapping (default: root_squash).
Squash *string `json:"squash,omitempty"`
// DataAccess controls read/write permissions (default: ro).
DataAccess *string `json:"data_access,omitempty"`
}
VolumeNFSShareCreateRequest is the request body for creating an NFS share.
type VolumeNFSShareService ¶
type VolumeNFSShareService struct {
// contains filtered or unexported fields
}
VolumeNFSShareService handles NFS share operations on NAS volumes. Note: Like volumes, NFS shares use SHA1 hash strings as keys instead of integers.
func (*VolumeNFSShareService) Create ¶
func (s *VolumeNFSShareService) Create(ctx context.Context, req *VolumeNFSShareCreateRequest) (*VolumeNFSShare, error)
Create creates a new NFS share and returns the created share.
func (*VolumeNFSShareService) Delete ¶
func (s *VolumeNFSShareService) Delete(ctx context.Context, id string) error
Delete deletes an NFS share.
func (*VolumeNFSShareService) Get ¶
func (s *VolumeNFSShareService) Get(ctx context.Context, id string) (*VolumeNFSShare, error)
Get returns a single NFS share by its SHA1 ID.
func (*VolumeNFSShareService) GetByName ¶
func (s *VolumeNFSShareService) GetByName(ctx context.Context, volumeID, name string) (*VolumeNFSShare, error)
GetByName returns a single NFS share by name within a volume.
func (*VolumeNFSShareService) List ¶
func (s *VolumeNFSShareService) List(ctx context.Context, opts ...ListOption) ([]VolumeNFSShare, error)
List returns all NFS shares, with optional filtering and pagination.
func (*VolumeNFSShareService) ListByVolume ¶
func (s *VolumeNFSShareService) ListByVolume(ctx context.Context, volumeID string, opts ...ListOption) ([]VolumeNFSShare, error)
ListByVolume returns all NFS shares belonging to a specific volume.
func (*VolumeNFSShareService) Update ¶
func (s *VolumeNFSShareService) Update(ctx context.Context, id string, req *VolumeNFSShareUpdateRequest) (*VolumeNFSShare, error)
Update updates an NFS share and returns the updated share.
type VolumeNFSShareServiceInterface ¶
type VolumeNFSShareServiceInterface interface {
}
VolumeNFSShareServiceInterface defines the interface for NFS share operations. Note: Like volumes, NFS shares use SHA1 hash strings as IDs instead of integers.
type VolumeNFSShareUpdateRequest ¶
type VolumeNFSShareUpdateRequest struct {
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
// SharePath is the path within the volume.
SharePath *string `json:"share_path,omitempty"`
// AllowedHosts is a comma-delimited list of allowed hosts/networks.
AllowedHosts *string `json:"allowed_hosts,omitempty"`
AllowAll *bool `json:"allow_all,omitempty"`
// FSID is the filesystem ID.
FSID *string `json:"fsid,omitempty"`
AnonUID *string `json:"anonuid,omitempty"`
AnonGID *string `json:"anongid,omitempty"`
// NoACL disables access control lists.
NoACL *bool `json:"no_acl,omitempty"`
Insecure *bool `json:"insecure,omitempty"`
Async *bool `json:"async,omitempty"`
// Squash controls user/group ID mapping.
Squash *string `json:"squash,omitempty"`
// DataAccess controls read/write permissions.
DataAccess *string `json:"data_access,omitempty"`
}
VolumeNFSShareUpdateRequest is the request body for updating an NFS share.
type VolumeService ¶
type VolumeService struct {
// contains filtered or unexported fields
}
VolumeService handles NAS volume operations. Note: Unlike other resources, volumes use SHA1 hash strings as keys instead of integers.
func (*VolumeService) Create ¶
func (s *VolumeService) Create(ctx context.Context, req *VolumeCreateRequest) (*Volume, error)
Create creates a new volume and returns the created volume.
func (*VolumeService) Delete ¶
func (s *VolumeService) Delete(ctx context.Context, id string) error
Delete deletes a volume.
func (*VolumeService) Disable ¶
func (s *VolumeService) Disable(ctx context.Context, id string) error
Disable disables a volume.
func (*VolumeService) Enable ¶
func (s *VolumeService) Enable(ctx context.Context, id string) error
Enable enables a volume.
func (*VolumeService) List ¶
func (s *VolumeService) List(ctx context.Context, opts ...ListOption) ([]Volume, error)
List returns all volumes, with optional filtering and pagination.
func (*VolumeService) ListByService ¶
ListByService returns all volumes belonging to a specific NAS service.
func (*VolumeService) Reset ¶
func (s *VolumeService) Reset(ctx context.Context, id string) error
Reset resets a volume (remounts it).
func (*VolumeService) Update ¶
func (s *VolumeService) Update(ctx context.Context, id string, req *VolumeUpdateRequest) (*Volume, error)
Update updates a volume and returns the updated volume.
type VolumeServiceInterface ¶
type VolumeServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]Volume, error)
ListByService(ctx context.Context, serviceID int) ([]Volume, error)
Get(ctx context.Context, id string) (*Volume, error)
GetByName(ctx context.Context, serviceID int, name string) (*Volume, error)
Create(ctx context.Context, req *VolumeCreateRequest) (*Volume, error)
Update(ctx context.Context, id string, req *VolumeUpdateRequest) (*Volume, error)
Delete(ctx context.Context, id string) error
Enable(ctx context.Context, id string) error
Disable(ctx context.Context, id string) error
Reset(ctx context.Context, id string) error
}
VolumeServiceInterface defines the interface for Volume operations. Note: Unlike other resources, volumes use SHA1 hash strings as IDs instead of integers.
type VolumeSnapshot ¶
type VolumeSnapshot struct {
// Key is the unique identifier for this snapshot.
Key FlexInt `json:"$key,omitempty"`
// Volume is the parent volume ID.
Volume FlexInt `json:"volume,omitempty"`
// SnapVolume is the snapshot volume reference (read-only).
SnapVolume FlexInt `json:"snap_volume,omitempty"`
// Name is the snapshot name.
Name string `json:"name"`
// Description is an optional description of the snapshot.
Description string `json:"description,omitempty"`
// Created is the creation timestamp (Unix epoch).
Created int64 `json:"created,omitempty"`
// Expiration settings
// ExpiresType is the expiration type (never or date).
ExpiresType string `json:"expires_type,omitempty"`
// Expires is the expiration timestamp (Unix epoch).
Expires int64 `json:"expires,omitempty"`
// Status flags
// Enabled indicates whether the snapshot is enabled.
Enabled bool `json:"enabled"`
// CreatedManually indicates whether this snapshot was created manually (vs scheduled).
CreatedManually bool `json:"created_manually,omitempty"`
// Quiesce indicates whether I/O was frozen during snapshot creation.
Quiesce bool `json:"quiesce,omitempty"`
}
VolumeSnapshot represents a snapshot of a VergeOS NAS volume.
type VolumeSnapshotCreateRequest ¶
type VolumeSnapshotCreateRequest struct {
// Volume is the parent volume ID (required).
Volume int `json:"volume"`
// Name is the snapshot name (required, 1-128 chars).
Name string `json:"name"`
// Description is an optional description of the snapshot.
Description string `json:"description,omitempty"`
// Enabled indicates whether the snapshot is enabled.
Enabled *bool `json:"enabled,omitempty"`
// Expiration settings
// ExpiresType is the expiration type (never or date).
ExpiresType *string `json:"expires_type,omitempty"`
// Expires is the expiration timestamp (Unix epoch). Default: now + 3 days.
Expires *int64 `json:"expires,omitempty"`
// Quiesce freezes I/O during snapshot creation for consistency.
Quiesce *bool `json:"quiesce,omitempty"`
}
VolumeSnapshotCreateRequest is the request body for creating a volume snapshot.
type VolumeSnapshotService ¶
type VolumeSnapshotService struct {
// contains filtered or unexported fields
}
VolumeSnapshotService handles NAS volume snapshot operations.
func (*VolumeSnapshotService) Create ¶
func (s *VolumeSnapshotService) Create(ctx context.Context, req *VolumeSnapshotCreateRequest) (*VolumeSnapshot, error)
Create creates a new volume snapshot and returns the created snapshot.
func (*VolumeSnapshotService) Delete ¶
func (s *VolumeSnapshotService) Delete(ctx context.Context, id int) error
Delete deletes a volume snapshot.
func (*VolumeSnapshotService) Disable ¶
func (s *VolumeSnapshotService) Disable(ctx context.Context, id int) error
Disable disables a volume snapshot.
func (*VolumeSnapshotService) Enable ¶
func (s *VolumeSnapshotService) Enable(ctx context.Context, id int) error
Enable enables a volume snapshot.
func (*VolumeSnapshotService) Get ¶
func (s *VolumeSnapshotService) Get(ctx context.Context, id int) (*VolumeSnapshot, error)
Get returns a single volume snapshot by ID.
func (*VolumeSnapshotService) GetByName ¶
func (s *VolumeSnapshotService) GetByName(ctx context.Context, volumeID int, name string) (*VolumeSnapshot, error)
GetByName returns a volume snapshot by name within a specific volume.
func (*VolumeSnapshotService) List ¶
func (s *VolumeSnapshotService) List(ctx context.Context, opts ...ListOption) ([]VolumeSnapshot, error)
List returns all volume snapshots, with optional filtering and pagination.
func (*VolumeSnapshotService) ListByVolume ¶
func (s *VolumeSnapshotService) ListByVolume(ctx context.Context, volumeID int, opts ...ListOption) ([]VolumeSnapshot, error)
ListByVolume returns all snapshots for a specific volume.
func (*VolumeSnapshotService) ListExpiring ¶
func (s *VolumeSnapshotService) ListExpiring(ctx context.Context, days int, opts ...ListOption) ([]VolumeSnapshot, error)
ListExpiring returns snapshots that will expire within the specified number of days.
func (*VolumeSnapshotService) ListManual ¶
func (s *VolumeSnapshotService) ListManual(ctx context.Context, opts ...ListOption) ([]VolumeSnapshot, error)
ListManual returns snapshots that were created manually (not scheduled).
func (*VolumeSnapshotService) SetExpires ¶
func (s *VolumeSnapshotService) SetExpires(ctx context.Context, id int, expires int64) (*VolumeSnapshot, error)
SetExpires sets the snapshot expiration time.
func (*VolumeSnapshotService) SetNeverExpires ¶
func (s *VolumeSnapshotService) SetNeverExpires(ctx context.Context, id int) (*VolumeSnapshot, error)
SetNeverExpires sets the snapshot to never expire.
func (*VolumeSnapshotService) Update ¶
func (s *VolumeSnapshotService) Update(ctx context.Context, id int, req *VolumeSnapshotUpdateRequest) (*VolumeSnapshot, error)
Update updates a volume snapshot and returns the updated snapshot.
type VolumeSnapshotServiceInterface ¶
type VolumeSnapshotServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]VolumeSnapshot, error)
ListByVolume(ctx context.Context, volumeID int, opts ...ListOption) ([]VolumeSnapshot, error)
ListExpiring(ctx context.Context, days int, opts ...ListOption) ([]VolumeSnapshot, error)
ListManual(ctx context.Context, opts ...ListOption) ([]VolumeSnapshot, error)
Get(ctx context.Context, id int) (*VolumeSnapshot, error)
GetByName(ctx context.Context, volumeID int, name string) (*VolumeSnapshot, error)
Create(ctx context.Context, req *VolumeSnapshotCreateRequest) (*VolumeSnapshot, error)
Update(ctx context.Context, id int, req *VolumeSnapshotUpdateRequest) (*VolumeSnapshot, error)
Delete(ctx context.Context, id int) error
Enable(ctx context.Context, id int) error
Disable(ctx context.Context, id int) error
SetNeverExpires(ctx context.Context, id int) (*VolumeSnapshot, error)
SetExpires(ctx context.Context, id int, expires int64) (*VolumeSnapshot, error)
}
VolumeSnapshotServiceInterface defines the interface for volume snapshot operations.
type VolumeSnapshotUpdateRequest ¶
type VolumeSnapshotUpdateRequest struct {
// Name is the snapshot name.
Name *string `json:"name,omitempty"`
// Description is an optional description of the snapshot.
Description *string `json:"description,omitempty"`
// Enabled indicates whether the snapshot is enabled.
Enabled *bool `json:"enabled,omitempty"`
// Expiration settings
// ExpiresType is the expiration type (never or date).
ExpiresType *string `json:"expires_type,omitempty"`
// Expires is the expiration timestamp (Unix epoch).
Expires *int64 `json:"expires,omitempty"`
}
VolumeSnapshotUpdateRequest is the request body for updating a volume snapshot.
type VolumeSync ¶
type VolumeSync struct {
// ID is the unique SHA1 hash identifier for this sync job.
ID string `json:"id,omitempty"`
// Key is the same as ID for volume_syncs.
Key string `json:"$key,omitempty"`
// Service is the NAS service ID this sync belongs to.
Service FlexInt `json:"service,omitempty"`
// Name is the sync job name.
Name string `json:"name"`
// Description is an optional description of the sync job.
Description string `json:"description,omitempty"`
// Enabled indicates whether the sync job is enabled.
Enabled bool `json:"enabled"`
// Created is the creation timestamp (Unix epoch).
Created int64 `json:"created,omitempty"`
// Modified is the last modified timestamp (Unix epoch).
Modified int64 `json:"modified,omitempty"`
// Source configuration
// SourceVolume is the source volume ID.
SourceVolume FlexInt `json:"source_volume,omitempty"`
// SourcePath is the starting directory path in the source volume.
SourcePath string `json:"source_path,omitempty"`
// Destination configuration
// DestinationVolume is the destination volume ID.
DestinationVolume FlexInt `json:"destination_volume,omitempty"`
// DestinationPath is the starting directory path in the destination volume.
DestinationPath string `json:"destination_path,omitempty"`
// Filter configuration
// Include is a newline-delimited list of include patterns.
Include string `json:"include,omitempty"`
// Exclude is a newline-delimited list of exclude patterns.
Exclude string `json:"exclude,omitempty"`
// Sync behavior options
// FSFreeze freezes the filesystem during snapshot.
FSFreeze bool `json:"fsfreeze,omitempty"`
// PreserveACLs preserves file ACLs during sync.
PreserveACLs bool `json:"preserve_ACLs,omitempty"`
// CopySymlinks copies symbolic links as links (vs following them).
CopySymlinks bool `json:"copy_symlinks,omitempty"`
// PreserveXattrs preserves extended attributes.
PreserveXattrs bool `json:"preserve_xattrs,omitempty"`
// PreservePermissions preserves file permissions.
PreservePermissions bool `json:"preserve_permissions,omitempty"`
// PreserveModTime preserves modification times.
PreserveModTime bool `json:"preserve_mod_time,omitempty"`
// PreserveGroups preserves group ownership.
PreserveGroups bool `json:"preserve_groups,omitempty"`
// PreserveOwner preserves user ownership.
PreserveOwner bool `json:"preserve_owner,omitempty"`
// PreserveDeviceFiles preserves device files (requires super-user).
PreserveDeviceFiles bool `json:"preserve_device_files,omitempty"`
// Scheduling
// StartTimeProfile is the snapshot profile ID for scheduling.
StartTimeProfile FlexInt `json:"start_time_profile,omitempty"`
// RunTime is the maximum run time in seconds.
RunTime int `json:"run_time,omitempty"`
// RunAsUser is the user to run the sync as.
RunAsUser string `json:"run_as_user,omitempty"`
// Delete behavior
// DestinationDelete controls deletion of files not in source.
// Values: never, delete, delete-before, delete-during, delete-delay, delete-after
DestinationDelete string `json:"destination_delete,omitempty"`
// Performance tuning
// ErrorsMax is the maximum error count before abort (default 1000).
ErrorsMax int64 `json:"errors_max,omitempty"`
// PreferredTier is the preferred storage tier (1-5).
PreferredTier string `json:"preferred_tier,omitempty"`
// Workers is the number of sync workers (1-128, default 4).
Workers int `json:"workers,omitempty"`
// Advanced options
// OmitDirTimes omits directory modification times.
OmitDirTimes bool `json:"omit_dir_times,omitempty"`
// OmitLinkTimes omits symlink modification times.
OmitLinkTimes bool `json:"omit_link_times,omitempty"`
// Inplace updates files in-place.
Inplace bool `json:"inplace,omitempty"`
// CIFSACL preserves CIFS ACLs (default true).
CIFSACL bool `json:"cifsacl,omitempty"`
// SyncMethod is the sync method (rsync or ysync).
SyncMethod string `json:"sync_method,omitempty"`
// YSyncExtended contains extended ysync properties.
YSyncExtended string `json:"ysync_extended,omitempty"`
// Type is the sync type (volsync or vmimport).
Type string `json:"type,omitempty"`
// Progress tracking (read-only)
// Progress is the current progress row reference.
Progress FlexInt `json:"progress,omitempty"`
}
VolumeSync represents a VergeOS volume sync job for replicating data between volumes.
type VolumeSyncCreateRequest ¶
type VolumeSyncCreateRequest struct {
// Service is the NAS service ID (required).
Service int `json:"service"`
// Name is the sync job name (required, 1-128 chars).
Name string `json:"name"`
// Description is an optional description of the sync job.
Description string `json:"description,omitempty"`
// Enabled indicates whether the sync job is enabled.
Enabled *bool `json:"enabled,omitempty"`
// Source configuration
// SourceVolume is the source volume ID (required).
SourceVolume int `json:"source_volume"`
// SourcePath is the starting directory path in the source volume.
SourcePath *string `json:"source_path,omitempty"`
// Destination configuration
// DestinationVolume is the destination volume ID (required).
DestinationVolume int `json:"destination_volume"`
// DestinationPath is the starting directory path in the destination volume.
DestinationPath *string `json:"destination_path,omitempty"`
// Filter configuration
// Include is a newline-delimited list of include patterns.
Include *string `json:"include,omitempty"`
// Exclude is a newline-delimited list of exclude patterns.
Exclude *string `json:"exclude,omitempty"`
// Sync behavior options
// FSFreeze freezes the filesystem during snapshot.
FSFreeze *bool `json:"fsfreeze,omitempty"`
// PreserveACLs preserves file ACLs during sync.
PreserveACLs *bool `json:"preserve_ACLs,omitempty"`
// CopySymlinks copies symbolic links as links.
CopySymlinks *bool `json:"copy_symlinks,omitempty"`
// PreserveXattrs preserves extended attributes.
PreserveXattrs *bool `json:"preserve_xattrs,omitempty"`
// PreservePermissions preserves file permissions.
PreservePermissions *bool `json:"preserve_permissions,omitempty"`
// PreserveModTime preserves modification times.
PreserveModTime *bool `json:"preserve_mod_time,omitempty"`
// PreserveGroups preserves group ownership.
PreserveGroups *bool `json:"preserve_groups,omitempty"`
// PreserveOwner preserves user ownership.
PreserveOwner *bool `json:"preserve_owner,omitempty"`
// PreserveDeviceFiles preserves device files.
PreserveDeviceFiles *bool `json:"preserve_device_files,omitempty"`
// Scheduling
// StartTimeProfile is the snapshot profile ID for scheduling.
StartTimeProfile *int `json:"start_time_profile,omitempty"`
// RunTime is the maximum run time in seconds.
RunTime *int `json:"run_time,omitempty"`
// RunAsUser is the user to run the sync as.
RunAsUser *string `json:"run_as_user,omitempty"`
// Delete behavior
// DestinationDelete controls deletion of files not in source.
DestinationDelete *string `json:"destination_delete,omitempty"`
// Performance tuning
// ErrorsMax is the maximum error count before abort.
ErrorsMax *int64 `json:"errors_max,omitempty"`
// PreferredTier is the preferred storage tier (1-5).
PreferredTier *string `json:"preferred_tier,omitempty"`
// Workers is the number of sync workers (1-128).
Workers *int `json:"workers,omitempty"`
// Advanced options
// OmitDirTimes omits directory modification times.
OmitDirTimes *bool `json:"omit_dir_times,omitempty"`
// OmitLinkTimes omits symlink modification times.
OmitLinkTimes *bool `json:"omit_link_times,omitempty"`
// Inplace updates files in-place.
Inplace *bool `json:"inplace,omitempty"`
// CIFSACL preserves CIFS ACLs.
CIFSACL *bool `json:"cifsacl,omitempty"`
// SyncMethod is the sync method (rsync or ysync).
SyncMethod *string `json:"sync_method,omitempty"`
// YSyncExtended contains extended ysync properties.
YSyncExtended *string `json:"ysync_extended,omitempty"`
}
VolumeSyncCreateRequest is the request body for creating a volume sync job.
type VolumeSyncService ¶
type VolumeSyncService struct {
// contains filtered or unexported fields
}
VolumeSyncService handles volume sync job operations. Volume syncs replicate data between volumes using rsync or ysync.
func (*VolumeSyncService) Create ¶
func (s *VolumeSyncService) Create(ctx context.Context, req *VolumeSyncCreateRequest) (*VolumeSync, error)
Create creates a new volume sync job and returns the created sync.
func (*VolumeSyncService) Delete ¶
func (s *VolumeSyncService) Delete(ctx context.Context, id string) error
Delete deletes a volume sync job.
func (*VolumeSyncService) Disable ¶
func (s *VolumeSyncService) Disable(ctx context.Context, id string) error
Disable disables a volume sync job.
func (*VolumeSyncService) Enable ¶
func (s *VolumeSyncService) Enable(ctx context.Context, id string) error
Enable enables a volume sync job.
func (*VolumeSyncService) Get ¶
func (s *VolumeSyncService) Get(ctx context.Context, id string) (*VolumeSync, error)
Get returns a single volume sync by its SHA1 ID.
func (*VolumeSyncService) GetByName ¶
func (s *VolumeSyncService) GetByName(ctx context.Context, serviceID int, name string) (*VolumeSync, error)
GetByName returns a volume sync by name within a specific service.
func (*VolumeSyncService) List ¶
func (s *VolumeSyncService) List(ctx context.Context, opts ...ListOption) ([]VolumeSync, error)
List returns all volume sync jobs, with optional filtering and pagination.
func (*VolumeSyncService) ListByService ¶
func (s *VolumeSyncService) ListByService(ctx context.Context, serviceID int) ([]VolumeSync, error)
ListByService returns all volume syncs belonging to a specific NAS service.
func (*VolumeSyncService) ListEnabled ¶
func (s *VolumeSyncService) ListEnabled(ctx context.Context, opts ...ListOption) ([]VolumeSync, error)
ListEnabled returns all enabled volume syncs.
func (*VolumeSyncService) Start ¶
func (s *VolumeSyncService) Start(ctx context.Context, id string) error
Start starts a volume sync job immediately.
func (*VolumeSyncService) Stop ¶
func (s *VolumeSyncService) Stop(ctx context.Context, id string) error
Stop stops a running volume sync job.
func (*VolumeSyncService) Update ¶
func (s *VolumeSyncService) Update(ctx context.Context, id string, req *VolumeSyncUpdateRequest) (*VolumeSync, error)
Update updates a volume sync job and returns the updated sync.
type VolumeSyncServiceInterface ¶
type VolumeSyncServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]VolumeSync, error)
ListByService(ctx context.Context, serviceID int) ([]VolumeSync, error)
ListEnabled(ctx context.Context, opts ...ListOption) ([]VolumeSync, error)
Get(ctx context.Context, id string) (*VolumeSync, error)
GetByName(ctx context.Context, serviceID int, name string) (*VolumeSync, error)
Create(ctx context.Context, req *VolumeSyncCreateRequest) (*VolumeSync, error)
Update(ctx context.Context, id string, req *VolumeSyncUpdateRequest) (*VolumeSync, error)
Delete(ctx context.Context, id string) error
Enable(ctx context.Context, id string) error
Disable(ctx context.Context, id string) error
Start(ctx context.Context, id string) error
Stop(ctx context.Context, id string) error
}
VolumeSyncServiceInterface defines the interface for volume sync operations. Note: Like volumes, volume syncs use SHA1 hash strings as IDs instead of integers.
type VolumeSyncUpdateRequest ¶
type VolumeSyncUpdateRequest struct {
// Name is the sync job name.
Name *string `json:"name,omitempty"`
// Description is an optional description of the sync job.
Description *string `json:"description,omitempty"`
// Enabled indicates whether the sync job is enabled.
Enabled *bool `json:"enabled,omitempty"`
// Source configuration
// SourceVolume is the source volume ID.
SourceVolume *int `json:"source_volume,omitempty"`
// SourcePath is the starting directory path in the source volume.
SourcePath *string `json:"source_path,omitempty"`
// Destination configuration
// DestinationVolume is the destination volume ID.
DestinationVolume *int `json:"destination_volume,omitempty"`
// DestinationPath is the starting directory path in the destination volume.
DestinationPath *string `json:"destination_path,omitempty"`
// Filter configuration
// Include is a newline-delimited list of include patterns.
Include *string `json:"include,omitempty"`
// Exclude is a newline-delimited list of exclude patterns.
Exclude *string `json:"exclude,omitempty"`
// Sync behavior options
// FSFreeze freezes the filesystem during snapshot.
FSFreeze *bool `json:"fsfreeze,omitempty"`
// PreserveACLs preserves file ACLs during sync.
PreserveACLs *bool `json:"preserve_ACLs,omitempty"`
// CopySymlinks copies symbolic links as links.
CopySymlinks *bool `json:"copy_symlinks,omitempty"`
// PreserveXattrs preserves extended attributes.
PreserveXattrs *bool `json:"preserve_xattrs,omitempty"`
// PreservePermissions preserves file permissions.
PreservePermissions *bool `json:"preserve_permissions,omitempty"`
// PreserveModTime preserves modification times.
PreserveModTime *bool `json:"preserve_mod_time,omitempty"`
// PreserveGroups preserves group ownership.
PreserveGroups *bool `json:"preserve_groups,omitempty"`
// PreserveOwner preserves user ownership.
PreserveOwner *bool `json:"preserve_owner,omitempty"`
// PreserveDeviceFiles preserves device files.
PreserveDeviceFiles *bool `json:"preserve_device_files,omitempty"`
// Scheduling
// StartTimeProfile is the snapshot profile ID for scheduling.
StartTimeProfile *int `json:"start_time_profile,omitempty"`
// RunTime is the maximum run time in seconds.
RunTime *int `json:"run_time,omitempty"`
// RunAsUser is the user to run the sync as.
RunAsUser *string `json:"run_as_user,omitempty"`
// Delete behavior
// DestinationDelete controls deletion of files not in source.
DestinationDelete *string `json:"destination_delete,omitempty"`
// Performance tuning
// ErrorsMax is the maximum error count before abort.
ErrorsMax *int64 `json:"errors_max,omitempty"`
// PreferredTier is the preferred storage tier (1-5).
PreferredTier *string `json:"preferred_tier,omitempty"`
// Workers is the number of sync workers (1-128).
Workers *int `json:"workers,omitempty"`
// Advanced options
// OmitDirTimes omits directory modification times.
OmitDirTimes *bool `json:"omit_dir_times,omitempty"`
// OmitLinkTimes omits symlink modification times.
OmitLinkTimes *bool `json:"omit_link_times,omitempty"`
// Inplace updates files in-place.
Inplace *bool `json:"inplace,omitempty"`
// CIFSACL preserves CIFS ACLs.
CIFSACL *bool `json:"cifsacl,omitempty"`
// SyncMethod is the sync method (rsync or ysync).
SyncMethod *string `json:"sync_method,omitempty"`
// YSyncExtended contains extended ysync properties.
YSyncExtended *string `json:"ysync_extended,omitempty"`
}
VolumeSyncUpdateRequest is the request body for updating a volume sync job.
type VolumeUpdateRequest ¶
type VolumeUpdateRequest struct {
// Name is the volume name.
Name *string `json:"name,omitempty"`
// Description is the volume description.
Description *string `json:"description,omitempty"`
// Enabled indicates whether the volume is enabled.
Enabled *bool `json:"enabled,omitempty"`
// Storage configuration
// MaxSize is the maximum size in bytes.
MaxSize *int64 `json:"maxsize,omitempty"`
// PreferredTier is the preferred storage tier (1-5).
PreferredTier *string `json:"preferred_tier,omitempty"`
// SnapshotProfile is the snapshot profile ID.
SnapshotProfile *int `json:"snapshot_profile,omitempty"`
// Discard indicates whether TRIM/discard is enabled.
Discard *bool `json:"discard,omitempty"`
// ReadOnly indicates whether the volume is read-only.
ReadOnly *bool `json:"read_only,omitempty"`
// Optimize is the optimization mode (general, large).
Optimize *string `json:"optimize,omitempty"`
// Ownership
// OwnerUser is the Unix user that owns the volume directory.
OwnerUser *string `json:"owner_user,omitempty"`
// OwnerGroup is the Unix group that owns the volume directory.
OwnerGroup *string `json:"owner_group,omitempty"`
// Snapshots
// AutomountSnapshots indicates whether to automatically mount snapshots.
AutomountSnapshots *bool `json:"automount_snapshots,omitempty"`
// Remote volume configuration (for CIFS/NFS remote mounts)
// CIFSUser is the username for CIFS authentication.
CIFSUser *string `json:"cifs_user,omitempty"`
// CIFSPassword is the password for CIFS authentication.
CIFSPassword *string `json:"cifs_password,omitempty"`
// CIFSProtocol is the SMB protocol version.
CIFSProtocol *string `json:"cifs_protocol,omitempty"`
// NFSProtocol is the NFS protocol version.
NFSProtocol *string `json:"nfs_protocol,omitempty"`
// MountOptions contains additional mount options.
MountOptions *string `json:"mount_options,omitempty"`
// ReadAheadKB is the read-ahead buffer size.
ReadAheadKB *string `json:"read_ahead_kb,omitempty"`
// Note is a free-form note about the volume.
Note *string `json:"note,omitempty"`
}
VolumeUpdateRequest is the request body for updating a volume.
type Webhook ¶
type Webhook struct {
// Key is the unique identifier.
Key FlexInt `json:"$key,omitempty"`
// WebhookURL is the webhook URL this message was sent to.
WebhookURL FlexInt `json:"webhook_url,omitempty"`
// Message is the JSON payload that was sent.
Message string `json:"message,omitempty"`
// Status is the delivery status: queued, running, sent, error.
Status string `json:"status,omitempty"`
// StatusInfo contains additional status details or error messages.
StatusInfo string `json:"status_info,omitempty"`
// LastAttempt is the timestamp of the last delivery attempt (Unix epoch).
LastAttempt int64 `json:"last_attempt,omitempty"`
// Created is the creation timestamp (Unix epoch).
Created int64 `json:"created,omitempty"`
}
Webhook represents a webhook message in the delivery queue/log. This is a read-only view of webhook messages that have been queued or sent.
type WebhookSendRequest ¶
type WebhookSendRequest struct {
// Message is the JSON payload to send.
Message string `json:"message"`
}
WebhookSendRequest is the request body for sending a test webhook.
type WebhookService ¶
type WebhookService struct {
// contains filtered or unexported fields
}
WebhookService handles webhook message log operations. Webhooks are the actual messages sent/queued for delivery.
func (*WebhookService) Delete ¶
func (s *WebhookService) Delete(ctx context.Context, id int) error
Delete deletes a webhook message from the queue/log.
func (*WebhookService) List ¶
func (s *WebhookService) List(ctx context.Context, opts ...ListOption) ([]Webhook, error)
List returns all webhook messages, with optional filtering and pagination.
func (*WebhookService) ListByStatus ¶
func (s *WebhookService) ListByStatus(ctx context.Context, status string, opts ...ListOption) ([]Webhook, error)
ListByStatus returns all webhook messages with a specific status.
func (*WebhookService) ListByWebhookURL ¶
func (s *WebhookService) ListByWebhookURL(ctx context.Context, webhookURLID int, opts ...ListOption) ([]Webhook, error)
ListByWebhookURL returns all webhook messages for a specific webhook URL.
func (*WebhookService) ListFailed ¶
func (s *WebhookService) ListFailed(ctx context.Context, opts ...ListOption) ([]Webhook, error)
ListFailed returns all webhook messages that failed to deliver.
func (*WebhookService) ListPending ¶
func (s *WebhookService) ListPending(ctx context.Context, opts ...ListOption) ([]Webhook, error)
ListPending returns all webhook messages that are queued or running.
type WebhookServiceInterface ¶
type WebhookServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]Webhook, error)
ListByWebhookURL(ctx context.Context, webhookURLID int, opts ...ListOption) ([]Webhook, error)
ListByStatus(ctx context.Context, status string, opts ...ListOption) ([]Webhook, error)
ListPending(ctx context.Context, opts ...ListOption) ([]Webhook, error)
ListFailed(ctx context.Context, opts ...ListOption) ([]Webhook, error)
Get(ctx context.Context, id int) (*Webhook, error)
Delete(ctx context.Context, id int) error
}
WebhookServiceInterface defines the interface for webhook message log operations (read-only).
type WebhookURL ¶
type WebhookURL struct {
// Key is the unique identifier.
Key FlexInt `json:"$key,omitempty"`
// Name is the webhook name (unique).
Name string `json:"name,omitempty"`
// Type is the webhook type (default: custom).
Type string `json:"type,omitempty"`
// URL is the destination URL for webhook payloads.
URL string `json:"url,omitempty"`
// Headers are custom HTTP headers in "Header:Value" format, newline-separated.
Headers string `json:"headers,omitempty"`
// AuthorizationType is the authorization method: none, basic, bearer, apikey.
AuthorizationType string `json:"authorization_type,omitempty"`
// AuthorizationValue is the authorization credential (hidden in responses).
AuthorizationValue string `json:"authorization_value,omitempty"`
// AllowInsecure allows connections to servers with invalid SSL certificates.
AllowInsecure bool `json:"allow_insecure,omitempty"`
// Timeout is the request timeout in seconds (default: 5, min: 3, max: 120).
Timeout int `json:"timeout,omitempty"`
// Retries is the number of retry attempts (default: 3, min: 0, max: 100).
Retries int `json:"retries,omitempty"`
}
WebhookURL represents a VergeOS webhook endpoint configuration. This is where you configure where webhooks are sent.
type WebhookURLCreateRequest ¶
type WebhookURLCreateRequest struct {
// Name is the webhook name (required, unique).
Name string `json:"name"`
// URL is the destination URL (required).
URL string `json:"url"`
// Type is the webhook type (optional, default: custom).
Type string `json:"type,omitempty"`
// Headers are custom HTTP headers in "Header:Value" format, newline-separated.
Headers string `json:"headers,omitempty"`
// AuthorizationType is the authorization method: none, basic, bearer, apikey.
AuthorizationType string `json:"authorization_type,omitempty"`
// AuthorizationValue is the authorization credential.
AuthorizationValue string `json:"authorization_value,omitempty"`
// AllowInsecure allows connections to servers with invalid SSL certificates.
AllowInsecure *bool `json:"allow_insecure,omitempty"`
// Timeout is the request timeout in seconds (default: 5).
Timeout *int `json:"timeout,omitempty"`
// Retries is the number of retry attempts (default: 3).
Retries *int `json:"retries,omitempty"`
}
WebhookURLCreateRequest is the request body for creating a webhook URL.
type WebhookURLService ¶
type WebhookURLService struct {
// contains filtered or unexported fields
}
WebhookURLService handles webhook URL configuration operations.
func (*WebhookURLService) Create ¶
func (s *WebhookURLService) Create(ctx context.Context, req *WebhookURLCreateRequest) (*WebhookURL, error)
Create creates a new webhook URL and returns the created webhook URL.
func (*WebhookURLService) Delete ¶
func (s *WebhookURLService) Delete(ctx context.Context, id int) error
Delete deletes a webhook URL.
func (*WebhookURLService) Get ¶
func (s *WebhookURLService) Get(ctx context.Context, id int) (*WebhookURL, error)
Get returns a single webhook URL by ID.
func (*WebhookURLService) GetByName ¶
func (s *WebhookURLService) GetByName(ctx context.Context, name string) (*WebhookURL, error)
GetByName returns a webhook URL by name.
func (*WebhookURLService) List ¶
func (s *WebhookURLService) List(ctx context.Context, opts ...ListOption) ([]WebhookURL, error)
List returns all webhook URLs, with optional filtering and pagination.
func (*WebhookURLService) Update ¶
func (s *WebhookURLService) Update(ctx context.Context, id int, req *WebhookURLUpdateRequest) (*WebhookURL, error)
Update updates a webhook URL and returns the updated webhook URL.
type WebhookURLServiceInterface ¶
type WebhookURLServiceInterface interface {
List(ctx context.Context, opts ...ListOption) ([]WebhookURL, error)
Get(ctx context.Context, id int) (*WebhookURL, error)
GetByName(ctx context.Context, name string) (*WebhookURL, error)
Create(ctx context.Context, req *WebhookURLCreateRequest) (*WebhookURL, error)
Update(ctx context.Context, id int, req *WebhookURLUpdateRequest) (*WebhookURL, error)
Delete(ctx context.Context, id int) error
Send(ctx context.Context, id int, message string) error
}
WebhookURLServiceInterface defines the interface for webhook URL configuration operations.
type WebhookURLUpdateRequest ¶
type WebhookURLUpdateRequest struct {
// Name is the webhook name.
Name *string `json:"name,omitempty"`
// URL is the destination URL.
URL *string `json:"url,omitempty"`
// Type is the webhook type.
Type *string `json:"type,omitempty"`
// Headers are custom HTTP headers.
Headers *string `json:"headers,omitempty"`
// AuthorizationType is the authorization method.
AuthorizationType *string `json:"authorization_type,omitempty"`
// AuthorizationValue is the authorization credential.
AuthorizationValue *string `json:"authorization_value,omitempty"`
// AllowInsecure allows connections to servers with invalid SSL certificates.
AllowInsecure *bool `json:"allow_insecure,omitempty"`
// Timeout is the request timeout in seconds.
Timeout *int `json:"timeout,omitempty"`
// Retries is the number of retry attempts.
Retries *int `json:"retries,omitempty"`
}
WebhookURLUpdateRequest is the request body for updating a webhook URL.
Source Files
¶
- alarm.go
- api_key.go
- certificate.go
- client.go
- cloud_snapshot.go
- cloudinit.go
- cluster.go
- doc.go
- errors.go
- file.go
- group.go
- interfaces.go
- log.go
- machine_drive_stats.go
- machine_nic.go
- machine_stats.go
- member.go
- nas_service.go
- network.go
- node.go
- options.go
- permission.go
- resourcegroup.go
- schema.go
- settings.go
- site.go
- snapshot_profile.go
- system.go
- tag.go
- tag_category.go
- tagmember.go
- task.go
- tenant.go
- tenant_layer2.go
- tenant_snapshot.go
- types.go
- types_alarm.go
- types_api_key.go
- types_certificate.go
- types_cloud_snapshot.go
- types_cloudinit.go
- types_log.go
- types_machine_drive_stats.go
- types_machine_nic.go
- types_machine_stats.go
- types_member.go
- types_nas_service.go
- types_network.go
- types_permission.go
- types_readonly.go
- types_site.go
- types_snapshot_profile.go
- types_tag.go
- types_tag_category.go
- types_task.go
- types_tenant.go
- types_tenant_layer2.go
- types_tenant_snapshot.go
- types_update.go
- types_user.go
- types_vm.go
- types_vm_device.go
- types_vm_drive.go
- types_vm_nic.go
- types_vm_snapshot.go
- types_vnet_address.go
- types_vnet_dns.go
- types_vnet_host.go
- types_vnet_ipsec.go
- types_vnet_rule.go
- types_vnet_wireguard.go
- types_volume.go
- types_volume_browser.go
- types_volume_share.go
- types_volume_snapshot.go
- types_volume_sync.go
- types_vsan.go
- types_webhook.go
- update.go
- user.go
- version.go
- vm.go
- vm_device.go
- vm_drive.go
- vm_nic.go
- vm_snapshot.go
- vnet_address.go
- vnet_dns.go
- vnet_host.go
- vnet_ipsec.go
- vnet_rule.go
- vnet_wireguard.go
- volume.go
- volume_browser.go
- volume_share.go
- volume_snapshot.go
- volume_sync.go
- vsan.go
- webhook.go
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
apikey-auth
command
Example: API Key Authentication
|
Example: API Key Authentication |
|
basic
command
Example: Basic goVergeOS Usage
|
Example: Basic goVergeOS Usage |
|
certificates
command
Example: SSL/TLS Certificate Management
|
Example: SSL/TLS Certificate Management |
|
cloud-snapshots
command
Example: Cloud Snapshots - System-Wide Backup Management
|
Example: Cloud Snapshots - System-Wide Backup Management |
|
cloudinit
command
Example: Cloud-Init File Management
|
Example: Cloud-Init File Management |
|
dr-sites
command
Example: DR Sites - Remote Site Management
|
Example: DR Sites - Remote Site Management |
|
files
command
Example: Files
|
Example: Files |
|
firewall-rules
command
Example: Firewall Rules
|
Example: Firewall Rules |
|
logs
command
Example: System Logs
|
Example: System Logs |
|
monitoring
command
Example: Monitoring - Alarms and Tasks
|
Example: Monitoring - Alarms and Tasks |
|
nas-services
command
Example: NAS Services Management
|
Example: NAS Services Management |
|
network-management
command
Example: Network Management
|
Example: Network Management |
|
networking
command
Example: Networking - IP Addresses, DNS, and Host Overrides
|
Example: Networking - IP Addresses, DNS, and Host Overrides |
|
permissions
command
Example: Permissions Management
|
Example: Permissions Management |
|
snapshot-profiles
command
Example: Snapshot Profile Lifecycle Management
|
Example: Snapshot Profile Lifecycle Management |
|
tags
command
Example: Tags and Tag Members
|
Example: Tags and Tag Members |
|
tenants
command
Example: Multi-Tenant Management
|
Example: Multi-Tenant Management |
|
users
command
Example: User Management
|
Example: User Management |
|
vm-lifecycle
command
Example: VM Lifecycle Management
|
Example: VM Lifecycle Management |
|
vm-snapshots
command
Package main demonstrates VM snapshot and tag operations using goVergeOS.
|
Package main demonstrates VM snapshot and tag operations using goVergeOS. |
|
volumes
command
Example: NAS Volume Management
|
Example: NAS Volume Management |
|
vpn
command
Example: WireGuard VPN Management
|
Example: WireGuard VPN Management |
|
vsan-monitoring
command
Example: VSAN Monitoring
|
Example: VSAN Monitoring |
|
webhooks
command
Example: Webhooks - Event Notification Management
|
Example: Webhooks - Event Notification Management |
|
test
|
|
|
integration/list-resources
command
Integration test: List all goVergeOS resources
|
Integration test: List all goVergeOS resources |
|
integration/type-analysis
command
Diagnostic tool: API Field Type Analysis
|
Diagnostic tool: API Field Type Analysis |