Documentation ¶
Index ¶
- Constants
- func Handlers(container *container.Container) []libweb.RequestHandler
- type BranchNavigator
- type CDROM
- type Cluster
- type ClusterHandler
- type Concern
- type CpuPinning
- type DataCenter
- type DataCenterHandler
- type Disk
- type DiskAttachment
- type DiskHandler
- type DiskProfile
- type DiskProfileHandler
- 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 Guest
- type Handler
- type Host
- type HostDevice
- type HostHandler
- type IpAddress
- type NICProfile
- type NICProfileHandler
- type Network
- type NetworkAttachment
- type NetworkHandler
- type NodeBuilder
- type NotFoundError
- type PathBuilder
- type Property
- type Provider
- type ProviderHandler
- type RefNotUniqueError
- type Resolver
- type Resource
- type ResourceNotResolvedError
- type Snapshot
- type StorageDomain
- type StorageDomainHandler
- type Tree
- type TreeHandler
- type TreeNode
- type VM
- type VM0
- type VM1
- type VMHandler
- type VNIC
- type WatchDog
- type Workload
- type WorkloadHandler
- type XDisk
- type XDiskAttachment
- type XNIC
- type XVM
Constants ¶
const ( DetailParam = base.DetailParam NameParam = base.NameParam )
Fields.
const ( ClusterParam = "cluster" ClusterCollection = "clusters" ClustersRoot = ProviderRoot + "/" + ClusterCollection ClusterRoot = ClustersRoot + "/:" + ClusterParam )
Routes.
const ( DataCenterParam = "datacenter" DataCenterCollection = "datacenters" DataCentersRoot = ProviderRoot + "/" + DataCenterCollection DataCenterRoot = DataCentersRoot + "/:" + DataCenterParam )
Routes.
const ( DiskParam = "disk" DiskCollection = "disks" DisksRoot = ProviderRoot + "/" + DiskCollection DiskRoot = DisksRoot + "/:" + DiskParam )
Routes
const ( DiskProfileParam = "profile" DiskProfileCollection = "diskprofiles" DiskProfilesRoot = ProviderRoot + "/" + DiskProfileCollection DiskProfileRoot = DiskProfilesRoot + "/:" + DiskProfileParam )
Routes.
const ( HostParam = "host" HostCollection = "hosts" HostsRoot = ProviderRoot + "/" + HostCollection HostRoot = HostsRoot + "/:" + HostParam )
Routes
const ( NetworkParam = "network" NetworkCollection = "networks" NetworksRoot = ProviderRoot + "/" + NetworkCollection NetworkRoot = NetworksRoot + "/:" + NetworkParam )
Routes.
const ( NICProfileParam = "profile" NICProfileCollection = "nicprofiles" NICProfilesRoot = ProviderRoot + "/" + NICProfileCollection NICProfileRoot = NICProfilesRoot + "/:" + NICProfileParam )
Routes.
const ( ProviderParam = base.ProviderParam ProvidersRoot = Root ProviderRoot = ProvidersRoot + "/:" + ProviderParam )
Routes.
const ( StorageDomainParam = "storagedomain" StorageDomainCollection = "storagedomains" StorageDomainsRoot = ProviderRoot + "/" + StorageDomainCollection StorageDomainRoot = StorageDomainsRoot + "/:" + StorageDomainParam )
Routes.
const ( TreeRoot = ProviderRoot + "/tree" TreeClusterRoot = TreeRoot + "/cluster" )
Routes.
const ( VMParam = "vm" VMCollection = "vms" VMsRoot = ProviderRoot + "/" + VMCollection VMRoot = VMsRoot + "/:" + VMParam )
Routes.
const ( WorkloadCollection = "workloads" WorkloadsRoot = ProviderRoot + "/" + WorkloadCollection WorkloadRoot = WorkloadsRoot + "/:" + VMParam )
Routes.
const (
Root = base.ProvidersRoot + "/" + string(api.OVirt)
)
Routes
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BranchNavigator ¶
type BranchNavigator struct {
// contains filtered or unexported fields
}
Tree (branch) navigator.
type Cluster ¶
type Cluster struct { Resource DataCenter string `json:"dataCenter"` HaReservation bool `json:"haReservation"` KsmEnabled bool `json:"ksmEnabled"` BiosType string `json:"biosType"` }
REST Resource.
type ClusterHandler ¶
type ClusterHandler struct { Handler // contains filtered or unexported fields }
Cluster handler.
func (*ClusterHandler) AddRoutes ¶
func (h *ClusterHandler) AddRoutes(e *gin.Engine)
Add routes to the `gin` router.
func (ClusterHandler) Get ¶
func (h ClusterHandler) Get(ctx *gin.Context)
Get a specific REST resource.
func (ClusterHandler) List ¶
func (h ClusterHandler) 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 CpuPinning ¶
type CpuPinning = model.CpuPinning
type DataCenter ¶
type DataCenter struct {
Resource
}
REST Resource.
func (*DataCenter) With ¶
func (r *DataCenter) With(m *model.DataCenter)
Build the resource using the model.
type DataCenterHandler ¶
type DataCenterHandler struct { Handler // contains filtered or unexported fields }
DataCenter handler.
func (*DataCenterHandler) AddRoutes ¶
func (h *DataCenterHandler) AddRoutes(e *gin.Engine)
Add routes to the `gin` router.
func (DataCenterHandler) Get ¶
func (h DataCenterHandler) Get(ctx *gin.Context)
Get a specific REST resource.
func (DataCenterHandler) List ¶
func (h DataCenterHandler) 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 Disk ¶
type Disk struct { Resource StorageDomain string `json:"storageDomain"` Profile string `json:"profile"` ProvisionedSize int64 `json:"provisionedSize"` ActualSize int64 `json:"actualSize"` StorageType string `json:"storageType"` Status string `json:"status"` }
REST Resource.
type DiskAttachment ¶
type DiskAttachment = model.DiskAttachment
type DiskHandler ¶
type DiskHandler struct {
Handler
}
Disk handler.
func (*DiskHandler) AddRoutes ¶
func (h *DiskHandler) AddRoutes(e *gin.Engine)
Add routes to the `gin` router.
func (DiskHandler) List ¶
func (h DiskHandler) 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 DiskProfile ¶
type DiskProfile struct { Resource StorageDomain string `json:"storageDomain"` QoS string `json:"qos"` }
REST Resource.
func (*DiskProfile) With ¶
func (r *DiskProfile) With(m *model.DiskProfile)
Build the resource using the model.
type DiskProfileHandler ¶
type DiskProfileHandler struct {
Handler
}
DiskProfile handler.
func (*DiskProfileHandler) AddRoutes ¶
func (h *DiskProfileHandler) AddRoutes(e *gin.Engine)
Add routes to the `gin` router.
func (DiskProfileHandler) Get ¶
func (h DiskProfileHandler) Get(ctx *gin.Context)
Get a specific REST resource.
func (DiskProfileHandler) List ¶
func (h DiskProfileHandler) 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 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 Host ¶
type Host struct { Resource Cluster string `json:"cluster"` Status string `json:"status"` ProductName string `json:"productName"` ProductVersion string `json:"productVersion"` InMaintenance bool `json:"inMaintenance"` CpuSockets int16 `json:"cpuSockets"` CpuCores int16 `json:"cpuCores"` NetworkAttachments []NetworkAttachment `json:"networkAttachments"` NICs []hNIC `json:"nics"` }
REST Resource.
type HostDevice ¶
type HostDevice = model.HostDevice
type HostHandler ¶
type HostHandler struct {
Handler
}
Host handler.
func (*HostHandler) AddRoutes ¶
func (h *HostHandler) AddRoutes(e *gin.Engine)
Add routes to the `gin` router.
func (HostHandler) List ¶
func (h HostHandler) 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 NICProfile ¶
type NICProfile struct { Resource Network string `json:"network"` NetworkFilter string `json:"networkFilter"` PortMirroring bool `json:"portMirroring"` QoS string `json:"qos"` Properties []model.Property `json:"properties"` PassThrough bool `json:"passThrough"` }
REST Resource.
func (*NICProfile) With ¶
func (r *NICProfile) With(m *model.NICProfile)
Build the resource using the model.
type NICProfileHandler ¶
type NICProfileHandler struct {
Handler
}
NICProfile handler.
func (*NICProfileHandler) AddRoutes ¶
func (h *NICProfileHandler) AddRoutes(e *gin.Engine)
Add routes to the `gin` router.
func (NICProfileHandler) Get ¶
func (h NICProfileHandler) Get(ctx *gin.Context)
Get a specific REST resource.
func (NICProfileHandler) List ¶
func (h NICProfileHandler) 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 Network ¶
type Network struct { Resource DataCenter string `json:"dataCenter"` VLan string `json:"vlan"` Usages []string `json:"usages"` Profiles []string `json:"nicProfiles"` }
REST Resource.
type NetworkAttachment ¶
type NetworkAttachment = model.NetworkAttachment
type NetworkHandler ¶
type NetworkHandler struct {
Handler
}
Network handler.
func (*NetworkHandler) AddRoutes ¶
func (h *NetworkHandler) AddRoutes(e *gin.Engine)
Add routes to the `gin` router.
func (NetworkHandler) Get ¶
func (h NetworkHandler) Get(ctx *gin.Context)
Get a specific REST resource.
func (NetworkHandler) List ¶
func (h NetworkHandler) 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 NodeBuilder ¶
type NodeBuilder struct {
// contains filtered or unexported fields
}
Tree node builder.
type NotFoundError ¶
type NotFoundError = base.NotFoundError
type PathBuilder ¶
Path builder.
type Provider ¶
type Provider struct { ocp.Resource Type string `json:"type"` Object api.Provider `json:"object"` DatacenterCount int64 `json:"datacenterCount"` ClusterCount int64 `json:"clusterCount"` HostCount int64 `json:"hostCount"` VMCount int64 `json:"vmCount"` NetworkCount int64 `json:"networkCount"` StorageDomainCount int64 `json:"storageDomainCount"` }
REST Resource.
type ProviderHandler ¶
Provider handler.
func (*ProviderHandler) AddDerived ¶
func (h *ProviderHandler) AddDerived(r *Provider) (err error)
Add derived fields.
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 { // Object ID. ID string `json:"id"` // Revision Revision int64 `json:"revision"` // Path Path string `json:"path,omitempty"` // Object name. Name string `json:"name"` // Object description. Description string `json:"description,omitempty"` // Self link. SelfLink string `json:"selfLink"` }
REST Resource.
type ResourceNotResolvedError ¶
type ResourceNotResolvedError = base.ResourceNotResolvedError
Errors.
type StorageDomain ¶
type StorageDomain struct { Resource DataCenter string `json:"dataCenter"` Type string `json:"type"` Capacity int64 `json:"capacity"` Free int64 `json:"free"` Storage struct { Type string `json:"type"` } `json:"storage"` }
REST Resource.
func (*StorageDomain) With ¶
func (r *StorageDomain) With(m *model.StorageDomain)
Build the resource using the model.
type StorageDomainHandler ¶
type StorageDomainHandler struct {
Handler
}
StorageDomain handler.
func (*StorageDomainHandler) AddRoutes ¶
func (h *StorageDomainHandler) AddRoutes(e *gin.Engine)
Add routes to the `gin` router.
func (StorageDomainHandler) Get ¶
func (h StorageDomainHandler) Get(ctx *gin.Context)
Get a specific REST resource.
func (StorageDomainHandler) List ¶
func (h StorageDomainHandler) 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 TreeHandler ¶
type TreeHandler struct { Handler // contains filtered or unexported fields }
Tree handler.
func (*TreeHandler) AddRoutes ¶
func (h *TreeHandler) AddRoutes(e *gin.Engine)
Add routes to the `gin` router.
type VM ¶
type VM struct { VM1 PolicyVersion int `json:"policyVersion"` GuestName string `json:"guestName"` CpuSockets int16 `json:"cpuSockets"` CpuCores int16 `json:"cpuCores"` CpuThreads int16 `json:"cpuThreads"` CpuAffinity []CpuPinning `json:"cpuAffinity"` Memory int64 `json:"memory"` BalloonedMemory bool `json:"balloonedMemory"` IOThreads int16 `json:"ioThreads"` BIOS string `json:"bios"` Display string `json:"display"` HasIllegalImages bool `json:"hasIllegalImages"` NumaNodeAffinity []string `json:"numaNodeAffinity"` LeaseStorageDomain string `json:"leaseStorageDomain"` StorageErrorResumeBehaviour string `json:"storageErrorResumeBehaviour"` HaEnabled bool `json:"haEnabled"` UsbEnabled bool `json:"usbEnabled"` BootMenuEnabled bool `json:"bootMenuEnabled"` PlacementPolicyAffinity string `json:"placementPolicyAffinity"` Timezone string `json:"timezone"` Stateless string `json:"stateless"` SerialNumber string `json:"serialNumber"` HostDevices []HostDevice `json:"hostDevices"` CDROMs []CDROM `json:"cdroms"` WatchDogs []WatchDog `json:"watchDogs"` Properties []Property `json:"properties"` Snapshots []Snapshot `json:"snapshots"` Guest Guest `json:"guest"` OSType string `json:"osType"` }
VM resource.
type VM1 ¶
type VM1 struct { VM0 Cluster string `json:"cluster"` Status string `json:"status"` Host string `json:"host"` RevisionValidated int64 `json:"revisionValidated"` NICs []VNIC `json:"nics"` DiskAttachments []DiskAttachment `json:"diskAttachments"` Concerns []Concern `json:"concerns"` }
VM detail=1
type VMHandler ¶
type VMHandler struct {
Handler
}
Virtual Machine handler.
type Workload ¶
type Workload struct { SelfLink string `json:"selfLink"` XVM Host *Host `json:"host"` Cluster Cluster `json:"cluster"` DataCenter DataCenter `json:"dataCenter"` }
Workload
type WorkloadHandler ¶
type WorkloadHandler struct {
Handler
}
Virtual Machine handler.
func (*WorkloadHandler) AddRoutes ¶
func (h *WorkloadHandler) AddRoutes(e *gin.Engine)
Add routes to the `gin` router.
func (WorkloadHandler) Get ¶
func (h WorkloadHandler) Get(ctx *gin.Context)
Get a specific REST resource.
func (WorkloadHandler) List ¶
func (h WorkloadHandler) List(ctx *gin.Context)
List resources in a REST collection.
type XDiskAttachment ¶
type XDiskAttachment struct { DiskAttachment Disk XDisk `json:"disk"` }
Expanded: DiskAttachment.
func (*XDiskAttachment) Link ¶
func (r *XDiskAttachment) Link(p *api.Provider)
Build self link (URI).