apiclient

package
v0.23.7 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiClient

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

func NewClient

func NewClient(baseURL string, token string, insecureSkipVerify bool) (*ApiClient, error)

func NewMuxClient added in v0.23.0

func NewMuxClient(user *model.User) *ApiClient

NewMuxClient creates an ApiClient that uses MuxClient for direct API calls

func (*ApiClient) AddShare added in v0.23.0

func (c *ApiClient) AddShare(ctx context.Context, spaceId string, userId string) (int, error)

func (*ApiClient) AppendUserAgent

func (c *ApiClient) AppendUserAgent(userAgent string) *ApiClient

func (*ApiClient) ConnectWebSocket added in v0.23.0

func (c *ApiClient) ConnectWebSocket(ctx context.Context, url string) (*websocket.Conn, error)

func (*ApiClient) CreateGroup

func (c *ApiClient) CreateGroup(ctx context.Context, request *GroupRequest) (string, int, error)

func (*ApiClient) CreateRole added in v0.12.0

func (c *ApiClient) CreateRole(ctx context.Context, request *RoleRequest) (string, int, error)

func (*ApiClient) CreateScript added in v0.23.0

func (*ApiClient) CreateSkill added in v0.23.0

func (c *ApiClient) CreateSkill(ctx context.Context, req *SkillCreateRequest) (*SkillCreateResponse, error)

func (*ApiClient) CreateSpace

func (c *ApiClient) CreateSpace(ctx context.Context, space *SpaceRequest) (string, int, error)

func (*ApiClient) CreateTemplate

func (c *ApiClient) CreateTemplate(ctx context.Context, request *TemplateCreateRequest) (string, int, error)

func (*ApiClient) CreateTemplateVar

func (c *ApiClient) CreateTemplateVar(ctx context.Context, request *TemplateVarValue) (string, int, error)

func (*ApiClient) CreateToken

func (c *ApiClient) CreateToken(ctx context.Context, name string) (string, int, error)

func (*ApiClient) CreateUser

func (c *ApiClient) CreateUser(ctx context.Context, request *CreateUserRequest) (string, int, error)

func (*ApiClient) CreateVolume

func (c *ApiClient) CreateVolume(ctx context.Context, request *VolumeCreateRequest) (*VolumeCreateResponse, int, error)

func (*ApiClient) DeleteGroup

func (c *ApiClient) DeleteGroup(ctx context.Context, groupId string) (int, error)

func (*ApiClient) DeleteRole added in v0.12.0

func (c *ApiClient) DeleteRole(ctx context.Context, roleId string) (int, error)

func (*ApiClient) DeleteScript added in v0.23.0

func (c *ApiClient) DeleteScript(ctx context.Context, id string) error

func (*ApiClient) DeleteSkill added in v0.23.0

func (c *ApiClient) DeleteSkill(ctx context.Context, nameOrId string) error

func (*ApiClient) DeleteSpace

func (c *ApiClient) DeleteSpace(ctx context.Context, spaceId string) (int, error)

func (*ApiClient) DeleteTemplate

func (c *ApiClient) DeleteTemplate(ctx context.Context, templateId string) (int, error)

func (*ApiClient) DeleteTemplateVar

func (c *ApiClient) DeleteTemplateVar(ctx context.Context, templateVarId string) (int, error)

func (*ApiClient) DeleteToken

func (c *ApiClient) DeleteToken(ctx context.Context, tokenId string) (int, error)

func (*ApiClient) DeleteUser

func (c *ApiClient) DeleteUser(ctx context.Context, userId string) error

func (*ApiClient) DeleteVolume

func (c *ApiClient) DeleteVolume(ctx context.Context, volumeId string) (int, error)

func (*ApiClient) Do added in v0.23.0

func (c *ApiClient) Do(ctx context.Context, method string, path string, requestBody interface{}, responseBody interface{}) (int, error)

Do makes an arbitrary API request

func (*ApiClient) DoJSON added in v0.23.0

func (c *ApiClient) DoJSON(ctx context.Context, method string, path string, requestBody interface{}, responseBody interface{}) (int, error)

DoJSON makes an arbitrary API request using JSON content type and JSON accept header (thread-safe)

func (*ApiClient) ExecuteScript added in v0.23.0

func (c *ApiClient) ExecuteScript(ctx context.Context, spaceId, scriptId string, args []string) (string, int, error)

func (*ApiClient) ExecuteScriptByName added in v0.23.0

func (c *ApiClient) ExecuteScriptByName(ctx context.Context, spaceId, scriptName string, args []string) (string, int, error)

func (*ApiClient) ExecuteScriptContent added in v0.23.0

func (c *ApiClient) ExecuteScriptContent(ctx context.Context, spaceId, content string, args []string) (string, int, error)

func (*ApiClient) ExecuteScriptContentStream added in v0.23.0

func (c *ApiClient) ExecuteScriptContentStream(ctx context.Context, spaceId, content string, args []string) (int, error)

func (*ApiClient) ExecuteScriptStream added in v0.23.0

func (c *ApiClient) ExecuteScriptStream(ctx context.Context, spaceId, scriptName string, args []string) (int, error)

func (*ApiClient) ForwardPort added in v0.22.2

func (c *ApiClient) ForwardPort(ctx context.Context, spaceId string, request *PortForwardRequest) (int, error)

func (*ApiClient) GetAuditLogs added in v0.12.9

func (c *ApiClient) GetAuditLogs(ctx context.Context, start int, maxItems int) (*AuditLogs, int, error)

func (*ApiClient) GetAuthToken added in v0.23.0

func (c *ApiClient) GetAuthToken() string

func (*ApiClient) GetBaseURL added in v0.23.0

func (c *ApiClient) GetBaseURL() string

func (*ApiClient) GetClusterInfo added in v0.18.0

func (c *ApiClient) GetClusterInfo(ctx context.Context) (*[]ClusterNodeInfo, int, error)

