* Add cmd/homerunner which supports creating/destroying HS images * Use blueprints instead of just HS images * Implement expiry and cleanup * Add ability to keep images created from blueprints * Add perf_many_messages with 7000 messages in one room * goimports * Add perf_many_rooms * Bump timers
29 lines
581 B
Go
29 lines
581 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/matrix-org/util"
|
|
)
|
|
|
|
type ReqDestroy struct {
|
|
BlueprintName string `json:"blueprint_name"`
|
|
}
|
|
|
|
type ResDestroy struct {
|
|
}
|
|
|
|
func RouteDestroy(ctx context.Context, rt *Runtime, rc *ReqDestroy) util.JSONResponse {
|
|
if rc.BlueprintName == "" {
|
|
return util.MessageResponse(400, "missing blueprint name")
|
|
}
|
|
err := rt.DestroyDeployment(rc.BlueprintName)
|
|
if err != nil {
|
|
return util.MessageResponse(500, fmt.Sprintf("failed to destroy deployment: %s", err))
|
|
}
|
|
return util.JSONResponse{
|
|
Code: 200,
|
|
JSON: ResDestroy{},
|
|
}
|
|
}
|