Documentation ¶
Index ¶
- Variables
- type EngineParams
- type NodeResource
- type NodeResourceInfo
- func (n *NodeResourceInfo) AvailableSize() int64
- func (n *NodeResourceInfo) CapSize() int64
- func (n *NodeResourceInfo) DeepCopy() *NodeResourceInfo
- func (n *NodeResourceInfo) GetAvailableResource() *NodeResource
- func (n *NodeResourceInfo) UsageSize() int64
- func (n *NodeResourceInfo) Validate() error
- type NodeResourceRequest
- type VolumeBinding
- type VolumeBindings
- type WorkloadResource
- type WorkloadResourceRequest
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type EngineParams ¶
type EngineParams struct { Volumes []string `json:"volumes" mapstructure:"volumes"` VolumeChanged bool `json:"volume_changed" mapstructure:"volume_changed"` // indicates whether the realloc request includes new volumes Storage int64 `json:"storage" mapstructure:"storage"` }
EngineParams .
type NodeResource ¶
type NodeResource struct {
SizeInBytes int64 `json:"size_in_bytes" mapstructure:"size_in_bytes"`
}
NodeResource indicate node cpumem resource
func NewNodeResource ¶
func NewNodeResource(sz int64) *NodeResource
func (*NodeResource) Parse ¶
func (r *NodeResource) Parse(rawParams resourcetypes.RawParams) error
Parse .
func (*NodeResource) Validate ¶
func (r *NodeResource) Validate() error
type NodeResourceInfo ¶
type NodeResourceInfo struct { Capacity *NodeResource `json:"capacity"` Usage *NodeResource `json:"usage"` }
NodeResourceInfo indicate cpumem capacity and usage
func (*NodeResourceInfo) AvailableSize ¶
func (n *NodeResourceInfo) AvailableSize() int64
func (*NodeResourceInfo) CapSize ¶
func (n *NodeResourceInfo) CapSize() int64
func (*NodeResourceInfo) DeepCopy ¶
func (n *NodeResourceInfo) DeepCopy() *NodeResourceInfo
DeepCopy .
func (*NodeResourceInfo) GetAvailableResource ¶
func (n *NodeResourceInfo) GetAvailableResource() *NodeResource
func (*NodeResourceInfo) UsageSize ¶
func (n *NodeResourceInfo) UsageSize() int64
func (*NodeResourceInfo) Validate ¶
func (n *NodeResourceInfo) Validate() error
type NodeResourceRequest ¶
type NodeResourceRequest struct {
SizeInBytes int64 `json:"size_in_bytes" mapstructure:"size_in_bytes"`
}
NodeResourceRequest includes all possible fields passed by eru-core for editing node, it not parsed!
func (*NodeResourceRequest) Parse ¶
func (n *NodeResourceRequest) Parse(rawParams resourcetypes.RawParams) error
type VolumeBinding ¶
type VolumeBinding struct { Pool string `json:"pool" mapstructure:"pool"` Image string `json:"image" mapstructure:"image"` Destination string `json:"dest" mapstructure:"destination"` Flags string `json:"flags" mapstructure:"flags"` SizeInBytes int64 `json:"size_in_bytes" mapstructure:"size_in_bytes"` ReadIOPS int64 `json:"read_iops" mapstructure:"read_iops"` WriteIOPS int64 `json:"write_iops" mapstructure:"write_iops"` ReadBPS int64 `json:"read_bps" mapstructure:"read_bps"` WriteBPS int64 `json:"write_bps" mapstructure:"write_bps"` }
VolumeBinding format => pool/image:dst[:flags][:size][:read_IOPS:write_IOPS:read_bytes:write_bytes]
func NewVolumeBinding ¶
func NewVolumeBinding(volume string) (_ *VolumeBinding, err error)
NewVolumeBinding returns pointer of VolumeBinding
func (*VolumeBinding) DeepCopy ¶
func (vb *VolumeBinding) DeepCopy() *VolumeBinding
func (*VolumeBinding) GetMapKey ¶
func (vb *VolumeBinding) GetMapKey() [3]string
func (*VolumeBinding) GetSource ¶
func (vb *VolumeBinding) GetSource() string
func (VolumeBinding) ToString ¶
func (vb VolumeBinding) ToString(normalize bool) (volume string)
ToString returns volume string
func (VolumeBinding) Validate ¶
func (vb VolumeBinding) Validate() error
Validate return error if invalid Please note: we allow negative value for SizeInBytes, because Realloc uses negative value to descrease the size of volume.
type VolumeBindings ¶
type VolumeBindings []*VolumeBinding
func MergeVolumeBindings ¶
func MergeVolumeBindings(vbs1 VolumeBindings, vbs2 ...VolumeBindings) (ans VolumeBindings)
MergeVolumeBindings combines two VolumeBindings
func NewVolumeBindings ¶
func NewVolumeBindings(volumes []string) (volumeBindings VolumeBindings, err error)
NewVolumeBindings return VolumeBindings of reference type
func RemoveEmptyVolumeBinding ¶
func RemoveEmptyVolumeBinding(vbs VolumeBindings) VolumeBindings
func (VolumeBindings) MarshalJSON ¶
func (vbs VolumeBindings) MarshalJSON() ([]byte, error)
MarshalJSON is used for encoding/json.Marshal
func (VolumeBindings) TotalSize ¶
func (vbs VolumeBindings) TotalSize() int64
func (*VolumeBindings) UnmarshalJSON ¶
func (vbs *VolumeBindings) UnmarshalJSON(b []byte) (err error)
type WorkloadResource ¶
type WorkloadResource struct { Volumes VolumeBindings `json:"volumes" mapstructure:"volumes"` // contains filtered or unexported fields }
WorkloadResource indicate RBD workload resource
func NewWorkloadResoure ¶
func NewWorkloadResoure() *WorkloadResource
func (*WorkloadResource) DeepCopy ¶
func (w *WorkloadResource) DeepCopy() *WorkloadResource
func (*WorkloadResource) Parse ¶
func (w *WorkloadResource) Parse(rawParams resourcetypes.RawParams) error
ParseFromRawParams .
func (*WorkloadResource) Size ¶
func (w *WorkloadResource) Size() int64
type WorkloadResourceRequest ¶
type WorkloadResourceRequest struct {
Volumes VolumeBindings `json:"volumes" mapstructure:"volumes"`
}
WorkloadResourceRaw includes all possible fields passed by eru-core for editing workload for request calculation
func (*WorkloadResourceRequest) DeepCopy ¶
func (w *WorkloadResourceRequest) DeepCopy() *WorkloadResourceRequest
func (*WorkloadResourceRequest) Parse ¶
func (w *WorkloadResourceRequest) Parse(rawParams resourcetypes.RawParams) (err error)
Parse .
func (*WorkloadResourceRequest) Validate ¶
func (w *WorkloadResourceRequest) Validate() error
Validate .