nexusclient

package
v0.0.0-...-55ab5bd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2026 License: AGPL-3.0 Imports: 25 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRemoteViewer

func CheckRemoteViewer() error

func NewPCIeClasses

func NewPCIeClasses(s string) ([]int, error)

Creates a new PCIe Classes object from a string representing the classes, e.g. "0,5,12"

Types

type NexusClient

type NexusClient struct {
	// contains filtered or unexported fields
}

func New

func New(host string) (*NexusClient, error)

The host argument has the following format: "ip:port" or "domain:port", e.g. "127.0.0.1:1077" or "my.domain.net:80"

func (*NexusClient) Authenticate

func (nc *NexusClient) Authenticate(user, pwd string) (string, error)

Authenticate a user. curl -X POST https://localhost:8000/login -H 'Content-Type: application/json' -d '{"email": "janedoe@nexus.org", "pwd":"pipomolo"}' Returns an JWT token if authentication succeeded or an error if it failed. IMPORTANT: caller MUST call the Cleanup() function before exiting!

func (*NexusClient) AuthenticateWithToken

func (nc *NexusClient) AuthenticateWithToken(token string) error

"Authenticate" by using an already established connection using a previously received token (typically with the Authenticate method). IMPORTANT: caller MUST call the Cleanup() function before exiting!

func (*NexusClient) CheckServerCompatibility

func (nc *NexusClient) CheckServerCompatibility(appname string) error

Checks the client version is compatible with the server's API.

func (*NexusClient) Cleanup

func (nc *NexusClient) Cleanup()

Cleanup resources allocated by Authenticate and AuthenticateWithToken. IMPORTANT: caller MUST call this function before exiting!

func (*NexusClient) GetAttachVMCreds

func (nc *NexusClient) GetAttachVMCreds(vmID string) (*response.VMAttachCredentials, error)

func (*NexusClient) GetHostname

func (nc *NexusClient) GetHostname() string

Returns the hostname, e.g. "127.0.0.1" or "my.domain.net".

func (*NexusClient) GetServerVersion

func (nc *NexusClient) GetServerVersion() (*response.Version, error)

func (*NexusClient) GetTemplate

func (nc *NexusClient) GetTemplate(uuid string) (*response.Template, error)

func (*NexusClient) GetTemplates

func (nc *NexusClient) GetTemplates() ([]response.Template, error)

func (*NexusClient) GetUser

func (nc *NexusClient) GetUser(email string) (*response.UserWithoutPwd, error)

func (*NexusClient) GetUsers

func (nc *NexusClient) GetUsers() ([]response.UserWithoutPwd, error)

func (*NexusClient) GetVM

func (nc *NexusClient) GetVM(vmID string) (*vm.VMRuntime, error)

func (*NexusClient) GetVMActions

func (nc *NexusClient) GetVMActions(v *vm.VMRuntime) caps.VMActions

func (*NexusClient) GetVMs

func (nc *NexusClient) GetVMs() ([]vm.VMRuntime, error)

func (*NexusClient) PCIeList

func (nc *NexusClient) PCIeList() (*response.PCIeListResponse, error)

Lists available PCIe devices

func (*NexusClient) RefreshToken

func (nc *NexusClient) RefreshToken() error

Obtain a new JWT token from the server.

func (*NexusClient) SetTimeout

func (nc *NexusClient) SetTimeout(timeout time.Duration)

Change the default timeout.

func (*NexusClient) TemplateCreate

func (nc *NexusClient) TemplateCreate(p params.TplCreate) (*response.Template, error)

func (*NexusClient) TemplateDel

func (nc *NexusClient) TemplateDel(tplID string) error

func (*NexusClient) TemplateEdit

func (nc *NexusClient) TemplateEdit(tplID string, p params.TplEdit) (*response.Template, error)

func (*NexusClient) TemplateExportDisk

func (nc *NexusClient) TemplateExportDisk(tplID, outputFile string) error

func (*NexusClient) UserCreate

func (*NexusClient) UserDelete

func (nc *NexusClient) UserDelete(email string) error

func (*NexusClient) UserEdit

func (nc *NexusClient) UserEdit(email string, p params.UserEdit) (*response.UserWithoutPwd, error)

func (*NexusClient) UserResetPwd

func (nc *NexusClient) UserResetPwd(email string) (string, error)

func (*NexusClient) UserSetCaps

func (nc *NexusClient) UserSetCaps(email string, userCaps *params.UserSetCaps) error

func (*NexusClient) UserUnlock

func (nc *NexusClient) UserUnlock(email string) error

func (*NexusClient) UserUpdatePwd

func (nc *NexusClient) UserUpdatePwd(newPwd string) error

func (*NexusClient) UserWhoAmI

func (nc *NexusClient) UserWhoAmI() (*response.UserWithoutPwd, error)

NOTE: this route is not implemented in the backend yet.

func (*NexusClient) VMAddAccess

func (nc *NexusClient) VMAddAccess(vmID, email string, vmAccessCaps *params.VMAddAccess) error

func (*NexusClient) VMAttachFromCreds

func (nc *NexusClient) VMAttachFromCreds(v response.VMAttachCredentials, fullscreen bool) error

func (*NexusClient) VMAttachFromID

func (nc *NexusClient) VMAttachFromID(vmID string, fullscreen bool) error

func (*NexusClient) VMAttachFromPwd

func (nc *NexusClient) VMAttachFromPwd(pwd string, fullscreen bool) error

func (*NexusClient) VMCreate

func (nc *NexusClient) VMCreate(p params.VMCreate) (*vm.VMRuntime, error)

func (*NexusClient) VMCreds2csv

func (nc *NexusClient) VMCreds2csv(credsList []response.VMAttachCredentials, file string) error

func (*NexusClient) VMCreds2pdf

func (nc *NexusClient) VMCreds2pdf(credsList []response.VMAttachCredentials, file string) error

func (*NexusClient) VMDel

func (nc *NexusClient) VMDel(vmID string) error

func (*NexusClient) VMDelAccess

func (nc *NexusClient) VMDelAccess(vmID, email string) error

func (*NexusClient) VMEdit

func (nc *NexusClient) VMEdit(vmID string, p params.VMEdit) (*vm.VMRuntime, error)

func (*NexusClient) VMExportDir

func (nc *NexusClient) VMExportDir(vmName, vmID, dirToExport, dirToSave string) (string, error)

func (*NexusClient) VMImportArchive

func (nc *NexusClient) VMImportArchive(vmID, vmDir, archiveFile string) error

func (*NexusClient) VMKill

func (nc *NexusClient) VMKill(vmID string) error

func (*NexusClient) VMReboot

func (nc *NexusClient) VMReboot(vmID string) error

func (*NexusClient) VMShutdown

func (nc *NexusClient) VMShutdown(vmID string) error

func (*NexusClient) VMStart

func (nc *NexusClient) VMStart(vmID string, p params.VMStart) error

Source Files

  • client.go
  • pcie.go
  • remote-viewer.go
  • response.go
  • template.go
  • user.go
  • version.go
  • vm.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL