ocp

package
v0.0.0-...-e73b65a Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NsParam     = base.NsParam
	NameParam   = base.NameParam
	DetailParam = base.DetailParam
)

Params.

View Source
const (
	NamespacesRoot = ProviderRoot + "/namespaces"
	NamespaceRoot  = NamespacesRoot + "/:" + NsParam
)

Routes.

View Source
const (
	NadParam = "network"
	NadsRoot = ProviderRoot + "/networkattachmentdefinitions"
	NadRoot  = NadsRoot + "/:" + NadParam
)

Routes.

View Source
const (
	ProviderParam = base.ProviderParam
	ProvidersRoot = Root
	ProviderRoot  = ProvidersRoot + "/:" + ProviderParam
)

Routes.

View Source
const (
	StorageClassParam  = "sc"
	StorageClassesRoot = ProviderRoot + "/storageclasses"
	StorageClassRoot   = StorageClassesRoot + "/:" + StorageClassParam
)

Routes.

View Source
const (
	VmParam = "vm"
	VMsRoot = ProviderRoot + "/vms"
	VMRoot  = VMsRoot + "/:" + VmParam
)

Routes.

View Source
const (
	Root = base.ProvidersRoot + "/" + string(api.OpenShift)
)

Routes

Variables

This section is empty.

Functions

func Handlers

func Handlers(container *container.Container) []libweb.RequestHandler

Build all handlers.

Types

type Finder

type Finder struct {
	base.Client
}

Resource finder.

func (*Finder) ByRef

func (r *Finder) ByRef(resource interface{}, ref base.Ref) (err error)

Find a resource by ref. Returns:

ProviderNotSupportedErr
ProviderNotReadyErr
NotFoundErr
RefNotUniqueErr

func (*Finder) Host

func (r *Finder) Host(ref *base.Ref) (object interface{}, err error)

Find host by ref. Returns the matching resource and:

ProviderNotSupportedErr
ProviderNotReadyErr
NotFoundErr
RefNotUniqueErr

func (*Finder) Network

func (r *Finder) Network(ref *base.Ref) (object interface{}, err error)

Find a Network by ref. Returns the matching resource and:

ProviderNotSupportedErr
ProviderNotReadyErr
NotFoundErr
RefNotUniqueErr

func (*Finder) Storage

func (r *Finder) Storage(ref *base.Ref) (object interface{}, err error)

Find storage by ref. Returns the matching resource and:

ProviderNotSupportedErr
ProviderNotReadyErr
NotFoundErr
RefNotUniqueErr

func (*Finder) VM

func (r *Finder) VM(ref *base.Ref) (object interface{}, err error)

Find a VM by ref. Returns the matching resource and:

ProviderNotSupportedErr
ProviderNotReadyErr
NotFoundErr
RefNotUniqueErr

func (*Finder) With

func (r *Finder) With(client base.Client) base.Finder

With client.

func (*Finder) Workload

func (r *Finder) Workload(ref *base.Ref) (object interface{}, err error)

Find workload by ref. Returns the matching resource and:

ProviderNotSupportedErr
ProviderNotReadyErr
NotFoundErr
RefNotUniqueErr

type Handler

type Handler struct {
	base.Handler
}

Base handler.

func (Handler) ListOptions

func (h Handler) ListOptions(ctx *gin.Context) libmodel.ListOptions

Build list options.

func (Handler) Predicate

func (h Handler) Predicate(ctx *gin.Context) (p libmodel.Predicate)

Build list predicate.

type NadHandler

type NadHandler struct {
	Handler
}

NetworkAttachmentDefinition handler.

func (*NadHandler) AddRoutes

func (h *NadHandler) AddRoutes(e *gin.Engine)

Add routes to the `gin` router.

func (NadHandler) Get

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

Get a specific REST resource.

func (NadHandler) List

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

List resources in a REST collection. A GET onn the collection that includes the `X-Watch` header will negotiate an upgrade of the connection to a websocket and push watch events.

type Namespace

type Namespace struct {
	Resource
	Object core.Namespace `json:"object"`
}

REST Resource.

func (*Namespace) Content

func (r *Namespace) Content(detail int) interface{}

As content.

func (r *Namespace) Link(p *api.Provider)

Build self link (URI).

func (*Namespace) With

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

Set fields with the specified object.

type NamespaceHandler

type NamespaceHandler struct {
	Handler
}

Namespace handler.

func (*NamespaceHandler) AddRoutes

