(w http.ResponseWriter, r *http.Request)
| 25 | ) |
| 26 | |
| 27 | func Deploy(w http.ResponseWriter, r *http.Request) { |
| 28 | force := getOptionalBoolQParam("force", false, r) |
| 29 | |
| 30 | configFileName, err := getRequiredQueryParam("configFileName", r) |
| 31 | if err != nil { |
| 32 | respondError(w, r, errors.WithStack(err)) |
| 33 | return |
| 34 | } |
| 35 | |
| 36 | configBytes, err := files.ReadReqFile(r, "config") |
| 37 | if err != nil { |
| 38 | respondError(w, r, errors.WithStack(err)) |
| 39 | return |
| 40 | } else if len(configBytes) == 0 { |
| 41 | respondError(w, r, ErrorFormFileMustBeProvided("config")) |
| 42 | return |
| 43 | } |
| 44 | |
| 45 | response, err := resources.Deploy(configFileName, configBytes, force) |
| 46 | if err != nil { |
| 47 | respondError(w, r, err) |
| 48 | return |
| 49 | } |
| 50 | |
| 51 | respondJSON(w, r, response) |
| 52 | } |
nothing calls this directly
no test coverage detected