Documentation ¶
Overview ¶
* Copyright (c) 2023 Juice Technologies, Inc. All Rights Reserved.
* Copyright (c) 2023 Juice Technologies, Inc. All Rights Reserved.
* Copyright (c) 2023 Juice Technologies, Inc. All Rights Reserved.
* Copyright (c) 2023 Juice Technologies, Inc. All Rights Reserved.
Index ¶
- Constants
- Variables
- func JsonReaderFromObject[T any](object T) (io.Reader, error)
- type Agent
- type AgentUpdate
- type Client
- func (api Client) CancelSession(id string) error
- func (api Client) CancelSessionWithContext(ctx context.Context, id string) error
- func (api Client) Delete(ctx context.Context, path string) (*http.Response, error)
- func (api Client) Get(ctx context.Context, path string) (*http.Response, error)
- func (api Client) GetAgent(id string) (Agent, error)
- func (api Client) GetAgentWithContext(ctx context.Context, id string) (Agent, error)
- func (api Client) GetSession(id string) (Session, error)
- func (api Client) GetSessionWithContext(ctx context.Context, id string) (Session, error)
- func (api Client) Post(ctx context.Context, path string) (*http.Response, error)
- func (api Client) PostWithJson(ctx context.Context, path string, body io.Reader) (*http.Response, error)
- func (api Client) PutWithJson(ctx context.Context, path string, body io.Reader) (*http.Response, error)
- func (api Client) RegisterAgent(agent Agent) (string, error)
- func (api Client) RegisterAgentWithContext(ctx context.Context, agent Agent) (string, error)
- func (api Client) ReleaseSession(id string) error
- func (api Client) ReleaseSessionWithContext(ctx context.Context, id string) error
- func (api Client) RequestSession(requirements SessionRequirements) (string, error)
- func (api Client) RequestSessionWithContext(ctx context.Context, requirements SessionRequirements) (string, error)
- func (api Client) Status() (Status, error)
- func (api Client) StatusWithContext(ctx context.Context) (Status, error)
- func (api Client) UpdateAgent(update AgentUpdate) error
- func (api Client) UpdateAgentWithContext(ctx context.Context, update AgentUpdate) error
- func (api Client) UpdateSession(session Session) error
- func (api Client) UpdateSessionWithContext(ctx context.Context, session Session) error
- type Connection
- type ConnectionData
- type CreatePoolParams
- type Gpu
- type GpuMetrics
- type GpuRequirements
- type Permission
- type PermissionParams
- type Pool
- type PoolPermissions
- type Server
- type Session
- type SessionGpu
- type SessionRequirements
- type SessionUpdate
- type Status
- type UserPermissions
- type WebhookMessage
Constants ¶
View Source
const ( SessionClosed = "closed" SessionQueued = "queued" SessionAssigned = "assigned" SessionActive = "active" SessionCanceling = "canceling" )
View Source
const ( AgentClosed = "closed" AgentActive = "active" AgentDisabled = "disabled" AgentMissing = "missing" )
Variables ¶
Functions ¶
Types ¶
type Agent ¶
type Agent struct { Id string `json:"id"` State string `json:"state"` Hostname string `json:"hostname"` Address string `json:"address"` Version string `json:"version"` PoolId string `json:"poolId"` Gpus []Gpu `json:"gpus"` Labels map[string]string `json:"labels"` Taints map[string]string `json:"taints"` Sessions []Session `json:"sessions"` }
type AgentUpdate ¶
type AgentUpdate struct { Id string `json:"id"` State string `json:"state"` SessionsUpdate map[string]SessionUpdate `json:"sessions"` Gpus []GpuMetrics `json:"gpus"` }
type Client ¶
func (Client) CancelSession ¶
func (Client) CancelSessionWithContext ¶
func (Client) GetAgentWithContext ¶
func (Client) GetSessionWithContext ¶
func (Client) PostWithJson ¶
func (Client) PutWithJson ¶
func (Client) RegisterAgentWithContext ¶
func (Client) ReleaseSession ¶
func (Client) ReleaseSessionWithContext ¶
func (Client) RequestSession ¶
func (api Client) RequestSession(requirements SessionRequirements) (string, error)
func (Client) RequestSessionWithContext ¶
func (Client) StatusWithContext ¶
func (Client) UpdateAgent ¶
func (api Client) UpdateAgent(update AgentUpdate) error
func (Client) UpdateAgentWithContext ¶
func (api Client) UpdateAgentWithContext(ctx context.Context, update AgentUpdate) error
func (Client) UpdateSession ¶
type Connection ¶
type Connection struct { ConnectionData ExitCode int `json:"exitCode"` }
type ConnectionData ¶
type CreatePoolParams ¶
type CreatePoolParams struct {
Name string `json:"name"`
}
type Gpu ¶
type Gpu struct { Index int `json:"index"` Uuid string `json:"uuid"` Name string `json:"name"` Vendor string `json:"vendor"` Model string `json:"model"` VendorId uint32 `json:"vendorId"` DeviceId uint32 `json:"deviceId"` SubDeviceId uint32 `json:"subDeviceId"` Driver string `json:"driver"` Vram uint64 `json:"vram"` PciBus string `json:"pciBus"` Metrics GpuMetrics `json:"metrics"` }
type GpuMetrics ¶
type GpuMetrics struct { ClockCore uint32 `json:"clockCore"` ClockMemory uint32 `json:"clockMemory"` UtilizationGpu uint32 `json:"utilizationGpu"` UtilizationVram uint32 `json:"utilizationVram"` TemperatureGpu uint32 `json:"temperatureGpu"` VramUsed uint64 `json:"vramUsed"` PowerDraw uint32 `json:"powerDraw"` PowerLimit uint32 `json:"powerLimit"` FanSpeed uint32 `json:"fanSpeed"` }
type GpuRequirements ¶
type Permission ¶
type Permission string
const ( PermissionCreateSession Permission = "create_session" PermissionRegisterAgent Permission = "register_agent" PermissionAdmin Permission = "admin" )
type PermissionParams ¶
type PermissionParams struct { Permission Permission `json:"permission"` UserId string `json:"userId"` PoolId string `json:"poolId"` }
type PoolPermissions ¶
type PoolPermissions struct {
UserIds map[string][]Permission `json:"userIds"`
}
type Session ¶
type Session struct { Id string `json:"id"` State string `json:"state"` Address string `json:"address"` Version string `json:"version"` PoolId string `json:"poolId"` Gpus []SessionGpu `json:"gpus"` Connections []Connection `json:"connections"` }
type SessionGpu ¶
type SessionRequirements ¶
type SessionUpdate ¶
type SessionUpdate struct { State string `json:"State"` Connections map[string]Connection `json:"connections"` }
type UserPermissions ¶
type UserPermissions struct {
Permissions map[Permission][]Pool `json:"permissions"`
}
type WebhookMessage ¶
Click to show internal directories.
Click to hide internal directories.