func (*ApiClient) GetClusterNodes added in v0.22.0

func (c *ApiClient) GetClusterNodes(ctx context.Context) (*[]ClusterNode, int, error)

func (*ApiClient) GetGroup

func (c *ApiClient) GetGroup(ctx context.Context, groupId string) (*GroupInfo, int, error)

func (*ApiClient) GetGroups

func (c *ApiClient) GetGroups(ctx context.Context) (*GroupInfoList, int, error)

func (*ApiClient) GetIcons added in v0.23.0

func (c *ApiClient) GetIcons(ctx context.Context) ([]Icon, int, error)

func (*ApiClient) GetPermissions added in v0.12.0

func (c *ApiClient) GetPermissions(ctx context.Context) (*PermissionInfoList, int, error)

func (*ApiClient) GetRESTClient added in v0.23.6

func (c *ApiClient) GetRESTClient() rest.RESTClient

func (*ApiClient) GetRole added in v0.12.0

func (c *ApiClient) GetRole(ctx context.Context, roleId string) (*RoleDetails, int, error)

func (*ApiClient) GetRoles added in v0.12.0

func (c *ApiClient) GetRoles(ctx context.Context) (*RoleInfoList, int, error)

func (*ApiClient) GetScript added in v0.23.0

func (c *ApiClient) GetScript(ctx context.Context, id string) (*ScriptDetails, error)

func (*ApiClient) GetScriptByName added in v0.23.0

func (c *ApiClient) GetScriptByName(ctx context.Context, name string) (string, error)

func (*ApiClient) GetScriptDetailsByName added in v0.23.0

func (c *ApiClient) GetScriptDetailsByName(ctx context.Context, name string) (*ScriptDetails, error)

func (*ApiClient) GetScriptLibrary added in v0.23.0

func (c *ApiClient) GetScriptLibrary(ctx context.Context, name string) (string, error)

func (*ApiClient) GetScripts added in v0.23.0

func (c *ApiClient) GetScripts(ctx context.Context) (*ScriptList, error)

func (*ApiClient) GetSkill added in v0.23.0

func (c *ApiClient) GetSkill(ctx context.Context, nameOrId string) (*SkillDetails, error)

func (*ApiClient) GetSkills added in v0.23.0

func (c *ApiClient) GetSkills(ctx context.Context) (*SkillList, error)

func (*ApiClient) GetSpace

func (c *ApiClient) GetSpace(ctx context.Context, spaceId string) (*SpaceDefinition, int, error)

func (*ApiClient) GetSpaceByName added in v0.23.0

func (c *ApiClient) GetSpaceByName(ctx context.Context, spaceName string) (*SpaceDefinition, error)

func (*ApiClient) GetSpaceCustomField added in v0.21.5

func (c *ApiClient) GetSpaceCustomField(ctx context.Context, spaceId string, fieldName string) (*GetCustomFieldResponse, int, error)

func (*ApiClient) GetSpaces

func (c *ApiClient) GetSpaces(ctx context.Context, userId string) (*SpaceInfoList, int, error)

func (*ApiClient) GetTemplate

func (c *ApiClient) GetTemplate(ctx context.Context, templateId string) (*TemplateDetails, int, error)

func (*ApiClient) GetTemplateByName added in v0.23.0

func (c *ApiClient) GetTemplateByName(ctx context.Context, name string) (*TemplateDetails, error)

func (*ApiClient) GetTemplateVar

func (c *ApiClient) GetTemplateVar(ctx context.Context, templateVarId string) (*TemplateVarValue, int, error)

func (*ApiClient) GetTemplateVars

func (c *ApiClient) GetTemplateVars(ctx context.Context) (*TemplateVarList, int, error)

func (*ApiClient) GetTemplates

func (c *ApiClient) GetTemplates(ctx context.Context) (*TemplateList, int, error)

func (*ApiClient) GetTokens

func (c *ApiClient) GetTokens(ctx context.Context) (*[]TokenInfo, int, error)

func (*ApiClient) GetTunnelServerInfo added in v0.18.0

func (c *ApiClient) GetTunnelServerInfo(ctx context.Context) (*TunnelServerInfo, int, error)

func (*ApiClient) GetTunnels added in v0.12.7

func (c *ApiClient) GetTunnels(ctx context.Context) ([]TunnelInfo, int, error)

func (*ApiClient) GetUser

func (c *ApiClient) GetUser(ctx context.Context, userId string) (*UserResponse, error)

func (*ApiClient) GetUserPermissions added in v0.23.0

func (c *ApiClient) GetUserPermissions(ctx context.Context, userId string) ([]uint16, error)

func (*ApiClient) GetUserQuota added in v0.12.0

func (c *ApiClient) GetUserQuota(ctx context.Context, userId string) (*UserQuota, error)

func (*ApiClient) GetUsers

func (c *ApiClient) GetUsers(ctx context.Context, state string, zone string) (*UserInfoList, error)

func (*ApiClient) GetVolume

func (c *ApiClient) GetVolume(ctx context.Context, volumeId string) (*VolumeDefinition, int, error)

func (*ApiClient) GetVolumeNodes added in v0.23.6

func (c *ApiClient) GetVolumeNodes(ctx context.Context, platform string) ([]VolumeNode, int, error)

func (*ApiClient) GetVolumes

func (c *ApiClient) GetVolumes(ctx context.Context) (*VolumeInfoList, int, error)

func (*ApiClient) GetWebSocketURL added in v0.23.0

func (c *ApiClient) GetWebSocketURL() string

func (*ApiClient) HasUserPermission added in v0.23.0

func (c *ApiClient) HasUserPermission(ctx context.Context, userId string, permission uint16) (bool, error)

func (*ApiClient) ListPorts added in v0.22.2

func (c *ApiClient) ListPorts(ctx context.Context, spaceId string) (*PortListResponse, int, error)

func (*ApiClient) Login

func (c *ApiClient) Login(ctx context.Context, email string, password string, totpCode string) (*AuthLoginResponse, int, error)

