Documentation
¶
Index ¶
- Constants
- func CheckVersion(version *types.Version) error
- type App
- type AppService
- func (api *AppService) CancelUpdate(request *restful.Request, response *restful.Response)
- func (api *AppService) CreateApp(request *restful.Request, response *restful.Response)
- func (api *AppService) DeleteApp(request *restful.Request, response *restful.Response)
- func (api *AppService) GetApp(request *restful.Request, response *restful.Response)
- func (api *AppService) GetAppTask(request *restful.Request, response *restful.Response)
- func (api *AppService) ListApp(request *restful.Request, response *restful.Response)
- func (api *AppService) ProceedUpdate(request *restful.Request, response *restful.Response)
- func (api *AppService) Register(container *restful.Container)
- func (api *AppService) ScaleDown(request *restful.Request, response *restful.Response)
- func (api *AppService) ScaleUp(request *restful.Request, response *restful.Response)
- func (api *AppService) UpdateApp(request *restful.Request, response *restful.Response)
- type Cmd
- type EventsService
- type ProceedUpdateParam
- type ScaleDownParam
- type ScaleUpParam
- type Stats
- type StatsService
- type Task
- type TaskHistory
Constants ¶
View Source
const (
API_PREFIX = "v_beta"
)
Variables ¶
This section is empty.
Functions ¶
func CheckVersion ¶
Types ¶
type App ¶
type App struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Instances int `json:"instances,omitempty"`
UpdatedInstances int `json:"updatedInstances,omitempty"`
RunningInstances int `json:"runningInstances"`
RunAs string `json:"runAs,omitempty"`
Priority int `json:"priority"`
ClusterId string `json:"clusterId,omitempty"`
Status string `json:"status,omitempty"`
Created time.Time `json:"created,omitempty"`
Updated time.Time `json:"updated,omitempty"`
Mode string `json:"mode,omitempty"`
State string `json:"state"`
// use task for compatability now, should be slot here
Tasks []*Task `json:"tasks,omitempty"`
Versions []string `json:"versions,omitempty"`
IP []string `json:"ip,omitempty"`
// current version related info
Labels map[string]string `json:"labels,omitempty"`
Env map[string]string `json:"env,omitempty"`
Constraints []string `json:"constraints,omitempty"`
Uris []string `json:"uris,omitempty"`
}
func FormAppRet ¶
type AppService ¶
type AppService struct {
Scheduler *scheduler.Scheduler
apiserver.ApiRegister
}
func NewAndInstallAppService ¶
func NewAndInstallAppService(apiServer *apiserver.ApiServer, eng *scheduler.Scheduler) *AppService
func (*AppService) CancelUpdate ¶
func (api *AppService) CancelUpdate(request *restful.Request, response *restful.Response)
func (*AppService) CreateApp ¶
func (api *AppService) CreateApp(request *restful.Request, response *restful.Response)
func (*AppService) DeleteApp ¶
func (api *AppService) DeleteApp(request *restful.Request, response *restful.Response)
func (*AppService) GetApp ¶
func (api *AppService) GetApp(request *restful.Request, response *restful.Response)
func (*AppService) GetAppTask ¶
func (api *AppService) GetAppTask(request *restful.Request, response *restful.Response)
func (*AppService) ListApp ¶
func (api *AppService) ListApp(request *restful.Request, response *restful.Response)
func (*AppService) ProceedUpdate ¶
func (api *AppService) ProceedUpdate(request *restful.Request, response *restful.Response)
func (*AppService) Register ¶
func (api *AppService) Register(container *restful.Container)
NOTE(xychu): Every service need to registed to ApiServer need to impl
a `Register` interface so that it can be added to ApiServer.Start
func (*AppService) ScaleDown ¶
func (api *AppService) ScaleDown(request *restful.Request, response *restful.Response)
type EventsService ¶
type EventsService struct {
Scheduler *scheduler.Scheduler
apiserver.ApiRegister
}
func NewAndInstallEventsService ¶
func NewAndInstallEventsService(apiServer *apiserver.ApiServer, eng *scheduler.Scheduler) *EventsService
func (*EventsService) Events ¶
func (api *EventsService) Events(request *restful.Request, response *restful.Response)
func (*EventsService) Register ¶
func (api *EventsService) Register(container *restful.Container)
type ProceedUpdateParam ¶
type ProceedUpdateParam struct {
Instances int `json:"instances"`
}
type ScaleDownParam ¶
type ScaleDownParam struct {
Instances int `json:"instances"`
}
type ScaleUpParam ¶
type Stats ¶
type Stats struct {
AppCount int `json:"appCount,omitempty"`
TaskCount int `json:"taskCount,omitempty"`
CpuTotalOffered float64 `json:"cpuTotalOffered,omitempty"`
MemTotalOffered float64 `json:"memTotalOffered,omitempty"`
DiskTotalOffered float64 `json:"diskTotalOffered,omitempty"`
CpuTotalUsed float64 `json:"cpuTotalUsed,omitempty"`
MemTotalUsed float64 `json:"memTotalUsed,omitempty"`
DiskTotalUsed float64 `json:"diskTotalUsed,omitempty"`
AppStats map[string]int `json:"appStats,omitempty"`
}
type StatsService ¶
type StatsService struct {
Scheduler *scheduler.Scheduler
apiserver.ApiRegister
}
func NewAndInstallStatsService ¶
func NewAndInstallStatsService(apiServer *apiserver.ApiServer, eng *scheduler.Scheduler) *StatsService
func (*StatsService) Register ¶
func (api *StatsService) Register(container *restful.Container)
type Task ¶
type Task struct {
ID string `json:"id,omitempty"`
AppId string `json:"appId,omitempty"`
VersionId string `json:"versionId,omitempty"`
Status string `json:"status"`
OfferId string `json:"offerId,omitempty"`
AgentId string `json:"agentId,omitempty"`
AgentHostname string `json:"agentHostname,omitempty"`
Cpu float64 `json:"cpu,omitempty"`
Mem float64 `json:"mem,omitempty"`
Disk float64 `json:"disk,omitempty"`
History []*TaskHistory `json:"history,omitempty"`
IP string `json:"ip,omitempty"`
Created time.Time `json:"created,omitempty"`
Image string `json:"image,omitempty"`
Healthy bool `json:"healthy"`
}
use task for compatability now, should be slot here and together with task history
func FilterTasksFromApp ¶
type TaskHistory ¶
type TaskHistory struct {
ID string `json:"id,omitempty"`
AppId string `json:"appId,omitempty"`
VersionId string `json:"versionId,omitempty"`
OfferId string `json:"offerId,omitempty"`
AgentId string `json:"agentId,omitempty"`
AgentHostname string `json:"agentHostname,omitempty"`
Cpu float64 `json:"cpu,omitempty"`
Mem float64 `json:"mem,omitempty"`
Disk float64 `json:"disk,omitempty"`
State string `json:"state,omitempty"`
Reason string `json:"Reason,omitempty"`
Stdout string `json:"stdout,omitempty"`
Stderr string `json:"stderr,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.