Skip to content

Commit a371849

Browse files
committed
FEATURE: expose QueuePartition via HTTP API
1 parent 211771b commit a371849

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/server.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ type pipelinesScheduleRequest struct {
9090
// Job variables
9191
// example: {"tag_name": "v1.17.4", "databases": ["mysql", "postgresql"]}
9292
Variables map[string]interface{} `json:"variables"`
93+
94+
// for queue_strategy=partitioned_replace, the queue partition to use for this job
95+
// example: "tenant1"
96+
QueuePartition string `json:"queuePartition"`
9397
}
9498
}
9599

@@ -135,7 +139,7 @@ func (s *server) pipelinesSchedule(w http.ResponseWriter, r *http.Request) {
135139
return
136140
}
137141

138-
pJob, err := s.pRunner.ScheduleAsync(in.Body.Pipeline, prunner.ScheduleOpts{Variables: in.Body.Variables, User: user})
142+
pJob, err := s.pRunner.ScheduleAsync(in.Body.Pipeline, prunner.ScheduleOpts{Variables: in.Body.Variables, QueuePartition: in.Body.QueuePartition, User: user})
139143
if err != nil {
140144
// TODO Send JSON error and include expected errors (see resolveScheduleAction)
141145
if errors.Is(err, prunner.ErrShuttingDown) {

0 commit comments

Comments
 (0)