@@ -69,18 +69,71 @@ var apiInternal = []APIEndpoint{
69
69
internalWarningCreateCmd ,
70
70
}
71
71
72
+ // Daemon management internal commands.
73
+ var internalReadyCmd = APIEndpoint {
74
+ Path : "ready" ,
75
+
76
+ Get : APIEndpointAction {Handler : internalWaitReady , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
77
+ }
78
+
72
79
var internalShutdownCmd = APIEndpoint {
73
80
Path : "shutdown" ,
74
81
75
82
Put : APIEndpointAction {Handler : internalShutdown , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
76
83
}
77
84
78
- var internalReadyCmd = APIEndpoint {
79
- Path : "ready" ,
85
+ // Internal managemnt traffic.
86
+ var internalImageOptimizeCmd = APIEndpoint {
87
+ Path : "image-optimize" ,
80
88
81
- Get : APIEndpointAction {Handler : internalWaitReady , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
89
+ Post : APIEndpointAction {Handler : internalOptimizeImage , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
90
+ }
91
+
92
+ var internalRebalanceLoadCmd = APIEndpoint {
93
+ Path : "rebalance" ,
94
+
95
+ Get : APIEndpointAction {Handler : internalRebalanceLoad , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
96
+ }
97
+
98
+ var internalSQLCmd = APIEndpoint {
99
+ Path : "sql" ,
100
+
101
+ Get : APIEndpointAction {Handler : internalSQLGet , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
102
+ Post : APIEndpointAction {Handler : internalSQLPost , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
103
+ }
104
+
105
+ // Internal cluster traffic.
106
+ var internalClusterAcceptCmd = APIEndpoint {
107
+ Path : "cluster/accept" ,
108
+
109
+ Post : APIEndpointAction {Handler : internalClusterPostAccept , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
110
+ }
111
+
112
+ var internalClusterAssignCmd = APIEndpoint {
113
+ Path : "cluster/assign" ,
114
+
115
+ Post : APIEndpointAction {Handler : internalClusterPostAssign , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
116
+ }
117
+
118
+ var internalClusterHandoverCmd = APIEndpoint {
119
+ Path : "cluster/handover" ,
120
+
121
+ Post : APIEndpointAction {Handler : internalClusterPostHandover , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
82
122
}
83
123
124
+ var internalClusterRaftNodeCmd = APIEndpoint {
125
+ Path : "cluster/raft-node/{address}" ,
126
+
127
+ Delete : APIEndpointAction {Handler : internalClusterRaftNodeDelete , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
128
+ }
129
+
130
+ var internalClusterRebalanceCmd = APIEndpoint {
131
+ Path : "cluster/rebalance" ,
132
+
133
+ Post : APIEndpointAction {Handler : internalClusterPostRebalance , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
134
+ }
135
+
136
+ // Container hooks.
84
137
var internalContainerOnStartCmd = APIEndpoint {
85
138
Path : "containers/{instanceRef}/onstart" ,
86
139
@@ -99,61 +152,44 @@ var internalContainerOnStopCmd = APIEndpoint{
99
152
Get : APIEndpointAction {Handler : internalContainerOnStop , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
100
153
}
101
154
155
+ // Virtual machine hooks.
102
156
var internalVirtualMachineOnResizeCmd = APIEndpoint {
103
157
Path : "virtual-machines/{instanceRef}/onresize" ,
104
158
105
159
Get : APIEndpointAction {Handler : internalVirtualMachineOnResize , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
106
160
}
107
161
108
- var internalSQLCmd = APIEndpoint {
109
- Path : "sql" ,
162
+ // Debugging.
163
+ var internalBGPStateCmd = APIEndpoint {
164
+ Path : "debug/bgp" ,
110
165
111
- Get : APIEndpointAction {Handler : internalSQLGet , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
112
- Post : APIEndpointAction {Handler : internalSQLPost , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
166
+ Get : APIEndpointAction {Handler : internalBGPState , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
113
167
}
114
168
115
169
var internalGarbageCollectorCmd = APIEndpoint {
116
- Path : "gc" ,
170
+ Path : "debug/ gc" ,
117
171
118
172
Get : APIEndpointAction {Handler : internalGC , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
119
173
}
120
174
121
- var internalRAFTSnapshotCmd = APIEndpoint {
122
- Path : "raft-snapshot" ,
123
-
124
- Get : APIEndpointAction {Handler : internalRAFTSnapshot , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
125
- }
126
-
127
175
var internalImageRefreshCmd = APIEndpoint {
128
- Path : "testing /image-refresh" ,
176
+ Path : "debug /image-refresh" ,
129
177
130
178
Get : APIEndpointAction {Handler : internalRefreshImage , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
131
179
}
132
180
133
- var internalImageOptimizeCmd = APIEndpoint {
134
- Path : "image-optimize " ,
181
+ var internalRAFTSnapshotCmd = APIEndpoint {
182
+ Path : "debug/raft-snapshot " ,
135
183
136
- Post : APIEndpointAction {Handler : internalOptimizeImage , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
184
+ Get : APIEndpointAction {Handler : internalRAFTSnapshot , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
137
185
}
138
186
139
187
var internalWarningCreateCmd = APIEndpoint {
140
- Path : "testing /warnings" ,
188
+ Path : "debug /warnings" ,
141
189
142
190
Post : APIEndpointAction {Handler : internalCreateWarning , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
143
191
}
144
192
145
- var internalBGPStateCmd = APIEndpoint {
146
- Path : "testing/bgp" ,
147
-
148
- Get : APIEndpointAction {Handler : internalBGPState , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
149
- }
150
-
151
- var internalRebalanceLoadCmd = APIEndpoint {
152
- Path : "rebalance" ,
153
-
154
- Get : APIEndpointAction {Handler : internalRebalanceLoad , AccessHandler : allowPermission (auth .ObjectTypeServer , auth .EntitlementCanEdit )},
155
- }
156
-
157
193
type internalImageOptimizePost struct {
158
194
Image api.Image `json:"image" yaml:"image"`
159
195
Pool string `json:"pool" yaml:"pool"`
0 commit comments