mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 04:40:05 +01:00
feat: move jobs to action based
Signed-off-by: allanice001 <allanice001@gmail.com>
This commit is contained in:
256
internal/handlers/actions.go
Normal file
256
internal/handlers/actions.go
Normal file
@@ -0,0 +1,256 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/glueops/autoglue/internal/handlers/dto"
|
||||
"github.com/glueops/autoglue/internal/models"
|
||||
"github.com/glueops/autoglue/internal/utils"
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/google/uuid"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// ListActions godoc
|
||||
//
|
||||
// @ID ListActions
|
||||
// @Summary List available actions
|
||||
// @Description Returns all admin-configured actions.
|
||||
// @Tags Actions
|
||||
// @Produce json
|
||||
// @Success 200 {array} dto.ActionResponse
|
||||
// @Failure 401 {string} string "Unauthorized"
|
||||
// @Failure 500 {string} string "db error"
|
||||
// @Router /admin/actions [get]
|
||||
// @Security BearerAuth
|
||||
func ListActions(db *gorm.DB) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var rows []models.Action
|
||||
if err := db.Order("label ASC").Find(&rows).Error; err != nil {
|
||||
utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error")
|
||||
return
|
||||
}
|
||||
|
||||
out := make([]dto.ActionResponse, 0, len(rows))
|
||||
for _, a := range rows {
|
||||
out = append(out, actionToDTO(a))
|
||||
}
|
||||
utils.WriteJSON(w, http.StatusOK, out)
|
||||
}
|
||||
}
|
||||
|
||||
// GetAction godoc
|
||||
//
|
||||
// @ID GetAction
|
||||
// @Summary Get a single action by ID
|
||||
// @Description Returns a single action.
|
||||
// @Tags Actions
|
||||
// @Produce json
|
||||
// @Param actionID path string true "Action ID"
|
||||
// @Success 200 {object} dto.ActionResponse
|
||||
// @Failure 400 {string} string "bad request"
|
||||
// @Failure 401 {string} string "Unauthorized"
|
||||
// @Failure 404 {string} string "not found"
|
||||
// @Failure 500 {string} string "db error"
|
||||
// @Router /admin/actions/{actionID} [get]
|
||||
// @Security BearerAuth
|
||||
func GetAction(db *gorm.DB) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
actionID, err := uuid.Parse(chi.URLParam(r, "actionID"))
|
||||
if err != nil {
|
||||
utils.WriteError(w, http.StatusBadRequest, "bad_action_id", "invalid action id")
|
||||
return
|
||||
}
|
||||
|
||||
var row models.Action
|
||||
if err := db.Where("id = ?", actionID).First(&row).Error; err != nil {
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
utils.WriteError(w, http.StatusNotFound, "not_found", "action not found")
|
||||
return
|
||||
}
|
||||
utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error")
|
||||
return
|
||||
}
|
||||
utils.WriteJSON(w, http.StatusOK, actionToDTO(row))
|
||||
}
|
||||
}
|
||||
|
||||
// CreateAction godoc
|
||||
//
|
||||
// @ID CreateAction
|
||||
// @Summary Create an action
|
||||
// @Description Creates a new admin-configured action.
|
||||
// @Tags Actions
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body dto.CreateActionRequest true "payload"
|
||||
// @Success 201 {object} dto.ActionResponse
|
||||
// @Failure 400 {string} string "bad request"
|
||||
// @Failure 401 {string} string "Unauthorized"
|
||||
// @Failure 500 {string} string "db error"
|
||||
// @Router /admin/actions [post]
|
||||
// @Security BearerAuth
|
||||
func CreateAction(db *gorm.DB) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var in dto.CreateActionRequest
|
||||
if err := json.NewDecoder(r.Body).Decode(&in); err != nil {
|
||||
utils.WriteError(w, http.StatusBadRequest, "bad_json", err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
label := strings.TrimSpace(in.Label)
|
||||
desc := strings.TrimSpace(in.Description)
|
||||
target := strings.TrimSpace(in.MakeTarget)
|
||||
|
||||
if label == "" {
|
||||
utils.WriteError(w, http.StatusBadRequest, "validation_error", "label is required")
|
||||
return
|
||||
}
|
||||
if desc == "" {
|
||||
utils.WriteError(w, http.StatusBadRequest, "validation_error", "description is required")
|
||||
return
|
||||
}
|
||||
if target == "" {
|
||||
utils.WriteError(w, http.StatusBadRequest, "validation_error", "make_target is required")
|
||||
return
|
||||
}
|
||||
|
||||
row := models.Action{
|
||||
Label: label,
|
||||
Description: desc,
|
||||
MakeTarget: target,
|
||||
}
|
||||
|
||||
if err := db.Create(&row).Error; err != nil {
|
||||
utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error")
|
||||
return
|
||||
}
|
||||
utils.WriteJSON(w, http.StatusCreated, actionToDTO(row))
|
||||
}
|
||||
}
|
||||
|
||||
// UpdateAction godoc
|
||||
//
|
||||
// @ID UpdateAction
|
||||
// @Summary Update an action
|
||||
// @Description Updates an action. Only provided fields are modified.
|
||||
// @Tags Actions
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param actionID path string true "Action ID"
|
||||
// @Param body body dto.UpdateActionRequest true "payload"
|
||||
// @Success 200 {object} dto.ActionResponse
|
||||
// @Failure 400 {string} string "bad request"
|
||||
// @Failure 401 {string} string "Unauthorized"
|
||||
// @Failure 404 {string} string "not found"
|
||||
// @Failure 500 {string} string "db error"
|
||||
// @Router /admin/actions/{actionID} [patch]
|
||||
// @Security BearerAuth
|
||||
func UpdateAction(db *gorm.DB) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
actionID, err := uuid.Parse(chi.URLParam(r, "actionID"))
|
||||
if err != nil {
|
||||
utils.WriteError(w, http.StatusBadRequest, "bad_action_id", "invalid action id")
|
||||
return
|
||||
}
|
||||
|
||||
var in dto.UpdateActionRequest
|
||||
if err := json.NewDecoder(r.Body).Decode(&in); err != nil {
|
||||
utils.WriteError(w, http.StatusBadRequest, "bad_json", err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
var row models.Action
|
||||
if err := db.Where("id = ?", actionID).First(&row).Error; err != nil {
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
utils.WriteError(w, http.StatusNotFound, "not_found", "action not found")
|
||||
return
|
||||
}
|
||||
utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error")
|
||||
return
|
||||
}
|
||||
|
||||
if in.Label != nil {
|
||||
v := strings.TrimSpace(*in.Label)
|
||||
if v == "" {
|
||||
utils.WriteError(w, http.StatusBadRequest, "validation_error", "label cannot be empty")
|
||||
return
|
||||
}
|
||||
row.Label = v
|
||||
}
|
||||
if in.Description != nil {
|
||||
v := strings.TrimSpace(*in.Description)
|
||||
if v == "" {
|
||||
utils.WriteError(w, http.StatusBadRequest, "validation_error", "description cannot be empty")
|
||||
return
|
||||
}
|
||||
row.Description = v
|
||||
}
|
||||
if in.MakeTarget != nil {
|
||||
v := strings.TrimSpace(*in.MakeTarget)
|
||||
if v == "" {
|
||||
utils.WriteError(w, http.StatusBadRequest, "validation_error", "make_target cannot be empty")
|
||||
return
|
||||
}
|
||||
row.MakeTarget = v
|
||||
}
|
||||
|
||||
if err := db.Save(&row).Error; err != nil {
|
||||
utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error")
|
||||
return
|
||||
}
|
||||
|
||||
utils.WriteJSON(w, http.StatusOK, actionToDTO(row))
|
||||
}
|
||||
}
|
||||
|
||||
// DeleteAction godoc
|
||||
//
|
||||
// @ID DeleteAction
|
||||
// @Summary Delete an action
|
||||
// @Description Deletes an action.
|
||||
// @Tags Actions
|
||||
// @Produce json
|
||||
// @Param actionID path string true "Action ID"
|
||||
// @Success 204 {string} string "deleted"
|
||||
// @Failure 400 {string} string "bad request"
|
||||
// @Failure 401 {string} string "Unauthorized"
|
||||
// @Failure 404 {string} string "not found"
|
||||
// @Failure 500 {string} string "db error"
|
||||
// @Router /admin/actions/{actionID} [delete]
|
||||
// @Security BearerAuth
|
||||
func DeleteAction(db *gorm.DB) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
actionID, err := uuid.Parse(chi.URLParam(r, "actionID"))
|
||||
if err != nil {
|
||||
utils.WriteError(w, http.StatusBadRequest, "bad_action_id", "invalid action id")
|
||||
return
|
||||
}
|
||||
|
||||
tx := db.Where("id = ?", actionID).Delete(&models.Action{})
|
||||
if tx.Error != nil {
|
||||
utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error")
|
||||
return
|
||||
}
|
||||
if tx.RowsAffected == 0 {
|
||||
utils.WriteError(w, http.StatusNotFound, "not_found", "action not found")
|
||||
return
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
}
|
||||
}
|
||||
|
||||
func actionToDTO(a models.Action) dto.ActionResponse {
|
||||
return dto.ActionResponse{
|
||||
ID: a.ID,
|
||||
Label: a.Label,
|
||||
Description: a.Description,
|
||||
MakeTarget: a.MakeTarget,
|
||||
CreatedAt: a.CreatedAt,
|
||||
UpdatedAt: a.UpdatedAt,
|
||||
}
|
||||
}
|
||||
257
internal/handlers/cluster_runs.go
Normal file
257
internal/handlers/cluster_runs.go
Normal file
@@ -0,0 +1,257 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/dyaksa/archer"
|
||||
"github.com/glueops/autoglue/internal/api/httpmiddleware"
|
||||
"github.com/glueops/autoglue/internal/bg"
|
||||
"github.com/glueops/autoglue/internal/handlers/dto"
|
||||
"github.com/glueops/autoglue/internal/models"
|
||||
"github.com/glueops/autoglue/internal/utils"
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/google/uuid"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// ListClusterRuns godoc
|
||||
//
|
||||
// @ID ListClusterRuns
|
||||
// @Summary List cluster runs (org scoped)
|
||||
// @Description Returns runs for a cluster within the organization in X-Org-ID.
|
||||
// @Tags ClusterRuns
|
||||
// @Produce json
|
||||
// @Param X-Org-ID header string false "Organization UUID"
|
||||
// @Param clusterID path string true "Cluster ID"
|
||||
// @Success 200 {array} dto.ClusterRunResponse
|
||||
// @Failure 401 {string} string "Unauthorized"
|
||||
// @Failure 403 {string} string "organization required"
|
||||
// @Failure 404 {string} string "cluster not found"
|
||||
// @Failure 500 {string} string "db error"
|
||||
// @Router /clusters/{clusterID}/runs [get]
|
||||
// @Security BearerAuth
|
||||
// @Security OrgKeyAuth
|
||||
// @Security OrgSecretAuth
|
||||
func ListClusterRuns(db *gorm.DB) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
orgID, ok := httpmiddleware.OrgIDFrom(r.Context())
|
||||
if !ok {
|
||||
utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID")
|
||||
return
|
||||
}
|
||||
|
||||
clusterID, err := uuid.Parse(chi.URLParam(r, "clusterID"))
|
||||
if err != nil {
|
||||
utils.WriteError(w, http.StatusBadRequest, "bad_cluster_id", "invalid cluster id")
|
||||
return
|
||||
}
|
||||
|
||||
// Ensure cluster exists + org scoped
|
||||
if err := db.Select("id").
|
||||
Where("id = ? AND organization_id = ?", clusterID, orgID).
|
||||
First(&models.Cluster{}).Error; err != nil {
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
utils.WriteError(w, http.StatusNotFound, "not_found", "cluster not found")
|
||||
return
|
||||
}
|
||||
utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error")
|
||||
return
|
||||
}
|
||||
|
||||
var rows []models.ClusterRun
|
||||
if err := db.
|
||||
Where("organization_id = ? AND cluster_id = ?", orgID, clusterID).
|
||||
Order("created_at DESC").
|
||||
Find(&rows).Error; err != nil {
|
||||
utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error")
|
||||
return
|
||||
}
|
||||
|
||||
out := make([]dto.ClusterRunResponse, 0, len(rows))
|
||||
for _, cr := range rows {
|
||||
out = append(out, clusterRunToDTO(cr))
|
||||
}
|
||||
utils.WriteJSON(w, http.StatusOK, out)
|
||||
}
|
||||
}
|
||||
|
||||
// GetClusterRun godoc
|
||||
//
|
||||
// @ID GetClusterRun
|
||||
// @Summary Get a cluster run (org scoped)
|
||||
// @Description Returns a single run for a cluster within the organization in X-Org-ID.
|
||||
// @Tags ClusterRuns
|
||||
// @Produce json
|
||||
// @Param X-Org-ID header string false "Organization UUID"
|
||||
// @Param clusterID path string true "Cluster ID"
|
||||
// @Param runID path string true "Run ID"
|
||||
// @Success 200 {object} dto.ClusterRunResponse
|
||||
// @Failure 400 {string} string "bad request"
|
||||
// @Failure 401 {string} string "Unauthorized"
|
||||
// @Failure 403 {string} string "organization required"
|
||||
// @Failure 404 {string} string "not found"
|
||||
// @Failure 500 {string} string "db error"
|
||||
// @Router /clusters/{clusterID}/runs/{runID} [get]
|
||||
// @Security BearerAuth
|
||||
// @Security OrgKeyAuth
|
||||
// @Security OrgSecretAuth
|
||||
func GetClusterRun(db *gorm.DB) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
orgID, ok := httpmiddleware.OrgIDFrom(r.Context())
|
||||
if !ok {
|
||||
utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID")
|
||||
return
|
||||
}
|
||||
|
||||
clusterID, err := uuid.Parse(chi.URLParam(r, "clusterID"))
|
||||
if err != nil {
|
||||
utils.WriteError(w, http.StatusBadRequest, "bad_cluster_id", "invalid cluster id")
|
||||
return
|
||||
}
|
||||
|
||||
runID, err := uuid.Parse(chi.URLParam(r, "runID"))
|
||||
if err != nil {
|
||||
utils.WriteError(w, http.StatusBadRequest, "bad_run_id", "invalid run id")
|
||||
return
|
||||
}
|
||||
|
||||
var row models.ClusterRun
|
||||
if err := db.
|
||||
Where("id = ? AND organization_id = ? AND cluster_id = ?", runID, orgID, clusterID).
|
||||
First(&row).Error; err != nil {
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
utils.WriteError(w, http.StatusNotFound, "not_found", "run not found")
|
||||
return
|
||||
}
|
||||
utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error")
|
||||
return
|
||||
}
|
||||
|
||||
utils.WriteJSON(w, http.StatusOK, clusterRunToDTO(row))
|
||||
}
|
||||
}
|
||||
|
||||
// RunClusterAction godoc
|
||||
//
|
||||
// @ID RunClusterAction
|
||||
// @Summary Run an admin-configured action on a cluster (org scoped)
|
||||
// @Description Creates a ClusterRun record for the cluster/action. Execution is handled asynchronously by workers.
|
||||
// @Tags ClusterRuns
|
||||
// @Produce json
|
||||
// @Param X-Org-ID header string false "Organization UUID"
|
||||
// @Param clusterID path string true "Cluster ID"
|
||||
// @Param actionID path string true "Action ID"
|
||||
// @Success 201 {object} dto.ClusterRunResponse
|
||||
// @Failure 400 {string} string "bad request"
|
||||
// @Failure 401 {string} string "Unauthorized"
|
||||
// @Failure 403 {string} string "organization required"
|
||||
// @Failure 404 {string} string "cluster or action not found"
|
||||
// @Failure 500 {string} string "db error"
|
||||
// @Router /clusters/{clusterID}/actions/{actionID}/runs [post]
|
||||
// @Security BearerAuth
|
||||
// @Security OrgKeyAuth
|
||||
// @Security OrgSecretAuth
|
||||
func RunClusterAction(db *gorm.DB, jobs *bg.Jobs) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
orgID, ok := httpmiddleware.OrgIDFrom(r.Context())
|
||||
if !ok {
|
||||
utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID")
|
||||
return
|
||||
}
|
||||
|
||||
clusterID, err := uuid.Parse(chi.URLParam(r, "clusterID"))
|
||||
if err != nil {
|
||||
utils.WriteError(w, http.StatusBadRequest, "bad_cluster_id", "invalid cluster id")
|
||||
return
|
||||
}
|
||||
|
||||
actionID, err := uuid.Parse(chi.URLParam(r, "actionID"))
|
||||
if err != nil {
|
||||
utils.WriteError(w, http.StatusBadRequest, "bad_action_id", "invalid action id")
|
||||
return
|
||||
}
|
||||
|
||||
// cluster must exist + org scoped
|
||||
var cluster models.Cluster
|
||||
if err := db.Select("id", "organization_id").
|
||||
Where("id = ? AND organization_id = ?", clusterID, orgID).
|
||||
First(&cluster).Error; err != nil {
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
utils.WriteError(w, http.StatusNotFound, "not_found", "cluster not found")
|
||||
return
|
||||
}
|
||||
utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error")
|
||||
return
|
||||
}
|
||||
|
||||
// action is global/admin-configured (not org scoped)
|
||||
var action models.Action
|
||||
if err := db.Where("id = ?", actionID).First(&action).Error; err != nil {
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
utils.WriteError(w, http.StatusNotFound, "action_not_found", "action not found")
|
||||
return
|
||||
}
|
||||
utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error")
|
||||
return
|
||||
}
|
||||
|
||||
run := models.ClusterRun{
|
||||
OrganizationID: orgID,
|
||||
ClusterID: clusterID,
|
||||
Action: action.MakeTarget, // this is what you actually execute
|
||||
Status: models.ClusterRunStatusQueued,
|
||||
Error: "",
|
||||
FinishedAt: time.Time{},
|
||||
}
|
||||
|
||||
if err := db.Create(&run).Error; err != nil {
|
||||
utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error")
|
||||
return
|
||||
}
|
||||
|
||||
// Enqueue with run.ID as the job ID so the worker can look it up.
|
||||
_, enqueueErr := jobs.Enqueue(
|
||||
r.Context(),
|
||||
run.ID.String(),
|
||||
"cluster_action",
|
||||
bg.ClusterActionWorker,
|
||||
archer.WithMaxRetries(3),
|
||||
)
|
||||
|
||||
if enqueueErr != nil {
|
||||
_ = db.Model(&models.ClusterRun{}).
|
||||
Where("id = ?", run.ID).
|
||||
Updates(map[string]any{
|
||||
"status": models.ClusterRunStatusFailed,
|
||||
"error": "failed to enqueue job",
|
||||
"finished_at": time.Now().UTC(),
|
||||
}).Error
|
||||
|
||||
utils.WriteError(w, http.StatusInternalServerError, "job_error", "failed to enqueue cluster action")
|
||||
return
|
||||
}
|
||||
utils.WriteJSON(w, http.StatusCreated, clusterRunToDTO(run))
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
func clusterRunToDTO(cr models.ClusterRun) dto.ClusterRunResponse {
|
||||
var finished *time.Time
|
||||
if !cr.FinishedAt.IsZero() {
|
||||
t := cr.FinishedAt
|
||||
finished = &t
|
||||
}
|
||||
return dto.ClusterRunResponse{
|
||||
ID: cr.ID,
|
||||
OrganizationID: cr.OrganizationID,
|
||||
ClusterID: cr.ClusterID,
|
||||
Action: cr.Action,
|
||||
Status: cr.Status,
|
||||
Error: cr.Error,
|
||||
CreatedAt: cr.CreatedAt,
|
||||
UpdatedAt: cr.UpdatedAt,
|
||||
FinishedAt: finished,
|
||||
}
|
||||
}
|
||||
28
internal/handlers/dto/actions.go
Normal file
28
internal/handlers/dto/actions.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type ActionResponse struct {
|
||||
ID uuid.UUID `json:"id" format:"uuid"`
|
||||
Label string `json:"label"`
|
||||
Description string `json:"description"`
|
||||
MakeTarget string `json:"make_target"`
|
||||
CreatedAt time.Time `json:"created_at" format:"date-time"`
|
||||
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
|
||||
}
|
||||
|
||||
type CreateActionRequest struct {
|
||||
Label string `json:"label"`
|
||||
Description string `json:"description"`
|
||||
MakeTarget string `json:"make_target"`
|
||||
}
|
||||
|
||||
type UpdateActionRequest struct {
|
||||
Label *string `json:"label,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
MakeTarget *string `json:"make_target,omitempty"`
|
||||
}
|
||||
19
internal/handlers/dto/cluster_runs.go
Normal file
19
internal/handlers/dto/cluster_runs.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type ClusterRunResponse struct {
|
||||
ID uuid.UUID `json:"id" format:"uuid"`
|
||||
OrganizationID uuid.UUID `json:"organization_id" format:"uuid"`
|
||||
ClusterID uuid.UUID `json:"cluster_id" format:"uuid"`
|
||||
Action string `json:"action"`
|
||||
Status string `json:"status"`
|
||||
Error string `json:"error"`
|
||||
CreatedAt time.Time `json:"created_at" format:"date-time"`
|
||||
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
|
||||
FinishedAt *time.Time `json:"finished_at,omitempty" format:"date-time"`
|
||||
}
|
||||
Reference in New Issue
Block a user