web

package
v0.0.0-...-ec8378c Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackupParam = "backup"
	BackupsRoot = NamespaceRoot + "/backups"
	BackupRoot  = BackupsRoot + "/:" + BackupParam
)

Backup route root.

View Source
const (
	ClusterParam = "cluster"
	ClustersRoot = Root + "/clusters"
	ClusterRoot  = ClustersRoot + "/:" + ClusterParam
)

Cluster-scoped route roots.

View Source
const (
	DirectImageParam = "directimagemigration"
	DirectImagesRoot = Root + "/directimagemigrations"
	DirectImageRoot  = DirectImagesRoot + "/:" + DirectImageParam
)
View Source
const (
	DirectImageStreamParam = "directimagestreammigration"
	DirectImageStreamsRoot = Root + "/directimagestreammigrations"
	DirectImageStreamRoot  = DirectImageStreamsRoot + "/:" + DirectImageStreamParam
)
View Source
const (
	DirectVolumeParam = "directvolumemigration"
	DirectVolumesRoot = Root + "/directvolumemigrations"
	DirectVolumeRoot  = DirectVolumesRoot + "/:" + DirectVolumeParam
)
View Source
const (
	DirectVolumeProgressParam  = "directvolumemigrationprogress"
	DirectVolumeProgressesRoot = Root + "/directvolumemigrationprogresses"
	DirectVolumeProgressRoot   = DirectVolumeProgressesRoot + "/:" + DirectVolumeProgressParam
)
View Source
const (
	EventInvolvedUIDParam = "involvedobjectuid"
	EventsRoot            = Root + "/events"
	EventRoot             = EventsRoot + "/:" + EventInvolvedUIDParam
)
View Source
const (
	HookParam = "hook"
	HooksRoot = Root + "/hooks"
	HookRoot  = HooksRoot + "/:" + HookParam
)
View Source
const (
	JobParam = "job"
	JobsRoot = NamespaceRoot + "/jobs"
	JobRoot  = JobsRoot + "/:" + JobParam
)
View Source
const (
	MigrationParam = "migration"
	MigrationsRoot = Root + "/migrations"
	MigrationRoot  = MigrationsRoot + "/:" + MigrationParam
)

Migration route root.

View Source
const (
	Ns2Param       = "ns2"
	NamespacesRoot = ClusterRoot + "/namespaces"
	NamespaceRoot  = NamespacesRoot + "/:" + Ns2Param
)
View Source
const (
	PlanParam = "plan"
	PlansRoot = Root + "/plans"
	PlanRoot  = PlansRoot + "/:" + PlanParam

	TreeMigrationParam    = "migration"
	PlanTreeRoot          = PlanRoot + "/tree"
	PlanTreeMigrationRoot = PlanTreeRoot + "/:" + TreeMigrationParam
)

Plan route root.

View Source
const (
	PodParam = "pod"
	PodsRoot = NamespaceRoot + "/pods"
	PodRoot  = PodsRoot + "/:" + PodParam
	LogRoot  = PodRoot + "/log"
)
View Source
const (
	PvParam = "pv"
	PvsRoot = ClusterRoot + "/persistentvolumes"
	PvRoot  = PvsRoot + "/:" + PvParam
)
View Source
const (
	PvBackupParam = "backup"
	PvBackupsRoot = NamespaceRoot + "/podvolumebackups"
	PvBackupRoot  = PvBackupsRoot + "/:" + PvBackupParam
)

PodVolumeBackup route root.

View Source
const (
	PvcParam = "pvc"
	PvcsRoot = NamespaceRoot + "/persistentvolumeclaims"
	PvcRoot  = PvcsRoot + "/:" + PvcParam
)
View Source
const (
	PvRestoreParam = "restore"
	PvRestoresRoot = NamespaceRoot + "/podvolumerestores"
	PvRestoreRoot  = PvRestoresRoot + "/:" + PvRestoreParam
)

PodVolumeRestore route root.

View Source
const (
	RestoreParam = "restore"
	RestoresRoot = NamespaceRoot + "/restores"
	RestoreRoot  = RestoresRoot + "/:" + RestoreParam
)

Restore route root.

