ovirt

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: 16 Imported by: 0

Documentation

Index

Constants

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

Fields.

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

Routes.

View Source
const (
	DataCenterParam      = "datacenter"
	DataCenterCollection = "datacenters"
	DataCentersRoot      = ProviderRoot + "/" + DataCenterCollection
	DataCenterRoot       = DataCentersRoot + "/:" + DataCenterParam
)

Routes.

View Source
const (
	DiskParam      = "disk"
	DiskCollection = "disks"
	DisksRoot      = ProviderRoot + "/" + DiskCollection
	DiskRoot       = DisksRoot + "/:" + DiskParam
)

Routes

View Source
const (
	DiskProfileParam      = "profile"
	DiskProfileCollection = "diskprofiles"
	DiskProfilesRoot      = ProviderRoot + "/" + DiskProfileCollection
	DiskProfileRoot       = DiskProfilesRoot + "/:" + DiskProfileParam
)

Routes.

View Source
const (
	HostParam      = "host"
	HostCollection = "hosts"
	HostsRoot      = ProviderRoot + "/" + HostCollection
	HostRoot       = HostsRoot + "/:" + HostParam
)

Routes

View Source
const (
	NetworkParam      = "network"
	NetworkCollection = "networks"
	NetworksRoot      = ProviderRoot + "/" + NetworkCollection
	NetworkRoot       = NetworksRoot + "/:" + NetworkParam
)

Routes.

View Source
const (
	NICProfileParam      = "profile"
	NICProfileCollection = "nicprofiles"
	NICProfilesRoot      = ProviderRoot + "/" + NICProfileCollection
	NICProfileRoot       = NICProfilesRoot + "/:" + NICProfileParam
)

Routes.

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

Routes.

View Source
const (
	StorageDomainParam      = "storagedomain"
	StorageDomainCollection = "storagedomains"
	StorageDomainsRoot      = ProviderRoot + "/" + StorageDomainCollection
	StorageDomainRoot       = StorageDomainsRoot + "/:" + StorageDomainParam
)

Routes.

View Source
const (
	TreeRoot        = ProviderRoot + "/tree"
	TreeClusterRoot = TreeRoot + "/cluster"
)

Routes.

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

Routes.

View Source
const (
	WorkloadCollection = "workloads"
	WorkloadsRoot      = ProviderRoot + "/" + WorkloadCollection
	WorkloadRoot       = WorkloadsRoot + "/:" + VMParam
)

Routes.

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

Routes

Variables

This section is empty.

Functions

func Handlers

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

Build all handlers.

Types

type BranchNavigator

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

Tree (branch) navigator.

func (*BranchNavigator) Next

func (n *BranchNavigator) Next(p libmodel.Model) (r []model.Model, err error)

Next (children) on the branch.

type CDROM

type CDROM = model.CDROM

type Cluster

type Cluster struct {
	Resource
	DataCenter    string `json:"dataCenter"`
	HaReservation bool   `json:"haReservation"`
	KsmEnabled    bool   `json:"ksmEnabled"`
	BiosType      string `json:"biosType"`
}

REST Resource.

func (*Cluster) Content

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

As content.

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

Build self link (URI).

func (*Cluster) With

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

Build the resource using the model.

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 Concern

type Concern = model.Concern

type CpuPinning

type CpuPinning = model.CpuPinning

type DataCenter

type DataCenter struct {
	Resource
}

REST Resource.

func (*DataCenter) Content

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

As content.

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

Build self link (URI).

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
	Shared          bool   `json:"shared"`
	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.

func (*Disk) Content

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

As content.

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

Build self link (URI).

func (*Disk) With

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

Build the resource using the model.

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) Get

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

Get a specific REST resource.

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) Content

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

As content.

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

Build self link (URI).

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

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 Guest

type Guest = model.Guest

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 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.

func (*Host) Content

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

As content.

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

Build self link (URI).

func (*Host) With

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

Build the resource using the model.

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) Get

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

Get a specific REST resource.

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 IpAddress

type IpAddress = model.IpAddress

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) Content

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

As content.

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

Build self link (URI).

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.

func (*Network) Content

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

As content.

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

Build self link (URI).

func (*Network) With

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

Build the resource using the model.

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.

func (*NodeBuilder) Node

func (r *NodeBuilder) Node(parent *TreeNode, m model.Model) *TreeNode

Build a node for the model.

type NotFoundError

type NotFoundError = base.NotFoundError

type PathBuilder

type PathBuilder struct {
	// Database.
	DB libmodel.DB
	// contains filtered or unexported fields
}

Path builder.

func (*PathBuilder) Path

func (r *PathBuilder) Path(m model.Model) (path string)

Build.

type Property

type Property = model.Property

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.

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) 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 Resolver

type Resolver struct {
	*api.Provider
}

API path resolver.

func (*Resolver) Path

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

Build the URL path.

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.

func (*Resource) With

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

Build the resource using the model.

type ResourceNotResolvedError

type ResourceNotResolvedError = base.ResourceNotResolvedError

Errors.

type Snapshot

type Snapshot = model.Snapshot

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) Content

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

As content.

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

Build self link (URI).

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 Tree

type Tree = base.Tree

Types.

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.

func (TreeHandler) Get

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

Get not supported.

func (TreeHandler) List

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

List not supported.

func (*TreeHandler) Prepare

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

Prepare to handle the request.

func (TreeHandler) Tree

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

Tree.

type TreeNode

type TreeNode = base.TreeNode

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"`
	CpuShares                   int16        `json:"cpuShares"`
	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.

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)

Build the resource using the model.

type VM0

type VM0 = Resource

VM detail=0

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

func (*VM1) Content

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

As content.

func (*VM1) With

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

Build the resource using the model.

type VMHandler

type VMHandler struct {
	Handler
}

Virtual Machine 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.

type VNIC

type VNIC = model.NIC

type WatchDog

type WatchDog = model.WatchDog

type Workload

type Workload struct {
	SelfLink string `json:"selfLink"`
	XVM
	Host       *Host      `json:"host"`
	Cluster    Cluster    `json:"cluster"`
	DataCenter DataCenter `json:"dataCenter"`
}

Workload

func (*Workload) Expand

func (r *Workload) Expand(db libmodel.DB) (err error)

Expand the workload.

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

Build self link (URI).

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 XDisk

type XDisk struct {
	Disk
	Profile DiskProfile `json:"profile"`
}

Expanded: Disk.

func (*XDisk) Expand

func (r *XDisk) Expand(db libmodel.DB) (err error)

Expand references.

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

Build self link (URI).

type XDiskAttachment

type XDiskAttachment struct {
	DiskAttachment
	Disk XDisk `json:"disk"`
}

Expanded: DiskAttachment.

func (*XDiskAttachment) Expand

func (r *XDiskAttachment) Expand(db libmodel.DB) (err error)
func (r *XDiskAttachment) Link(p *api.Provider)

Build self link (URI).

type XNIC

type XNIC struct {
	VNIC
	Profile NICProfile `json:"profile"`
}

Expanded: vNIC.

func (*XNIC) Expand

func (r *XNIC) Expand(db libmodel.DB) (err error)

Expand references.

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

Build self link (URI).

type XVM

type XVM struct {
	VM
	DiskAttachments []XDiskAttachment `json:"diskAttachments"`
	NICs            []XNIC            `json:"nics"`
}

Expanded: VM.

func (*XVM) Expand

func (r *XVM) Expand(db libmodel.DB) (err error)

Expand references.

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

Build self link (URI).

Jump to

Keyboard shortcuts

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