@@ -19,26 +19,26 @@ import (
19
19
logutil "kusionstack.io/kusion/pkg/server/util/logging"
20
20
)
21
21
22
- // @Id previewStackAsync
23
- // @Summary Asynchronously preview stack
24
- // @Description Start a run and asynchronously preview stack changes by stack ID
25
- // @Tags stack
26
- // @Produce json
27
- // @Param stack_id path int true "Stack ID"
28
- // @Param importedResources body request.StackImportRequest false "The resources to import during the stack preview"
29
- // @Param workspace query string true "The target workspace to preview the spec in."
30
- // @Param importResources query bool false "Import existing resources during the stack preview"
31
- // @Param output query string false "Output format. Choices are: json, default. Default to default output format in Kusion."
32
- // @Param detail query bool false "Show detailed output"
33
- // @Param specID query string false "The Spec ID to use for the preview. Default to the last one generated."
34
- // @Param force query bool false "Force the preview even when the stack is locked"
35
- // @Success 200 {object} entity.Run "Success"
36
- // @Failure 400 {object} error "Bad Request"
37
- // @Failure 401 {object} error "Unauthorized"
38
- // @Failure 429 {object} error "Too Many Requests"
39
- // @Failure 404 {object} error "Not Found"
40
- // @Failure 500 {object} error "Internal Server Error"
41
- // @Router /api/v1/stacks/{stack_id}/preview [post]
22
+ // @Id previewStackAsync
23
+ // @Summary Asynchronously preview stack
24
+ // @Description Start a run and asynchronously preview stack changes by stack ID
25
+ // @Tags stack
26
+ // @Produce json
27
+ // @Param stack_id path int true "Stack ID"
28
+ // @Param importedResources body request.StackImportRequest false "The resources to import during the stack preview"
29
+ // @Param workspace query string true "The target workspace to preview the spec in."
30
+ // @Param importResources query bool false "Import existing resources during the stack preview"
31
+ // @Param output query string false "Output format. Choices are: json, default. Default to default output format in Kusion."
32
+ // @Param detail query bool false "Show detailed output"
33
+ // @Param specID query string false "The Spec ID to use for the preview. Default to the last one generated."
34
+ // @Param force query bool false "Force the preview even when the stack is locked"
35
+ // @Success 200 {object} entity.Run "Success"
36
+ // @Failure 400 {object} error "Bad Request"
37
+ // @Failure 401 {object} error "Unauthorized"
38
+ // @Failure 429 {object} error "Too Many Requests"
39
+ // @Failure 404 {object} error "Not Found"
40
+ // @Failure 500 {object} error "Internal Server Error"
41
+ // @Router /api/v1/stacks/{stack_id}/preview [post]
42
42
func (h * Handler ) PreviewStackAsync () http.HandlerFunc {
43
43
return func (w http.ResponseWriter , r * http.Request ) {
44
44
// Getting stuff from context
@@ -124,25 +124,25 @@ func (h *Handler) PreviewStackAsync() http.HandlerFunc {
124
124
}
125
125
}
126
126
127
- // @Id applyStackAsync
128
- // @Summary Asynchronously apply stack
129
- // @Description Start a run and asynchronously apply stack changes by stack ID
130
- // @Tags stack
131
- // @Produce json
132
- // @Param stack_id path int true "Stack ID"
133
- // @Param importedResources body request.StackImportRequest false "The resources to import during the stack preview"
134
- // @Param workspace query string true "The target workspace to preview the spec in."
135
- // @Param importResources query bool false "Import existing resources during the stack preview"
136
- // @Param specID query string false "The Spec ID to use for the apply. Will generate a new spec if omitted."
137
- // @Param force query bool false "Force the apply even when the stack is locked. May cause concurrency issues!!!"
138
- // @Param dryrun query bool false "Apply in dry-run mode"
139
- // @Success 200 {object} entity.Run "Success"
140
- // @Failure 400 {object} error "Bad Request"
141
- // @Failure 401 {object} error "Unauthorized"
142
- // @Failure 429 {object} error "Too Many Requests"
143
- // @Failure 404 {object} error "Not Found"
144
- // @Failure 500 {object} error "Internal Server Error"
145
- // @Router /api/v1/stacks/{stack_id}/apply/async [post]
127
+ // @Id applyStackAsync
128
+ // @Summary Asynchronously apply stack
129
+ // @Description Start a run and asynchronously apply stack changes by stack ID
130
+ // @Tags stack
131
+ // @Produce json
132
+ // @Param stack_id path int true "Stack ID"
133
+ // @Param importedResources body request.StackImportRequest false "The resources to import during the stack preview"
134
+ // @Param workspace query string true "The target workspace to preview the spec in."
135
+ // @Param importResources query bool false "Import existing resources during the stack preview"
136
+ // @Param specID query string false "The Spec ID to use for the apply. Will generate a new spec if omitted."
137
+ // @Param force query bool false "Force the apply even when the stack is locked. May cause concurrency issues!!!"
138
+ // @Param dryrun query bool false "Apply in dry-run mode"
139
+ // @Success 200 {object} entity.Run "Success"
140
+ // @Failure 400 {object} error "Bad Request"
141
+ // @Failure 401 {object} error "Unauthorized"
142
+ // @Failure 429 {object} error "Too Many Requests"
143
+ // @Failure 404 {object} error "Not Found"
144
+ // @Failure 500 {object} error "Internal Server Error"
145
+ // @Router /api/v1/stacks/{stack_id}/apply/async [post]
146
146
func (h * Handler ) ApplyStackAsync () http.HandlerFunc {
147
147
return func (w http.ResponseWriter , r * http.Request ) {
148
148
// Getting stuff from context
@@ -229,22 +229,22 @@ func (h *Handler) ApplyStackAsync() http.HandlerFunc {
229
229
}
230
230
}
231
231
232
- // @Id generateStackAsync
233
- // @Summary Asynchronously generate stack
234
- // @Description Start a run and asynchronously generate stack spec by stack ID
235
- // @Tags stack
236
- // @Produce json
237
- // @Param stack_id path int true "Stack ID"
238
- // @Param workspace query string true "The target workspace to preview the spec in."
239
- // @Param format query string false "The format to generate the spec in. Choices are: spec. Default to spec."
240
- // @Param force query bool false "Force the generate even when the stack is locked"
241
- // @Success 200 {object} apiv1.Spec "Success"
242
- // @Failure 400 {object} error "Bad Request"
243
- // @Failure 401 {object} error "Unauthorized"
244
- // @Failure 429 {object} error "Too Many Requests"
245
- // @Failure 404 {object} error "Not Found"
246
- // @Failure 500 {object} error "Internal Server Error"
247
- // @Router /api/v1/stacks/{stack_id}/generate/async [post]
232
+ // @Id generateStackAsync
233
+ // @Summary Asynchronously generate stack
234
+ // @Description Start a run and asynchronously generate stack spec by stack ID
235
+ // @Tags stack
236
+ // @Produce json
237
+ // @Param stack_id path int true "Stack ID"
238
+ // @Param workspace query string true "The target workspace to preview the spec in."
239
+ // @Param format query string false "The format to generate the spec in. Choices are: spec. Default to spec."
240
+ // @Param force query bool false "Force the generate even when the stack is locked"
241
+ // @Success 200 {object} apiv1.Spec "Success"
242
+ // @Failure 400 {object} error "Bad Request"
243
+ // @Failure 401 {object} error "Unauthorized"
244
+ // @Failure 429 {object} error "Too Many Requests"
245
+ // @Failure 404 {object} error "Not Found"
246
+ // @Failure 500 {object} error "Internal Server Error"
247
+ // @Router /api/v1/stacks/{stack_id}/generate/async [post]
248
248
func (h * Handler ) GenerateStackAsync () http.HandlerFunc {
249
249
return func (w http.ResponseWriter , r * http.Request ) {
250
250
// Getting stuff from context
@@ -325,22 +325,22 @@ func (h *Handler) GenerateStackAsync() http.HandlerFunc {
325
325
}
326
326
}
327
327
328
- // @Id destroyStackAsync
329
- // @Summary Asynchronously destroy stack
330
- // @Description Start a run and asynchronously destroy stack resources by stack ID
331
- // @Tags stack
332
- // @Produce json
333
- // @Param stack_id path int true "Stack ID"
334
- // @Param workspace query string true "The target workspace to preview the spec in."
335
- // @Param force query bool false "Force the destroy even when the stack is locked. May cause concurrency issues!!!"
336
- // @Param dryrun query bool false "Destroy in dry-run mode"
337
- // @Success 200 {object} string "Success"
338
- // @Failure 400 {object} error "Bad Request"
339
- // @Failure 401 {object} error "Unauthorized"
340
- // @Failure 429 {object} error "Too Many Requests"
341
- // @Failure 404 {object} error "Not Found"
342
- // @Failure 500 {object} error "Internal Server Error"
343
- // @Router /api/v1/stacks/{stack_id}/destroy/async [post]
328
+ // @Id destroyStackAsync
329
+ // @Summary Asynchronously destroy stack
330
+ // @Description Start a run and asynchronously destroy stack resources by stack ID
331
+ // @Tags stack
332
+ // @Produce json
333
+ // @Param stack_id path int true "Stack ID"
334
+ // @Param workspace query string true "The target workspace to preview the spec in."
335
+ // @Param force query bool false "Force the destroy even when the stack is locked. May cause concurrency issues!!!"
336
+ // @Param dryrun query bool false "Destroy in dry-run mode"
337
+ // @Success 200 {object} string "Success"
338
+ // @Failure 400 {object} error "Bad Request"
339
+ // @Failure 401 {object} error "Unauthorized"
340
+ // @Failure 429 {object} error "Too Many Requests"
341
+ // @Failure 404 {object} error "Not Found"
342
+ // @Failure 500 {object} error "Internal Server Error"
343
+ // @Router /api/v1/stacks/{stack_id}/destroy/async [post]
344
344
func (h * Handler ) DestroyStackAsync () http.HandlerFunc {
345
345
return func (w http.ResponseWriter , r * http.Request ) {
346
346
// Getting stuff from context
0 commit comments