-
Notifications
You must be signed in to change notification settings - Fork 74
/
rpc.go
94 lines (72 loc) · 2.17 KB
/
rpc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package api
import (
"bytes"
"github.com/testground/testground/pkg/task"
)
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~ Request payloads ~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// DescribeRequest is the request struct for the `describe` function.
type DescribeRequest struct {
Term string `json:"term"`
}
// BuildRequest is the request struct for the `build` function.
type BuildRequest struct {
Priority int `json:"priority"`
Composition Composition `json:"composition"`
Manifest TestPlanManifest `json:"manifest"`
CreatedBy CreatedBy `json:"created_by"`
}
// RunRequest is the request struct for the `run` function.
type RunRequest struct {
Priority int `json:"priority"`
BuildGroups []int `json:"build_groups"`
RunIds []string `json:"run_ids"`
Composition Composition `json:"composition"`
Manifest TestPlanManifest `json:"manifest"`
CreatedBy CreatedBy `json:"created_by"`
}
type CreatedBy task.CreatedBy
type OutputsRequest struct {
Runner string `json:"runner"`
RunID string `json:"run_id"`
}
type TerminateRequest struct {
Runner string `json:"runner"`
Builder string `json:"builder"`
}
type HealthcheckRequest struct {
Runner string `json:"runner"`
Fix bool `json:"fix"`
}
type BuildPurgeRequest struct {
Builder string `json:"builder"`
Testplan string `json:"testplan"`
}
type TasksRequest = TasksFilters
type StatusRequest struct {
TaskID string `json:"task_id"`
}
type CancelRequest struct {
TaskID string `json:"task_id"`
}
type LogsRequest struct {
TaskID string `json:"task_id"`
Follow bool `json:"follow"`
// CancelWithContext indicates if the task should be cancelled
// on context cancellation.
CancelWithContext bool `json:"cancel_with_context"`
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~ Response payloads ~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// BuildResponse is the response struct for the `build` function.
type BuildResponse = []BuildOutput
type RunResponse = RunOutput
type CollectResponse struct {
File bytes.Buffer
Exists bool
}
type HealthcheckResponse = HealthcheckReport
type StatusResponse = task.Task
type LogsResponse = task.Task