Skip to content

Commit 0b7cd14

Browse files
authored
feat(serverless_jobs): add state filter to list job runs (#2389)
1 parent feaab91 commit 0b7cd14

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

api/jobs/v1alpha1/jobs_sdk.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,9 @@ type ListJobRunsRequest struct {
522522
ProjectID *string `json:"-"`
523523

524524
OrganizationID *string `json:"-"`
525+
526+
// State: default value: unknown_state
527+
State JobRunState `json:"-"`
525528
}
526529

527530
// ListJobRunsResponse: list job runs response.
@@ -1145,6 +1148,7 @@ func (s *API) ListJobRuns(req *ListJobRunsRequest, opts ...scw.RequestOption) (*
11451148
parameter.AddToQuery(query, "job_definition_id", req.JobDefinitionID)
11461149
parameter.AddToQuery(query, "project_id", req.ProjectID)
11471150
parameter.AddToQuery(query, "organization_id", req.OrganizationID)
1151+
parameter.AddToQuery(query, "state", req.State)
11481152

11491153
if fmt.Sprint(req.Region) == "" {
11501154
return nil, errors.New("field Region cannot be empty in request")

0 commit comments

Comments
 (0)