Documentation ¶
Overview ¶
Package api defines API between Microscaling agent and server
Index ¶
- func AppsFromData(b []byte) (tasks []*demand.Task, maxContainers int, err error)
- func GetApps(apiAddress string, userID string) (tasks []*demand.Task, maxContainers int, err error)
- func SendMetrics(ws *websocket.Conn, userID string, tasks *demand.Tasks) error
- type AppDescription
- type AppsMessage
- type DemandPayload
- type DockerAppConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppsFromData ¶
AppsFromData converts apps data from json into tasks.
Types ¶
type AppDescription ¶
type AppDescription struct { Name string `json:"name"` Priority int `json:"priority"` // 1 is the highest, 0 means it's not scalable MinContainers int `json:"minContainers"` MaxContainers int `json:"maxContainers"` TargetQueueLength int `json:"targetValue"` RuleType string `json:"ruleType"` AppType string `json:"appType"` MetricType string `json:"metricType"` Config DockerAppConfig `json:"config"` }
AppDescription is the json describing an individual app
type AppsMessage ¶
type AppsMessage struct { UserID string `json:"name"` MaxContainers int `json:"maxContainers"` Apps []AppDescription `json:"apps"` }
AppsMessage is the json that arrives from /apps/<userID>
type DemandPayload ¶
type DemandPayload struct {
Demand demandUpdate `json:"demand"`
}
DemandPayload is the JSON sent from the server describing the number of containers needed for each task This is only used if we're generating demand server-sde
type DockerAppConfig ¶
type DockerAppConfig struct { Image string `json:"image"` Command string `json:"command"` PublishAllPorts bool `json:"publishAllPorts"` QueueLength int `json:"targetQueueLength"` QueueName string `json:"queueName"` TopicName string `json:"topicName"` ChannelName string `json:"channelName"` QueueURL string `json:"queueURL"` }
DockerAppConfig is the json describing parameters that need to be passed into Docker when starting this app TODO!! This is not really just Docker-specific as we have some target info in here too
Click to show internal directories.
Click to hide internal directories.