Documentation ¶
Index ¶
- Constants
- Variables
- func GetBool(b *bool) bool
- func GetInt(i *int) int
- func GetString(s *string) string
- type AdminDesktop
- type Cfg
- type Client
- func (c *Client) AdminDesktopList(ctx context.Context) ([]*AdminDesktop, error)
- func (c *Client) AdminGroupCreate(ctx context.Context, ...) (*Group, error)
- func (c *Client) AdminHypervisorOnlyForced(ctx context.Context, id string, onlyForced bool) error
- func (c *Client) AdminHypervisorUpdate(ctx context.Context, h *Hypervisor) error
- func (c *Client) AdminTemplateList(ctx context.Context) ([]*Template, error)
- func (c *Client) AdminUserAutoRegister(ctx context.Context, registerTkn string, roleID string, groupID string, ...) (string, error)
- func (c *Client) AdminUserCreate(ctx context.Context, ...) (*User, error)
- func (c *Client) AdminUserDelete(ctx context.Context, id string) error
- func (c *Client) AdminUserList(ctx context.Context) ([]*User, error)
- func (c *Client) AdminUserRequiredDisclaimerAcknowledgement(ctx context.Context, id string) (bool, error)
- func (c *Client) AdminUserRequiredEmailVerification(ctx context.Context, id string) (bool, error)
- func (c *Client) AdminUserRequiredPasswordReset(ctx context.Context, id string) (bool, error)
- func (c *Client) AdminUserResetPassword(ctx context.Context, id, pwd string) error
- func (c *Client) AuthForm(ctx context.Context, category, usr, pwd string) (string, error)
- func (c *Client) DesktopCreate(ctx context.Context, name, templateID string) (*Desktop, error)
- func (c *Client) DesktopCreateFromScratch(ctx context.Context, name string, xml string) (*Desktop, error)
- func (c *Client) DesktopDelete(ctx context.Context, id string) error
- func (c *Client) DesktopGet(ctx context.Context, id string) (*Desktop, error)
- func (c *Client) DesktopList(ctx context.Context) ([]*Desktop, error)
- func (c *Client) DesktopStart(ctx context.Context, id string) error
- func (c *Client) DesktopStop(ctx context.Context, id string) error
- func (c *Client) DesktopUpdate(ctx context.Context, id string, opts DesktopUpdateOptions) error
- func (c *Client) DesktopViewer(ctx context.Context, t DesktopViewer, id string) (string, error)
- func (c *Client) HypervisorDelete(ctx context.Context, id string) error
- func (c *Client) HypervisorGet(ctx context.Context, id string) (*Hypervisor, error)
- func (c *Client) HypervisorList(ctx context.Context) ([]*Hypervisor, error)
- func (c *Client) Maintenance(ctx context.Context) (bool, error)
- func (c *Client) OrchestratorGPUBookingList(ctx context.Context) ([]*OrchestratorGPUBooking, error)
- func (c *Client) OrchestratorHypervisorAddToDeadRow(ctx context.Context, id string) (time.Time, error)
- func (c *Client) OrchestratorHypervisorGet(ctx context.Context, id string) (*OrchestratorHypervisor, error)
- func (c *Client) OrchestratorHypervisorList(ctx context.Context) ([]*OrchestratorHypervisor, error)
- func (c *Client) OrchestratorHypervisorManage(ctx context.Context, id string) error
- func (c *Client) OrchestratorHypervisorRemoveFromDeadRow(ctx context.Context, id string) error
- func (c *Client) OrchestratorHypervisorStopDesktops(ctx context.Context, id string) error
- func (c *Client) OrchestratorHypervisorUnmanage(ctx context.Context, id string) error
- func (c *Client) SetBeforeRequestHook(hook func(*Client) error)
- func (c *Client) SetToken(tkn string)
- func (c *Client) StatsCategoryList(ctx context.Context) ([]*StatsCategory, error)
- func (c *Client) StatsDeploymentByCategory(ctx context.Context) ([]*StatsDeploymentByCategory, error)
- func (c *Client) StatsDesktops(ctx context.Context) ([]*StatsDesktop, error)
- func (c *Client) StatsDomainsStatus(ctx context.Context) (*StatsDomainsStatus, error)
- func (c *Client) StatsHypervisors(ctx context.Context) ([]*StatsHypervisor, error)
- func (c *Client) StatsTemplates(ctx context.Context) ([]*StatsTemplate, error)
- func (c *Client) StatsUsers(ctx context.Context) ([]*StatsUser, error)
- func (c *Client) TemplateCreateFromDesktop(ctx context.Context, name string, desktopID string) (*Template, error)
- func (c *Client) TemplateList(ctx context.Context) ([]*Template, error)
- func (c *Client) URL() *url.URL
- func (c *Client) UserOwnsDesktop(ctx context.Context, opts *UserOwnsDesktopOpts) error
- func (c *Client) UserVPN(ctx context.Context) (string, error)
- func (c *Client) Version(ctx context.Context) (string, error)
- type Desktop
- type DesktopUpdateOptions
- type DesktopViewer
- type DesktopViewerRsp
- type DomainState
- type Err
- type Group
- type Hypervisor
- type HypervisorStatus
- type Interface
- type OrchestratorGPUBooking
- type OrchestratorGPUBookingTime
- type OrchestratorHypervisor
- type OrchestratorHypervisorGPU
- type OrchestratorHypervisorStats
- type OrchestratorHypervisorStatsCPU
- type OrchestratorHypervisorStatsMem
- type OrchestratorResourceLoad
- type StatsCategory
- type StatsDeploymentByCategory
- type StatsDesktop
- type StatsDomainsStatus
- type StatsHypervisor
- type StatsTemplate
- type StatsUser
- type Template
- type User
- type UserOwnsDesktopOpts
- type UserVPNRsp
Constants ¶
View Source
const ( DomainStateUnknown = "Unknown" DomainStateFailed = "Failed" DomainStateStarting = "Starting" DomainStateStartingDomainDisposable = "StartingDomainDisposable" DomainStateStarted = "Started" DomainStateStopping = "Stopping" DomainStateShuttingDown = "Shutting-down" DomainStateStopped = "Stopped" DomainStateCreating = "Creating" DomainStateCreatingAndStarting = "CreatingAndStarting" DomainStateCreatingDiskFromScratch = "CreatingDiskFromScratch" DomainStateCreatingFromBuilder = "CreatingFromBuilder" DomainStateCreatingDomain = "CreatingDomain" DomainStateUpdating = "Updating" DomainStateDeleting = "Deleting" DomainStateDeletingDomainDisk = "DeletingDomainDisk" DomainStateDiskDeleted = "DiskDeleted" )
Variables ¶
View Source
var ( ErrBadRequest = Err{ Err: "bad_request", Msg: "Bad request", StatusCode: http.StatusBadRequest, } Err: "unauthorized", Msg: "Unauthorized", StatusCode: http.StatusUnauthorized, } ErrForbidden = Err{ Err: "forbidden", Msg: "Forbidden", StatusCode: http.StatusForbidden, } ErrNotFound = Err{ Err: "not_found", Msg: "Not found", StatusCode: http.StatusNotFound, } ErrConflict = Err{ Err: "conflict", Msg: "Conflict", StatusCode: http.StatusConflict, } ErrInternalServer = Err{ Err: "internal_server", Msg: "Internal server error", StatusCode: http.StatusInternalServerError, } ErrGatewayTimeout = Err{ Err: "gateway_timeout", Msg: "Gateway timeout", StatusCode: http.StatusGatewayTimeout, } ErrPreconditionRequired = Err{ Err: "precondition_required", Msg: "Precondition required", StatusCode: http.StatusPreconditionRequired, } ErrInsufficientStorage = Err{ Err: "insufficient_storage", Msg: "Insufficient storage", StatusCode: http.StatusInsufficientStorage, } ErrMaintenance = Err{ Err: "maintenance", Msg: "Maintenance", StatusCode: http.StatusServiceUnavailable, } )
View Source
var Version = "Unknown version"
Functions ¶
Types ¶
type AdminDesktop ¶
type AdminDesktop struct { ID *string `json:"id,omitempty"` State *string `json:"status,omitempty"` Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` User *string `json:"user,omitempty"` HypervisorStarted *string `json:"hyp_started,omitempty"` }
TODO: This should be removed when the admin/domains endpoint and the user/desktops endpoints are unified
type Client ¶
type Client struct { BaseURL *url.URL UserAgent string Token string BeforeRequestHook func(*Client) error // contains filtered or unexported fields }
func (*Client) AdminDesktopList ¶
func (c *Client) AdminDesktopList(ctx context.Context) ([]*AdminDesktop, error)
func (*Client) AdminGroupCreate ¶
func (*Client) AdminHypervisorOnlyForced ¶
func (*Client) AdminHypervisorUpdate ¶
func (c *Client) AdminHypervisorUpdate(ctx context.Context, h *Hypervisor) error
func (*Client) AdminTemplateList ¶
func (*Client) AdminUserAutoRegister ¶
func (*Client) AdminUserCreate ¶
func (*Client) AdminUserDelete ¶
func (*Client) AdminUserRequiredDisclaimerAcknowledgement ¶
func (*Client) AdminUserRequiredEmailVerification ¶
func (*Client) AdminUserRequiredPasswordReset ¶
func (*Client) AdminUserResetPassword ¶
func (*Client) DesktopCreate ¶
func (*Client) DesktopCreateFromScratch ¶
func (*Client) DesktopGet ¶
func (*Client) DesktopUpdate ¶
func (*Client) DesktopViewer ¶
func (*Client) HypervisorDelete ¶
func (*Client) HypervisorGet ¶
func (*Client) HypervisorList ¶
func (c *Client) HypervisorList(ctx context.Context) ([]*Hypervisor, error)
func (*Client) OrchestratorGPUBookingList ¶
func (c *Client) OrchestratorGPUBookingList(ctx context.Context) ([]*OrchestratorGPUBooking, error)
func (*Client) OrchestratorHypervisorAddToDeadRow ¶
func (*Client) OrchestratorHypervisorGet ¶
func (*Client) OrchestratorHypervisorList ¶
func (c *Client) OrchestratorHypervisorList(ctx context.Context) ([]*OrchestratorHypervisor, error)
func (*Client) OrchestratorHypervisorManage ¶
func (*Client) OrchestratorHypervisorRemoveFromDeadRow ¶
func (*Client) OrchestratorHypervisorStopDesktops ¶
func (*Client) OrchestratorHypervisorUnmanage ¶
func (*Client) SetBeforeRequestHook ¶
func (*Client) StatsCategoryList ¶
func (c *Client) StatsCategoryList(ctx context.Context) ([]*StatsCategory, error)
func (*Client) StatsDeploymentByCategory ¶
func (c *Client) StatsDeploymentByCategory(ctx context.Context) ([]*StatsDeploymentByCategory, error)
func (*Client) StatsDesktops ¶
func (c *Client) StatsDesktops(ctx context.Context) ([]*StatsDesktop, error)
func (*Client) StatsDomainsStatus ¶
func (c *Client) StatsDomainsStatus(ctx context.Context) (*StatsDomainsStatus, error)
func (*Client) StatsHypervisors ¶
func (c *Client) StatsHypervisors(ctx context.Context) ([]*StatsHypervisor, error)
func (*Client) StatsTemplates ¶
func (c *Client) StatsTemplates(ctx context.Context) ([]*StatsTemplate, error)
func (*Client) TemplateCreateFromDesktop ¶
func (*Client) TemplateList ¶
func (*Client) UserOwnsDesktop ¶
func (c *Client) UserOwnsDesktop(ctx context.Context, opts *UserOwnsDesktopOpts) error
type DesktopUpdateOptions ¶
type DesktopUpdateOptions struct {
ForcedHyp []string `json:"forced_hyp,omitempty"`
}
type DesktopViewer ¶
type DesktopViewer string
const ( DesktopViewerSpice DesktopViewer = "spice" DesktopViewerVNCBrowser DesktopViewer = "vnc-browser" DesktopViewerRdpGW DesktopViewer = "rdp-gw" DesktopViewerRdpVPN DesktopViewer = "rdp-vpn" DesktopViewerRdpBrowser DesktopViewer = "rdp-browser" )
type DesktopViewerRsp ¶
type DomainState ¶
type DomainState string
type Err ¶
type Group ¶
type Group struct { ID *string `json:"id,omitempty"` UID *string `json:"uid,omitempty"` Category *string `json:"parent_category,omitempty"` Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` ExternalAppID *string `json:"external_app_id,omitempty"` ExternalGID *string `json:"external_gid,omitempty"` }
type Hypervisor ¶
type Hypervisor struct { ID *string `json:"id,omitempty"` URI *string `json:"uri,omitempty"` Status *HypervisorStatus `json:"status,omitempty"` OnlyForced *bool `json:"only_forced,omitempty"` Buffering *bool `json:"buffering_hyper,omitempty"` }
type HypervisorStatus ¶
type HypervisorStatus string
const ( HypervisorStatusOnline HypervisorStatus = "Online" HypervisorStatusOffline HypervisorStatus = "Offline" HypervisorStatusError HypervisorStatus = "Error" HypervisorStatusDeleting HypervisorStatus = "Deleting" )
type Interface ¶
type Interface interface { URL() *url.URL Version(context.Context) (string, error) Maintenance(context.Context) (bool, error) SetBeforeRequestHook(func(*Client) error) AuthForm(ctx context.Context, category, usr, pwd string) (string, error) SetToken(string) UserVPN(context.Context) (string, error) UserOwnsDesktop(context.Context, *UserOwnsDesktopOpts) error AdminUserList(ctx context.Context) ([]*User, error) AdminUserCreate(ctx context.Context, provider, role, category, group, uid, username, pwd string) (*User, error) AdminUserDelete(ctx context.Context, id string) error AdminUserResetPassword(ctx context.Context, id, pwd string) error AdminUserRequiredDisclaimerAcknowledgement(ctx context.Context, id string) (bool, error) AdminUserRequiredEmailVerification(ctx context.Context, id string) (bool, error) AdminUserRequiredPasswordReset(ctx context.Context, id string) (bool, error) AdminUserAutoRegister(ctx context.Context, registerTkn, roleID, groupID string, secondaryGroupsIDs []string) (id string, err error) AdminGroupCreate(ctx context.Context, category, uid, name, description, externalAppID, externalGID string) (*Group, error) AdminDesktopList(context.Context) ([]*AdminDesktop, error) AdminTemplateList(context.Context) ([]*Template, error) AdminHypervisorUpdate(context.Context, *Hypervisor) error AdminHypervisorOnlyForced(ctx context.Context, id string, onlyForced bool) error HypervisorList(context.Context) ([]*Hypervisor, error) HypervisorGet(ctx context.Context, id string) (*Hypervisor, error) HypervisorDelete(ctx context.Context, id string) error DesktopList(context.Context) ([]*Desktop, error) DesktopGet(ctx context.Context, id string) (*Desktop, error) DesktopCreate(ctx context.Context, name, templateID string) (*Desktop, error) DesktopCreateFromScratch(ctx context.Context, name, xml string) (*Desktop, error) DesktopUpdate(ctx context.Context, id string, opts DesktopUpdateOptions) error DesktopDelete(ctx context.Context, id string) error DesktopStart(ctx context.Context, id string) error DesktopStop(ctx context.Context, id string) error DesktopViewer(ctx context.Context, t DesktopViewer, id string) (string, error) TemplateList(context.Context) ([]*Template, error) TemplateCreateFromDesktop(ctx context.Context, name, desktopID string) (*Template, error) StatsCategoryList(context.Context) ([]*StatsCategory, error) StatsDeploymentByCategory(ctx context.Context) ([]*StatsDeploymentByCategory, error) StatsUsers(ctx context.Context) ([]*StatsUser, error) StatsDesktops(ctx context.Context) ([]*StatsDesktop, error) StatsTemplates(ctx context.Context) ([]*StatsTemplate, error) StatsHypervisors(ctx context.Context) ([]*StatsHypervisor, error) StatsDomainsStatus(ctx context.Context) (*StatsDomainsStatus, error) OrchestratorHypervisorList(ctx context.Context) ([]*OrchestratorHypervisor, error) OrchestratorHypervisorGet(ctx context.Context, id string) (*OrchestratorHypervisor, error) OrchestratorHypervisorManage(ctx context.Context, id string) error OrchestratorHypervisorUnmanage(ctx context.Context, id string) error OrchestratorHypervisorAddToDeadRow(ctx context.Context, id string) (time.Time, error) OrchestratorHypervisorRemoveFromDeadRow(ctx context.Context, id string) error OrchestratorHypervisorStopDesktops(ctx context.Context, id string) error OrchestratorGPUBookingList(ctx context.Context) ([]*OrchestratorGPUBooking, error) }
type OrchestratorGPUBooking ¶
type OrchestratorGPUBooking struct { Brand string `json:"brand,omitempty"` Model string `json:"model,omitempty"` Profile string `json:"profile,omitempty"` Now OrchestratorGPUBookingTime `json:"now,omitempty"` Create OrchestratorGPUBookingTime `json:"to_create,omitempty"` Destroy OrchestratorGPUBookingTime `json:"to_destroy,omitempty"` }
type OrchestratorHypervisor ¶
type OrchestratorHypervisor struct { ID string `json:"id,omitempty"` Status HypervisorStatus `json:"status,omitempty"` OnlyForced bool `json:"only_forced,omitempty"` Buffering bool `json:"buffering_hyper,omitempty"` DestroyTime time.Time `json:"destroy_time,omitempty"` Stats OrchestratorHypervisorStats `json:"stats,omitempty"` MinFreeMemGB int `json:"min_free_mem_gb,omitempty"` OrchestratorManaged bool `json:"orchestrator_managed,omitempty"` GPUOnly bool `json:"gpu_only,omitempty"` DesktopsStarted int `json:"desktops_started,omitempty"` CPU OrchestratorResourceLoad `json:"-"` RAM OrchestratorResourceLoad `json:"-"` GPUs []*OrchestratorHypervisorGPU `json:"gpus,omitempty"` BookingsEndTime time.Time `json:"bookings_end_time,omitempty"` }
type OrchestratorHypervisorGPU ¶
type OrchestratorHypervisorGPU struct { ID string `json:"id,omitempty"` Brand string `json:"brand,omitempty"` Model string `json:"model,omitempty"` Profile string `json:"profile,omitempty"` TotalUnits int `json:"total_units,omitempty"` UsedUnits int `json:"used_units,omitempty"` FreeUnits int `json:"free_units,omitempty"` }
type OrchestratorHypervisorStats ¶
type OrchestratorHypervisorStats struct { CPUCurrent OrchestratorHypervisorStatsCPU `json:"cpu_current,omitempty"` CPU5Min OrchestratorHypervisorStatsCPU `json:"cpu_5min,omitempty"` Mem OrchestratorHypervisorStatsMem `json:"mem_stats,omitempty"` }
type StatsCategory ¶
type StatsDesktop ¶
type StatsDomainsStatus ¶
type StatsDomainsStatus struct { Desktop map[DomainState]int `json:"desktop,omitempty"` Template map[DomainState]int `json:"template,omitempty"` }
type StatsHypervisor ¶
type StatsHypervisor struct { ID *string `json:"id,omitempty"` Status *HypervisorStatus `json:"status,omitempty"` OnlyForced *bool `json:"only_forced,omitempty"` }
type StatsTemplate ¶
type StatsTemplate struct {
ID *string `json:"id,omitempty"`
}
type User ¶
type User struct { ID *string `json:"id,omitempty"` Provider *string `json:"provider,omitempty"` Role *string `json:"role,omitempty"` Category *string `json:"category,omitempty"` Group *string `json:"group,omitempty"` UID *string `json:"uid,omitempty"` Username *string `json:"username,omitempty"` Name *string `json:"name,omitempty"` }
type UserOwnsDesktopOpts ¶
type UserVPNRsp ¶
Click to show internal directories.
Click to hide internal directories.