Documentation
¶
Index ¶
- Constants
- Variables
- func GetMsg(code int) string
- func GetSlaveStatsString(stats StatsSlave) string
- type APICallBackRequestBase
- type APICallBackResponseBase
- type APIContainerCreateRequest
- type APIContainerCreateResponse
- type APIContainerRemoveRequest
- type APIContainerRemoveResponse
- type APIContainerStartRequest
- type APIContainerStartResponse
- type APIContainerStopRequest
- type APIContainerStopResponse
- type APISlaveAddToken
- type APISlaveDeleteRequest
- type APISlaveDeleteResponse
- type APISlaveImageListRequest
- type APISlaveImageListResponse
- type APISlaveProfileListRequest
- type APISlaveProfileListResponse
- type APISlaveStatusItem
- type APISlaveStatusRequest
- type APISlaveStatusResponse
- type APISlaveUUIDListResponse
- type CreatMasterBody
- type CreatSlaveBody
- type ImageListItem
- type SlaveProfile
- type StatsSlave
Constants ¶
View Source
const ( SUCCESS = 200 ERROR = 500 INVALID_PARAMS = 400 UNKNOWN_ERROR = 999 SLAVE_INVALID = 5001 SLAVE_INSUFFICIENT_RESOURCE = 5002 CONTAINER_IS_BUSY = 6001 )
Variables ¶
View Source
var MsgFlags = map[int]string{ SUCCESS: "ok", ERROR: "内部错误", INVALID_PARAMS: "请求参数错误", UNKNOWN_ERROR: "未知错误", SLAVE_INVALID: "设备机无效", SLAVE_INSUFFICIENT_RESOURCE: "设备机资源不足", CONTAINER_IS_BUSY: "该容器正在进行其他操作", }
Functions ¶
func GetSlaveStatsString ¶
func GetSlaveStatsString(stats StatsSlave) string
Types ¶
type APICallBackRequestBase ¶
type APICallBackRequestBase struct { OperationID int64 `form:"operation_id" valid:"Required"` CallbackURL string `form:"callback_url" valid:"Required"` }
APICallBackRequestBase 需要回调的 API 请求的 Request base
type APICallBackResponseBase ¶
type APICallBackResponseBase struct { OperationID int64 `json:"operation_id"` Code int `json:"code"` Msg string `json:"msg"` }
APICallBackResponseBase 需要回调的 API 请求的 Response base
type APIContainerCreateRequest ¶
type APIContainerCreateRequest struct { APICallBackRequestBase SlaveID string `form:"slave_id" valid:"Required"` UECContainerID string `form:"uec_container_id" valid:"Required"` ImageName string `form:"image_name" valid:"Required"` ExposedTCPPorts []string `form:"exposed_tcp_ports"` ExposedUDPPorts []string `form:"exposed_udp_ports"` Mounts []string `form:"mounts"` CoreCnt int `form:"core_cnt" valid:"Required"` // max memory usage, in bytes MemorySize int64 `form:"memory_size" valid:"Required"` // max storage usage size, in bytes StorageSize int64 `form:"storage_size" valid:"Required"` }
type APIContainerCreateResponse ¶
type APIContainerCreateResponse struct { APICallBackResponseBase `json:"api_response_base"` ExposedTCPPorts []string `json:"exposed_tcp_ports"` ExposedTCPMappingPorts []string `json:"exposed_tcp_mapping_ports"` ExposedUDPPorts []string `json:"exposed_udp_ports"` ExposedUDPMappingPorts []string `json:"exposed_udp_mapping_ports"` }
type APIContainerRemoveRequest ¶
type APIContainerRemoveRequest struct { APICallBackRequestBase SlaveID string `form:"slave_id" valid:"Required"` UECContainerID string `form:"uec_container_id" valid:"Required"` }
type APIContainerRemoveResponse ¶
type APIContainerRemoveResponse struct {
APICallBackResponseBase `json:"api_response_base"`
}
type APIContainerStartRequest ¶
type APIContainerStartRequest struct { APICallBackRequestBase SlaveID string `form:"slave_id" valid:"Required"` UECContainerID string `form:"uec_container_id" valid:"Required"` }
type APIContainerStartResponse ¶
type APIContainerStartResponse struct {
APICallBackResponseBase `json:"api_response_base"`
}
type APIContainerStopRequest ¶
type APIContainerStopRequest struct { APICallBackRequestBase SlaveID string `form:"slave_id" valid:"Required"` UECContainerID string `form:"uec_container_id" valid:"Required"` }
type APIContainerStopResponse ¶
type APIContainerStopResponse struct {
APICallBackResponseBase `json:"api_response_base"`
}
type APISlaveAddToken ¶
type APISlaveAddToken struct {
Token string `json:"token"`
}
type APISlaveDeleteRequest ¶
type APISlaveDeleteRequest struct { APICallBackRequestBase SlaveUUID string `json:"slave_uuid"` }
type APISlaveDeleteResponse ¶
type APISlaveDeleteResponse struct { APICallBackResponseBase SlaveUUID string `json:"slave_uuid"` }
type APISlaveImageListRequest ¶
type APISlaveImageListRequest struct {
SlaveUUID string `json:"slave_uuid"`
}
type APISlaveImageListResponse ¶
type APISlaveImageListResponse struct {
Images []ImageListItem `json:"images"`
}
type APISlaveProfileListRequest ¶
type APISlaveProfileListRequest struct {
SlavesUUID []string `json:"slaves"`
}
type APISlaveProfileListResponse ¶
type APISlaveProfileListResponse struct {
Slaves []SlaveProfile `json:"slaves"`
}
type APISlaveStatusItem ¶
type APISlaveStatusRequest ¶
type APISlaveStatusRequest struct {
SlaveUUID []string `json:"uuids"`
}
type APISlaveStatusResponse ¶
type APISlaveStatusResponse struct {
Status []APISlaveStatusItem `json:"status"`
}
type APISlaveUUIDListResponse ¶
type APISlaveUUIDListResponse struct {
SlavesUUID []string `json:"slaves"`
}
type CreatMasterBody ¶
type CreatSlaveBody ¶
type ImageListItem ¶
type SlaveProfile ¶
type SlaveProfile struct { SlaveUUId string `json:"slave_uuid"` Platform string `json:"platform"` PlatformFamily string `json:"platform_family"` PlatformVersion string `json:"platform_version"` MemoryTotalSize uint64 `json:"memory_total_size"` CpuModelName string `json:"cpu_model_name"` LogicalCoreCnt int `json:"logical_core_cnt"` PhysicalCoreCnt int `json:"physical_core_cnt"` }
type StatsSlave ¶
type StatsSlave int
const ( StatsWaitingEstablishControlConnection StatsSlave = iota StatsWaitingEstablishDataConnection StatsNormal StatsStopped StatsOffline )
Click to show internal directories.
Click to hide internal directories.