templateVersionResources returns the workspace agent resources associated with a template version. A template can specify more than one resource to be provisioned, each resource can have an agent that dials back to coderd. The agents returned are informative of the template version, and do not retur
(rw http.ResponseWriter, r *http.Request)
| 1918 | // @Success 200 {array} codersdk.WorkspaceResource |
| 1919 | // @Router /api/v2/templateversions/{templateversion}/resources [get] |
| 1920 | func (api *API) templateVersionResources(rw http.ResponseWriter, r *http.Request) { |
| 1921 | var ( |
| 1922 | ctx = r.Context() |
| 1923 | templateVersion = httpmw.TemplateVersionParam(r) |
| 1924 | ) |
| 1925 | |
| 1926 | job, err := api.Database.GetProvisionerJobByID(ctx, templateVersion.JobID) |
| 1927 | if err != nil { |
| 1928 | httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{ |
| 1929 | Message: "Internal error fetching provisioner job.", |
| 1930 | Detail: err.Error(), |
| 1931 | }) |
| 1932 | return |
| 1933 | } |
| 1934 | api.provisionerJobResources(rw, r, job) |
| 1935 | } |
| 1936 | |
| 1937 | // templateVersionLogs returns the logs returned by the provisioner for the given |
| 1938 | // template version. These logs are only associated with the template version, |
nothing calls this directly
no test coverage detected