Documentation ¶
Index ¶
- Constants
- func Handlers(container *container.Container) []libweb.RequestHandler
- type Finder
- func (r *Finder) ByRef(resource interface{}, ref base.Ref) (err error)
- func (r *Finder) Host(ref *base.Ref) (object interface{}, err error)
- func (r *Finder) Network(ref *base.Ref) (object interface{}, err error)
- func (r *Finder) Storage(ref *base.Ref) (object interface{}, err error)
- func (r *Finder) VM(ref *base.Ref) (object interface{}, err error)
- func (r *Finder) With(client base.Client) base.Finder
- func (r *Finder) Workload(ref *base.Ref) (object interface{}, err error)
- type Handler
- type NadHandler
- type Namespace
- type NamespaceHandler
- type NetworkAttachmentDefinition
- type NotFoundError
- type Provider
- type ProviderHandler
- type RefNotUniqueError
- type Resolver
- type Resource
- type ResourceNotResolvedError
- type StorageClass
- type StorageClassHandler
- type VM
- type VMHandler
Constants ¶
const ( NsParam = base.NsParam NameParam = base.NameParam DetailParam = base.DetailParam )
Params.
const ( NamespacesRoot = ProviderRoot + "/namespaces" NamespaceRoot = NamespacesRoot + "/:" + NsParam )
Routes.
const ( NadParam = "network" NadsRoot = ProviderRoot + "/networkattachmentdefinitions" NadRoot = NadsRoot + "/:" + NadParam )
Routes.
const ( ProviderParam = base.ProviderParam ProvidersRoot = Root ProviderRoot = ProvidersRoot + "/:" + ProviderParam )
Routes.
const ( StorageClassParam = "sc" StorageClassesRoot = ProviderRoot + "/storageclasses" StorageClassRoot = StorageClassesRoot + "/:" + StorageClassParam )
Routes.
const ( VmParam = "vm" VMsRoot = ProviderRoot + "/vms" VMRoot = VMsRoot + "/:" + VmParam )
Routes.
const (
Root = base.ProvidersRoot + "/" + string(api.OpenShift)
)
Routes
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Finder ¶
Resource finder.
func (*Finder) ByRef ¶
Find a resource by ref. Returns:
ProviderNotSupportedErr ProviderNotReadyErr NotFoundErr RefNotUniqueErr
func (*Finder) Host ¶
Find host by ref. Returns the matching resource and:
ProviderNotSupportedErr ProviderNotReadyErr NotFoundErr RefNotUniqueErr
func (*Finder) Network ¶
Find a Network by ref. Returns the matching resource and:
ProviderNotSupportedErr ProviderNotReadyErr NotFoundErr RefNotUniqueErr
func (*Finder) Storage ¶
Find storage by ref. Returns the matching resource and:
ProviderNotSupportedErr ProviderNotReadyErr NotFoundErr RefNotUniqueErr
type Handler ¶
Base handler.
func (Handler) ListOptions ¶
func (h Handler) ListOptions(ctx *gin.Context) libmodel.ListOptions
Build list options.
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) 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 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.
func (*NetworkAttachmentDefinition) Link ¶
func (r *NetworkAttachmentDefinition) Link(p *api.Provider)
Build self link (URI).
func (*NetworkAttachmentDefinition) With ¶
func (r *NetworkAttachmentDefinition) With(m *model.NetworkAttachmentDefinition)
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.
type ProviderHandler ¶
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 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.
type ResourceNotResolvedError ¶
type ResourceNotResolvedError = base.ResourceNotResolvedError
Errors.
type StorageClass ¶
type StorageClass struct { Resource Object storage.StorageClass `json:"object"` }
REST Resource.
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.