func (*ApiClient) LoginUserToken added in v0.10.0

func (c *ApiClient) LoginUserToken(ctx context.Context, userId string, token string) error

Login to the server using a user ID and token

func (*ApiClient) Logout

func (c *ApiClient) Logout(ctx context.Context) error

func (*ApiClient) Ping

func (c *ApiClient) Ping(ctx context.Context) (*PingResponse, error)

func (*ApiClient) ReadSpaceFile added in v0.23.0

func (c *ApiClient) ReadSpaceFile(ctx context.Context, spaceId string, filePath string) (string, error)

func (*ApiClient) RemoveShare added in v0.23.0

func (c *ApiClient) RemoveShare(ctx context.Context, spaceId string) (int, error)

func (*ApiClient) RestartSpace added in v0.18.0

func (c *ApiClient) RestartSpace(ctx context.Context, spaceId string) (int, error)

func (*ApiClient) RunCommand added in v0.23.0

func (c *ApiClient) RunCommand(ctx context.Context, spaceId string, request *RunCommandRequest) (string, error)

func (*ApiClient) SetAuthToken

func (c *ApiClient) SetAuthToken(token string) *ApiClient

func (*ApiClient) SetBaseUrl

func (c *ApiClient) SetBaseUrl(baseURL string) *ApiClient

func (*ApiClient) SetContentType added in v0.23.0

func (c *ApiClient) SetContentType(contentType string) *ApiClient

func (*ApiClient) SetSpaceCustomField added in v0.21.5

func (c *ApiClient) SetSpaceCustomField(ctx context.Context, spaceId string, fieldName string, fieldValue string) (int, error)

func (*ApiClient) SetTimeout added in v0.23.0

func (c *ApiClient) SetTimeout(timeout time.Duration) *ApiClient

func (*ApiClient) StartSpace

func (c *ApiClient) StartSpace(ctx context.Context, spaceId string) (int, error)

func (*ApiClient) StartVolume

func (c *ApiClient) StartVolume(ctx context.Context, volumeId string) (*StartVolumeResponse, int, error)

func (*ApiClient) StopPort added in v0.22.2

func (c *ApiClient) StopPort(ctx context.Context, spaceId string, request *PortStopRequest) (int, error)

func (*ApiClient) StopSpace

func (c *ApiClient) StopSpace(ctx context.Context, spaceId string) (int, error)

func (*ApiClient) StopVolume

func (c *ApiClient) StopVolume(ctx context.Context, volumeId string) (int, error)

func (*ApiClient) TransferSpace added in v0.16.0

func (c *ApiClient) TransferSpace(ctx context.Context, spaceId string, userId string) (int, error)

func (*ApiClient) UpdateGroup

func (c *ApiClient) UpdateGroup(ctx context.Context, groupId string, request *GroupRequest) (int, error)

func (*ApiClient) UpdateRole added in v0.12.0

func (c *ApiClient) UpdateRole(ctx context.Context, roleId string, request *RoleRequest) (int, error)

func (*ApiClient) UpdateScript added in v0.23.0

func (c *ApiClient) UpdateScript(ctx context.Context, scriptId string, req ScriptUpdateRequest) error

func (*ApiClient) UpdateSkill added in v0.23.0

func (c *ApiClient) UpdateSkill(ctx context.Context, nameOrId string, req *SkillUpdateRequest) (*SkillUpdateResponse, error)

func (*ApiClient) UpdateSpace

func (c *ApiClient) UpdateSpace(ctx context.Context, spaceId string, space *SpaceRequest) (int, error)

func (*ApiClient) UpdateTemplate

func (c *ApiClient) UpdateTemplate(ctx context.Context, templateId string, request *TemplateUpdateRequest) (int, error)

func (*ApiClient) UpdateTemplateVar

func (c *ApiClient) UpdateTemplateVar(ctx context.Context, templateVarId string, request *TemplateVarValue) (int, error)

func (*ApiClient) UpdateUser

func (c *ApiClient) UpdateUser(ctx context.Context, userId string, user *UpdateUserRequest) error

func (*ApiClient) UpdateVolume

func (c *ApiClient) UpdateVolume(ctx context.Context, volumeId string, request *VolumeUpdateRequest) (int, error)

func (*ApiClient) UseSessionCookie

func (c *ApiClient) UseSessionCookie(useCookie bool) *ApiClient

func (*ApiClient) UsingTOTP added in v0.15.0

func (c *ApiClient) UsingTOTP(ctx context.Context) (bool, int, error)

func (*ApiClient) WhoAmI

func (c *ApiClient) WhoAmI(ctx context.Context) (*UserResponse, error)

func (*ApiClient) WriteSpaceFile added in v0.23.0

func (c *ApiClient) WriteSpaceFile(ctx context.Context, spaceId string, filePath string, content string) error

type AuditLogEntry added in v0.12.9

type AuditLogEntry struct {
	Id         int64                  `json:"audit_log_id"`
	Zone       string                 `json:"zone"`
	Actor      string                 `json:"actor"`
	ActorType  string                 `json:"actor_type"`
	Event      string                 `json:"event"`
	When       time.Time              `json:"when"`
	Details    string                 `json:"details"`
	Properties map[string]interface{} `json:"properties"`
}

type AuditLogs added in v0.12.9

type AuditLogs struct {
	Count int             `json:"count"`
	Items []AuditLogEntry `json:"items"`
}

type AuthLoginRequest

type AuthLoginRequest struct {
	Password string `json:"password"`
	Email    string `json:"email"`
	TOTPCode string `json:"totp_code"`
}

type AuthLoginResponse

type AuthLoginResponse struct {
	Status     bool   `json:"status"`
	Token      string `json:"token"`
	TOTPSecret string `json:"totp_secret"`
}

type AuthLogoutResponse

type AuthLogoutResponse struct {
	Status bool `json:"status"`
}

