MCPcopy Index your code
hub / github.com/coder/coder / template

Method template

coderd/templates.go:50–55  ·  view source on GitHub ↗

Returns a single template. @Summary Get template settings by ID @ID get-template-settings-by-id @Security CoderSessionToken @Produce json @Tags Templates @Param template path string true "Template ID" format(uuid) @Success 200 {object} codersdk.Template @Router /api/v2/templates/{template} [get]

(rw http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

48// @Success 200 {object} codersdk.Template
49// @Router /api/v2/templates/{template} [get]
50func (api *API) template(rw http.ResponseWriter, r *http.Request) {
51 ctx := r.Context()
52 template := httpmw.TemplateParam(r)
53
54 httpapi.Write(ctx, rw, http.StatusOK, api.convertTemplate(template))
55}
56
57// @Summary Delete template by ID
58// @ID delete-template-by-id

Callers

nothing calls this directly

Calls 4

convertTemplateMethod · 0.95
TemplateParamFunction · 0.92
WriteFunction · 0.92
ContextMethod · 0.65

Tested by

no test coverage detected