MCPcopy
hub / github.com/cortexlabs/cortex / Deploy

Function Deploy

pkg/operator/endpoints/deploy.go:27–52  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

25)
26
27func 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}

Callers

nothing calls this directly

Calls 8

WithStackFunction · 0.92
ReadReqFileFunction · 0.92
DeployFunction · 0.92
getOptionalBoolQParamFunction · 0.85
getRequiredQueryParamFunction · 0.85
respondErrorFunction · 0.85
respondJSONFunction · 0.70

Tested by

no test coverage detected