type ClusterNode added in v0.22.0

type ClusterNode struct {
	NodeId          string   `json:"node_id"`
	Hostname        string   `json:"hostname"`
	Zone            string   `json:"zone"`
	ApiEndpoint     string   `json:"api_endpoint"`
	AllocatedSpaces int      `json:"allocated_spaces"`
	RunningSpaces   int      `json:"running_spaces"`
	Runtimes        []string `json:"runtimes"`
}

type ClusterNodeInfo added in v0.18.0

type ClusterNodeInfo struct {
	Id       string            `json:"id"`
	Address  string            `json:"address"`
	State    string            `json:"state"`
	Metadata map[string]string `json:"metadata"`
}

type CopyFileRequest added in v0.19.0

type CopyFileRequest struct {
	SourcePath string `json:"source_path"`
	DestPath   string `json:"dest_path"`
	Content    []byte `json:"content,omitempty"`
	Direction  string `json:"direction"` // "to_space" or "from_space"
	Workdir    string `json:"workdir,omitempty"`
}

type CreateSpaceResponse

type CreateSpaceResponse struct {
	Status  bool   `json:"status"`
	SpaceID string `json:"space_id"`
}

type CreateTokenRequest

type CreateTokenRequest struct {
	Name string `json:"name"`
}

type CreateTokenResponse

type CreateTokenResponse struct {
	Status  bool   `json:"status"`
	TokenID string `json:"token_id"`
}

type CreateUserRequest

type CreateUserRequest = userRequest

type CreateUserResponse

type CreateUserResponse struct {
	Status bool   `json:"status"`
	UserId string `json:"user_id"`
}

type CustomFieldDef added in v0.18.0

type CustomFieldDef struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

type CustomFieldValue added in v0.18.0

type CustomFieldValue struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type GetCustomFieldResponse added in v0.21.5

type GetCustomFieldResponse struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type GroupInfo

type GroupInfo struct {
	Id           string `json:"group_id"`
	Name         string `json:"name"`
	MaxSpaces    uint32 `json:"max_spaces"`
	ComputeUnits uint32 `json:"compute_units"`
	StorageUnits uint32 `json:"storage_units"`
	MaxTunnels   uint32 `json:"max_tunnels"`
}

type GroupInfoList

type GroupInfoList struct {
	Count  int         `json:"count"`
	Groups []GroupInfo `json:"groups"`
}

type GroupRequest added in v0.18.0

type GroupRequest struct {
	Name         string `json:"name"`
	MaxSpaces    uint32 `json:"max_spaces"`
	ComputeUnits uint32 `json:"compute_units"`
	StorageUnits uint32 `json:"storage_units"`
	MaxTunnels   uint32 `json:"max_tunnels"`
}

type GroupResponse

type GroupResponse struct {
	Status bool   `json:"status"`
	Id     string `json:"group_id"`
}

type Icon added in v0.23.0

type Icon struct {
	Description string `json:"description"`
	Source      string `json:"source"`
	URL         string `json:"url"`
}

type IconsResponse added in v0.23.0

type IconsResponse struct {
	Icons []Icon `json:"icons" msgpack:"icons"`
}

type PermissionInfo added in v0.12.0

type PermissionInfo struct {
	Id    int    `json:"id"`
	Name  string `json:"name"`
	Group string `json:"group"`
}

type PermissionInfoList added in v0.12.0

type PermissionInfoList struct {
	Count       int              `json:"count"`
	Permissions []PermissionInfo `json:"permissions"`
}

type PingResponse

type PingResponse struct {
	Status  bool   `json:"status"`
	Version string `json:"version"`
	Zone    string `json:"zone"`
}

type PortForwardInfo added in v0.22.2

type PortForwardInfo struct {
	LocalPort  uint16 `json:"local_port"`
	Space      string `json:"space"`
	RemotePort uint16 `json:"remote_port"`
}

type PortForwardRequest added in v0.22.2

type PortForwardRequest struct {
	LocalPort  uint16 `json:"local_port"`
	Space      string `json:"space"`
	RemotePort uint16 `json:"remote_port"`
}

type PortListResponse added in v0.22.2

type PortListResponse struct {
	Forwards []PortForwardInfo `json:"forwards"`
}

type PortStopRequest added in v0.22.2

type PortStopRequest struct {
	LocalPort uint16 `json:"local_port"`
}

type RoleDetails added in v0.12.0

type RoleDetails struct {
	Id          string   `json:"role_id"`
	Name        string   `json:"name"`
	Permissions []uint16 `json:"permissions"`
}

type RoleInfo added in v0.12.0

type RoleInfo struct {
	Id   string `json:"role_id"`
	Name string `json:"name"`
}

type RoleInfoList added in v0.12.0

type RoleInfoList struct {
	Count int        `json:"count"`
	Roles []RoleInfo `json:"roles"`
}

type RoleRequest added in v0.18.0

type RoleRequest struct {
	Name        string   `json:"name"`
	Permissions []uint16 `json:"permissions"`
}

type RoleResponse added in v0.12.0

type RoleResponse struct {
	Status bool   `json:"status"`
	Id     string `json:"role_id"`
}

type RunCommandRequest added in v0.19.0

type RunCommandRequest struct {
	Command string   `json:"command"`
	Args    []string `json:"args,omitempty"`
	Timeout int      `json:"timeout"`
	Workdir string   `json:"workdir,omitempty"`
}

type ScriptContentExecuteRequest added in v0.23.0

type ScriptContentExecuteRequest struct {
	Content   string   `json:"content"`
	Arguments []string `json:"arguments"`
}

type ScriptCreateRequest added in v0.23.0

type ScriptCreateRequest struct {
	UserId             string   `json:"user_id"`
	Name               string   `json:"name"`
	Description        string   `json:"description"`
	Content            string   `json:"content"`
	Groups             []string `json:"groups"`
	Zones              []string `json:"zones"`
	Active             bool     `json:"active"`
	ScriptType         string   `json:"script_type"`
	MCPInputSchemaToml string   `json:"mcp_input_schema_toml"`
	MCPKeywords        []string `json:"mcp_keywords"`
	Discoverable       bool     `json:"discoverable"`
}

