Skip to content

Commit 8500a9f

Browse files
committed
dashboard/dashapi: AI patching jobs
1 parent 280ea30 commit 8500a9f

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

dashboard/dashapi/dashapi.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,43 @@ type JobInfo struct {
988988
OnMergeBase bool
989989
}
990990

991+
type AIJobPollReq struct {
992+
Namespaces []string
993+
Workflows []AIWorkflow
994+
}
995+
996+
type AIWorkflow struct {
997+
Type AIWorkflowType
998+
Name string
999+
}
1000+
1001+
type AIWorkflowType string
1002+
1003+
const (
1004+
AIPatching AIWorkflowType = "patching"
1005+
)
1006+
1007+
type AIJobPollResp struct {
1008+
ID string
1009+
Workflow AIWorkflow
1010+
// ... bug info ...
1011+
}
1012+
1013+
type AIJobJournalReq struct {
1014+
JobID string
1015+
//!!! what to do with retried/duplicated entries
1016+
//!!! Attempt int?
1017+
// ... entry info
1018+
}
1019+
1020+
func (dash *Dashboard) AIJobPoll(req *AIJobPollReq) (*AIJobPollResp, error) {
1021+
resp := new(AIJobPollResp)
1022+
if err := dash.Query("ai_job_poll", req, resp); err != nil {
1023+
return nil, err
1024+
}
1025+
return resp, nil
1026+
}
1027+
9911028
func (dash *Dashboard) Query(method string, req, reply interface{}) error {
9921029
if dash.logger != nil {
9931030
dash.logger("API(%v): %#v", method, req)

0 commit comments

Comments
 (0)