Documentation ¶
Index ¶
- Constants
- Variables
- func FetchAuthToken(req *http.Request) (mcclient.TokenCredential, error)
- func FetchUserCred(req *http.Request) (mcclient.TokenCredential, error)
- func SchedtagStrategyCheck(strategy string) (err error)
- type CandidateDetailArgs
- type CandidateDetailResult
- type CandidateGroup
- type CandidateListArgs
- type CandidateListResult
- type CandidateListResultItem
- type CandidateNetwork
- type CandidateStorage
- type CleanupArgs
- type CleanupResult
- type CompletedNotifyArgs
- type CompletedNotifyResult
- type ExpireArgs
- type ExpireResult
- type FilteredCandidate
- type ForecastFilter
- type HistoryArgs
- type HistoryDetail
- type HistoryDetailArgs
- type HistoryDetailResult
- type HistoryItem
- type HistoryResult
- type HistoryTask
- type ReservedResourcesArgs
- type ReservedResourcesResult
- type ResultResource
- type SchedBackupResultItem
- type SchedErrItem
- type SchedForecastResult
- 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" 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, ) 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 FetchAuthToken ¶
func FetchAuthToken(req *http.Request) (mcclient.TokenCredential, error)
func FetchUserCred ¶
func FetchUserCred(req *http.Request) (mcclient.TokenCredential, error)
func SchedtagStrategyCheck ¶
Types ¶
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 CandidateGroup ¶
type CandidateListArgs ¶
type CandidateListArgs struct { Type string `json:"type"` Region string `json:"region"` Zone string `json:"zone"` //Pool string Limit int64 `json:"limit"` Offset int64 `json:"offset"` Avaliable bool `json:"available"` }
CandidateListArgs is a struct just for parsing candidate resource list parameters.
func NewCandidateListArgs ¶
func NewCandidateListArgs(r io.Reader) (*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"` PendingUsage map[string]interface{} `json:"pending_usage"` }
type CandidateNetwork ¶
type CandidateStorage ¶
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 ExpireArgs ¶
type ExpireResult ¶
type ExpireResult struct { }
type FilteredCandidate ¶
type ForecastFilter ¶
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 *SchedInfo `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"` CapacityMap interface{} `json:"capacity_map"` }
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 SchedBackupResultItem ¶
type SchedErrItem ¶
type SchedErrItem struct {
Error string `json:"error"`
}
type SchedForecastResult ¶
type SchedForecastResult struct { CanCreate bool `json:"can_create"` Candidates []*api.CandidateResource `json:"candidates"` ReqCount int64 `json:"req_count"` AllowCount int64 `json:"allow_count"` NotAllowReasons []string `json:"not_allow_reasons"` FilteredCandidates []FilteredCandidate `json:"filtered_candidates"` }
type SchedInfo ¶
type SchedInfo struct { *api.ScheduleInput Tag string `json:"tag"` Type string `json:"type"` IsContainer bool `json:"is_container"` PreferCandidates []string `json:"candidates"` RequiredCandidates int `json:"required_candidates"` IgnoreFilters map[string]bool `json:"ignore_filters"` IsSuggestion bool `json:"suggestion"` ShowSuggestionDetails bool `json:"suggestion_details"` Raw string InstanceGroupsDetail map[string]*models.SGroup UserCred mcclient.TokenCredential }
func NewSchedInfo ¶
func NewSchedInfo(input *api.ScheduleInput) *SchedInfo
func (*SchedInfo) AllDiskBackendSize ¶
func (*SchedInfo) GetCandidateHostTypes ¶
func (*SchedInfo) SkipDirtyMarkHost ¶
type SchedNormalResultItem ¶
type SchedResult ¶
type SchedResult struct {
Items []SchedResultItem `json:"scheduler"`
}
type SchedResultItem ¶
type SchedResultItem interface{}
type SchedSuccItem ¶
type SchedSuccItem struct {
Candidate interface{} `json:"candidate"`
}
type SchedTestResult ¶
Click to show internal directories.
Click to hide internal directories.