type ScriptCreateResponse added in v0.23.0

type ScriptCreateResponse struct {
	Status bool   `json:"status"`
	Id     string `json:"script_id"`
}

type ScriptDetails added in v0.23.0

type ScriptDetails struct {
	Id                 string   `json:"script_id"`
	UserId             string   `json:"user_id"`
	Name               string   `json:"name"`
	Description        string   `json:"description"`
	Content            string   `json:"content"`
	Groups             []string `json:"groups"`
	Zones              []string `json:"zones"`
	Active             bool     `json:"active"`
	ScriptType         string   `json:"script_type"`
	MCPInputSchemaToml string   `json:"mcp_input_schema_toml"`
	MCPKeywords        []string `json:"mcp_keywords"`
	Discoverable       bool     `json:"discoverable"`
	IsManaged          bool     `json:"is_managed"`
}

type ScriptExecuteRequest added in v0.23.0

type ScriptExecuteRequest struct {
	Arguments []string `json:"arguments"`
}

type ScriptExecuteResponse added in v0.23.0

type ScriptExecuteResponse struct {
	Output   string `json:"output"`
	Error    string `json:"error,omitempty"`
	ExitCode int    `json:"exit_code"`
}

type ScriptInfo added in v0.23.0

type ScriptInfo struct {
	Id           string   `json:"script_id"`
	UserId       string   `json:"user_id"`
	Name         string   `json:"name"`
	Description  string   `json:"description"`
	Groups       []string `json:"groups"`
	Zones        []string `json:"zones"`
	Active       bool     `json:"active"`
	ScriptType   string   `json:"script_type"`
	Discoverable bool     `json:"discoverable"`
	IsManaged    bool     `json:"is_managed"`
}

type ScriptLibraryResponse added in v0.23.0

type ScriptLibraryResponse struct {
	Name    string `json:"name"`
	Content string `json:"content"`
}

type ScriptList added in v0.23.0

type ScriptList struct {
	Count   int          `json:"count"`
	Scripts []ScriptInfo `json:"scripts"`
}

type ScriptNameExecuteRequest added in v0.23.0

type ScriptNameExecuteRequest struct {
	ScriptName string   `json:"script_name"`
	Arguments  []string `json:"arguments"`
}

type ScriptUpdateRequest added in v0.23.0

type ScriptUpdateRequest struct {
	Name               string   `json:"name"`
	Description        string   `json:"description"`
	Content            string   `json:"content"`
	Groups             []string `json:"groups"`
	Zones              []string `json:"zones"`
	Active             bool     `json:"active"`
	ScriptType         string   `json:"script_type"`
	MCPInputSchemaToml string   `json:"mcp_input_schema_toml"`
	MCPKeywords        []string `json:"mcp_keywords"`
	Discoverable       bool     `json:"discoverable"`
}

type SetCustomFieldRequest added in v0.21.5

type SetCustomFieldRequest struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type SkillCreateRequest added in v0.23.0

type SkillCreateRequest struct {
	UserId  string   `json:"user_id"`
	Content string   `json:"content"`
	Groups  []string `json:"groups"`
	Zones   []string `json:"zones"`
	Active  bool     `json:"active"`
}

type SkillCreateResponse added in v0.23.0

type SkillCreateResponse struct {
	Status bool   `json:"status"`
	Id     string `json:"skill_id"`
}

type SkillDetails added in v0.23.0

type SkillDetails struct {
	Id          string   `json:"skill_id"`
	UserId      string   `json:"user_id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Content     string   `json:"content"`
	Groups      []string `json:"groups"`
	Zones       []string `json:"zones"`
	Active      bool     `json:"active"`
	IsManaged   bool     `json:"is_managed"`
}

type SkillInfo added in v0.23.0

type SkillInfo struct {
	Id          string   `json:"skill_id"`
	UserId      string   `json:"user_id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Groups      []string `json:"groups"`
	Zones       []string `json:"zones"`
	Active      bool     `json:"active"`
	IsManaged   bool     `json:"is_managed"`
}

type SkillList added in v0.23.0

type SkillList struct {
	Count  int         `json:"count"`
	Skills []SkillInfo `json:"skills"`
}

type SkillSearchResult added in v0.23.0

type SkillSearchResult struct {
	Skill string  `json:"skill"`
	Score float64 `json:"score"`
}

type SkillUpdateRequest added in v0.23.0

type SkillUpdateRequest struct {
	Content string   `json:"content"`
	Groups  []string `json:"groups"`
	Zones   []string `json:"zones"`
	Active  bool     `json:"active"`
}

type SkillUpdateResponse added in v0.23.0

type SkillUpdateResponse struct {
	Status bool `json:"status"`
}

type SpaceDefinition

