Skip to content

Commit 971b2a9

Browse files
committed
add swagger
1 parent 01ca9de commit 971b2a9

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

coderd/provisionerkeys.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ import (
1313
"github.com/coder/coder/v2/codersdk"
1414
)
1515

16+
// @Summary Create provisioner key
17+
// @ID create-provisioner-key
18+
// @Security CoderSessionToken
19+
// @Produce json
20+
// @Tags Enterprise
21+
// @Param organization path string true "Organization ID"
22+
// @Success 201 {object} codersdk.CreateProvisionerKeyResponse
23+
// @Router /organizations/{organization}/provisionerkey [post]
1624
func (api *API) postProvisionerKey(rw http.ResponseWriter, r *http.Request) {
1725
ctx := r.Context()
1826
organization := httpmw.OrganizationParam(r)
@@ -71,6 +79,14 @@ func (api *API) postProvisionerKey(rw http.ResponseWriter, r *http.Request) {
7179
})
7280
}
7381

82+
// @Summary List provisioner key
83+
// @ID list-provisioner-key
84+
// @Security CoderSessionToken
85+
// @Produce json
86+
// @Tags Enterprise
87+
// @Param organization path string true "Organization ID"
88+
// @Success 200 {object} []codersdk.ProvisionerKey
89+
// @Router /organizations/{organization}/provisionerkey [get]
7490
func (api *API) provisionerKeys(rw http.ResponseWriter, r *http.Request) {
7591
ctx := r.Context()
7692
organization := httpmw.OrganizationParam(r)
@@ -84,6 +100,15 @@ func (api *API) provisionerKeys(rw http.ResponseWriter, r *http.Request) {
84100
httpapi.Write(ctx, rw, http.StatusOK, convertProvisionerKeys(pks))
85101
}
86102

103+
// @Summary Delete provisioner key
104+
// @ID delete-provisioner-key
105+
// @Security CoderSessionToken
106+
// @Produce json
107+
// @Tags Enterprise
108+
// @Param organization path string true "Organization ID"
109+
// @Param provisionerkey path string true "Provisioner key name"
110+
// @Success 204
111+
// @Router /organizations/{organization}/provisionerkey/{provisionerkey} [delete]
87112
func (api *API) deleteProvisionerKey(rw http.ResponseWriter, r *http.Request) {
88113
ctx := r.Context()
89114
organization := httpmw.OrganizationParam(r)

0 commit comments

Comments
 (0)