...
1
18
19 package faas_openfaas
20
21 type Service struct {
22 OpenFaaSFunction Function `json:"openfaas_service,omitempty" bson:"openfaas_service"`
23 Deadline uint64 `json:"deadline,omitempty" bson:"deadline"`
24 }
25
26 type CurrentLoad struct {
27 NumberOfServices uint `json:"total_services" bson:"total_services"`
28 TotalReplicas uint `json:"total_replicas" bson:"total_running_replicas"`
29 TotalAvailableReplicas uint `json:"total_available_replicas" bson:"total_available_replicas"`
30 }
31
32 type MachineResources struct {
33 Memory string `json:"memory,omitempty" bson:"memory"`
34 CPU string `json:"cpu,omitempty" bson:"cpu"`
35 }
36
37
71
72 type Function struct {
73 Name string `json:"name,omitempty" bson:"name"`
74 Service string `json:"service,omitempty" bson:"service"`
75 Network string `json:"network,omitempty" bson:"network"`
76 Image string `json:"image,omitempty" bson:"image"`
77 EnvProcess string `json:"envProcess,omitempty" bson:"envProcess"`
78 EnvVars map[string]string `json:"envVars,omitempty" bson:"envVars"`
79 Constraints []string `json:"constraints,omitempty" bson:"constraints"`
80 Labels map[string]string `json:"labels,omitempty" bson:"labels"`
81 Annotations []string `json:"annotations,omitempty" bson:"annotations"`
82 Secrets []string `json:"secrets,omitempty" bson:"secrets"`
83 RegistryAuth string `json:"registryAuth,omitempty" bson:"registryAuth"`
84 Limits MachineResources `json:"limits,omitempty" bson:"limits"`
85 Requests MachineResources `json:"requests,omitempty" bson:"requests"`
86
87 InvocationCount uint `json:"invocationCount,omitempty" bson:"invocationCount"`
88 Replicas uint `json:"replicas,omitempty" bson:"replicas"`
89 AvailableReplicas uint `json:"availableReplicas,omitempty" bson:"availableReplicas"`
90 }
91
92 type FunctionScalePayload struct {
93 Service string `json:"service,omitempty" bson:"service"`
94 Replicas uint `json:"replicas,omitempty" bson:"replicas"`
95 }
96
97
104
View as plain text