Documentation
¶
Index ¶
- type ProjectResponse
- type ProjectsResponse
- type RunaiApi
- func (c *RunaiApi) CreateWorkspace(ctx context.Context, project ProjectResponse, jobName string, ...) (*WorkspaceResponse, error)
- func (c *RunaiApi) DeleteWorkspace(ctx context.Context, id string) error
- func (c *RunaiApi) GetProjects(ctx context.Context) ([]ProjectResponse, error)
- func (c *RunaiApi) GetProjectsByName(ctx context.Context, name string) ([]ProjectResponse, error)
- func (c *RunaiApi) GetWorkloads(ctx context.Context) ([]WorkloadResponse, error)
- type RunaiApiOption
- type RunaiClient
- type RunaiClientOption
- type RunaiRemoteSessionController
- type WorkloadResponse
- type WorkloadsResponse
- type WorkspacePostBody
- type WorkspaceResponse
- type WorkspaceSpec
- type WorkspaceSpecEnvVar
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProjectResponse ¶
type ProjectResponse struct {
Id string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
SchedulingRules map[string]interface{} `json:"schedulingRules"`
DefaultNodePools []string `json:"defaultNodePools"`
NodeTypes map[string]interface{} `json:"nodeTypes"`
ClusterId string `json:"clusterId"`
ParentId string `json:"parentId"`
RequestedNamespace string `json:"requestedNamespace"`
EnforceRunaiScheduler bool `json:"enforceRunaiScheduler"`
}
type ProjectsResponse ¶
type ProjectsResponse struct {
Projects []ProjectResponse `json:"projects"`
}
type RunaiApi ¶
type RunaiApi struct {
BaseURL string
TokenExpiresAt time.Time
Auth auth.RunaiAuth
HTTPClient *http.Client
// A list of callbacks for modifying requests which are generated before sending over
// the network.
RequestEditors []sharedAuth.RequestEditorFn
}
RunaiApi handles authentication and API calls to Run:AI
func NewRunaiApi ¶
NewRunaiApi creates a new RunAI client instance
func (*RunaiApi) CreateWorkspace ¶
func (c *RunaiApi) CreateWorkspace(ctx context.Context, project ProjectResponse, jobName string, spec WorkspaceSpec) (*WorkspaceResponse, error)
func (*RunaiApi) DeleteWorkspace ¶
func (*RunaiApi) GetProjects ¶
func (c *RunaiApi) GetProjects(ctx context.Context) ([]ProjectResponse, error)
func (*RunaiApi) GetProjectsByName ¶
func (*RunaiApi) GetWorkloads ¶
func (c *RunaiApi) GetWorkloads(ctx context.Context) ([]WorkloadResponse, error)
type RunaiApiOption ¶
type RunaiClient ¶
type RunaiClient struct {
RunaiApi
// contains filtered or unexported fields
}
func NewRunaiClient ¶
func NewRunaiClient(baseUrl *url.URL, options ...RunaiClientOption) (rc *RunaiClient, err error)
type RunaiClientOption ¶
type RunaiClientOption func(*RunaiClient) error
func WithAuth ¶
func WithAuth(auth auth.RunaiAuth) RunaiClientOption
func WithHttpClient ¶
func WithHttpClient(httpClient *http.Client) RunaiClientOption
type RunaiRemoteSessionController ¶
type RunaiRemoteSessionController struct {
// contains filtered or unexported fields
}
func NewRunaiRemoteSessionController ¶
func NewRunaiRemoteSessionController(cfg config.RemoteSessionControllerConfig) (c *RunaiRemoteSessionController, err error)
func (*RunaiRemoteSessionController) Start ¶
func (c *RunaiRemoteSessionController) Start(ctx context.Context) error
Start sets up and starts the remote session using the Runai API
func (*RunaiRemoteSessionController) Status ¶
func (c *RunaiRemoteSessionController) Status(ctx context.Context) (state models.RemoteSessionState, err error)
Status returns the status of the remote session
type WorkloadResponse ¶
type WorkloadResponse map[string]interface{}
type WorkloadsResponse ¶
type WorkloadsResponse struct {
Workloads []WorkloadResponse `json:"workloads"`
}
WorkloadsResponse represents the response from the workloads endpoint
type WorkspacePostBody ¶
type WorkspacePostBody struct {
Name string `json:"name"`
ProjectId string `json:"projectId"`
ClusterId string `json:"clusterId"`
Spec WorkspaceSpec `json:"spec"`
}
type WorkspaceResponse ¶
type WorkspaceResponse struct {
Name string `json:"name"`
WorkloadId string `json:"workloadId"`
ProjectId string `json:"projectId"`
DepartmentId string `json:"departmentId"`
ClusterId string `json:"clusterId"`
CreatedAt time.Time `json:"createdAt"`
DeletedAt *time.Time `json:"deletedAt,omitempty"`
DesiredPhase string `json:"desiredPhase"`
ActualPhase string `json:"actualPhase"`
}
type WorkspaceSpec ¶
type WorkspaceSpec struct {
Image string `json:"image"`
EnvironmentVariables []WorkspaceSpecEnvVar `json:"environmentVariables"`
}
type WorkspaceSpecEnvVar ¶
Click to show internal directories.
Click to hide internal directories.