api

package
v0.0.0-...-b33afb8 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildImage

func BuildImage(w http.ResponseWriter, r *http.Request)

func CreateBucket

func CreateBucket(w http.ResponseWriter, r *http.Request)

func CreateFunction

func CreateFunction(w http.ResponseWriter, r *http.Request)

func CreatePipeline

func CreatePipeline(w http.ResponseWriter, r *http.Request)

func DeleteFunction

func DeleteFunction(w http.ResponseWriter, r *http.Request)

DeleteFunction removes a user function file by name (e.g. /delete-function?name=hello.py)

func DeleteObject

func DeleteObject(w http.ResponseWriter, r *http.Request)

func DeletePipeline

func DeletePipeline(w http.ResponseWriter, r *http.Request)

DeletePipeline deletes a pipeline by its ID

func DownloadObject

func DownloadObject(w http.ResponseWriter, r *http.Request)

func GetBlobBuckets

func GetBlobBuckets(w http.ResponseWriter, r *http.Request)

GetBlobBuckets returns blobs from all containers or a specific container if specified.

func GetContainerRegistry

func GetContainerRegistry(w http.ResponseWriter, r *http.Request)

GetContainerRegistry lists all container images using containerd

func GetContainers

func GetContainers(w http.ResponseWriter, r *http.Request)

GetContainers lists all container images using containerd

func GetFunction

func GetFunction(w http.ResponseWriter, r *http.Request)

GetFunction handles routes like /get-function/<name>

func GetFunctionLogs

func GetFunctionLogs(w http.ResponseWriter, r *http.Request)

GetFunctionLogs retrieves the logs for a specific function

func GetPipeline

func GetPipeline(w http.ResponseWriter, r *http.Request)

GetPipeline retrieves a single pipeline by its ID

func GetPipelineLogs

func GetPipelineLogs(w http.ResponseWriter, r *http.Request)

GetPipelineLogs retrieves execution logs for a pipeline

func GetPipelines

func GetPipelines(w http.ResponseWriter, r *http.Request)

GetPipelines retrieves all pipelines from the ~/.opencloud/pipelines directory

func GetSystemMetrics

func GetSystemMetrics(w http.ResponseWriter, r *http.Request)

func InvokeFunction

func InvokeFunction(w http.ResponseWriter, r *http.Request)

func ListBlobContainers

func ListBlobContainers(w http.ResponseWriter, r *http.Request)

GetBlobBuckets() - Reads from ~/.opencloud/blob_storage

ListBlobContainers returns a list of blob storage containers with metadata.

func ListFunctions

func ListFunctions(w http.ResponseWriter, r *http.Request)

func RunPipeline

func RunPipeline(w http.ResponseWriter, r *http.Request)

RunPipeline executes a pipeline by its ID

func StopPipeline

func StopPipeline(w http.ResponseWriter, r *http.Request)

StopPipeline stops a running pipeline

func UpdateFunction

func UpdateFunction(w http.ResponseWriter, r *http.Request)

func UpdatePipeline

func UpdatePipeline(w http.ResponseWriter, r *http.Request)

UpdatePipeline updates an existing pipeline by its ID

func UploadObject

func UploadObject(w http.ResponseWriter, r *http.Request)

Types

type Blob

type Blob struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	Size         int64  `json:"size"`
	ContentType  string `json:"contentType"`
	LastModified string `json:"lastModified"`
	Container    string `json:"container"`
}

type Container

type Container struct {
	Name         string `json:"name"`
	ObjectCount  int    `json:"objectCount"`
	TotalSize    int64  `json:"totalSize"`
	LastModified string `json:"lastModified"`
}

type CreatePipelineRequest

type CreatePipelineRequest struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Code        string `json:"code"`
	Branch      string `json:"branch"`
}

type FunctionItem

type FunctionItem struct {
	ID           string    `json:"id"`
	Name         string    `json:"name"`
	Runtime      string    `json:"runtime"`
	Status       string    `json:"status"`
	LastModified time.Time `json:"lastModified"`
	Invocations  int       `json:"invocations"`
	MemorySize   int       `json:"memorySize"`
	Timeout      int       `json:"timeout"`
	Trigger      *Trigger  `json:"trigger,omitempty"`
}

type ImageInfo

type ImageInfo struct {
	ID          string            `json:"Id"`
	RepoTags    []string          `json:"RepoTags"`
	RepoDigests []string          `json:"RepoDigests"`
	Created     int64             `json:"Created"`
	Size        int64             `json:"Size"`
	VirtualSize int64             `json:"VirtualSize"`
	Labels      map[string]string `json:"Labels"`
	Names       []string          `json:"Names"`
	Image       string            `json:"Image"`
	State       string            `json:"State"`
	Status      string            `json:"Status"`
}

ImageInfo represents container image information compatible with the frontend. This structure maps containerd/Docker image metadata to a common format.

type Metrics

type Metrics struct {
	Storage Storage `json:"STORAGE"`
	CPU     int     `json:"CPU"`
	Memory  int     `json:"MEMORY"`
}

type Pipeline

type Pipeline struct {
	ID          string     `json:"id"`
	Name        string     `json:"name"`
	Description string     `json:"description"`
	Code        string     `json:"code"`
	Branch      string     `json:"branch"`
	Status      string     `json:"status"`
	CreatedAt   time.Time  `json:"createdAt"`
	LastRun     *time.Time `json:"lastRun,omitempty"`
	Duration    string     `json:"duration,omitempty"`
}

type PipelineLog

type PipelineLog struct {
	Timestamp string `json:"timestamp"`
	Output    string `json:"output"`
	Error     string `json:"error,omitempty"`
	Status    string `json:"status"` // "success" or "error"
}

PipelineLog represents a single pipeline execution log entry

type Storage

type Storage struct {
	UsedStorage      string `json:"UsedStorage"`
	AvailableStorage string `json:"AvailableStorage"`
	TotalStorage     string `json:"TotalStorage"`
	PercentageUsed   string `json:"PercentageUsed"`
}

type Trigger

type Trigger struct {
	Type     string `json:"type"`     // "cron" for now
	Schedule string `json:"schedule"` // CRON expression like "0 0 * * *"
	Enabled  bool   `json:"enabled"`
}

type UpdateFunctionRequest

type UpdateFunctionRequest struct {
	Name       string   `json:"name"`
	Runtime    string   `json:"runtime"`
	Code       string   `json:"code"`
	MemorySize int      `json:"memorySize"`
	Timeout    int      `json:"timeout"`
	Trigger    *Trigger `json:"trigger,omitempty"`
}

type UpdatePipelineRequest

type UpdatePipelineRequest struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Code        string `json:"code"`
	Branch      string `json:"branch"`
}

UpdatePipelineRequest represents the request body for updating a pipeline

Jump to

Keyboard shortcuts

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