View Source
const (
	RouteParam = "route"
	RoutesRoot = NamespaceRoot + "/routes"
	RouteRoot  = RoutesRoot + "/:" + RouteParam
)
View Source
const (
	ServiceParam = "service"
	ServicesRoot = NamespaceRoot + "/services"
	ServiceRoot  = ServicesRoot + "/:" + ServiceParam
)
View Source
const (
	StorageClassParam = "storageclass"
	StorageClasssRoot = ClusterRoot + "/storageclasses"
	StorageClassRoot  = StorageClasssRoot + "/:" + StorageClassParam
)
View Source
const (
	NsParam      = "ns1"
	NsCollection = "namespaces"
	Root         = "/" + NsCollection + "/" + ":" + NsParam
)

Root - all routes.

Variables

Shared logger.

View Source
var Settings = &settings.Settings

Application settings.

Functions

This section is empty.

Types

type Backup

type Backup struct {
	// The k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// The k8s name.
	Name string `json:"name"`
	// Self URI.
	SelfLink string `json:"selfLink"`
	// Raw k8s object.
	Object *velero.Backup `json:"object,omitempty"`
}

Backup REST resource.

func (*Backup) With

func (r *Backup) With(m *model.Backup)

Build the resource.

type BackupHandler

type BackupHandler struct {
	// Base
	ClusterScoped
	// contains filtered or unexported fields
}

Backup (route) handler.

func (BackupHandler) AddRoutes

func (h BackupHandler) AddRoutes(r *gin.Engine)

Add routes.

func (BackupHandler) Get

func (h BackupHandler) Get(ctx *gin.Context)

Get a specific backup.

func (h BackupHandler) Link(c *model.Cluster, m *model.Backup) string

Build self link.

func (BackupHandler) List

func (h BackupHandler) List(ctx *gin.Context)

List all of the backups in the namespace.

func (*BackupHandler) Prepare

func (h *BackupHandler) Prepare(ctx *gin.Context) int

Prepare to fulfil the request. Fetch the referenced backup.

type BackupList

type BackupList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// List of resources.
	Items []Backup `json:"resources"`
}

Backup collection REST resource.

type BaseHandler

type BaseHandler struct {
	// contains filtered or unexported fields
}

Base web request handler.

func (h *BaseHandler) Link(path string, params Params) string

Build link.

func (*BaseHandler) Prepare

func (h *BaseHandler) Prepare(ctx *gin.Context) int

Prepare the handler to fulfil the request. Set the `token` and `page` fields using passed parameters.

type Cluster

type Cluster struct {
	// Cluster k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// Cluster k8s name.
	Name string `json:"name"`
	// Self URI.
	SelfLink string `json:"selfLink"`
	// Raw k8s object.
	Object *migapi.MigCluster `json:"object,omitempty"`
}

Cluster REST resource.

func (*Cluster) With

func (r *Cluster) With(m *model.Cluster)

Get self URI.

type ClusterHandler

type ClusterHandler struct {
	// Base
	ClusterScoped
}

Cluster (route) handler.

func (ClusterHandler) AddRoutes

func (h ClusterHandler) AddRoutes(r *gin.Engine)

Add routes.

func (ClusterHandler) Get

func (h ClusterHandler) Get(ctx *gin.Context)

Get a specific cluster.

func (h ClusterHandler) Link(m *model.Cluster) string

Build self link.

func (ClusterHandler) List

func (h ClusterHandler) List(ctx *gin.Context)

List clusters in the namespace.

type ClusterList

type ClusterList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// List of resources.
	Items []Cluster `json:"resources"`
}

Cluster collection REST resource.

type ClusterScoped

type ClusterScoped struct {
	// Base
	BaseHandler
	// contains filtered or unexported fields
}

Base handler for cluster scoped routes.

func (*ClusterScoped) Prepare

func (h *ClusterScoped) Prepare(ctx *gin.Context) int

Prepare to fulfil the request. Set the `cluster` field and ensure the related DataSource is `ready`. Perform SAR authorization.

type Container

type Container struct {
	// Pod k8s name.
	Name string `json:"name"`
	// The URI used to obtain logs.
	Log string `json:"log"`
}

Container REST resource.

type ContainerFilter

type ContainerFilter func(*v1.Container) bool

Container filter.

type DirectImage

type DirectImage struct {
	// The k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// The k8s name.
	Name string `json:"name"`
	// Self URI.
	SelfLink string `json:"selfLink"`
	// Raw k8s object.
	Object *migapi.DirectImageMigration `json:"object,omitempty"`
}

DirectImage REST resource.

func (*DirectImage) With

Build the resource.

type DirectImageList

type DirectImageList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// List of resources.
	Items []DirectImage `json:"resources"`
}

