Documentation
¶
Index ¶
- Constants
- func Handlers(container *container.Container) []libweb.RequestHandler
- type AllocationPool
- type AttachedVolume
- type Attachment
- type BranchNavigator
- type Concern
- type Fault
- type Finder
- func (r *Finder) ByRef(resource interface{}, ref base.Ref) (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 Flavor
- type FlavorHandler
- type Handler
- type HostRoute
- type Image
- type ImageHandler
- type Network
- type NetworkHandler
- type NodeBuilder
- type NotFoundError
- type PathBuilder
- type Project
- type ProjectHandler
- type Provider
- type ProviderHandler
- type RefNotUniqueError
- type Region
- type RegionHandler
- type Resolver
- type Resource
- type ResourceNotResolvedError
- type Snapshot
- type SnapshotHandler
- type Subnet
- type SubnetHandler
- type Tree
- type TreeHandler
- type TreeNode
- type VM
- type VM0
- type VM1
- type VMHandler
- type Volume
- type VolumeHandler
- type VolumeType
- type VolumeTypeHandler
- type Workload
- type WorkloadHandler
- type XVM
Constants ¶
const ( DetailParam = base.DetailParam NameParam = base.NameParam )
Fields.
const ( FlavorParam = "flavor" FlavorCollection = "flavors" FlavorsRoot = ProviderRoot + "/" + FlavorCollection FlavorRoot = FlavorsRoot + "/:" + FlavorParam )
Routes.
const ( ImageParam = "image" ImageCollection = "images" ImagesRoot = ProviderRoot + "/" + ImageCollection ImageRoot = ImagesRoot + "/:" + ImageParam )
Routes
const ( NetworkParam = "network" NetworkCollection = "networks" NetworksRoot = ProviderRoot + "/" + NetworkCollection NetworkRoot = NetworksRoot + "/:" + NetworkParam )
Routes.
const ( ProjectParam = "project" ProjectCollection = "projects" ProjectsRoot = ProviderRoot + "/" + ProjectCollection ProjectRoot = ProjectsRoot + "/:" + ProjectParam )
Routes.
const ( ProviderParam = base.ProviderParam ProvidersRoot = Root ProviderRoot = ProvidersRoot + "/:" + ProviderParam )
Routes.
const ( RegionParam = "region" RegionCollection = "regions" RegionsRoot = ProviderRoot + "/" + RegionCollection RegionRoot = RegionsRoot + "/:" + RegionParam )
Routes.
const ( SnapshotParam = "snapshot" SnapshotCollection = "snapshots" SnapshotsRoot = ProviderRoot + "/" + SnapshotCollection SnapshotRoot = SnapshotsRoot + "/:" + SnapshotParam )
Routes.
const ( SubnetParam = "subnet" SubnetCollection = "subnets" SubnetsRoot = ProviderRoot + "/" + SubnetCollection SubnetRoot = SubnetsRoot + "/:" + SubnetParam )
Routes.
const ( TreeRoot = ProviderRoot + "/tree" TreeProjectRoot = TreeRoot + "/project" )
Routes.
const ( VMParam = "vm" VMCollection = "vms" VMsRoot = ProviderRoot + "/" + VMCollection VMRoot = VMsRoot + "/:" + VMParam )
Routes.
const ( VolumeParam = "volume" VolumeCollection = "volumes" VolumesRoot = ProviderRoot + "/" + VolumeCollection VolumeRoot = VolumesRoot + "/:" + VolumeParam )
Routes.
const ( VolumeTypeParam = "volumetype" VolumeTypeCollection = "volumetypes" VolumeTypesRoot = ProviderRoot + "/" + VolumeTypeCollection VolumeTypeRoot = VolumeTypesRoot + "/:" + VolumeTypeParam )
Routes.
const ( WorkloadCollection = "workloads" WorkloadsRoot = ProviderRoot + "/" + WorkloadCollection WorkloadRoot = WorkloadsRoot + "/:" + VMParam )
Routes.
const (
Root = base.ProvidersRoot + "/" + string(api.OpenStack)
)
Routes
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AllocationPool ¶
type AllocationPool = model.AllocationPool
type AttachedVolume ¶
type AttachedVolume = model.AttachedVolume
type Attachment ¶
type Attachment = model.Attachment
type BranchNavigator ¶
type BranchNavigator struct {
// contains filtered or unexported fields
}
Tree (branch) navigator.
type Finder ¶
Resource finder.
func (*Finder) ByRef ¶
Find a resource by ref. Returns:
ProviderNotSupportedErr ProviderNotReadyErr NotFoundErr RefNotUniqueErr
func (*Finder) Network ¶
Find Network by ref. Returns the matching resource and:
ProviderNotSupportedErr ProviderNotReadyErr NotFoundErr RefNotUniqueErr
func (*Finder) Storage ¶
Find a storage by ref. Returns the matching resource and:
ProviderNotSupportedErr ProviderNotReadyErr NotFoundErr RefNotUniqueErr
type Flavor ¶
type Flavor struct {
Resource
Description string `json:"description"`
Disk int `json:"disk"`
RAM int `json:"ram"`
RxTxFactor float64 `json:"rxtxFactor"`
Swap int `json:"swap"`
VCPUs int `json:"vcpus"`
IsPublic bool `json:"isPublic"`
Ephemeral int `json:"ephemeral"`
ExtraSpecs map[string]string `json:"extraSpecs,omitempty"`
}
REST Resource.
type FlavorHandler ¶
type FlavorHandler struct {
Handler
}
Flavor handler.
func (*FlavorHandler) AddRoutes ¶
func (h *FlavorHandler) AddRoutes(e *gin.Engine)
Add routes to the `gin` router.
func (FlavorHandler) Get ¶
func (h FlavorHandler) Get(ctx *gin.Context)
Get a specific REST resource.
func (FlavorHandler) List ¶
func (h FlavorHandler) 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 Image ¶
type Image struct {
Resource
Status string `json:"status"`
Tags []string `json:"tags"`
ContainerFormat string `json:"containerFormat"`
DiskFormat string `json:"diskFormat"`
MinDiskGigabytes int `json:"minDisk"`
MinRAMMegabytes int `json:"minRam"`
Owner string `json:"owner"`
Protected bool `json:"protected"`
Visibility string `json:"visibility"`
Hidden bool `json:"osHidden"`
Checksum string `json:"checksum"`
SizeBytes int64 `json:"sizeBytes"`
Metadata map[string]string `json:"metadata"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
File string `json:"file"`
Schema string `json:"schema"`
VirtualSize int64 `json:"virtualSize"`
OpenStackImageImportMethods []string `json:"imageImportMethods"`
OpenStackImageStoreIDs []string `json:"imageStoreIDs"`
Properties map[string]interface{} `json:"properties"`
}
type ImageHandler ¶
type ImageHandler struct {
Handler
}
Image handler.
func (*ImageHandler) AddRoutes ¶
func (h *ImageHandler) AddRoutes(e *gin.Engine)
Add routes to the `gin` router.
func (ImageHandler) List ¶
func (h ImageHandler) 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
Description string `json:"description"`
AdminStateUp bool `json:"adminStateUp"`
Status string `json:"status"`
Subnets []string `json:"subnets,omitempty"`
TenantID string `json:"tenantID"`
UpdatedAt time.Time `json:"updatedAt"`
CreatedAt time.Time `json:"createdAt"`
ProjectID string `json:"projectID"`
AvailabilityZoneHints []string `json:"availabilityZoneHints,omitempty"`
Tags []string `json:"tags,omitempty"`
RevisionNumber int `json:"revisionNumber"`
}
REST Resource.
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 Project ¶
type Project struct {
Resource
IsDomain bool `json:"isDomain"`
Description string `json:"description"`
DomainID string `json:"domainID"`
Enabled bool `json:"enabled"`
ParentID string `json:"parentID,omitempty"`
}
REST Resource.
type ProjectHandler ¶
type ProjectHandler struct {
Handler
}
Project handler.
func (*ProjectHandler) AddRoutes ¶
func (h *ProjectHandler) AddRoutes(e *gin.Engine)
Add routes to the `gin` router.
func (ProjectHandler) Get ¶
func (h ProjectHandler) Get(ctx *gin.Context)
Get a specific REST resource.
func (ProjectHandler) List ¶
func (h ProjectHandler) 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 Provider ¶
type Provider struct {
ocp.Resource
Type string `json:"type"`
Object api.Provider `json:"object"`
RegionCount int64 `json:"regionCount"`
ProjectCount int64 `json:"projectCount"`
VMCount int64 `json:"vmCount"`
ImageCount int64 `json:"imageCount"`
VolumeCount int64 `json:"volumeCount"`
VolumeTypeCount int64 `json:"volumeTypeCount"`
NetworkCount int64 `json:"networkCount"`
}
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 Region ¶
type Region struct {
Resource
Description string `json:"description"`
ParentRegionID string `json:"parentRegionID,omitempty"`
}
REST Resource.
type RegionHandler ¶
type RegionHandler struct {
Handler
}
Region handler.
func (*RegionHandler) AddRoutes ¶
func (h *RegionHandler) AddRoutes(e *gin.Engine)
Add routes to the `gin` router.
func (RegionHandler) Get ¶
func (h RegionHandler) Get(ctx *gin.Context)
Get a specific REST resource.
func (RegionHandler) List ¶
func (h RegionHandler) 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 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"`
// Self link.
SelfLink string `json:"selfLink"`
}
REST Resource.
type ResourceNotResolvedError ¶
type ResourceNotResolvedError = base.ResourceNotResolvedError
Errors.
type Snapshot ¶
type Snapshot struct {
Resource
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Description string `json:"description"`
VolumeID string `json:"volumeID"`
Status string `json:"status"`
Size int `json:"size"`
Metadata map[string]string `json:"metadata,omitempty"`
}
REST Resource.
type SnapshotHandler ¶
type SnapshotHandler struct {
Handler
}
Snapshot handler.
func (*SnapshotHandler) AddRoutes ¶
func (h *SnapshotHandler) AddRoutes(e *gin.Engine)
Add routes to the `gin` router.
func (SnapshotHandler) Get ¶
func (h SnapshotHandler) Get(ctx *gin.Context)
Get a specific REST resource.
func (SnapshotHandler) List ¶
func (h SnapshotHandler) 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 Subnet ¶
type Subnet struct {
Resource
NetworkID string `json:"networkID"`
Description string `json:"description,omitempty"`
IPVersion int `json:"ipVersion"`
CIDR string `json:"cidr"`
GatewayIP string `json:"gatewayIP,omitempty"`
DNSNameservers []string `json:"dnsNameservers,omitempty"`
ServiceTypes []string `json:"serviceTypes,omitempty"`
AllocationPools []AllocationPool `json:"allocationPools,omitempty"`
HostRoutes []HostRoute `json:"hostRoutes,omitempty"`
EnableDHCP bool `json:"enableDHCP"`
TenantID string `json:"tenantID"`
ProjectID string `json:"projectID"`
IPv6AddressMode string `json:"ipv6AddressMode,omitempty"`
IPv6RAMode string `json:"ipv6RAMode,omitempty"`
SubnetPoolID string `json:"subnetpoolID,omitempty"`
Tags []string `json:"tags,omitempty"`
RevisionNumber int `json:"revisionNumber"`
}
REST Resource.
type SubnetHandler ¶
type SubnetHandler struct {
Handler
}
Subnet handler.
func (*SubnetHandler) AddRoutes ¶
func (h *SubnetHandler) AddRoutes(e *gin.Engine)
Add routes to the `gin` router.
func (SubnetHandler) Get ¶
func (h SubnetHandler) Get(ctx *gin.Context)
Get a specific REST resource.
func (SubnetHandler) List ¶
func (h SubnetHandler) 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
UserID string `json:"userID"`
Updated time.Time `json:"updated"`
Created time.Time `json:"created"`
Progress int `json:"progress"`
AccessIPv4 string `json:"accessIPv4,omitempty"`
AccessIPv6 string `json:"accessIPv6,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
KeyName string `json:"keyName,omitempty"`
AdminPass string `json:"adminPass,omitempty"`
SecurityGroups []map[string]interface{} `json:"securityGroups,omitempty"`
Fault Fault `json:"fault"`
Tags *[]string `json:"tags,omitempty"`
ServerGroups *[]string `json:"serverGroups,omitempty"`
}
VM resource.
func (*VM) GetConcerns ¶
type VM1 ¶
type VM1 struct {
VM0
TenantID string `json:"tenantID"`
Status string `json:"status"`
HostID string `json:"hostID,omitempty"`
RevisionValidated int64 `json:"revisionValidated"`
ImageID string `json:"imageID,omitempty"`
FlavorID string `json:"flavorID"`
Addresses map[string]interface{} `json:"addresses"`
AttachedVolumes []AttachedVolume `json:"attachedVolumes,omitempty"`
Concerns []Concern `json:"concerns"`
}
VM detail=1
type VMHandler ¶
type VMHandler struct {
Handler
}
Virtual Machine handler.
type Volume ¶
type Volume struct {
Resource // Unique identifier for the volume.
Status string `json:"status"`
Size int `json:"size"`
AvailabilityZone string `json:"availabilityZone"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Attachments []Attachment `json:"attachments"`
Description string `json:"description,omitempty"`
VolumeType string `json:"volumeType"`
SnapshotID string `json:"snapshotID,omitempty"`
SourceVolID string `json:"sourceVolID,omitempty"`
BackupID *string `json:"backupID,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
UserID string `json:"userID"`
Bootable string `json:"bootable"`
Encrypted bool `json:"encrypted"`
ReplicationStatus string `json:"replicationStatus"`
ConsistencyGroupID string `json:"consistencygroupID,omitempty"`
Multiattach bool `json:"multiattach"`
VolumeImageMetadata map[string]string `json:"volumeImageMetadata,omitempty"`
}
REST Resource.
type VolumeHandler ¶
type VolumeHandler struct {
Handler
}
Volume handler.
func (*VolumeHandler) AddRoutes ¶
func (h *VolumeHandler) AddRoutes(e *gin.Engine)
Add routes to the `gin` router.
func (VolumeHandler) Get ¶
func (h VolumeHandler) Get(ctx *gin.Context)
Get a specific REST resource.
func (VolumeHandler) List ¶
func (h VolumeHandler) 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 VolumeType ¶
type VolumeType struct {
Resource
Description string `json:"description"`
ExtraSpecs map[string]string `json:"extraSpecs,omitempty"`
IsPublic bool `json:"isPublic"`
QosSpecID string `json:"qosSpecsID"`
PublicAccess bool `json:"publicAccess"`
}
REST Resource.
func (*VolumeType) With ¶
func (r *VolumeType) With(m *model.VolumeType)
Build the resource using the model.
type VolumeTypeHandler ¶
type VolumeTypeHandler struct {
Handler
}
VolumeType handler.
func (*VolumeTypeHandler) AddRoutes ¶
func (h *VolumeTypeHandler) AddRoutes(e *gin.Engine)
Add routes to the `gin` router.
func (VolumeTypeHandler) Get ¶
func (h VolumeTypeHandler) Get(ctx *gin.Context)
Get a specific REST resource.
func (VolumeTypeHandler) List ¶
func (h VolumeTypeHandler) 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 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 XVM ¶
type XVM struct {
VM
Image Image `json:"image"`
Flavor Flavor `json:"flavor"`
Networks []Network `json:"networks"`
Subnets []Subnet `json:"subnets"`
Volumes []Volume `json:"volumes,omitempty"`
VolumeTypes []VolumeType `json:"volumeTypes,omitempty"`
Snapshots []Snapshot `json:"snapshots,omitempty"`
}
Expanded: VM.