backends

package
Version: v0.4.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventStorageBackend

type EventStorageBackend interface {
	// Initialize initializes a backend storage service with local or remote
	// event hub.
	Initialize() error
	// Close shutdown backend event storage service or disconnect the event hub.
	Close() error
	// Name returns backend name.
	Name() string
	// SaveEvent append or update a event record to backend.
	SaveEvent(event *v1.Event, region string) error
	// ListEvent list all events created by this job.
	ListEvent(jobNamespace, jobName, uid string, from, to time.Time) ([]*dmo.Event, error)
	// ListLogs list log entries generated by the pod with namespaced name (uid is optional).
	ListLogs(namespace, name, uid string, maxLine int64, from, to time.Time) ([]string, error)
}

EventStorageBackend provides a collection of abstract methods to interact with different storage backends, write/read events.

type NotebookQuery added in v0.4.2

type NotebookQuery struct {
	NotebookID string
	Name       string
	Namespace  string
	Region     string
	Status     v1alpha1.NotebookCondition
	StartTime  time.Time
	EndTime    time.Time
	IsDel      *int
	Pagination *QueryPagination
}

NotebookQuery for notebooks via http

type ObjectStorageBackend

type ObjectStorageBackend interface {
	// Initialize initializes a backend storage service with local or remote
	// database.
	Initialize() error
	// Close shutdown backend storage service.
	Close() error
	// Name returns backend name.
	Name() string
	// SavePod append or update a pod record to backend, region is optional.
	SavePod(pod *v1.Pod, defaultContainerName, region string) error
	// ListPods lists pods controlled by some job, region is optional.
	ListPods(ns, name, jobID string) ([]*dmo.Pod, error)
	// StopPod updates status of pod record as stopped.
	StopPod(ns, name, podID string) error
	// SaveJob append or update a job record to backend, region is optional.
	SaveJob(job metav1.Object, kind string, specs map[apiv1.ReplicaType]*apiv1.ReplicaSpec, jobStatus *apiv1.JobStatus, region string) error
	// GetJob retrieve a job from backend, region is optional.
	GetJob(ns, name, jobID, kind, region string) (*dmo.Job, error)
	// ListJobs lists those jobs who satisfied with query conditions.
	ListJobs(query *Query) ([]*dmo.Job, error)
	// StopJob updates status of job record as stooped.
	StopJob(ns, name, jobID, kind, region string) error
	// DeleteJob updates job as deleted from api-server, but not delete job record
	// from backend, region is optional.
	DeleteJob(ns, name, jobID, kind, region string) error
	// ListNotebooks retrieves list of notebooks
	ListNotebooks(query *NotebookQuery) ([]*dmo.Notebook, error)
	// DeleteNotebook from backend, region is optional.
	DeleteNotebook(ns, name, id, region string) error
	// ListWorkspaces lists the workspaces
	ListWorkspaces(query *WorkspaceQuery) ([]*model.WorkspaceInfo, error)
	// DeleteWorkspace deletes the workspace
	DeleteWorkspace(name string) error
	// CreateWorkspace deletes the workspace
	CreateWorkspace(workspace *model.WorkspaceInfo) error
}

ObjectStorageBackend provides a collection of abstract methods to interact with different storage backends, write/read pod and job objects.

type Query

type Query struct {
	JobID      string
	Name       string
	Namespace  string
	Type       string
	Region     string
	Status     v1.JobConditionType
	StartTime  time.Time
	EndTime    time.Time
	IsDel      *int
	Pagination *QueryPagination
}

Query for job via http

type QueryPagination

type QueryPagination struct {
	PageNum  int
	PageSize int
	Count    int
}

type WorkspaceQuery added in v0.4.2

type WorkspaceQuery struct {
	WorkspaceID string
	Name        string
	Namespace   string
	Region      string
	StartTime   time.Time
	EndTime     time.Time
	IsDel       *int
	Pagination  *QueryPagination
}

Directories

Path Synopsis
events
objects

Jump to

Keyboard shortcuts

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