DirectImage collection REST resource.

type DirectImageMigrationHandler

type DirectImageMigrationHandler struct {
	// Base
	BaseHandler
	// contains filtered or unexported fields
}

DirectImage (route) handler.

func (DirectImageMigrationHandler) AddRoutes

func (h DirectImageMigrationHandler) AddRoutes(r *gin.Engine)

Add DIM routes.

func (DirectImageMigrationHandler) Get

Get a specific dim.

Build self link.

func (DirectImageMigrationHandler) List

List all of the dims in the namespace.

func (*DirectImageMigrationHandler) Prepare

func (h *DirectImageMigrationHandler) Prepare(ctx *gin.Context) int

Prepare to fulfil the request. Fetch the referenced dim. Perform SAR authorization.

type DirectImageStream

type DirectImageStream struct {
	// The k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// The k8s name.
	Name string `json:"name"`
	// Self URI.
	SelfLink string `json:"selfLink"`
	// Raw k8s object.
	Object *migapi.DirectImageStreamMigration `json:"object,omitempty"`
}

DirectImageStream REST resource.

func (*DirectImageStream) With

Build the resource.

type DirectImageStreamList

type DirectImageStreamList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// List of resources.
	Items []DirectImageStream `json:"resources"`
}

DirectImageStream collection REST resource.

type DirectImageStreamMigrationHandler

type DirectImageStreamMigrationHandler struct {
	// Base
	BaseHandler
	// contains filtered or unexported fields
}

DirectImageStreamMigration (route) handler.

func (DirectImageStreamMigrationHandler) AddRoutes

Add DISM routes.

func (DirectImageStreamMigrationHandler) Get

Get a specific dism.

Build self link.

func (DirectImageStreamMigrationHandler) List

List all of the disms in the namespace.

func (*DirectImageStreamMigrationHandler) Prepare

Prepare to fulfil the request. Fetch the referenced dism. Perform SAR authorization.

type DirectVolume

type DirectVolume struct {
	// The k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// The k8s name.
	Name string `json:"name"`
	// Self URI.
	SelfLink string `json:"selfLink"`
	// Raw k8s object.
	Object *migapi.DirectVolumeMigration `json:"object,omitempty"`
}

DirectVolume REST resource.

func (*DirectVolume) With

Build the resource.

type DirectVolumeList

type DirectVolumeList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// List of resources.
	Items []DirectVolume `json:"resources"`
}

DirectVolume collection REST resource.

type DirectVolumeMigrationHandler

type DirectVolumeMigrationHandler struct {
	// Base
	BaseHandler
	// contains filtered or unexported fields
}

DirectVolume (route) handler.

func (DirectVolumeMigrationHandler) AddRoutes

func (h DirectVolumeMigrationHandler) AddRoutes(r *gin.Engine)

Add DVM routes.

func (DirectVolumeMigrationHandler) Get

Get a specific dvm.

Build self link.

func (DirectVolumeMigrationHandler) List

List all of the dvms in the namespace.

func (*DirectVolumeMigrationHandler) Prepare

func (h *DirectVolumeMigrationHandler) Prepare(ctx *gin.Context) int

Prepare to fulfil the request. Fetch the referenced dvm. Perform SAR authorization.

type DirectVolumeMigrationProgressHandler

type DirectVolumeMigrationProgressHandler struct {
	// Base
	BaseHandler
	// contains filtered or unexported fields
}

DirectVolumeMigrationProgress (route) handler.

func (DirectVolumeMigrationProgressHandler) AddRoutes

Add DVMP routes.

func (DirectVolumeMigrationProgressHandler) Get

Get a specific dvmp.

Build self link.

func (DirectVolumeMigrationProgressHandler) List

List all of the dvmps in the namespace.

func (*DirectVolumeMigrationProgressHandler) Prepare

Prepare to fulfil the request. Fetch the referenced dvmp. Perform SAR authorization.

type DirectVolumeProgress

type DirectVolumeProgress struct {
	// The k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// The k8s name.
	Name string `json:"name"`
	// Self URI.
	SelfLink string `json:"selfLink"`
	// Raw k8s object.
	Object *migapi.DirectVolumeMigrationProgress `json:"object,omitempty"`
}

DirectVolumeMigrationProgress REST resource.

func (*DirectVolumeProgress) With

Build the resource.

type DirectVolumeProgressList

type DirectVolumeProgressList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// List of resources.
	Items []DirectVolumeProgress `json:"resources"`
}

