|
|
@ -41,6 +41,7 @@ var deployments = []Route{
|
|
|
|
{"PutDeployment", "/deployments/{deployment}", "PUT", putDeploymentHandlerFunc, "JSON"},
|
|
|
|
{"PutDeployment", "/deployments/{deployment}", "PUT", putDeploymentHandlerFunc, "JSON"},
|
|
|
|
{"ListManifests", "/deployments/{deployment}/manifests", "GET", listManifestsHandlerFunc, ""},
|
|
|
|
{"ListManifests", "/deployments/{deployment}/manifests", "GET", listManifestsHandlerFunc, ""},
|
|
|
|
{"GetManifest", "/deployments/{deployment}/manifests/{manifest}", "GET", getManifestHandlerFunc, ""},
|
|
|
|
{"GetManifest", "/deployments/{deployment}/manifests/{manifest}", "GET", getManifestHandlerFunc, ""},
|
|
|
|
|
|
|
|
{"Expand", "/expand", "POST", expandHandlerFunc, ""},
|
|
|
|
{"ListTypes", "/types", "GET", listTypesHandlerFunc, ""},
|
|
|
|
{"ListTypes", "/types", "GET", listTypesHandlerFunc, ""},
|
|
|
|
{"ListTypeInstances", "/types/{type}/instances", "GET", listTypeInstancesHandlerFunc, ""},
|
|
|
|
{"ListTypeInstances", "/types/{type}/instances", "GET", listTypeInstancesHandlerFunc, ""},
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -290,6 +291,23 @@ func getManifestHandlerFunc(w http.ResponseWriter, r *http.Request) {
|
|
|
|
util.LogHandlerExitWithJSON(handler, w, m, http.StatusOK)
|
|
|
|
util.LogHandlerExitWithJSON(handler, w, m, http.StatusOK)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func expandHandlerFunc(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
|
|
|
handler := "manager: expand config"
|
|
|
|
|
|
|
|
util.LogHandlerEntry(handler, r)
|
|
|
|
|
|
|
|
defer r.Body.Close()
|
|
|
|
|
|
|
|
t := getTemplate(w, r, handler)
|
|
|
|
|
|
|
|
if t != nil {
|
|
|
|
|
|
|
|
c, err := backend.Expand(t)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
util.LogAndReturnError(handler, http.StatusBadRequest, err, w)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
util.LogHandlerExitWithJSON(handler, w, c, http.StatusCreated)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Putting Type handlers here for now because deployments.go
|
|
|
|
// Putting Type handlers here for now because deployments.go
|
|
|
|
// currently owns its own Manager backend and doesn't like to share.
|
|
|
|
// currently owns its own Manager backend and doesn't like to share.
|
|
|
|
func listTypesHandlerFunc(w http.ResponseWriter, r *http.Request) {
|
|
|
|
func listTypesHandlerFunc(w http.ResponseWriter, r *http.Request) {
|
|
|
|