func (h *NamespaceHandler) AddRoutes(e *gin.Engine)

Add routes to the `gin` router.

func (NamespaceHandler) Get

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

Get a specific REST resource.

func (NamespaceHandler) List

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

List resources in a REST collection. A GET onn the collection that includes the `X-Watch` header will negotiate an upgrade of the connection to a websocket and push watch events.

type NetworkAttachmentDefinition

type NetworkAttachmentDefinition struct {
	Resource
	Object net.NetworkAttachmentDefinition `json:"object"`
}

REST Resource.

func (*NetworkAttachmentDefinition) Content

func (r *NetworkAttachmentDefinition) Content(detail int) interface{}

As content.

Build self link (URI).

func (*NetworkAttachmentDefinition) With

Set fields with the specified object.

type NotFoundError

type NotFoundError = base.NotFoundError

type Provider

type Provider struct {
	Resource
	Type              string       `json:"type"`
	Object            api.Provider `json:"object"`
	VMCount           int64        `json:"vmCount"`
	NetworkCount      int64        `json:"networkCount"`
	StorageClassCount int64        `json:"storageClassCount"`
}

REST Resource.

func (*Provider) Content

func (r *Provider) Content(detail int) interface{}

As content.

func (r *Provider) Link()

Build self link (URI).

func (*Provider) With

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

Set fields with the specified object.

type ProviderHandler

type ProviderHandler struct {
	base.Handler
}

Provider handler.

func (ProviderHandler) AddCount

func (h ProviderHandler) AddCount(r *Provider) (err error)

Add counts.

func (*ProviderHandler) AddRoutes

func (h *ProviderHandler) AddRoutes(e *gin.Engine)

Add routes to the `gin` router.

func (ProviderHandler) Get

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

Get a specific REST resource.

func (ProviderHandler) List

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

List resources in a REST collection.

func (*ProviderHandler) ListContent

func (h *ProviderHandler) ListContent(ctx *gin.Context) (content []interface{}, err error)

Build the list content.

type RefNotUniqueError

type RefNotUniqueError = base.RefNotUniqueError

type Resolver

type Resolver struct {
	*api.Provider
}

API path resolver.

func (*Resolver) Path

func (r *Resolver) Path(object interface{}, id string) (path string, err error)

Resolve the URL path.

type Resource

type Resource struct {
	// k8s UID.
	UID string `json:"uid"`
	// k8s resource version.
	Version string `json:"version"`
	// k8s namespace.
	Namespace string `json:"namespace"`
	// k8s name.
	Name string `json:"name"`
	// self link.
	SelfLink string `json:"selfLink"`
}

REST Resource.

func (*Resource) With

func (r *Resource) With(m *model.Base)

Populate the fields with the specified object.

type ResourceNotResolvedError

type ResourceNotResolvedError = base.ResourceNotResolvedError

Errors.

type StorageClass

type StorageClass struct {
	Resource
	Object storage.StorageClass `json:"object"`
}

REST Resource.

func (*StorageClass) Content

func (r *StorageClass) Content(detail int) interface{}

As content.

func (r *StorageClass) Link(p *api.Provider)

Build self link (URI).

func (*StorageClass) With

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

Set fields with the specified object.

type StorageClassHandler

type StorageClassHandler struct {
	Handler
}

StorageClass handler.

func (*StorageClassHandler) AddRoutes

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

Add routes to the `gin` router.

func (StorageClassHandler) Get

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

Get a specific REST resource.

func (StorageClassHandler) List

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

List resources in a REST collection. A GET onn the collection that includes the `X-Watch` header will negotiate an upgrade of the connection to a websocket and push watch events.

type VM

type VM struct {
	Resource
	Object cnv.VirtualMachine `json:"object"`
}

REST Resource.

func (*VM) Content

func (r *VM) Content(detail int) interface{}

As content.

func (r *VM) Link(p *api.Provider)

Build self link (URI).

func (*VM) With

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

Set fields with the specified object.

type VMHandler

type VMHandler struct {
	Handler
}

VM handler.

func (*VMHandler) AddRoutes

func (h *VMHandler) AddRoutes(e *gin.Engine)

Add routes to the `gin` router.

func (VMHandler) Get

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

Get a specific REST resource.

func (VMHandler) List

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

List resources in a REST collection. A GET onn the collection that includes the `X-Watch` header will negotiate an upgrade of the connection to a websocket and push watch events.

Jump to

Keyboard shortcuts

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