type SpaceDefinition struct {
	SpaceId            string                       `json:"space_id"`
	UserId             string                       `json:"user_id"`
	TemplateId         string                       `json:"template_id"`
	SharedUserId       string                       `json:"shared_user_id"`
	SharedUsername     string                       `json:"shared_username"`
	Name               string                       `json:"name"`
	Description        string                       `json:"description"`
	Note               string                       `json:"note"`
	TemplateName       string                       `json:"template_name"`
	Username           string                       `json:"username"`
	Platform           string                       `json:"platform"`
	Shell              string                       `json:"shell"`
	Zone               string                       `json:"zone"`
	AltNames           []string                     `json:"alt_names"`
	IsDeployed         bool                         `json:"is_deployed"`
	IsPending          bool                         `json:"is_pending"`
	IsDeleting         bool                         `json:"is_deleting"`
	VolumeData         map[string]model.SpaceVolume `json:"volume_data"`
	StartedAt          time.Time                    `json:"started_at"`
	CreatedAt          time.Time                    `json:"created_at"`
	CreatedAtFormatted string                       `json:"created_at_formatted"`
	IconURL            string                       `json:"icon_url"`
	CustomFields       []CustomFieldValue           `json:"custom_fields"`
	StartupScriptId    string                       `json:"startup_script_id"`
	HasCodeServer      bool                         `json:"has_code_server"`
	HasSSH             bool                         `json:"has_ssh"`
	HasTerminal        bool                         `json:"has_terminal"`
	HasHttpVNC         bool                         `json:"has_http_vnc"`
	HasState           bool                         `json:"has_state"`
	TcpPorts           map[string]string            `json:"tcp_ports"`
	HttpPorts          map[string]string            `json:"http_ports"`
	UpdateAvailable    bool                         `json:"update_available"`
	HasVSCodeTunnel    bool                         `json:"has_vscode_tunnel"`
	VSCodeTunnel       string                       `json:"vscode_tunnel_name"`
	IsRemote           bool                         `json:"is_remote"`
	NodeHostname       string                       `json:"node_hostname"`
}

type SpaceInfo

type SpaceInfo struct {
	Id              string            `json:"space_id"`
	Name            string            `json:"name"`
	Description     string            `json:"description"`
	Note            string            `json:"note"`
	TemplateName    string            `json:"template_name"`
	TemplateId      string            `json:"template_id"`
	Zone            string            `json:"zone"`
	Username        string            `json:"username"`
	UserId          string            `json:"user_id"`
	Platform        string            `json:"platform"`
	SharedUserId    string            `json:"shared_user_id"`
	SharedUsername  string            `json:"shared_username"`
	HasCodeServer   bool              `json:"has_code_server"`
	HasSSH          bool              `json:"has_ssh"`
	HasHttpVNC      bool              `json:"has_http_vnc"`
	HasTerminal     bool              `json:"has_terminal"`
	HasState        bool              `json:"has_state"`
	IsDeployed      bool              `json:"is_deployed"`
	IsPending       bool              `json:"is_pending"`
	IsDeleting      bool              `json:"is_deleting"`
	TcpPorts        map[string]string `json:"tcp_ports"`
	HttpPorts       map[string]string `json:"http_ports"`
	UpdateAvailable bool              `json:"update_available"`
	IsRemote        bool              `json:"is_remote"`
	HasVSCodeTunnel bool              `json:"has_vscode_tunnel"`
	VSCodeTunnel    string            `json:"vscode_tunnel_name"`
	StartedAt       time.Time         `json:"started_at"`
	IconURL         string            `json:"icon_url"`
	NodeHostname    string            `json:"node_hostname"`
}

type SpaceInfoList

type SpaceInfoList struct {
	Count  int         `json:"count"`
	Spaces []SpaceInfo `json:"spaces"`
}

type SpaceRequest

type SpaceRequest struct {
	Name            string             `json:"name"`
	Description     string             `json:"description"`
	TemplateId      string             `json:"template_id"`
	Shell           string             `json:"shell"`
	UserId          string             `json:"user_id"`
	AltNames        []string           `json:"alt_names"`
	IconURL         string             `json:"icon_url"`
	CustomFields    []CustomFieldValue `json:"custom_fields"`
	SelectedNodeId  string             `json:"selected_node_id,omitempty"`
	StartupScriptId string             `json:"startup_script_id,omitempty"`
}

type SpaceTransferRequest added in v0.16.0

type SpaceTransferRequest struct {
	UserId string `json:"user_id"`
}

type StartVolumeResponse

type StartVolumeResponse struct {
	Status bool   `json:"status"`
	Zone   string `json:"zone"`
}

type TemplateCreateRequest added in v0.11.0

type TemplateCreateRequest struct {
	Name             string               `json:"name"`
	Job              string               `json:"job"`
	Description      string               `json:"description"`
	Volumes          string               `json:"volumes"`
	Groups           []string             `json:"groups"`
	Platform         string               `json:"platform"`
	Active           bool                 `json:"active"`
	WithTerminal     bool                 `json:"with_terminal"`
	WithVSCodeTunnel bool                 `json:"with_vscode_tunnel"`
	WithCodeServer   bool                 `json:"with_code_server"`
	WithSSH          bool                 `json:"with_ssh"`
	WithRunCommand   bool                 `json:"with_run_command"`
	StartupScriptId  string               `json:"startup_script_id"`
	ShutdownScriptId string               `json:"shutdown_script_id"`
	ScheduleEnabled  bool                 `json:"schedule_enabled"`
	AutoStart        bool                 `json:"auto_start"`
	Schedule         []TemplateDetailsDay `json:"schedule"`
	ComputeUnits     uint32               `json:"compute_units"`
	StorageUnits     uint32               `json:"storage_units"`
	Zones            []string             `json:"zones"`
	MaxUptime        uint32               `json:"max_uptime"`
	MaxUptimeUnit    string               `json:"max_uptime_unit"`
	IconURL          string               `json:"icon_url"`
	CustomFields     []CustomFieldDef     `json:"custom_fields"`
}

type TemplateCreateResponse

type TemplateCreateResponse struct {
	Status bool   `json:"status"`
	Id     string `json:"template_id"`
}

type TemplateDetails

