Documentation ¶
Index ¶
- Constants
- Variables
- func AggregateStrategyCheck(strategy string) (err error)
- type Aggregate
- type CandidateDetailArgs
- type CandidateDetailResult
- type CandidateListArgs
- type CandidateListResult
- type CandidateListResultItem
- type CleanupArgs
- type CleanupResult
- type CompletedNotifyArgs
- type CompletedNotifyResult
- type Disk
- type ExpireArgs
- type ExpireResult
- type ForGuest
- type GroupRelation
- type HistoryArgs
- type HistoryDetail
- type HistoryDetailArgs
- type HistoryDetailResult
- type HistoryItem
- type HistoryResult
- type HistoryTask
- type IsolatedDevice
- type Meta
- type Network
- type ReservedResourcesArgs
- type ReservedResourcesResult
- type ResultResource
- type SchedData
- type SchedErrItem
- type SchedInfo
- type SchedNormalResultItem
- type SchedResult
- type SchedResultItem
- type SchedSuccItem
- type SchedTestResult
Constants ¶
View Source
const ( HostTypeHost = "host" HostTypeBaremetal = "baremetal" SchedTypeGuest = "guest" SchedTypeBaremetal = "baremetal" SchedTypeContainer = "container" SchedTypeEsxi = "esxi" SchedTypeHyperV = "hyperv" SchedTypeKvm = "kvm" HostHypervisorForKvm = "hypervisor" HostTypeAliyun = "aliyun" HostTypeAzure = "azure" HostTypeKubelet = "kubelet" AggregateStrategyRequire = "require" AggregateStrategyExclude = "exclude" AggregateStrategyPrefer = "prefer" AggregateStrategyAvoid = "avoid" // passthrough device type DIRECT_PCI_TYPE = "PCI" GPU_HPC_TYPE = "GPU-HPC" GPU_VGA_TYPE = "GPU-VGA" USB_TYPE = "USB" NIC_TYPE = "NIC" // Hard code vendor const NVIDIA = "NVIDIA" AMD = "AMD" NVIDIA_VENDOR_ID = "10de" AMD_VENDOR_ID = "1002" )
View Source
const (
DefaultCandidateListArgsLimit = 20
)
Variables ¶
View Source
var ( AggregateStrategySets = sets.NewString( AggregateStrategyRequire, AggregateStrategyExclude, AggregateStrategyPrefer, AggregateStrategyAvoid, ) PublicCloudProviders = sets.NewString( HostTypeAliyun, HostTypeAzure, ) ValidGpuTypes = sets.NewString( GPU_HPC_TYPE, GPU_VGA_TYPE, ) ValidPassthroughTypes = sets.NewString( DIRECT_PCI_TYPE, USB_TYPE, NIC_TYPE, ).Union(ValidGpuTypes) IsolatedVendorIDMap = map[string]string{ NVIDIA: NVIDIA_VENDOR_ID, AMD: AMD_VENDOR_ID, } IsolatedIDVendorMap = map[string]string{} )
Functions ¶
func AggregateStrategyCheck ¶
Types ¶
type Aggregate ¶
func NewSchedTagFromCmdline ¶
type CandidateDetailArgs ¶
CandidateDetailArgs is a struct just for parsing candidate resource parameters.
func NewCandidateDetailArgs ¶
func NewCandidateDetailArgs(sjson *simplejson.Json, id string) (*CandidateDetailArgs, error)
NewCandidateDetailArgs provides a function that will parse candidate's args from a json data.
type CandidateDetailResult ¶
type CandidateDetailResult struct {
Candidate interface{} `json:"candidate"`
}
type CandidateListArgs ¶
type CandidateListArgs struct { Type string Zone string Pool string Limit int64 Offset int64 Avaliable bool }
CandidateListArgs is a struct just for parsing candidate resource list parameters.
func NewCandidateListArgs ¶
func NewCandidateListArgs(sjson *simplejson.Json) (*CandidateListArgs, error)
NewCandidateListArgs provides a function that will parse candidate's list args from a json data.
type CandidateListResult ¶
type CandidateListResult struct { Data []CandidateListResultItem `json:"data"` Total int64 `json:"total"` Limit int64 `json:"limit"` Offset int64 `json:"offset"` }
type CandidateListResultItem ¶
type CandidateListResultItem struct { ID string `json:"id"` Name string `json:"name"` Cpu ResultResource `json:"cpu"` Mem ResultResource `json:"mem"` Storage ResultResource `json:"storage"` Status string `json:"status"` HostStatus string `json:"host_status"` EnableStatus string `json:"enable_status"` HostType string `json:"host_type"` }
type CleanupArgs ¶
type CleanupArgs struct {
ResType string
}
func NewCleanupArgs ¶
func NewCleanupArgs(sjson *simplejson.Json) (*CleanupArgs, error)
type CleanupResult ¶
type CleanupResult struct { }
type CompletedNotifyArgs ¶
type CompletedNotifyArgs struct {
SessionID string
}
func NewCompletedNotifyArgs ¶
func NewCompletedNotifyArgs(sjson *simplejson.Json, sessionId string) (*CompletedNotifyArgs, error)
type CompletedNotifyResult ¶
type CompletedNotifyResult struct { }
type Disk ¶
type Disk struct { Backend string `json:"backend"` ImageID string `json:"image_id"` Fs *string `json:"fs"` Os string `json:"os"` OSDistribution string `json:"os_distribution"` OsVersion string `json:"os_version"` Format string `json:"format"` MountPoint *string `json:"mountpoint"` Driver *string `json:"driver"` Cache *string `json:"cache"` ImageDiskFormat string `json:"image_disk_format"` Size int64 `json:"size"` Storage *string `json:"storage"` }
type ExpireArgs ¶
type ExpireResult ¶
type ExpireResult struct { }
type GroupRelation ¶
type HistoryArgs ¶
func NewHistoryArgs ¶
func NewHistoryArgs(sjson *simplejson.Json) (*HistoryArgs, error)
type HistoryDetail ¶
type HistoryDetailArgs ¶
func NewHistoryDetailArgs ¶
func NewHistoryDetailArgs(sjson *simplejson.Json, id string) (*HistoryDetailArgs, error)
type HistoryDetailResult ¶
type HistoryDetailResult struct {
Detail *HistoryDetail `json:"history"`
}
type HistoryItem ¶
type HistoryResult ¶
type HistoryResult struct { Items []*HistoryItem `json:"data"` Total int64 `json:"total"` Offset int64 `json:"offset"` Limit int64 `json:"limit"` }
type HistoryTask ¶
type HistoryTask struct { Type string `json:"type"` Status string `json:"status"` Data *SchedData `json:"data"` Time string `json:"time"` Consuming string `json:"consuming"` //Result []SchedResultItem `json:"result"` Result interface{} `json:"result"` Error string `json:"error"` Logs []string `json:"logs"` }
type IsolatedDevice ¶
type Network ¶
type Network struct { Idx string `json:"idx"` TenantId string `json:"tenant_id"` Private bool `json:"private"` Ports int64 `json:"ports"` Exit bool `json:"exit"` Wire string `json:"wire"` Mac string `json:"mac"` Address string `json:"address"` Address6 string `json:"address6"` Driver string `json:"driver"` BwLimit int64 `json:"bw_limit"` Vip bool `json:"vip"` Reserved bool `json:"reserved"` }
type ReservedResourcesArgs ¶
type ReservedResourcesResult ¶
type ReservedResourcesResult struct {
Resources interface{} `json:"resources"`
}
type ResultResource ¶
type ResultResource struct { Free float64 `json:"free"` Reserved float64 `json:"reserverd"` Total float64 `json:"total"` }
func NewResultResource ¶
func NewResultResource(f, r, t float64) *ResultResource
func NewResultResourceInt64 ¶
func NewResultResourceInt64(f, r, t int64) *ResultResource
func NewResultResourceString ¶
func NewResultResourceString(free, reserverd, total string) (*ResultResource, error)
type SchedData ¶
type SchedData struct { Tag string `json:"tag"` Type string `json:"type"` IsContainer bool `json:"is_container"` Count int64 `json:"count"` ZoneID string `json:"zone_id"` PoolID string `json:"pool_id"` HostID string `json:"host_id"` Candidates []string `json:"candidates"` OwnerTenantID string `json:"owner_tenant_id"` OwnerUserID string `json:"owner_user_id"` VMEMSize int64 `json:"vmem_size"` VCPUCount int64 `json:"vcpu_count"` Disks []*Disk `json:"disks"` Name string `json:"name"` Networks []*Network `json:"networks"` IsolatedDevices []*IsolatedDevice `json:"isolated_devices"` Aggregates []Aggregate `json:"aggregate_stategy"` Meta Meta `json:"__meta__"` ForGuests []*ForGuest `json:"for_guests"` GuestStatus string `json:"guest_status"` Hypervisor string `json:"hypervisor"` // VM Groups []string `json:"group"` GroupRelations []GroupRelation `json:"group_relations"` // baremental BaremetalDiskConfigs []*baremetal.BaremetalDiskConfig `json:"baremetal_disk_config"` }
func NewSchedData ¶
func (*SchedData) AllDiskBackendSize ¶
func (*SchedData) IsPublicCloudProvider ¶
func (*SchedData) SkipDirtyMarkHost ¶
type SchedErrItem ¶
type SchedErrItem struct {
Error string `json:"error"`
}
type SchedInfo ¶
type SchedInfo struct { Data *SchedData `json:"scheduler"` IgnoreFilters map[string]bool `json:"ignore_filters"` SessionID string `json:"session_id"` IsSuggestion bool `json:"suggestion"` ShowSuggestionDetails bool `json:"suggestion_details"` SuggestionLimit int64 `json:"suggestion_limit"` SuggestionAll bool `json:"suggestion_all"` Raw string `json:"raw"` BestEffort bool `json:"best_effort"` }
func NewSchedInfo ¶
type SchedNormalResultItem ¶
type SchedResult ¶
type SchedResult struct {
Items []SchedResultItem `json:"scheduler"`
}
type SchedResultItem ¶
type SchedResultItem interface{}
type SchedSuccItem ¶
type SchedSuccItem struct {
Candidate SchedNormalResultItem `json:"candidate"`
}
type SchedTestResult ¶
Click to show internal directories.
Click to hide internal directories.