mirror of
https://github.com/openfaas/faas.git
synced 2025-06-21 00:06:38 +00:00
@ -5,6 +5,7 @@ package requests
|
||||
|
||||
// CreateFunctionRequest create a function in the swarm.
|
||||
type CreateFunctionRequest struct {
|
||||
|
||||
// Service corresponds to a Docker Service
|
||||
Service string `json:"service"`
|
||||
|
||||
@ -34,30 +35,18 @@ type CreateFunctionRequest struct {
|
||||
// Labels are metadata for functions which may be used by the
|
||||
// back-end for making scheduling or routing decisions
|
||||
Labels *map[string]string `json:"labels"`
|
||||
|
||||
// Limits for function
|
||||
Limits *FunctionResources `json:"limits"`
|
||||
|
||||
// Requests of resources requested by function
|
||||
Requests *FunctionResources `json:"requests"`
|
||||
}
|
||||
|
||||
// DeleteFunctionRequest delete a deployed function
|
||||
type DeleteFunctionRequest struct {
|
||||
FunctionName string `json:"functionName"`
|
||||
}
|
||||
|
||||
// PrometheusInnerAlertLabel PrometheusInnerAlertLabel
|
||||
type PrometheusInnerAlertLabel struct {
|
||||
AlertName string `json:"alertname"`
|
||||
FunctionName string `json:"function_name"`
|
||||
}
|
||||
|
||||
// PrometheusInnerAlert PrometheusInnerAlert
|
||||
type PrometheusInnerAlert struct {
|
||||
Status string `json:"status"`
|
||||
Labels PrometheusInnerAlertLabel `json:"labels"`
|
||||
}
|
||||
|
||||
// PrometheusAlert as produced by AlertManager
|
||||
type PrometheusAlert struct {
|
||||
Status string `json:"status"`
|
||||
Receiver string `json:"receiver"`
|
||||
Alerts []PrometheusInnerAlert `json:"alerts"`
|
||||
// FunctionResources Memory and CPU
|
||||
type FunctionResources struct {
|
||||
Memory string `json:"memory"`
|
||||
CPU string `json:"cpu"`
|
||||
}
|
||||
|
||||
// Function exported for system/functions endpoint
|
||||
@ -79,3 +68,8 @@ type AsyncReport struct {
|
||||
StatusCode int `json:"statusCode"`
|
||||
TimeTaken float64 `json:"timeTaken"`
|
||||
}
|
||||
|
||||
// DeleteFunctionRequest delete a deployed function
|
||||
type DeleteFunctionRequest struct {
|
||||
FunctionName string `json:"functionName"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user