@@ -20,7 +20,6 @@ import (
20
20
21
21
"cdr.dev/slog"
22
22
"github.com/coder/coder/v2/coderd/database"
23
- "github.com/coder/coder/v2/coderd/database/db2sdk"
24
23
"github.com/coder/coder/v2/coderd/database/dbauthz"
25
24
"github.com/coder/coder/v2/coderd/database/dbtime"
26
25
"github.com/coder/coder/v2/coderd/httpapi"
@@ -49,50 +48,6 @@ func (api *API) provisionerDaemonsEnabledMW(next http.Handler) http.Handler {
49
48
})
50
49
}
51
50
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
-
96
51
type provisiionerDaemonAuthResponse struct {
97
52
keyID uuid.UUID
98
53
orgID uuid.UUID
0 commit comments