type TemplateDetails struct {
	TemplateId       string               `json:"template_id"`
	Name             string               `json:"name"`
	Job              string               `json:"job"`
	Description      string               `json:"description"`
	Volumes          string               `json:"volumes"`
	Usage            int                  `json:"usage"`
	Hash             string               `json:"hash"`
	Deployed         int                  `json:"deployed"`
	Groups           []string             `json:"groups"`
	Platform         string               `json:"platform"`
	Active           bool                 `json:"active"`
	IsManaged        bool                 `json:"is_managed"`
	WithTerminal     bool                 `json:"with_terminal"`
	WithVSCodeTunnel bool                 `json:"with_vscode_tunnel"`
	WithCodeServer   bool                 `json:"with_code_server"`
	WithSSH          bool                 `json:"with_ssh"`
	WithRunCommand   bool                 `json:"with_run_command"`
	StartupScriptId  string               `json:"startup_script_id"`
	ShutdownScriptId string               `json:"shutdown_script_id"`
	ComputeUnits     uint32               `json:"compute_units"`
	StorageUnits     uint32               `json:"storage_units"`
	ScheduleEnabled  bool                 `json:"schedule_enabled"`
	AutoStart        bool                 `json:"auto_start"`
	Schedule         []TemplateDetailsDay `json:"schedule"`
	Zones            []string             `json:"zones"`
	MaxUptime        uint32               `json:"max_uptime"`
	MaxUptimeUnit    string               `json:"max_uptime_unit"`
	IconURL          string               `json:"icon_url"`
	CustomFields     []CustomFieldDef     `json:"custom_fields"`
}

type TemplateDetailsDay added in v0.12.0

type TemplateDetailsDay struct {
	Enabled bool   `json:"enabled"`
	From    string `json:"from"`
	To      string `json:"to"`
}

type TemplateInfo

type TemplateInfo struct {
	Id              string               `json:"template_id"`
	Name            string               `json:"name"`
	Description     string               `json:"description"`
	Usage           int                  `json:"usage"`
	Deployed        int                  `json:"deployed"`
	Groups          []string             `json:"groups"`
	Platform        string               `json:"platform"`
	Active          bool                 `json:"active"`
	IsManaged       bool                 `json:"is_managed"`
	ScheduleEnabled bool                 `json:"schedule_enabled"`
	AutoStart       bool                 `json:"auto_start"`
	ComputeUnits    uint32               `json:"compute_units"`
	StorageUnits    uint32               `json:"storage_units"`
	Schedule        []TemplateDetailsDay `json:"schedule"`
	Zones           []string             `json:"zones"`
	MaxUptime       uint32               `json:"max_uptime"`
	MaxUptimeUnit   string               `json:"max_uptime_unit"`
	IconURL         string               `json:"icon_url"`
}

type TemplateList

type TemplateList struct {
	Count     int            `json:"count"`
	Templates []TemplateInfo `json:"templates"`
}

type TemplateUpdateRequest added in v0.11.0

type TemplateUpdateRequest struct {
	Name             string               `json:"name"`
	Job              string               `json:"job"`
	Description      string               `json:"description"`
	Volumes          string               `json:"volumes"`
	Groups           []string             `json:"groups"`
	Active           bool                 `json:"active"`
	Platform         string               `json:"platform"`
	WithTerminal     bool                 `json:"with_terminal"`
	WithVSCodeTunnel bool                 `json:"with_vscode_tunnel"`
	WithCodeServer   bool                 `json:"with_code_server"`
	WithSSH          bool                 `json:"with_ssh"`
	WithRunCommand   bool                 `json:"with_run_command"`
	StartupScriptId  string               `json:"startup_script_id"`
	ShutdownScriptId string               `json:"shutdown_script_id"`
	ScheduleEnabled  bool                 `json:"schedule_enabled"`
	AutoStart        bool                 `json:"auto_start"`
	Schedule         []TemplateDetailsDay `json:"schedule"`
	ComputeUnits     uint32               `json:"compute_units"`
	StorageUnits     uint32               `json:"storage_units"`
	Zones            []string             `json:"zones"`
	MaxUptime        uint32               `json:"max_uptime"`
	MaxUptimeUnit    string               `json:"max_uptime_unit"`
	IconURL          string               `json:"icon_url"`
	CustomFields     []CustomFieldDef     `json:"custom_fields"`
}

type TemplateVar

type TemplateVar struct {
	Id         string   `json:"templatevar_id"`
	Name       string   `json:"name"`
	Zones      []string `json:"zones"`
	Local      bool     `json:"local"`
	Protected  bool     `json:"protected"`
	Restricted bool     `json:"restricted"`
	IsManaged  bool     `json:"is_managed"`
}

type TemplateVarCreateResponse

type TemplateVarCreateResponse struct {
	Status bool   `json:"status"`
	Id     string `json:"templatevar_id"`
}

type TemplateVarList

type TemplateVarList struct {
	Count       int           `json:"count"`
	TemplateVar []TemplateVar `json:"variables"`
}

type TemplateVarValue

type TemplateVarValue struct {
	Id         string   `json:"templatevar_id"`
	Name       string   `json:"name"`
	Zones      []string `json:"zones"`
	Local      bool     `json:"local"`
	Value      string   `json:"value"`
	Protected  bool     `json:"protected"`
	Restricted bool     `json:"restricted"`
	IsManaged  bool     `json:"is_managed"`
}

type TokenInfo

type TokenInfo struct {
	Id           string    `json:"token_id"`
	Name         string    `json:"name"`
	ExpiresAfter time.Time `json:"expires_after"`
}

type TunnelInfo added in v0.12.7

type TunnelInfo struct {
	Name    string `json:"name"`
	Address string `json:"address"`
}

type TunnelServerInfo added in v0.18.0

type TunnelServerInfo struct {
	Domain        string   `json:"domain"`
	TunnelServers []string `json:"tunnel_servers"`
}

type UnifiedScriptExecuteRequest added in v0.23.0

type UnifiedScriptExecuteRequest struct {
	ScriptId   string   `json:"script_id,omitempty"`
	ScriptName string   `json:"script_name,omitempty"`
	Content    string   `json:"content,omitempty"`
	Arguments  []string `json:"arguments"`
}

type UpdateUserRequest

type UpdateUserRequest = userRequest

type UserHasPermission added in v0.23.0

type UserHasPermission struct {
	HasPermission bool `json:"has_permission"`
}

type UserInfo

