@@ -18,6 +18,7 @@ package job
18
18
19
19
import "d7y.io/dragonfly/v2/scheduler/resource"
20
20
21
+ // PreheatRequest defines the request parameters for preheating.
21
22
type PreheatRequest struct {
22
23
URL string `json:"url" validate:"required,url"`
23
24
Tag string `json:"tag" validate:"omitempty"`
@@ -29,17 +30,18 @@ type PreheatRequest struct {
29
30
PieceLength uint32 `json:"pieceLength" validate:"omitempty"`
30
31
}
31
32
33
+ // PreheatResponse defines the response parameters for preheating.
32
34
type PreheatResponse struct {
33
- TaskID string `json:"taskID "`
35
+ TaskID string `json:"task_id "`
34
36
}
35
37
36
- // ListTasksRequest defines the request parameters for listing tasks .
37
- type ListTasksRequest struct {
38
+ // GetTaskRequest defines the request parameters for getting task .
39
+ type GetTaskRequest struct {
38
40
TaskID string `json:"task_id" validate:"required"`
39
41
}
40
42
41
- // ListTasksResponse defines the response parameters for listing tasks .
42
- type ListTasksResponse struct {
43
+ // GetTaskResponse defines the response parameters for getting task .
44
+ type GetTaskResponse struct {
43
45
Peers []* resource.Peer `json:"peers"`
44
46
}
45
47
@@ -48,16 +50,14 @@ type DeleteTaskRequest struct {
48
50
TaskID string `json:"task_id" validate:"required"`
49
51
}
50
52
51
- // Task includes information about a task along with peer details and a description.
52
- type Task struct {
53
- Task * resource.Task `json:"task"`
54
- Peer * resource.Peer `json:"peer"`
55
- Description string `json:"description"`
53
+ // DeleteTaskResponse defines the response parameters for deleting task.
54
+ type DeleteTaskResponse struct {
55
+ SuccessPeers []* DeletePeerResponse `json:"success_peers"`
56
+ FailurePeers []* DeletePeerResponse `json:"failure_peers"`
56
57
}
57
58
58
- // DeleteTaskResponse represents the response after attempting to delete tasks,
59
- // categorizing them into successfully and unsuccessfully deleted.
60
- type DeleteTaskResponse struct {
61
- SuccessTasks []* Task `json:"success_tasks"`
62
- FailureTasks []* Task `json:"failure_tasks"`
59
+ // DeletePeerResponse represents the response after attempting to delete a peer.
60
+ type DeletePeerResponse struct {
61
+ Peer * resource.Peer `json:"peer"`
62
+ Description string `json:"description"`
63
63
}
0 commit comments