runai

package
v0.0.0-...-b9823e1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

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

func NewRunaiApi(baseURL string, auth auth.RunaiAuth, httpClient *http.Client) (*RunaiApi, error)

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 (c *RunaiApi) DeleteWorkspace(ctx context.Context, id string) error

func (*RunaiApi) GetProjects

func (c *RunaiApi) GetProjects(ctx context.Context) ([]ProjectResponse, error)

func (*RunaiApi) GetProjectsByName

func (c *RunaiApi) GetProjectsByName(ctx context.Context, name string) ([]ProjectResponse, error)

func (*RunaiApi) GetWorkloads

func (c *RunaiApi) GetWorkloads(ctx context.Context) ([]WorkloadResponse, error)

type RunaiApiOption

type RunaiApiOption func(*RunaiApi) error

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 (*RunaiRemoteSessionController) Start

Start sets up and starts the remote session using the Runai API

func (*RunaiRemoteSessionController) Status

Status returns the status of the remote session

func (*RunaiRemoteSessionController) Stop

Stop stops the remote session using the Runai API.

The caller needs to make sure Stop is not called before Start has returned.

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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