type UserInfo struct {
	Id                         string     `json:"user_id"`
	Username                   string     `json:"username"`
	Email                      string     `json:"email"`
	Roles                      []string   `json:"roles"`
	Groups                     []string   `json:"groups"`
	Active                     bool       `json:"active"`
	MaxSpaces                  uint32     `json:"max_spaces"`
	ComputeUnits               uint32     `json:"compute_units"`
	StorageUnits               uint32     `json:"storage_units"`
	MaxTunnels                 uint32     `json:"max_tunnels"`
	Current                    bool       `json:"current"`
	LastLoginAt                *time.Time `json:"last_login_at"`
	NumberSpaces               int        `json:"number_spaces"`
	NumberSpacesDeployed       int        `json:"number_spaces_deployed"`
	NumberSpacesDeployedInZone int        `json:"number_spaces_deployed_in_zone"`
	UsedComputeUnits           uint32     `json:"used_compute_units"`
	UsedStorageUnits           uint32     `json:"used_storage_units"`
	UsedTunnels                uint32     `json:"used_tunnels"`
}

type UserInfoList

type UserInfoList struct {
	Count int        `json:"count"`
	Users []UserInfo `json:"users"`
}

type UserPermissions added in v0.23.0

type UserPermissions struct {
	Permissions []uint16 `json:"permissions"`
}

type UserQuota added in v0.12.0

type UserQuota struct {
	MaxSpaces            uint32 `json:"max_spaces"`
	ComputeUnits         uint32 `json:"compute_units"`
	StorageUnits         uint32 `json:"storage_units"`
	MaxTunnels           uint32 `json:"max_tunnels"`
	NumberSpaces         int    `json:"number_spaces"`
	NumberSpacesDeployed int    `json:"number_spaces_deployed"`
	UsedComputeUnits     uint32 `json:"used_compute_units"`
	UsedStorageUnits     uint32 `json:"used_storage_units"`
	UsedTunnels          uint32 `json:"used_tunnels"`
}

type UserResponse

type UserResponse struct {
	Id                         string     `json:"user_id"`
	Username                   string     `json:"username"`
	Email                      string     `json:"email"`
	ServicePassword            string     `json:"service_password"`
	Roles                      []string   `json:"roles"`
	Groups                     []string   `json:"groups"`
	Active                     bool       `json:"active"`
	MaxSpaces                  uint32     `json:"max_spaces"`
	ComputeUnits               uint32     `json:"compute_units"`
	StorageUnits               uint32     `json:"storage_units"`
	MaxTunnels                 uint32     `json:"max_tunnels"`
	SSHPublicKey               string     `json:"ssh_public_key"`
	GitHubUsername             string     `json:"github_username"`
	PreferredShell             string     `json:"preferred_shell"`
	Timezone                   string     `json:"timezone"`
	Current                    bool       `json:"current"`
	LastLoginAt                *time.Time `json:"last_login_at"`
	CreatedAt                  time.Time  `json:"created_at"`
	UpdatedAt                  time.Time  `json:"updated_at"`
	TOTPSecret                 string     `json:"totp_secret"`
	NumberSpaces               int        `json:"number_spaces"`
	NumberSpacesDeployed       int        `json:"number_spaces_deployed"`
	NumberSpacesDeployedInZone int        `json:"number_spaces_deployed_in_zone"`
	UsedComputeUnits           uint32     `json:"used_compute_units"`
	UsedStorageUnits           uint32     `json:"used_storage_units"`
	UsedTunnels                uint32     `json:"used_tunnels"`
}

type UsingTOTPResponse added in v0.15.0

type UsingTOTPResponse struct {
	UsingTOTP bool `json:"using_totp"`
}

type VolumeCreateRequest added in v0.11.0

type VolumeCreateRequest struct {
	Name       string `json:"name"`
	Definition string `json:"definition"`
	Platform   string `json:"platform"`
	NodeId     string `json:"node_id"`
}

type VolumeCreateResponse

type VolumeCreateResponse struct {
	Status   bool   `json:"status"`
	VolumeId string `json:"volume_id"`
}

type VolumeDefinition

type VolumeDefinition struct {
	VolumeId     string `json:"volume_id"`
	Name         string `json:"name"`
	Definition   string `json:"definition"`
	Zone         string `json:"zone"`
	NodeId       string `json:"node_id"`
	NodeHostname string `json:"node_hostname"`
	Active       bool   `json:"active"`
	Platform     string `json:"platform"`
}

type VolumeInfo

type VolumeInfo struct {
	Id           string `json:"volume_id"`
	Name         string `json:"name"`
	Active       bool   `json:"active"`
	Zone         string `json:"zone"`
	NodeId       string `json:"node_id"`
	NodeHostname string `json:"node_hostname"`
	Platform     string `json:"platform"`
}

type VolumeInfoList

type VolumeInfoList struct {
	Count   int          `json:"count"`
	Volumes []VolumeInfo `json:"volumes"`
}

type VolumeNode added in v0.23.6

type VolumeNode struct {
	NodeId   string `json:"node_id"`
	Hostname string `json:"hostname"`
}

type VolumeStartRequest

type VolumeStartRequest = VolumeStartStopRequest

type VolumeStartResponse

type VolumeStartResponse = VolumeStartStopResponse

type VolumeStartStopRequest

type VolumeStartStopRequest struct {
	Zone string `json:"zone"`
}

type VolumeStartStopResponse

type VolumeStartStopResponse struct {
	Name       string                 `json:"name"`
	Definition string                 `json:"definition"`
	Zone       string                 `json:"zone"`
	Variables  map[string]interface{} `json:"variables"`
}

type VolumeStopRequest

type VolumeStopRequest = VolumeStartStopRequest

type VolumeStopResponse

type VolumeStopResponse = VolumeStartStopResponse

type VolumeUpdateRequest added in v0.11.0

type VolumeUpdateRequest struct {
	Name       string `json:"name"`
	Definition string `json:"definition"`
	Platform   string `json:"platform"`
	NodeId     string `json:"node_id"`
}

Jump to

Keyboard shortcuts

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