Skip to content

Commit 22194f1

Browse files
committed
remove unused
1 parent f8b61a7 commit 22194f1

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

enterprise/coderd/provisionerdaemons.go

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020

2121
"cdr.dev/slog"
2222
"github.com/coder/coder/v2/coderd/database"
23-
"github.com/coder/coder/v2/coderd/database/db2sdk"
2423
"github.com/coder/coder/v2/coderd/database/dbauthz"
2524
"github.com/coder/coder/v2/coderd/database/dbtime"
2625
"github.com/coder/coder/v2/coderd/httpapi"
@@ -49,50 +48,6 @@ func (api *API) provisionerDaemonsEnabledMW(next http.Handler) http.Handler {
4948
})
5049
}
5150

52-
// @Summary Get provisioner daemons
53-
// @ID get-provisioner-daemons
54-
// @Security CoderSessionToken
55-
// @Produce json
56-
// @Tags Enterprise
57-
// @Param organization path string true "Organization ID" format(uuid)
58-
// @Param tags query object false "Provisioner tags to filter by (JSON of the form {'tag1':'value1','tag2':'value2'})"
59-
// @Success 200 {array} codersdk.ProvisionerDaemon
60-
// @Router /organizations/{organization}/provisionerdaemons [get]
61-
func (api *API) provisionerDaemons(rw http.ResponseWriter, r *http.Request) {
62-
var (
63-
ctx = r.Context()
64-
org = httpmw.OrganizationParam(r)
65-
tagParam = r.URL.Query().Get("tags")
66-
tags = database.StringMap{}
67-
err = tags.Scan([]byte(tagParam))
68-
)
69-
70-
if tagParam != "" && err != nil {
71-
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
72-
Message: "Invalid tags query parameter",
73-
Detail: err.Error(),
74-
})
75-
return
76-
}
77-
78-
daemons, err := api.Database.GetProvisionerDaemonsByOrganization(
79-
ctx,
80-
database.GetProvisionerDaemonsByOrganizationParams{
81-
OrganizationID: org.ID,
82-
WantTags: tags,
83-
},
84-
)
85-
if err != nil {
86-
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
87-
Message: "Internal error fetching provisioner daemons.",
88-
Detail: err.Error(),
89-
})
90-
return
91-
}
92-
93-
httpapi.Write(ctx, rw, http.StatusOK, db2sdk.List(daemons, db2sdk.ProvisionerDaemon))
94-
}
95-
9651
type provisiionerDaemonAuthResponse struct {
9752
keyID uuid.UUID
9853
orgID uuid.UUID

0 commit comments

Comments
 (0)