mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-23 07:13:23 +00:00
Update to latest faas-provider
The scale and delete endpoints no-longer accept namespace via the query string, but through the body. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
4
vendor/github.com/openfaas/faas-provider/serve.go
generated
vendored
4
vendor/github.com/openfaas/faas-provider/serve.go
generated
vendored
@ -80,10 +80,10 @@ func Serve(handlers *types.FaaSHandlers, config *types.FaaSConfig) {
|
||||
|
||||
// Only register the mutate namespace handler if it is defined
|
||||
if handlers.MutateNamespace != nil {
|
||||
r.HandleFunc("/system/namespace/{namespace:["+NameExpression+"]+}",
|
||||
r.HandleFunc("/system/namespace/{name:["+NameExpression+"]*}",
|
||||
hm.InstrumentHandler(handlers.MutateNamespace, "")).Methods(http.MethodPost, http.MethodDelete, http.MethodPut, http.MethodGet)
|
||||
} else {
|
||||
r.HandleFunc("/system/namespace/{namespace:["+NameExpression+"]+}",
|
||||
r.HandleFunc("/system/namespace/{name:["+NameExpression+"]*}",
|
||||
hm.InstrumentHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, "Feature not implemented in this version of OpenFaaS", http.StatusNotImplemented)
|
||||
}), "")).Methods(http.MethodGet)
|
||||
|
9
vendor/github.com/openfaas/faas-provider/types/requests.go
generated
vendored
9
vendor/github.com/openfaas/faas-provider/types/requests.go
generated
vendored
@ -3,15 +3,17 @@
|
||||
|
||||
package types
|
||||
|
||||
// ScaleServiceRequest scales the service to the requested replcia count.
|
||||
// ScaleServiceRequest scales the service to the requested replica count.
|
||||
type ScaleServiceRequest struct {
|
||||
ServiceName string `json:"serviceName"`
|
||||
Replicas uint64 `json:"replicas"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
}
|
||||
|
||||
// DeleteFunctionRequest delete a deployed function
|
||||
type DeleteFunctionRequest struct {
|
||||
FunctionName string `json:"functionName"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
}
|
||||
|
||||
// ProviderInfo provides information about the configured provider
|
||||
@ -28,10 +30,9 @@ type VersionInfo struct {
|
||||
Release string `json:"release"`
|
||||
}
|
||||
|
||||
// FunctionNamespace is required for use with the /system/namespace/NAME endpoint
|
||||
// for deletions, just pass the namespace field.
|
||||
// FunctionNamespace is the namespace for a function
|
||||
type FunctionNamespace struct {
|
||||
Namespace string `json:"namespace"`
|
||||
Name string `json:"name"`
|
||||
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
|
Reference in New Issue
Block a user