DirectVolumeProgress collection REST resource.

type Event

type Event struct {
	// The k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// The k8s name.
	Name string `json:"name"`
	// Self URI.
	SelfLink string `json:"selfLink"`
	// Raw k8s object.
	Object *v1.Event `json:"object,omitempty"`
}

Event REST resource

func (*Event) With

func (r *Event) With(m *model.Event)

Build the resource.

type EventHandler

type EventHandler struct {
	// Base
	BaseHandler
}

Event (route) handler.

func (EventHandler) AddRoutes

func (h EventHandler) AddRoutes(r *gin.Engine)

Add routes.

func (EventHandler) Get

func (h EventHandler) Get(ctx *gin.Context)

Get Events for a particular involvedObject UID on a cluster.

func (h EventHandler) Link(m *model.Event) string

Build self link.

func (EventHandler) List

func (h EventHandler) List(ctx *gin.Context)

List all of the Events on a cluster.

type EventList

type EventList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// UID of involvedObject events were retrieved for
	UID string `json:"uid"`
	// List of resources.
	Items []Event `json:"resources"`
}

Event collection REST resource.

type Hook

type Hook struct {
	// The k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// The k8s name.
	Name string `json:"name"`
	// Self URI.
	SelfLink string `json:"selfLink"`
	// Raw k8s object.
	Object *migapi.MigHook `json:"object,omitempty"`
}

Hook REST resource.

func (*Hook) With

func (r *Hook) With(m *model.Hook)

Build the resource.

type HookHandler

type HookHandler struct {
	// Base
	BaseHandler
	// contains filtered or unexported fields
}

Hook (route) handler.

func (HookHandler) AddRoutes

func (h HookHandler) AddRoutes(r *gin.Engine)

Add DIM routes.

func (HookHandler) Get

func (h HookHandler) Get(ctx *gin.Context)

Get a specific dim.

func (h HookHandler) Link(m *model.Hook) string

Build self link.

func (HookHandler) List

func (h HookHandler) List(ctx *gin.Context)

List all of the dims in the namespace.

func (*HookHandler) Prepare

func (h *HookHandler) Prepare(ctx *gin.Context) int

Prepare to fulfil the request. Fetch the referenced hook. Perform SAR authorization.

type HookList

type HookList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// List of resources.
	Items []Hook `json:"resources"`
}

Hook collection REST resource.

type Job

type Job struct {
	// The k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// The k8s name.
	Name string `json:"name"`
	// Self URI.
	SelfLink string `json:"selfLink"`
	// Raw k8s object.
	Object *batchv1.Job `json:"object,omitempty"`
}

Job REST resource

func (*Job) With

func (r *Job) With(m *model.Job)

Build the resource.

type JobHandler

type JobHandler struct {
	// Base
	ClusterScoped
}

Job (route) handler.

func (JobHandler) AddRoutes

func (h JobHandler) AddRoutes(r *gin.Engine)

Add routes.

func (JobHandler) Get

func (h JobHandler) Get(ctx *gin.Context)

Get a specific Job on a cluster.

func (h JobHandler) Link(c *model.Cluster, m *model.Job) string

Build self link.

func (JobHandler) List

func (h JobHandler) List(ctx *gin.Context)

List all of the Jobs on a cluster.

type JobList

type JobList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// List of resources.
	Items []Job `json:"resources"`
}

Job collection REST resource.

type LogHandler

type LogHandler struct {
	// Base
	ClusterScoped
}

Pod-log (route) handler.

func (LogHandler) AddRoutes

func (h LogHandler) AddRoutes(r *gin.Engine)

Add routes.

func (LogHandler) Get

func (h LogHandler) Get(ctx *gin.Context)

Not supported.

func (LogHandler) List

func (h LogHandler) List(ctx *gin.Context)

List all logs (entries) for a pod (and optional container).

type MigResource

type MigResource interface {
	// Get a map containing the correlation label.
	// Correlation labels are used to track any resource
	// created by the controller.  The includes the application
	// (global) label and the resource label.
	GetCorrelationLabels() map[string]string
	// Get the resource correlation label.
	// The label is used to track resources created by the
	// controller that is related to this resource.
	GetCorrelationLabel() (string, string)
	// Get the resource namespace.
	GetNamespace() string
	// Get the resource name.
	GetName() string
	// Mark the resource as having been reconciled.
	// Updates the ObservedDigest.
	// Update the touch annotation. This ensures that the resource
	// is changed on every reconcile. This needed to support
	// remote watch event propagation on OCP4.
	MarkReconciled()
	// Get whether the resource has been reconciled.
	HasReconciled() bool
}

