Documentation
¶
Index ¶
- Constants
- func Handlers(container *container.Container) []libweb.RequestHandler
- type AdapterBuilder
- type Cluster
- type ClusterHandler
- type Datacenter
- type DatacenterHandler
- type Datastore
- type DatastoreHandler
- 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 Folder
- type FolderHandler
- type Handler
- type Host
- type HostHandler
- type HostNavigator
- type Network
- type NetworkAdapter
- type NetworkHandler
- type NodeBuilder
- type NotFoundError
- type PathBuilder
- type Provider
- type ProviderHandler
- type RefNotUniqueError
- type Resolver
- type Resource
- type ResourceNotResolvedError
- type Tree
- type TreeHandler
- type TreeNode
- type VM
- type VM0
- type VM1
- type VMHandler
- type VMNavigator
- type Workload
- type WorkloadHandler
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 ( DatastoreParam = "datastore" DatastoreCollection = "datastores" DatastoresRoot = ProviderRoot + "/" + DatastoreCollection DatastoreRoot = DatastoresRoot + "/:" + DatastoreParam )
Routes.
const ( FolderParam = "folder" FolderCollection = "folders" FoldersRoot = ProviderRoot + "/" + FolderCollection FolderRoot = FoldersRoot + "/:" + FolderParam )
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 ( ProviderParam = base.ProviderParam ProvidersRoot = Root ProviderRoot = ProvidersRoot + "/:" + ProviderParam )
Routes.
const ( TreeRoot = ProviderRoot + "/tree" TreeHostRoot = TreeRoot + "/host" TreeVmRoot = TreeRoot + "/vm" )
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.VSphere)
)
Routes
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdapterBuilder ¶
type AdapterBuilder struct {
// contains filtered or unexported fields
}
Build (and set) adapter list in the host.
type Cluster ¶
type Cluster struct { Resource Folder string `json:"folder"` Networks []model.Ref `json:"networks"` Datastores []model.Ref `json:"datastores"` Hosts []model.Ref `json:"hosts"` DasEnabled bool `json:"dasEnabled"` DasVms []model.Ref `json:"dasVms"` DrsEnabled bool `json:"drsEnabled"` DrsBehavior string `json:"drsBehavior"` DrsVms []model.Ref `json:"drsVms"` }
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 Datacenter ¶
type Datacenter struct { Resource Datastores model.Ref `json:"datastores"` Networks model.Ref `json:"networks"` Clusters model.Ref `json:"clusters"` VMs model.Ref `json:"vms"` }
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 Datastore ¶
type Datastore struct { Resource Type string `json:"type"` Capacity int64 `json:"capacity"` Free int64 `json:"free"` MaintenanceMode string `json:"maintenance"` }
REST Resource.
type DatastoreHandler ¶
type DatastoreHandler struct {
Handler
}
Datastore handler.
func (*DatastoreHandler) AddRoutes ¶
func (h *DatastoreHandler) AddRoutes(e *gin.Engine)
Add routes to the `gin` router.
func (DatastoreHandler) Get ¶
func (h DatastoreHandler) Get(ctx *gin.Context)
Get a specific REST resource.
func (DatastoreHandler) List ¶
func (h DatastoreHandler) 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 Folder ¶
type Folder struct { Resource Folder string `json:"folder"` Datacenter string `json:"datacenter"` Children []model.Ref `json:"children"` }
REST Resource.
type FolderHandler ¶
type FolderHandler struct { Handler // contains filtered or unexported fields }
Folder handler.
func (*FolderHandler) AddRoutes ¶
func (h *FolderHandler) AddRoutes(e *gin.Engine)
Add routes to the `gin` router.
func (FolderHandler) Get ¶
func (h FolderHandler) Get(ctx *gin.Context)
Get a specific REST resource.
func (FolderHandler) List ¶
func (h FolderHandler) 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 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"` InMaintenanceMode bool `json:"inMaintenance"` ManagementServerIp string `json:"managementServerIp"` Thumbprint string `json:"thumbprint"` Timezone string `json:"timezone"` CpuSockets int16 `json:"cpuSockets"` CpuCores int16 `json:"cpuCores"` ProductName string `json:"productName"` ProductVersion string `json:"productVersion"` Network model.HostNetwork `json:"networking"` Networks []model.Ref `json:"networks"` Datastores []model.Ref `json:"datastores"` VMs []model.Ref `json:"vms"` NetworkAdapters []NetworkAdapter `json:"networkAdapters"` }
REST Resource.
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 HostNavigator ¶
type HostNavigator struct {
// contains filtered or unexported fields
}
Host (tree) navigator.
type Network ¶
type Network struct { Resource Variant string `json:"variant"` DVSwitch *model.Ref `json:"dvSwitch,omitempty"` Host []model.DVSHost `json:"host"` Tag string `json:"tag,omitempty"` Key string `json:"key,omitempty"` }
REST Resource.
type NetworkAdapter ¶
type NetworkAdapter struct { Name string `json:"name"` IpAddress string `json:"ipAddress"` SubnetMask string `json:"subnetMask"` LinkSpeed int32 `json:"linkSpeed"` MTU int32 `json:"mtu"` }
Host network adapter.
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"` APIVersion string `json:"apiVersion"` Product string `json:"product"` DatacenterCount int64 `json:"datacenterCount"` ClusterCount int64 `json:"clusterCount"` HostCount int64 `json:"hostCount"` VMCount int64 `json:"vmCount"` NetworkCount int64 `json:"networkCount"` DatastoreCount int64 `json:"datastoreCount"` }
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"` // Variant Variant string `json:"variant,omitempty"` // Parent. Parent model.Ref `json:"parent"` // Path Path string `json:"path,omitempty"` // Revision Revision int64 `json:"revision"` // Object name. Name string `json:"name"` // Self link. SelfLink string `json:"selfLink"` }
REST Resource.
type ResourceNotResolvedError ¶
type ResourceNotResolvedError = base.ResourceNotResolvedError
Errors.
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"` UUID string `json:"uuid"` Firmware string `json:"firmware"` ConnectionState string `json:"connectionState"` Snapshot model.Ref `json:"snapshot"` ChangeTrackingEnabled bool `json:"changeTrackingEnabled"` CpuAffinity []int32 `json:"cpuAffinity"` CpuHotAddEnabled bool `json:"cpuHotAddEnabled"` CpuHotRemoveEnabled bool `json:"cpuHotRemoveEnabled"` MemoryHotAddEnabled bool `json:"memoryHotAddEnabled"` FaultToleranceEnabled bool `json:"faultToleranceEnabled"` CpuCount int32 `json:"cpuCount"` CoresPerSocket int32 `json:"coresPerSocket"` MemoryMB int32 `json:"memoryMB"` GuestName string `json:"guestName"` GuestID string `json:"guestId"` BalloonedMemory int32 `json:"balloonedMemory"` IpAddress string `json:"ipAddress"` StorageUsed int64 `json:"storageUsed"` NumaNodeAffinity []string `json:"numaNodeAffinity"` Devices []model.Device `json:"devices"` NICs []model.NIC `json:"nics"` }
VM full detail.
type VM1 ¶
type VM1 struct { VM0 RevisionValidated int64 `json:"revisionValidated"` IsTemplate bool `json:"isTemplate"` PowerState string `json:"powerState"` Host string `json:"host"` Networks []model.Ref `json:"networks"` Disks []model.Disk `json:"disks"` Concerns []model.Concern `json:"concerns"` }
VM detail=1
type VMHandler ¶
type VMHandler struct {
Handler
}
Virtual Machine handler.
type VMNavigator ¶
type VMNavigator struct {
// contains filtered or unexported fields
}
VM (tree) navigator.
type Workload ¶
type Workload struct { SelfLink string `json:"selfLink"` VM Host struct { Host Cluster struct { Cluster Datacenter *Datacenter `json:"datacenter"` } `json:"cluster"` } `json:"host"` }
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.