Skip to content

feat: add DefaultFilteredQueryParams for job #3608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions api/manager/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4208,10 +4208,6 @@ const docTemplate = `{
"bio": {
"type": "string"
},
"result": {
"type": "object",
"additionalProperties": {}
},
"scheduler_cluster_ids": {
"type": "array",
"items": {
Expand Down
4 changes: 0 additions & 4 deletions api/manager/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -4202,10 +4202,6 @@
"bio": {
"type": "string"
},
"result": {
"type": "object",
"additionalProperties": {}
},
"scheduler_cluster_ids": {
"type": "array",
"items": {
Expand Down
3 changes: 0 additions & 3 deletions api/manager/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,6 @@ definitions:
type: object
bio:
type: string
result:
additionalProperties: {}
type: object
scheduler_cluster_ids:
items:
type: integer
Expand Down
13 changes: 13 additions & 0 deletions manager/service/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"d7y.io/dragonfly/v2/manager/metrics"
"d7y.io/dragonfly/v2/manager/models"
"d7y.io/dragonfly/v2/manager/types"
"d7y.io/dragonfly/v2/pkg/net/http"
"d7y.io/dragonfly/v2/pkg/retry"
"d7y.io/dragonfly/v2/pkg/slices"
"d7y.io/dragonfly/v2/pkg/structure"
Expand All @@ -46,6 +47,10 @@ func (s *service) CreatePreheatJob(ctx context.Context, json types.CreatePreheat
json.Args.Timeout = types.DefaultJobTimeout
}

if json.Args.FilteredQueryParams == "" {
json.Args.FilteredQueryParams = http.RawDefaultFilteredQueryParams
}

args, err := structure.StructToMap(json.Args)
if err != nil {
return nil, err
Expand Down Expand Up @@ -85,6 +90,10 @@ func (s *service) CreatePreheatJob(ctx context.Context, json types.CreatePreheat
}

func (s *service) CreateGetTaskJob(ctx context.Context, json types.CreateGetTaskJobRequest) (*models.Job, error) {
if json.Args.FilteredQueryParams == "" {
json.Args.FilteredQueryParams = http.RawDefaultFilteredQueryParams
}

args, err := structure.StructToMap(json.Args)
if err != nil {
return nil, err
Expand Down Expand Up @@ -128,6 +137,10 @@ func (s *service) CreateDeleteTaskJob(ctx context.Context, json types.CreateDele
json.Args.Timeout = types.DefaultJobTimeout
}

if json.Args.FilteredQueryParams == "" {
json.Args.FilteredQueryParams = http.RawDefaultFilteredQueryParams
}

args, err := structure.StructToMap(json.Args)
if err != nil {
return nil, err
Expand Down
74 changes: 0 additions & 74 deletions manager/types/model.go

This file was deleted.

87 changes: 0 additions & 87 deletions manager/types/model_test.go

This file was deleted.

39 changes: 0 additions & 39 deletions pkg/idgen/model_id.go

This file was deleted.

Loading
Loading