Migration application CR.

type Migration

type Migration struct {
	// The k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// The k8s name.
	Name string `json:"name"`
	// Self URI.
	SelfLink string `json:"selfLink"`
	// Raw k8s object.
	Object *migapi.MigMigration `json:"object,omitempty"`
}

Migration REST resource.

func (*Migration) With

func (r *Migration) With(m *model.Migration)

Build the resource.

type MigrationHandler

type MigrationHandler struct {
	// Base
	BaseHandler
	// contains filtered or unexported fields
}

Migration (route) handler.

func (MigrationHandler) AddRoutes

func (h MigrationHandler) AddRoutes(r *gin.Engine)

Add routes.

func (MigrationHandler) Get

func (h MigrationHandler) Get(ctx *gin.Context)

Get a specific migration.

Build self link.

func (MigrationHandler) List

func (h MigrationHandler) List(ctx *gin.Context)

List all of the migrations in the namespace.

func (*MigrationHandler) Prepare

func (h *MigrationHandler) Prepare(ctx *gin.Context) int

Prepare to fulfil the request. Fetch the referenced migration. Perform SAR authorization.

type MigrationList

type MigrationList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// List of resources.
	Items []Migration `json:"resources"`
}

Migration collection REST resource.

type Namespace

type Namespace struct {
	// Cluster k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// Cluster k8s name.
	Name string `json:"name"`
	// Number of services.
	ServiceCount int64 `json:"serviceCount"`
	// Number of pods.
	PodCount int64 `json:"podCount"`
	// Number of PVCs.
	PvcCount int64 `json:"pvcCount"`
	// Self URI.
	SelfLink string `json:"selfLink"`
	// Raw k8s object.
	Object *v1.Namespace `json:"object,omitempty"`
}

Namespace REST resource

func (*Namespace) With

func (r *Namespace) With(m *model.Namespace, serviceCount, podCount, pvcCount int64)

Build the resource.

type NamespaceList

type NamespaceList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// List of resources.
	Items []Namespace `json:"resources"`
}

NS collection REST resource.

type NsHandler

type NsHandler struct {
	// Base
	ClusterScoped
}

Namespaces (route) handler.

func (NsHandler) AddRoutes

func (h NsHandler) AddRoutes(r *gin.Engine)

Add routes.

func (NsHandler) Get

func (h NsHandler) Get(ctx *gin.Context)

Get a specific namespace on a cluster.

func (h NsHandler) Link(m *model.Namespace) string

Build self link.

func (NsHandler) List

func (h NsHandler) List(ctx *gin.Context)

List namespaces on a cluster.

type PV

type PV struct {
	// The k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// The k8s name.
	Name string `json:"name"`
	// Self URI.
	SelfLink string `json:"selfLink"`
	// Raw k8s object.
	Object *v1.PersistentVolume `json:"object,omitempty"`
}

PV REST resource

func (*PV) With

func (r *PV) With(m *model.PV)

Build the resource.

type PVC

type PVC struct {
	// The k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// The k8s name.
	Name string `json:"name"`
	// Self URI.
	SelfLink string `json:"selfLink"`
	// Raw k8s object.
	Object *v1.PersistentVolumeClaim `json:"object,omitempty"`
}

PVC REST resource

func (*PVC) With

func (r *PVC) With(m *model.PVC)

Build the resource.

type Params

type Params = map[string]string

Params

type Plan

type Plan struct {
	// The k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// The k8s name.
	Name string `json:"name"`
	// Self URI.
	SelfLink string `json:"selfLink"`
	// Raw k8s object.
	Object *migapi.MigPlan `json:"object,omitempty"`
}

Plan REST resource.

func (*Plan) With

func (r *Plan) With(m *model.Plan)

Build the resource.

type PlanHandler

type PlanHandler struct {
	// Base
	BaseHandler
	// contains filtered or unexported fields
}

Plan (route) handler.

func (PlanHandler) AddRoutes

func (h PlanHandler) AddRoutes(r *gin.Engine)

Add routes.

func (PlanHandler) Get

func (h PlanHandler) Get(ctx *gin.Context)

Get a specific plan.

func (h PlanHandler) Link(m *model.Plan) string

Build self link.

func (PlanHandler) List

