-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsession_schema.go
72 lines (63 loc) · 2.52 KB
/
session_schema.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
package livy
const (
StateNotStarted SessionState = "not_started"
StateStarting SessionState = "starting"
StateIdle SessionState = "idle"
StateBusy SessionState = "busy"
StateShuttingDown SessionState = "shutting_down"
StateError SessionState = "error"
StateDead SessionState = "dead"
StateSuccess SessionState = "success"
)
type SessionState string
// A session represents an interactive shell.
type Session struct {
ID int `json:"id"`
AppID string `json:"appId"`
Owner string `json:"owner"`
ProxyUser string `json:"proxyUser"`
Kind CodeKind `json:"kind"`
Log []string `json:"log"`
State SessionState `json:"state"`
AppInfo map[string]string `json:"appInfo"`
}
type StartSessionRequest struct {
Kind CodeKind `json:"kind,omitempty"`
ProxyUser string `json:"proxyUser,omitempty"`
Jars []string `json:"jars,omitempty"`
PyFiles []string `json:"pyFiles,omitempty"`
Files []string `json:"files,omitempty"`
DriverMemory string `json:"driverMemory,omitempty"`
DriverCores int `json:"driverCores,omitempty"`
ExecutorMemory string `json:"executorMemory,omitempty"`
ExecutorCores int `json:"executorCores,omitempty"`
NumExecutors int `json:"numExecutors,omitempty"`
Archives []string `json:"archives,omitempty"`
Queue string `json:"queue,omitempty"`
Name string `json:"name,omitempty"`
Conf map[string]string `json:"conf,omitempty"`
HeartbeatTimeoutInSecond int `json:"heartbeatTimeoutInSecond,omitempty"`
}
type GetSessionsRequest struct {
From int `json:"from,omitempty"`
Size int `json:"size,omitempty"`
}
type GetSessionsResponse struct {
From int `json:"from"`
Total int `json:"total"`
Sessions []Session `json:"sessions"`
}
type GetSessionStateResponse struct {
ID int `json:"id,omitempty"`
State SessionState `json:"state"`
}
type GetSessionLogsRequest struct {
From int `json:"from,omitempty"`
Size int `json:"size,omitempty"`
}
type GetSessionLogsResponse struct {
ID int `json:"id"`
From int `json:"from"`
Size int `json:"size"`
Log []string `json:"log"`
}