openstack

package
v0.0.0-...-e74992a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

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

Fields.

View Source
const (
	FlavorParam      = "flavor"
	FlavorCollection = "flavors"
	FlavorsRoot      = ProviderRoot + "/" + FlavorCollection
	FlavorRoot       = FlavorsRoot + "/:" + FlavorParam
)

Routes.

View Source
const (
	ImageParam      = "image"
	ImageCollection = "images"
	ImagesRoot      = ProviderRoot + "/" + ImageCollection
	ImageRoot       = ImagesRoot + "/:" + ImageParam
)

Routes

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

Routes.

View Source
const (
	ProjectParam      = "project"
	ProjectCollection = "projects"
	ProjectsRoot      = ProviderRoot + "/" + ProjectCollection
	ProjectRoot       = ProjectsRoot + "/:" + ProjectParam
)

Routes.

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

Routes.

View Source
const (
	RegionParam      = "region"
	RegionCollection = "regions"
	RegionsRoot      = ProviderRoot + "/" + RegionCollection
	RegionRoot       = RegionsRoot + "/:" + RegionParam
)

Routes.

View Source
const (
	SnapshotParam      = "snapshot"
	SnapshotCollection = "snapshots"
	SnapshotsRoot      = ProviderRoot + "/" + SnapshotCollection
	SnapshotRoot       = SnapshotsRoot + "/:" + SnapshotParam
)

Routes.

View Source
const (
	SubnetParam      = "subnet"
	SubnetCollection = "subnets"
	SubnetsRoot      = ProviderRoot + "/" + SubnetCollection
	SubnetRoot       = SubnetsRoot + "/:" + SubnetParam
)

Routes.

View Source
const (
	TreeRoot        = ProviderRoot + "/tree"
	TreeProjectRoot = TreeRoot + "/project"
)

Routes.

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

Routes.

View Source
const (
	VolumeParam      = "volume"
	VolumeCollection = "volumes"
	VolumesRoot      = ProviderRoot + "/" + VolumeCollection
	VolumeRoot       = VolumesRoot + "/:" + VolumeParam
)

Routes.

View Source
const (
	VolumeTypeParam      = "volumetype"
	VolumeTypeCollection = "volumetypes"
	VolumeTypesRoot      = ProviderRoot + "/" + VolumeTypeCollection
	VolumeTypeRoot       = VolumeTypesRoot + "/:" + VolumeTypeParam
)

Routes.

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

Routes.

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

Routes

Variables

This section is empty.

Functions

func Handlers

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

Build all handlers.

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.

func (*BranchNavigator) Next

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

Next (children) on the branch.

type Concern

type Concern = model.Concern

type Fault

type Fault = model.Fault

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

func (r *Finder) Network(ref *base.Ref) (object interface{}, err error)

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

func (*Flavor) Content

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

As content.

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

Build self link (URI).

func (*Flavor) With

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

Build the resource using the model.

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

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 HostRoute

type HostRoute = model.HostRoute

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"`
}

func (*Image) Content

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

As content.

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

Build self link (URI).

func (*Image) With

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

Build the resource using the model.

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

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

Get a specific REST resource.

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"`
	Shared                bool      `json:"shared"`
	AvailabilityZoneHints []string  `json:"availabilityZoneHints,omitempty"`
	Tags                  []string  `json:"tags,omitempty"`
	RevisionNumber        int       `json:"revisionNumber"`
}

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

func (*Project) Content

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

As content.

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

Build self link (URI).

func (*Project) With

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

Build the resource using the model.

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.

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 Region

type Region struct {
	Resource
	Description    string `json:"description"`
	ParentRegionID string `json:"parentRegionID,omitempty"`
}

REST Resource.

func (*Region) Content

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

As content.

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

Build self link (URI).

func (*Region) With

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

Build the resource using the model.

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 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"`
	// 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 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.

func (*Snapshot) Content

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

As content.

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

Build self link (URI).

func (*Snapshot) With

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

Build the resource using the model.

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.

func (*Subnet) Content

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

As content.

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

Build self link (URI).

func (*Subnet) With

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

Build the resource using the model.

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

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

As content.

func (*VM) GetConcerns

func (r *VM) GetConcerns() []model.Concern
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
	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

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

func (*Volume) Content

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

As content.

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

Build self link (URI).

func (*Volume) With

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

Build the resource using the model.

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

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

As content.

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

Build self link (URI).

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 Workload

type Workload struct {
	SelfLink string `json:"selfLink"`
	XVM
}

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

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