func (h PlanHandler) List(ctx *gin.Context)

List all of the plans in the namespace.

func (PlanHandler) Pods

func (h PlanHandler) Pods(ctx *gin.Context)

Get the `PlanPods` for the plan.

func (*PlanHandler) Prepare

func (h *PlanHandler) Prepare(ctx *gin.Context) int

Prepare to fulfil the request. Fetch the referenced plan. Perform SAR authorization.

func (PlanHandler) Tree

func (h PlanHandler) Tree(ctx *gin.Context)

Get a specific migration tree.

type PlanList

type PlanList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// List of resources.
	Items []Plan `json:"resources"`
}

Plan collection REST resource.

type PlanPod

type PlanPod struct {
	// Pod k8s namespace.
	Namespace string `json:"namespace"`
	// Pod k8s name.
	Name string `json:"name"`
	// List of containers.
	Containers []Container `json:"containers"`
}

PlanPod REST resource.

func (*PlanPod) With

func (p *PlanPod) With(pod *model.Pod, cluster *model.Cluster, filters ...ContainerFilter)

Update fields using the specified models.

type PlanPods

type PlanPods struct {
	// The k8s namespace.
	Namespace string `json:"namespace"`
	// The k8s name.
	Name string `json:"name"`
	// List of controller pods.
	Controller []PlanPod `json:"controller"`
	// List of relevant pods on source cluster.
	Source []PlanPod `json:"source"`
	// List of relevant pods on the destination cluster.
	Destination []PlanPod `json:"destination"`
}

PlanPods REST resource.

func (*PlanPods) With

func (p *PlanPods) With(ctx *gin.Context, h *PlanHandler) error

Update the model `with` a PlanHandler Fetch and build the pod lists.

type PlanTree

type PlanTree struct {
	// contains filtered or unexported fields
}

Plan Tree.

func (*PlanTree) Build

func (t *PlanTree) Build() (*TreeNode, error)

Build the tree.

type Pod

type Pod struct {
	// The k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// The k8s name.
	Name string `json:"name"`
	// Self URI.
	SelfLink string `json:"selfLink"`
	// Raw k8s object.
	Object *v1.Pod `json:"object,omitempty"`
}

Pod REST resource

func (*Pod) With

func (r *Pod) With(m *model.Pod)

Build the resource.

type PodHandler

type PodHandler struct {
	// Base
	ClusterScoped
}

Pod (route) handler.

func (PodHandler) AddRoutes

func (h PodHandler) AddRoutes(r *gin.Engine)

Add routes.

func (PodHandler) Get

func (h PodHandler) Get(ctx *gin.Context)

Get a specific pod.

func (h PodHandler) Link(c *model.Cluster, m *model.Pod) string

Build self link.

func (PodHandler) List

func (h PodHandler) List(ctx *gin.Context)

List pods on a cluster in a namespace.

type PodList

type PodList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// List of resources.
	Items []Pod `json:"resources"`
}

Pod collection REST resource.

type PvBackup

type PvBackup struct {
	// The k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// The k8s name.
	Name string `json:"name"`
	// Self URI.
	SelfLink string `json:"selfLink"`
	// Raw k8s object.
	Object *velero.PodVolumeBackup `json:"object,omitempty"`
}

PodVolumeBackup REST resource.

func (*PvBackup) With

func (r *PvBackup) With(m *model.PodVolumeBackup)

Build the resource.

type PvBackupHandler

type PvBackupHandler struct {
	// Base
	ClusterScoped
	// contains filtered or unexported fields
}

PodVolumeBackup (route) handler.

func (PvBackupHandler) AddRoutes

func (h PvBackupHandler) AddRoutes(r *gin.Engine)

Add routes.

func (PvBackupHandler) Get

func (h PvBackupHandler) Get(ctx *gin.Context)

Get a specific backup.

Build self link.

func (PvBackupHandler) List

func (h PvBackupHandler) List(ctx *gin.Context)

List all of the backups in the namespace.

func (*PvBackupHandler) Prepare

func (h *PvBackupHandler) Prepare(ctx *gin.Context) int

Prepare to fulfil the request. Fetch the referenced backup.

type PvBackupList

type PvBackupList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// List of resources.
	Items []PvBackup `json:"resources"`
}

PodVolumeBackup collection REST resource.

type PvHandler

type PvHandler struct {
	// Base
	ClusterScoped
}

PV (route) handler.

func (PvHandler) AddRoutes

