Documentation ¶
Overview ¶
Package client provides a REST wrapper to the kVDI API.
Package client provides a REST wrapper to the kVDI API.
Index ¶
- type Client
- func (c *Client) Close()
- func (c *Client) CreateDesktopSession(opts *types.CreateSessionRequest) (*types.CreateSessionResponse, error)
- func (c *Client) CreateDesktopTemplate(req *desktopsv1.Template) error
- func (c *Client) CreateVDIRole(req *types.CreateRoleRequest) error
- func (c *Client) CreateVDIUser(req *types.CreateUserRequest) error
- func (c *Client) DeleteDesktopSession(nn NamespacedName) error
- func (c *Client) DeleteDesktopTemplate(name string) error
- func (c *Client) DeleteVDIRole(name string) error
- func (c *Client) DeleteVDIUser(name string) error
- func (c *Client) GetDesktopAudioProxy(nn NamespacedName) (io.ReadWriteCloser, error)
- func (c *Client) GetDesktopDisplayProxy(nn NamespacedName) (io.ReadWriteCloser, error)
- func (c *Client) GetDesktopFile(nn NamespacedName, path string) (io.ReadCloser, error)
- func (c *Client) GetDesktopSessions() (*types.DesktopSessionsResponse, error)
- func (c *Client) GetDesktopTemplate(name string) (*desktopsv1.Template, error)
- func (c *Client) GetDesktopTemplates() ([]*desktopsv1.Template, error)
- func (c *Client) GetNamespaces() ([]string, error)
- func (c *Client) GetServerConfig() (*appv1.VDIClusterSpec, error)
- func (c *Client) GetServerVersion() (version, gitCommit string, err error)
- func (c *Client) GetServiceAccounts(namespace string) ([]string, error)
- func (c *Client) GetVDIRole(name string) (*rbacv1.VDIRole, error)
- func (c *Client) GetVDIRoles() ([]*rbacv1.VDIRole, error)
- func (c *Client) GetVDIUser(name string) (*types.VDIUser, error)
- func (c *Client) GetVDIUsers() ([]*types.VDIUser, error)
- func (c *Client) PutDesktopFile(nn NamespacedName, name string, contents io.Reader) error
- func (c *Client) SetAutoRefreshToken(val bool)
- func (c *Client) StatDesktopFile(nn NamespacedName, path string) (*types.StatDesktopFileResponse, error)
- func (c *Client) UpdateDesktopTemplate(name string, req *desktopsv1.Template) error
- func (c *Client) UpdateVDIRole(name string, req *types.UpdateRoleRequest) error
- func (c *Client) UpdateVDIUser(name string, req *types.UpdateUserRequest) error
- func (c *Client) WhoAmI() (*types.VDIUser, error)
- type NamespacedName
- type Opts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides a REST wrapper to the kVDI API.
func (*Client) Close ¶
func (c *Client) Close()
Close will stop the token refresh goroutine if it's running.
func (*Client) CreateDesktopSession ¶
func (c *Client) CreateDesktopSession(opts *types.CreateSessionRequest) (*types.CreateSessionResponse, error)
CreateDesktopSession creates a new desktop session.
func (*Client) CreateDesktopTemplate ¶
func (c *Client) CreateDesktopTemplate(req *desktopsv1.Template) error
CreateDesktopTemplate creates a new DesktopTemplate for this cluster.
func (*Client) CreateVDIRole ¶
func (c *Client) CreateVDIRole(req *types.CreateRoleRequest) error
CreateVDIRole creates a new VDIRole for this cluster.
func (*Client) CreateVDIUser ¶
func (c *Client) CreateVDIUser(req *types.CreateUserRequest) error
CreateVDIUser creates a new VDIUser for this cluster, if possible.
func (*Client) DeleteDesktopSession ¶
func (c *Client) DeleteDesktopSession(nn NamespacedName) error
DeleteDesktopSession terminates the given desktop session.
func (*Client) DeleteDesktopTemplate ¶
DeleteDesktopTemplate will delete the given DesktopTemplate.
func (*Client) DeleteVDIRole ¶
DeleteVDIRole will delete the given VDIRole.
func (*Client) DeleteVDIUser ¶
DeleteVDIUser will delete the given VDIUser.
func (*Client) GetDesktopAudioProxy ¶
func (c *Client) GetDesktopAudioProxy(nn NamespacedName) (io.ReadWriteCloser, error)
GetDesktopAudioProxy returns a ReadWriteCloser proxying the audio of the given session.
func (*Client) GetDesktopDisplayProxy ¶
func (c *Client) GetDesktopDisplayProxy(nn NamespacedName) (io.ReadWriteCloser, error)
GetDesktopDisplayProxy returns a ReadWriteCloser proxying the display of the given session.
func (*Client) GetDesktopFile ¶
func (c *Client) GetDesktopFile(nn NamespacedName, path string) (io.ReadCloser, error)
GetDesktopFile retrieves a ReadCloser containing the contents of the requested file
func (*Client) GetDesktopSessions ¶
func (c *Client) GetDesktopSessions() (*types.DesktopSessionsResponse, error)
GetDesktopSessions retrieves the status of currently running desktop sessions in kVDI.
func (*Client) GetDesktopTemplate ¶
func (c *Client) GetDesktopTemplate(name string) (*desktopsv1.Template, error)
GetDesktopTemplate retrieves a single DesktopTemplate in kVDI by its name.
func (*Client) GetDesktopTemplates ¶
func (c *Client) GetDesktopTemplates() ([]*desktopsv1.Template, error)
GetDesktopTemplates returns a list of available DesktopTemplates. This is the same as doing `kubectl get desktoptemplates -o json`.
func (*Client) GetNamespaces ¶
GetNamespaces retrieves a list of namespaces the current user has access to.
func (*Client) GetServerConfig ¶
func (c *Client) GetServerConfig() (*appv1.VDIClusterSpec, error)
GetServerConfig returns the VDICluster configuration of the server.
func (*Client) GetServerVersion ¶
GetServerVersion will return the version and git commit of the running API server.
func (*Client) GetServiceAccounts ¶
GetServiceAccounts retrieves all the service accounts the current user can use in the given namespace.
func (*Client) GetVDIRole ¶
GetVDIRole retrieves a single VDIRole in kVDI by its name.
func (*Client) GetVDIRoles ¶
GetVDIRoles retrieves the available VDIRoles for kVDI. This is the same as doing `kubectl get vdiroles -l "kvdi.io/cluster-ref=kvdi" -o json`.
func (*Client) GetVDIUser ¶
GetVDIUser returns a single VDIUser by name, if possible. VDIUsers are not like DesktopTemplates and VDIRoles in that they are not CRDs, and are just used as an internal abstraction on the concept of a user.
func (*Client) GetVDIUsers ¶
GetVDIUsers returns a list of available VDIUsers, if possible. VDIUsers are not like DesktopTemplates and VDIRoles in that they are not CRDs, and are just used as an internal abstraction on the concept of a user.
func (*Client) PutDesktopFile ¶
PutDesktopFile uploads a file to the given desktop session.
func (*Client) SetAutoRefreshToken ¶
SetAutoRefreshToken will set whether the client should try to auto refresh tokens after an unauthorized response. The default value is true. Use this method to disable the behavior.
func (*Client) StatDesktopFile ¶
func (c *Client) StatDesktopFile(nn NamespacedName, path string) (*types.StatDesktopFileResponse, error)
StatDesktopFile retrieves stat information for the given path on the desktop.
func (*Client) UpdateDesktopTemplate ¶
func (c *Client) UpdateDesktopTemplate(name string, req *desktopsv1.Template) error
UpdateDesktopTemplate will update a DesktopTemplate. Unlike CreateRoleRequest, the properties provided in the request are merged into the remote state. So only attributes defined in the payload are applied to the remote object.
func (*Client) UpdateVDIRole ¶
func (c *Client) UpdateVDIRole(name string, req *types.UpdateRoleRequest) error
UpdateVDIRole will update a VDIRole. All existing properties are overwritten by those in the request, even if nil or unset.
func (*Client) UpdateVDIUser ¶
func (c *Client) UpdateVDIUser(name string, req *types.UpdateUserRequest) error
UpdateVDIUser will update a VDIUser, if possible. If a password is provided, the password is changed for the user. If a list of role names are provided, the user's roles are updated to match those provided in the payload.
type NamespacedName ¶
type NamespacedName ktypes.NamespacedName
NamespacedName casts the Kubernetes NamespacedName for ease of use when using this package.
func (NamespacedName) String ¶
func (n NamespacedName) String() string
type Opts ¶
type Opts struct { // The full URL to the kVDI app server (e.g. https://kvdi.local) URL string // The username to use to authenticate. Username string // The password to use to authenticate. Password string // TODO: Allow for API keys tied to roles for auth providers that don't allow us // to independently verify credentials (e.g. OpenID). APIKey string // The PEM encoded CA certificate to use when validating the kVDI server certificate. // When using the generated certificate, this can be found in the kvdi-app // server TLS secret. TLSCACert []byte // Set to true to skip TLS verification. TLSInsecureSkipVerify bool }
Opts are options to pass to New when creating a new client interface.