func (h PvHandler) AddRoutes(r *gin.Engine)

Add routes.

func (PvHandler) Get

func (h PvHandler) Get(ctx *gin.Context)

Get a specific PV on a cluster.

func (h PvHandler) Link(c *model.Cluster, m *model.PV) string

Build self link.

func (PvHandler) List

func (h PvHandler) List(ctx *gin.Context)

List all of the PVs on a cluster.

type PvList

type PvList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// List of resources.
	Items []PV `json:"resources"`
}

PV collection REST resource.

type PvRestore

type PvRestore struct {
	// The k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// The k8s name.
	Name string `json:"name"`
	// Self URI.
	SelfLink string `json:"selfLink"`
	// Raw k8s object.
	Object *velero.PodVolumeRestore `json:"object,omitempty"`
}

PodVolumeRestore REST resource.

func (*PvRestore) With

func (r *PvRestore) With(m *model.PodVolumeRestore)

Build the resource.

type PvRestoreHandler

type PvRestoreHandler struct {
	// Base
	ClusterScoped
	// contains filtered or unexported fields
}

PodVolumeRestore (route) handler.

func (PvRestoreHandler) AddRoutes

func (h PvRestoreHandler) AddRoutes(r *gin.Engine)

Add routes.

func (PvRestoreHandler) Get

func (h PvRestoreHandler) Get(ctx *gin.Context)

Get a specific restore.

Build self link.

func (PvRestoreHandler) List

func (h PvRestoreHandler) List(ctx *gin.Context)

List all of the restores in the namespace.

func (*PvRestoreHandler) Prepare

func (h *PvRestoreHandler) Prepare(ctx *gin.Context) int

Prepare to fulfil the request. Fetch the referenced restore.

type PvRestoreList

type PvRestoreList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// List of resources.
	Items []PvRestore `json:"resources"`
}

PodVolumeRestore collection REST resource.

type PvcHandler

type PvcHandler struct {
	// Base
	ClusterScoped
}

PVC (route) handler.

func (PvcHandler) AddRoutes

func (h PvcHandler) AddRoutes(r *gin.Engine)

Add routes.

func (PvcHandler) Get

func (h PvcHandler) Get(ctx *gin.Context)

Get a specific PVC on a cluster.

func (h PvcHandler) Link(c *model.Cluster, m *model.PVC) string

Build self link.

func (PvcHandler) List

func (h PvcHandler) List(ctx *gin.Context)

List all of the PVCs on a cluster.

type PvcList

type PvcList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// List of resources.
	Items []PVC `json:"resources"`
}

PVC collection REST resource.

type RequestHandler

type RequestHandler interface {
	// Add routes to the `gin` router.
	AddRoutes(*gin.Engine)
	// List resources in a REST collection.
	List(*gin.Context)
	// Get a specific REST resource.
	Get(*gin.Context)
}

Web request handler.

type Restore

type Restore struct {
	// The k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// The k8s name.
	Name string `json:"name"`
	// Raw k8s object.
	Object *velero.Restore `json:"object,omitempty"`
	// Self URI.
	SelfLink string `json:"selfLink"`
}

Restore REST resource.

func (*Restore) With

func (r *Restore) With(m *model.Restore)

Build the resource.

type RestoreHandler

type RestoreHandler struct {
	// Base
	ClusterScoped
	// contains filtered or unexported fields
}

Restore (route) handler.

func (RestoreHandler) AddRoutes

func (h RestoreHandler) AddRoutes(r *gin.Engine)

Add routes.

func (RestoreHandler) Get

func (h RestoreHandler) Get(ctx *gin.Context)

Get a specific restore.

Build self link.

func (RestoreHandler) List

func (h RestoreHandler) List(ctx *gin.Context)

List all of the restores in the namespace.

func (*RestoreHandler) Prepare

func (h *RestoreHandler) Prepare(ctx *gin.Context) int

Prepare to fulfil the request. Fetch the referenced restore.

type RestoreList

type RestoreList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// List of resources.
	Items []Restore `json:"resources"`
}

Restore collection REST resource.

type RootNsHandler

type RootNsHandler struct {
	// Base
	BaseHandler
}

Root namespace (route) handler.

func (RootNsHandler) AddRoutes

func (h RootNsHandler) AddRoutes(r *gin.Engine)

func (RootNsHandler) Get

func (h RootNsHandler) Get(ctx *gin.Context)

Not supported.

func (RootNsHandler) List

func (h RootNsHandler) List(ctx *gin.Context)

List all root level namespaces.

type Route

type Route struct {
	// The k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// The k8s name.
	Name string `json:"name"`
	// Self URI.
	SelfLink string `json:"selfLink"`
	// Raw k8s object.
	Object *v1.Route `json:"object,omitempty"`
}

Route REST resource

func (*Route) With

func (r *Route) With(m *model.Route)

Build the resource.

type RouteHandler

type RouteHandler struct {
	// Base
	ClusterScoped
}

Route (route) handler.

func (RouteHandler) AddRoutes

func (h RouteHandler) AddRoutes(r *gin.Engine)

Add routes.

func (RouteHandler) Get

func (h RouteHandler) Get(ctx *gin.Context)

Get a specific route.

func (h RouteHandler) Link(c *model.Cluster, m *model.Route) string

Build self link.

func (RouteHandler) List

func (h RouteHandler) List(ctx *gin.Context)

List routes on a cluster in a namespace.

type RouteList

type RouteList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// List of resources.
	Items []Route `json:"resources"`
}

Route collection REST resource.

type SchemaHandler

type SchemaHandler struct {
	// contains filtered or unexported fields
}

Schema (route) handler.

func (SchemaHandler) AddRoutes

func (h SchemaHandler) AddRoutes(r *gin.Engine)

func (SchemaHandler) Get

func (h SchemaHandler) Get(ctx *gin.Context)

Not supported.

func (SchemaHandler) List

func (h SchemaHandler) List(ctx *gin.Context)

List schema.

type Service

type Service struct {
	// The k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// The k8s name.
	Name string `json:"name"`
	// Self URI.
	SelfLink string `json:"selfLink"`
	// Raw k8s object.
	Object *v1.Service `json:"object,omitempty"`
}

Service REST resource

func (*Service) With

func (r *Service) With(m *model.Service)

Build the resource.

type ServiceHandler

type ServiceHandler struct {
	// Base
	ClusterScoped
}

Service (route) handler.

func (ServiceHandler) AddRoutes

func (h ServiceHandler) AddRoutes(r *gin.Engine)

Add routes.

func (ServiceHandler) Get

func (h ServiceHandler) Get(ctx *gin.Context)

Get a specific Service on a cluster.

Build self link.

func (ServiceHandler) List

func (h ServiceHandler) List(ctx *gin.Context)

List all of the Services on a cluster.

type ServiceList

type ServiceList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// List of resources.
	Items []Service `json:"resources"`
}

Service collection REST resource.

type StorageClass

type StorageClass struct {
	// The k8s namespace.
	Namespace string `json:"namespace,omitempty"`
	// The k8s name.
	Name string `json:"name"`
	// Self URI.
	SelfLink string `json:"selfLink"`
	// Raw k8s object.
	Object *v1.StorageClass `json:"object,omitempty"`
}

StorageClass REST resource

func (*StorageClass) With

func (r *StorageClass) With(m *model.StorageClass)

Build the resource.

type StorageClassHandler

type StorageClassHandler struct {
	// Base
	ClusterScoped
}

StorageClass (route) handler.

func (StorageClassHandler) AddRoutes

func (h StorageClassHandler) AddRoutes(r *gin.Engine)

Add routes.

func (StorageClassHandler) Get

func (h StorageClassHandler) Get(ctx *gin.Context)

Get a specific StorageClass on a cluster.

Build self link.

func (StorageClassHandler) List

func (h StorageClassHandler) List(ctx *gin.Context)

List all of the StorageClasss on a cluster.

type StorageClassList

type StorageClassList struct {
	// Total number in the collection.
	Count int64 `json:"count"`
	// List of resources.
	Items []StorageClass `json:"resources"`
}

StorageClass collection REST resource.

type TreeNode

type TreeNode struct {
	Kind        string     `json:"kind"`
	Namespace   string     `json:"namespace"`
	Name        string     `json:"name"`
	ClusterType string     `json:"clusterType"`
	Children    []TreeNode `json:"children,omitempty"`
	ObjectLink  string     `json:"objectLink"`
}

Tree node.

type WebServer

type WebServer struct {

	// Reference to the container.
	Container *container.Container
	// contains filtered or unexported fields
}

Web server

func (*WebServer) Start

func (w *WebServer) Start()

Start the web-server. Initializes `gin` with routes and CORS origins.

Jump to

Keyboard shortcuts

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