root / src / Ganeti / OpCodes.hs @ f5b765f0
History | View | Annotate | Download (26.7 kB)
1 | 34af39e8 | Jose A. Lopes | {-# LANGUAGE ExistentialQuantification, TemplateHaskell #-} |
---|---|---|---|
2 | 34af39e8 | Jose A. Lopes | {-# OPTIONS_GHC -fno-warn-orphans #-} |
3 | e9aaa3c6 | Iustin Pop | |
4 | 702a4ee0 | Iustin Pop | {-| Implementation of the opcodes. |
5 | 702a4ee0 | Iustin Pop | |
6 | 702a4ee0 | Iustin Pop | -} |
7 | 702a4ee0 | Iustin Pop | |
8 | 702a4ee0 | Iustin Pop | {- |
9 | 702a4ee0 | Iustin Pop | |
10 | 551b44e2 | Iustin Pop | Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc. |
11 | 702a4ee0 | Iustin Pop | |
12 | 702a4ee0 | Iustin Pop | This program is free software; you can redistribute it and/or modify |
13 | 702a4ee0 | Iustin Pop | it under the terms of the GNU General Public License as published by |
14 | 702a4ee0 | Iustin Pop | the Free Software Foundation; either version 2 of the License, or |
15 | 702a4ee0 | Iustin Pop | (at your option) any later version. |
16 | 702a4ee0 | Iustin Pop | |
17 | 702a4ee0 | Iustin Pop | This program is distributed in the hope that it will be useful, but |
18 | 702a4ee0 | Iustin Pop | WITHOUT ANY WARRANTY; without even the implied warranty of |
19 | 702a4ee0 | Iustin Pop | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
20 | 702a4ee0 | Iustin Pop | General Public License for more details. |
21 | 702a4ee0 | Iustin Pop | |
22 | 702a4ee0 | Iustin Pop | You should have received a copy of the GNU General Public License |
23 | 702a4ee0 | Iustin Pop | along with this program; if not, write to the Free Software |
24 | 702a4ee0 | Iustin Pop | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
25 | 702a4ee0 | Iustin Pop | 02110-1301, USA. |
26 | 702a4ee0 | Iustin Pop | |
27 | 702a4ee0 | Iustin Pop | -} |
28 | 702a4ee0 | Iustin Pop | |
29 | 702a4ee0 | Iustin Pop | module Ganeti.OpCodes |
30 | 34af39e8 | Jose A. Lopes | ( pyClasses |
31 | 34af39e8 | Jose A. Lopes | , OpCode(..) |
32 | ebf38064 | Iustin Pop | , ReplaceDisksMode(..) |
33 | 4a1dc2bf | Iustin Pop | , DiskIndex |
34 | 4a1dc2bf | Iustin Pop | , mkDiskIndex |
35 | 4a1dc2bf | Iustin Pop | , unDiskIndex |
36 | ebf38064 | Iustin Pop | , opID |
37 | a583ec5d | Iustin Pop | , allOpIDs |
38 | 3929e782 | Iustin Pop | , allOpFields |
39 | ad1c1e41 | Iustin Pop | , opSummary |
40 | 4a826364 | Iustin Pop | , CommonOpParams(..) |
41 | 4a826364 | Iustin Pop | , defOpParams |
42 | 4a826364 | Iustin Pop | , MetaOpCode(..) |
43 | 62933497 | Klaus Aehlig | , resolveDependencies |
44 | 4a826364 | Iustin Pop | , wrapOpCode |
45 | 4a826364 | Iustin Pop | , setOpComment |
46 | 551b44e2 | Iustin Pop | , setOpPriority |
47 | ebf38064 | Iustin Pop | ) where |
48 | 702a4ee0 | Iustin Pop | |
49 | 34af39e8 | Jose A. Lopes | import Text.JSON (readJSON, JSObject, JSON, JSValue(..), makeObj, fromJSObject) |
50 | 4a826364 | Iustin Pop | import qualified Text.JSON |
51 | 702a4ee0 | Iustin Pop | |
52 | 12c19659 | Iustin Pop | import Ganeti.THH |
53 | e9aaa3c6 | Iustin Pop | |
54 | 34af39e8 | Jose A. Lopes | import qualified Ganeti.Hs2Py.OpDoc as OpDoc |
55 | 92f51573 | Iustin Pop | import Ganeti.OpParams |
56 | c4d68e39 | Jose A. Lopes | import Ganeti.PyValueInstances () |
57 | 34af39e8 | Jose A. Lopes | import Ganeti.Types |
58 | ad1c1e41 | Iustin Pop | import Ganeti.Query.Language (queryTypeOpToRaw) |
59 | 4a1dc2bf | Iustin Pop | |
60 | 34af39e8 | Jose A. Lopes | import Data.List (intercalate) |
61 | 34af39e8 | Jose A. Lopes | import Data.Map (Map) |
62 | 34af39e8 | Jose A. Lopes | |
63 | 34af39e8 | Jose A. Lopes | import qualified Ganeti.Constants as C |
64 | 34af39e8 | Jose A. Lopes | |
65 | 34af39e8 | Jose A. Lopes | instance PyValue DiskIndex where |
66 | 34af39e8 | Jose A. Lopes | showValue = showValue . unDiskIndex |
67 | 34af39e8 | Jose A. Lopes | |
68 | 34af39e8 | Jose A. Lopes | instance PyValue IDiskParams where |
69 | 34af39e8 | Jose A. Lopes | showValue _ = error "OpCodes.showValue(IDiskParams): unhandled case" |
70 | 34af39e8 | Jose A. Lopes | |
71 | 34af39e8 | Jose A. Lopes | instance PyValue RecreateDisksInfo where |
72 | 34af39e8 | Jose A. Lopes | showValue RecreateDisksAll = "[]" |
73 | 34af39e8 | Jose A. Lopes | showValue (RecreateDisksIndices is) = showValue is |
74 | 34af39e8 | Jose A. Lopes | showValue (RecreateDisksParams is) = showValue is |
75 | 34af39e8 | Jose A. Lopes | |
76 | 34af39e8 | Jose A. Lopes | instance PyValue a => PyValue (SetParamsMods a) where |
77 | 34af39e8 | Jose A. Lopes | showValue SetParamsEmpty = "[]" |
78 | 34af39e8 | Jose A. Lopes | showValue _ = error "OpCodes.showValue(SetParamsMods): unhandled case" |
79 | 34af39e8 | Jose A. Lopes | |
80 | 34af39e8 | Jose A. Lopes | instance PyValue a => PyValue (NonNegative a) where |
81 | 34af39e8 | Jose A. Lopes | showValue = showValue . fromNonNegative |
82 | f048c574 | Thomas Thrainer | |
83 | 34af39e8 | Jose A. Lopes | instance PyValue a => PyValue (NonEmpty a) where |
84 | 34af39e8 | Jose A. Lopes | showValue = showValue . fromNonEmpty |
85 | f048c574 | Thomas Thrainer | |
86 | 34af39e8 | Jose A. Lopes | -- FIXME: should use the 'toRaw' function instead of being harcoded or |
87 | 34af39e8 | Jose A. Lopes | -- perhaps use something similar to the NonNegative type instead of |
88 | 34af39e8 | Jose A. Lopes | -- using the declareSADT |
89 | 34af39e8 | Jose A. Lopes | instance PyValue ExportMode where |
90 | 34af39e8 | Jose A. Lopes | showValue ExportModeLocal = show C.exportModeLocal |
91 | 661c765b | Jose A. Lopes | showValue ExportModeRemote = show C.exportModeLocal |
92 | 34af39e8 | Jose A. Lopes | |
93 | 34af39e8 | Jose A. Lopes | instance PyValue CVErrorCode where |
94 | 34af39e8 | Jose A. Lopes | showValue = cVErrorCodeToRaw |
95 | 94d8fc5a | Jose A. Lopes | |
96 | 34af39e8 | Jose A. Lopes | instance PyValue VerifyOptionalChecks where |
97 | 34af39e8 | Jose A. Lopes | showValue = verifyOptionalChecksToRaw |
98 | 34af39e8 | Jose A. Lopes | |
99 | 34af39e8 | Jose A. Lopes | instance PyValue INicParams where |
100 | 34af39e8 | Jose A. Lopes | showValue = error "instance PyValue INicParams: not implemented" |
101 | 34af39e8 | Jose A. Lopes | |
102 | 34af39e8 | Jose A. Lopes | instance PyValue a => PyValue (JSObject a) where |
103 | 34af39e8 | Jose A. Lopes | showValue obj = |
104 | 34af39e8 | Jose A. Lopes | "{" ++ intercalate ", " (map showPair (fromJSObject obj)) ++ "}" |
105 | 34af39e8 | Jose A. Lopes | where showPair (k, v) = show k ++ ":" ++ showValue v |
106 | 34af39e8 | Jose A. Lopes | |
107 | 34af39e8 | Jose A. Lopes | instance PyValue JSValue where |
108 | 34af39e8 | Jose A. Lopes | showValue (JSObject obj) = showValue obj |
109 | 34af39e8 | Jose A. Lopes | showValue x = show x |
110 | 34af39e8 | Jose A. Lopes | |
111 | 34af39e8 | Jose A. Lopes | type JobIdListOnly = [(Bool, Either String JobId)] |
112 | 34af39e8 | Jose A. Lopes | |
113 | 34af39e8 | Jose A. Lopes | type InstanceMultiAllocResponse = |
114 | 34af39e8 | Jose A. Lopes | ([(Bool, Either String JobId)], NonEmptyString) |
115 | 34af39e8 | Jose A. Lopes | |
116 | 34af39e8 | Jose A. Lopes | type QueryFieldDef = |
117 | 34af39e8 | Jose A. Lopes | (NonEmptyString, NonEmptyString, TagKind, NonEmptyString) |
118 | 34af39e8 | Jose A. Lopes | |
119 | 34af39e8 | Jose A. Lopes | type QueryResponse = |
120 | 34af39e8 | Jose A. Lopes | ([QueryFieldDef], [[(QueryResultCode, JSValue)]]) |
121 | 34af39e8 | Jose A. Lopes | |
122 | 34af39e8 | Jose A. Lopes | type QueryFieldsResponse = [QueryFieldDef] |
123 | 34af39e8 | Jose A. Lopes | |
124 | 525bfb36 | Iustin Pop | -- | OpCode representation. |
125 | 525bfb36 | Iustin Pop | -- |
126 | 3bebda52 | Dato Simรณ | -- We only implement a subset of Ganeti opcodes: those which are actually used |
127 | 3bebda52 | Dato Simรณ | -- in the htools codebase. |
128 | 12c19659 | Iustin Pop | $(genOpCode "OpCode" |
129 | 34af39e8 | Jose A. Lopes | [ ("OpClusterPostInit", |
130 | 34af39e8 | Jose A. Lopes | [t| Bool |], |
131 | 34af39e8 | Jose A. Lopes | OpDoc.opClusterPostInit, |
132 | 34af39e8 | Jose A. Lopes | [], |
133 | 34af39e8 | Jose A. Lopes | []) |
134 | 34af39e8 | Jose A. Lopes | , ("OpClusterDestroy", |
135 | 34af39e8 | Jose A. Lopes | [t| NonEmptyString |], |
136 | 34af39e8 | Jose A. Lopes | OpDoc.opClusterDestroy, |
137 | 34af39e8 | Jose A. Lopes | [], |
138 | 34af39e8 | Jose A. Lopes | []) |
139 | 34af39e8 | Jose A. Lopes | , ("OpClusterQuery", |
140 | 34af39e8 | Jose A. Lopes | [t| JSObject JSValue |], |
141 | 34af39e8 | Jose A. Lopes | OpDoc.opClusterQuery, |
142 | 34af39e8 | Jose A. Lopes | [], |
143 | 34af39e8 | Jose A. Lopes | []) |
144 | c66f09f5 | Iustin Pop | , ("OpClusterVerify", |
145 | 34af39e8 | Jose A. Lopes | [t| JobIdListOnly |], |
146 | 34af39e8 | Jose A. Lopes | OpDoc.opClusterVerify, |
147 | c66f09f5 | Iustin Pop | [ pDebugSimulateErrors |
148 | c66f09f5 | Iustin Pop | , pErrorCodes |
149 | c66f09f5 | Iustin Pop | , pSkipChecks |
150 | c66f09f5 | Iustin Pop | , pIgnoreErrors |
151 | c66f09f5 | Iustin Pop | , pVerbose |
152 | c66f09f5 | Iustin Pop | , pOptGroupName |
153 | 34af39e8 | Jose A. Lopes | ], |
154 | 34af39e8 | Jose A. Lopes | []) |
155 | c66f09f5 | Iustin Pop | , ("OpClusterVerifyConfig", |
156 | 34af39e8 | Jose A. Lopes | [t| Bool |], |
157 | 34af39e8 | Jose A. Lopes | OpDoc.opClusterVerifyConfig, |
158 | c66f09f5 | Iustin Pop | [ pDebugSimulateErrors |
159 | c66f09f5 | Iustin Pop | , pErrorCodes |
160 | c66f09f5 | Iustin Pop | , pIgnoreErrors |
161 | c66f09f5 | Iustin Pop | , pVerbose |
162 | 34af39e8 | Jose A. Lopes | ], |
163 | 34af39e8 | Jose A. Lopes | []) |
164 | c66f09f5 | Iustin Pop | , ("OpClusterVerifyGroup", |
165 | 34af39e8 | Jose A. Lopes | [t| Bool |], |
166 | 34af39e8 | Jose A. Lopes | OpDoc.opClusterVerifyGroup, |
167 | c66f09f5 | Iustin Pop | [ pGroupName |
168 | c66f09f5 | Iustin Pop | , pDebugSimulateErrors |
169 | c66f09f5 | Iustin Pop | , pErrorCodes |
170 | c66f09f5 | Iustin Pop | , pSkipChecks |
171 | c66f09f5 | Iustin Pop | , pIgnoreErrors |
172 | c66f09f5 | Iustin Pop | , pVerbose |
173 | 34af39e8 | Jose A. Lopes | ], |
174 | 34af39e8 | Jose A. Lopes | "group_name") |
175 | 34af39e8 | Jose A. Lopes | , ("OpClusterVerifyDisks", |
176 | 34af39e8 | Jose A. Lopes | [t| JobIdListOnly |], |
177 | 34af39e8 | Jose A. Lopes | OpDoc.opClusterVerifyDisks, |
178 | 34af39e8 | Jose A. Lopes | [], |
179 | 34af39e8 | Jose A. Lopes | []) |
180 | c66f09f5 | Iustin Pop | , ("OpGroupVerifyDisks", |
181 | 34af39e8 | Jose A. Lopes | [t| (Map String String, [String], Map String [[String]]) |], |
182 | 34af39e8 | Jose A. Lopes | OpDoc.opGroupVerifyDisks, |
183 | c66f09f5 | Iustin Pop | [ pGroupName |
184 | 34af39e8 | Jose A. Lopes | ], |
185 | 34af39e8 | Jose A. Lopes | "group_name") |
186 | c66f09f5 | Iustin Pop | , ("OpClusterRepairDiskSizes", |
187 | 34af39e8 | Jose A. Lopes | [t| [(NonEmptyString, NonNegative Int, NonEmptyString, NonNegative Int)]|], |
188 | 34af39e8 | Jose A. Lopes | OpDoc.opClusterRepairDiskSizes, |
189 | c66f09f5 | Iustin Pop | [ pInstances |
190 | 34af39e8 | Jose A. Lopes | ], |
191 | 34af39e8 | Jose A. Lopes | []) |
192 | c66f09f5 | Iustin Pop | , ("OpClusterConfigQuery", |
193 | 34af39e8 | Jose A. Lopes | [t| [JSValue] |], |
194 | 34af39e8 | Jose A. Lopes | OpDoc.opClusterConfigQuery, |
195 | c66f09f5 | Iustin Pop | [ pOutputFields |
196 | 34af39e8 | Jose A. Lopes | ], |
197 | 34af39e8 | Jose A. Lopes | []) |
198 | c66f09f5 | Iustin Pop | , ("OpClusterRename", |
199 | 34af39e8 | Jose A. Lopes | [t| NonEmptyString |], |
200 | 34af39e8 | Jose A. Lopes | OpDoc.opClusterRename, |
201 | c66f09f5 | Iustin Pop | [ pName |
202 | 34af39e8 | Jose A. Lopes | ], |
203 | 34af39e8 | Jose A. Lopes | "name") |
204 | c66f09f5 | Iustin Pop | , ("OpClusterSetParams", |
205 | 34af39e8 | Jose A. Lopes | [t| () |], |
206 | 34af39e8 | Jose A. Lopes | OpDoc.opClusterSetParams, |
207 | e5c92cfb | Klaus Aehlig | [ pForce |
208 | e5c92cfb | Klaus Aehlig | , pHvState |
209 | c66f09f5 | Iustin Pop | , pDiskState |
210 | c66f09f5 | Iustin Pop | , pVgName |
211 | c66f09f5 | Iustin Pop | , pEnabledHypervisors |
212 | c66f09f5 | Iustin Pop | , pClusterHvParams |
213 | c66f09f5 | Iustin Pop | , pClusterBeParams |
214 | c66f09f5 | Iustin Pop | , pOsHvp |
215 | 6d558717 | Iustin Pop | , pClusterOsParams |
216 | c66f09f5 | Iustin Pop | , pDiskParams |
217 | c66f09f5 | Iustin Pop | , pCandidatePoolSize |
218 | c66f09f5 | Iustin Pop | , pUidPool |
219 | c66f09f5 | Iustin Pop | , pAddUids |
220 | c66f09f5 | Iustin Pop | , pRemoveUids |
221 | c66f09f5 | Iustin Pop | , pMaintainNodeHealth |
222 | c66f09f5 | Iustin Pop | , pPreallocWipeDisks |
223 | c66f09f5 | Iustin Pop | , pNicParams |
224 | 34af39e8 | Jose A. Lopes | , withDoc "Cluster-wide node parameter defaults" pNdParams |
225 | 34af39e8 | Jose A. Lopes | , withDoc "Cluster-wide ipolicy specs" pIpolicy |
226 | c66f09f5 | Iustin Pop | , pDrbdHelper |
227 | c66f09f5 | Iustin Pop | , pDefaultIAllocator |
228 | c66f09f5 | Iustin Pop | , pMasterNetdev |
229 | 67fc4de7 | Iustin Pop | , pMasterNetmask |
230 | c66f09f5 | Iustin Pop | , pReservedLvs |
231 | c66f09f5 | Iustin Pop | , pHiddenOs |
232 | c66f09f5 | Iustin Pop | , pBlacklistedOs |
233 | c66f09f5 | Iustin Pop | , pUseExternalMipScript |
234 | 66af5ec5 | Helga Velroyen | , pEnabledDiskTemplates |
235 | 75f2ff7d | Michele Tartara | , pModifyEtcHosts |
236 | 5ce621ab | Helga Velroyen | , pClusterFileStorageDir |
237 | 5ce621ab | Helga Velroyen | , pClusterSharedFileStorageDir |
238 | 34af39e8 | Jose A. Lopes | ], |
239 | 34af39e8 | Jose A. Lopes | []) |
240 | 34af39e8 | Jose A. Lopes | , ("OpClusterRedistConf", |
241 | 34af39e8 | Jose A. Lopes | [t| () |], |
242 | 34af39e8 | Jose A. Lopes | OpDoc.opClusterRedistConf, |
243 | 34af39e8 | Jose A. Lopes | [], |
244 | 34af39e8 | Jose A. Lopes | []) |
245 | 34af39e8 | Jose A. Lopes | , ("OpClusterActivateMasterIp", |
246 | 34af39e8 | Jose A. Lopes | [t| () |], |
247 | 34af39e8 | Jose A. Lopes | OpDoc.opClusterActivateMasterIp, |
248 | 34af39e8 | Jose A. Lopes | [], |
249 | 34af39e8 | Jose A. Lopes | []) |
250 | 34af39e8 | Jose A. Lopes | , ("OpClusterDeactivateMasterIp", |
251 | 34af39e8 | Jose A. Lopes | [t| () |], |
252 | 34af39e8 | Jose A. Lopes | OpDoc.opClusterDeactivateMasterIp, |
253 | 34af39e8 | Jose A. Lopes | [], |
254 | 34af39e8 | Jose A. Lopes | []) |
255 | c66f09f5 | Iustin Pop | , ("OpQuery", |
256 | 34af39e8 | Jose A. Lopes | [t| QueryResponse |], |
257 | 34af39e8 | Jose A. Lopes | OpDoc.opQuery, |
258 | c66f09f5 | Iustin Pop | [ pQueryWhat |
259 | c66f09f5 | Iustin Pop | , pUseLocking |
260 | c66f09f5 | Iustin Pop | , pQueryFields |
261 | c66f09f5 | Iustin Pop | , pQueryFilter |
262 | 34af39e8 | Jose A. Lopes | ], |
263 | 34af39e8 | Jose A. Lopes | "what") |
264 | c66f09f5 | Iustin Pop | , ("OpQueryFields", |
265 | 34af39e8 | Jose A. Lopes | [t| QueryFieldsResponse |], |
266 | 34af39e8 | Jose A. Lopes | OpDoc.opQueryFields, |
267 | c66f09f5 | Iustin Pop | [ pQueryWhat |
268 | 34af39e8 | Jose A. Lopes | , pQueryFieldsFields |
269 | 34af39e8 | Jose A. Lopes | ], |
270 | 34af39e8 | Jose A. Lopes | "what") |
271 | c66f09f5 | Iustin Pop | , ("OpOobCommand", |
272 | 34af39e8 | Jose A. Lopes | [t| [[(QueryResultCode, JSValue)]] |], |
273 | 34af39e8 | Jose A. Lopes | OpDoc.opOobCommand, |
274 | c66f09f5 | Iustin Pop | [ pNodeNames |
275 | 34af39e8 | Jose A. Lopes | , withDoc "List of node UUIDs to run the OOB command against" pNodeUuids |
276 | c66f09f5 | Iustin Pop | , pOobCommand |
277 | c66f09f5 | Iustin Pop | , pOobTimeout |
278 | c66f09f5 | Iustin Pop | , pIgnoreStatus |
279 | c66f09f5 | Iustin Pop | , pPowerDelay |
280 | 34af39e8 | Jose A. Lopes | ], |
281 | 34af39e8 | Jose A. Lopes | []) |
282 | 34af39e8 | Jose A. Lopes | , ("OpRestrictedCommand", |
283 | 34af39e8 | Jose A. Lopes | [t| [(Bool, String)] |], |
284 | 34af39e8 | Jose A. Lopes | OpDoc.opRestrictedCommand, |
285 | 34af39e8 | Jose A. Lopes | [ pUseLocking |
286 | 34af39e8 | Jose A. Lopes | , withDoc |
287 | 34af39e8 | Jose A. Lopes | "Nodes on which the command should be run (at least one)" |
288 | 34af39e8 | Jose A. Lopes | pRequiredNodes |
289 | 34af39e8 | Jose A. Lopes | , withDoc |
290 | 34af39e8 | Jose A. Lopes | "Node UUIDs on which the command should be run (at least one)" |
291 | 34af39e8 | Jose A. Lopes | pRequiredNodeUuids |
292 | 34af39e8 | Jose A. Lopes | , pRestrictedCommand |
293 | 34af39e8 | Jose A. Lopes | ], |
294 | 34af39e8 | Jose A. Lopes | []) |
295 | 1c3231aa | Thomas Thrainer | , ("OpNodeRemove", |
296 | 34af39e8 | Jose A. Lopes | [t| () |], |
297 | 34af39e8 | Jose A. Lopes | OpDoc.opNodeRemove, |
298 | 1c3231aa | Thomas Thrainer | [ pNodeName |
299 | 1c3231aa | Thomas Thrainer | , pNodeUuid |
300 | 34af39e8 | Jose A. Lopes | ], |
301 | 34af39e8 | Jose A. Lopes | "node_name") |
302 | c66f09f5 | Iustin Pop | , ("OpNodeAdd", |
303 | 34af39e8 | Jose A. Lopes | [t| () |], |
304 | 34af39e8 | Jose A. Lopes | OpDoc.opNodeAdd, |
305 | c66f09f5 | Iustin Pop | [ pNodeName |
306 | c66f09f5 | Iustin Pop | , pHvState |
307 | c66f09f5 | Iustin Pop | , pDiskState |
308 | c66f09f5 | Iustin Pop | , pPrimaryIp |
309 | c66f09f5 | Iustin Pop | , pSecondaryIp |
310 | c66f09f5 | Iustin Pop | , pReadd |
311 | c66f09f5 | Iustin Pop | , pNodeGroup |
312 | c66f09f5 | Iustin Pop | , pMasterCapable |
313 | c66f09f5 | Iustin Pop | , pVmCapable |
314 | c66f09f5 | Iustin Pop | , pNdParams |
315 | 34af39e8 | Jose A. Lopes | ], |
316 | 34af39e8 | Jose A. Lopes | "node_name") |
317 | c66f09f5 | Iustin Pop | , ("OpNodeQueryvols", |
318 | 34af39e8 | Jose A. Lopes | [t| [JSValue] |], |
319 | 34af39e8 | Jose A. Lopes | OpDoc.opNodeQueryvols, |
320 | c66f09f5 | Iustin Pop | [ pOutputFields |
321 | 34af39e8 | Jose A. Lopes | , withDoc "Empty list to query all nodes, node names otherwise" pNodes |
322 | 34af39e8 | Jose A. Lopes | ], |
323 | 34af39e8 | Jose A. Lopes | []) |
324 | c66f09f5 | Iustin Pop | , ("OpNodeQueryStorage", |
325 | 34af39e8 | Jose A. Lopes | [t| [[JSValue]] |], |
326 | 34af39e8 | Jose A. Lopes | OpDoc.opNodeQueryStorage, |
327 | c66f09f5 | Iustin Pop | [ pOutputFields |
328 | 4f90370c | Helga Velroyen | , pStorageTypeOptional |
329 | 34af39e8 | Jose A. Lopes | , withDoc |
330 | 34af39e8 | Jose A. Lopes | "Empty list to query all, list of names to query otherwise" |
331 | 34af39e8 | Jose A. Lopes | pNodes |
332 | c66f09f5 | Iustin Pop | , pStorageName |
333 | 34af39e8 | Jose A. Lopes | ], |
334 | 34af39e8 | Jose A. Lopes | []) |
335 | c66f09f5 | Iustin Pop | , ("OpNodeModifyStorage", |
336 | 34af39e8 | Jose A. Lopes | [t| () |], |
337 | 34af39e8 | Jose A. Lopes | OpDoc.opNodeModifyStorage, |
338 | c66f09f5 | Iustin Pop | [ pNodeName |
339 | 1c3231aa | Thomas Thrainer | , pNodeUuid |
340 | c66f09f5 | Iustin Pop | , pStorageType |
341 | c66f09f5 | Iustin Pop | , pStorageName |
342 | c66f09f5 | Iustin Pop | , pStorageChanges |
343 | 34af39e8 | Jose A. Lopes | ], |
344 | 34af39e8 | Jose A. Lopes | "node_name") |
345 | c66f09f5 | Iustin Pop | , ("OpRepairNodeStorage", |
346 | 34af39e8 | Jose A. Lopes | [t| () |], |
347 | 34af39e8 | Jose A. Lopes | OpDoc.opRepairNodeStorage, |
348 | c66f09f5 | Iustin Pop | [ pNodeName |
349 | 1c3231aa | Thomas Thrainer | , pNodeUuid |
350 | c66f09f5 | Iustin Pop | , pStorageType |
351 | c66f09f5 | Iustin Pop | , pStorageName |
352 | c66f09f5 | Iustin Pop | , pIgnoreConsistency |
353 | 34af39e8 | Jose A. Lopes | ], |
354 | 34af39e8 | Jose A. Lopes | "node_name") |
355 | c66f09f5 | Iustin Pop | , ("OpNodeSetParams", |
356 | 34af39e8 | Jose A. Lopes | [t| [(NonEmptyString, JSValue)] |], |
357 | 34af39e8 | Jose A. Lopes | OpDoc.opNodeSetParams, |
358 | c66f09f5 | Iustin Pop | [ pNodeName |
359 | 1c3231aa | Thomas Thrainer | , pNodeUuid |
360 | c66f09f5 | Iustin Pop | , pForce |
361 | c66f09f5 | Iustin Pop | , pHvState |
362 | c66f09f5 | Iustin Pop | , pDiskState |
363 | c66f09f5 | Iustin Pop | , pMasterCandidate |
364 | 34af39e8 | Jose A. Lopes | , withDoc "Whether to mark the node offline" pOffline |
365 | c66f09f5 | Iustin Pop | , pDrained |
366 | c66f09f5 | Iustin Pop | , pAutoPromote |
367 | c66f09f5 | Iustin Pop | , pMasterCapable |
368 | c66f09f5 | Iustin Pop | , pVmCapable |
369 | c66f09f5 | Iustin Pop | , pSecondaryIp |
370 | c66f09f5 | Iustin Pop | , pNdParams |
371 | 67fc4de7 | Iustin Pop | , pPowered |
372 | 34af39e8 | Jose A. Lopes | ], |
373 | 34af39e8 | Jose A. Lopes | "node_name") |
374 | c66f09f5 | Iustin Pop | , ("OpNodePowercycle", |
375 | 34af39e8 | Jose A. Lopes | [t| Maybe NonEmptyString |], |
376 | 34af39e8 | Jose A. Lopes | OpDoc.opNodePowercycle, |
377 | c66f09f5 | Iustin Pop | [ pNodeName |
378 | 1c3231aa | Thomas Thrainer | , pNodeUuid |
379 | c66f09f5 | Iustin Pop | , pForce |
380 | 34af39e8 | Jose A. Lopes | ], |
381 | 34af39e8 | Jose A. Lopes | "node_name") |
382 | c66f09f5 | Iustin Pop | , ("OpNodeMigrate", |
383 | 34af39e8 | Jose A. Lopes | [t| JobIdListOnly |], |
384 | 34af39e8 | Jose A. Lopes | OpDoc.opNodeMigrate, |
385 | c66f09f5 | Iustin Pop | [ pNodeName |
386 | 1c3231aa | Thomas Thrainer | , pNodeUuid |
387 | c66f09f5 | Iustin Pop | , pMigrationMode |
388 | c66f09f5 | Iustin Pop | , pMigrationLive |
389 | c66f09f5 | Iustin Pop | , pMigrationTargetNode |
390 | 1c3231aa | Thomas Thrainer | , pMigrationTargetNodeUuid |
391 | c66f09f5 | Iustin Pop | , pAllowRuntimeChgs |
392 | c66f09f5 | Iustin Pop | , pIgnoreIpolicy |
393 | c66f09f5 | Iustin Pop | , pIallocator |
394 | 34af39e8 | Jose A. Lopes | ], |
395 | 34af39e8 | Jose A. Lopes | "node_name") |
396 | c66f09f5 | Iustin Pop | , ("OpNodeEvacuate", |
397 | 34af39e8 | Jose A. Lopes | [t| JobIdListOnly |], |
398 | 34af39e8 | Jose A. Lopes | OpDoc.opNodeEvacuate, |
399 | c66f09f5 | Iustin Pop | [ pEarlyRelease |
400 | c66f09f5 | Iustin Pop | , pNodeName |
401 | 1c3231aa | Thomas Thrainer | , pNodeUuid |
402 | c66f09f5 | Iustin Pop | , pRemoteNode |
403 | 1c3231aa | Thomas Thrainer | , pRemoteNodeUuid |
404 | c66f09f5 | Iustin Pop | , pIallocator |
405 | c66f09f5 | Iustin Pop | , pEvacMode |
406 | 34af39e8 | Jose A. Lopes | ], |
407 | 34af39e8 | Jose A. Lopes | "node_name") |
408 | 6d558717 | Iustin Pop | , ("OpInstanceCreate", |
409 | 34af39e8 | Jose A. Lopes | [t| [NonEmptyString] |], |
410 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceCreate, |
411 | 6d558717 | Iustin Pop | [ pInstanceName |
412 | 6d558717 | Iustin Pop | , pForceVariant |
413 | 6d558717 | Iustin Pop | , pWaitForSync |
414 | 6d558717 | Iustin Pop | , pNameCheck |
415 | 6d558717 | Iustin Pop | , pIgnoreIpolicy |
416 | 34af39e8 | Jose A. Lopes | , pOpportunisticLocking |
417 | 6d558717 | Iustin Pop | , pInstBeParams |
418 | 6d558717 | Iustin Pop | , pInstDisks |
419 | 7b6996a8 | Thomas Thrainer | , pOptDiskTemplate |
420 | 6d558717 | Iustin Pop | , pFileDriver |
421 | 6d558717 | Iustin Pop | , pFileStorageDir |
422 | 6d558717 | Iustin Pop | , pInstHvParams |
423 | 6d558717 | Iustin Pop | , pHypervisor |
424 | 6d558717 | Iustin Pop | , pIallocator |
425 | 6d558717 | Iustin Pop | , pResetDefaults |
426 | 6d558717 | Iustin Pop | , pIpCheck |
427 | 6d558717 | Iustin Pop | , pIpConflictsCheck |
428 | 6d558717 | Iustin Pop | , pInstCreateMode |
429 | 6d558717 | Iustin Pop | , pInstNics |
430 | 6d558717 | Iustin Pop | , pNoInstall |
431 | 6d558717 | Iustin Pop | , pInstOsParams |
432 | 6d558717 | Iustin Pop | , pInstOs |
433 | 6d558717 | Iustin Pop | , pPrimaryNode |
434 | 1c3231aa | Thomas Thrainer | , pPrimaryNodeUuid |
435 | 6d558717 | Iustin Pop | , pSecondaryNode |
436 | 1c3231aa | Thomas Thrainer | , pSecondaryNodeUuid |
437 | 6d558717 | Iustin Pop | , pSourceHandshake |
438 | 6d558717 | Iustin Pop | , pSourceInstance |
439 | 6d558717 | Iustin Pop | , pSourceShutdownTimeout |
440 | 6d558717 | Iustin Pop | , pSourceX509Ca |
441 | 6d558717 | Iustin Pop | , pSrcNode |
442 | 1c3231aa | Thomas Thrainer | , pSrcNodeUuid |
443 | 6d558717 | Iustin Pop | , pSrcPath |
444 | 51d7ac96 | Thomas Thrainer | , pBackupCompress |
445 | 6d558717 | Iustin Pop | , pStartInstance |
446 | 6d558717 | Iustin Pop | , pInstTags |
447 | 34af39e8 | Jose A. Lopes | ], |
448 | 34af39e8 | Jose A. Lopes | "instance_name") |
449 | c2d3219b | Iustin Pop | , ("OpInstanceMultiAlloc", |
450 | 34af39e8 | Jose A. Lopes | [t| InstanceMultiAllocResponse |], |
451 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceMultiAlloc, |
452 | 34af39e8 | Jose A. Lopes | [ pOpportunisticLocking |
453 | 34af39e8 | Jose A. Lopes | , pIallocator |
454 | c2d3219b | Iustin Pop | , pMultiAllocInstances |
455 | 34af39e8 | Jose A. Lopes | ], |
456 | 34af39e8 | Jose A. Lopes | []) |
457 | c2d3219b | Iustin Pop | , ("OpInstanceReinstall", |
458 | 34af39e8 | Jose A. Lopes | [t| () |], |
459 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceReinstall, |
460 | c2d3219b | Iustin Pop | [ pInstanceName |
461 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
462 | c2d3219b | Iustin Pop | , pForceVariant |
463 | c2d3219b | Iustin Pop | , pInstOs |
464 | c2d3219b | Iustin Pop | , pTempOsParams |
465 | 34af39e8 | Jose A. Lopes | ], |
466 | 34af39e8 | Jose A. Lopes | "instance_name") |
467 | c2d3219b | Iustin Pop | , ("OpInstanceRemove", |
468 | 34af39e8 | Jose A. Lopes | [t| () |], |
469 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceRemove, |
470 | c2d3219b | Iustin Pop | [ pInstanceName |
471 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
472 | c2d3219b | Iustin Pop | , pShutdownTimeout |
473 | c2d3219b | Iustin Pop | , pIgnoreFailures |
474 | 34af39e8 | Jose A. Lopes | ], |
475 | 34af39e8 | Jose A. Lopes | "instance_name") |
476 | c2d3219b | Iustin Pop | , ("OpInstanceRename", |
477 | 34af39e8 | Jose A. Lopes | [t| NonEmptyString |], |
478 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceRename, |
479 | c2d3219b | Iustin Pop | [ pInstanceName |
480 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
481 | 34af39e8 | Jose A. Lopes | , withDoc "New instance name" pNewName |
482 | c2d3219b | Iustin Pop | , pNameCheck |
483 | c2d3219b | Iustin Pop | , pIpCheck |
484 | 34af39e8 | Jose A. Lopes | ], |
485 | 34af39e8 | Jose A. Lopes | []) |
486 | c2d3219b | Iustin Pop | , ("OpInstanceStartup", |
487 | 34af39e8 | Jose A. Lopes | [t| () |], |
488 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceStartup, |
489 | c2d3219b | Iustin Pop | [ pInstanceName |
490 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
491 | c2d3219b | Iustin Pop | , pForce |
492 | c2d3219b | Iustin Pop | , pIgnoreOfflineNodes |
493 | c2d3219b | Iustin Pop | , pTempHvParams |
494 | c2d3219b | Iustin Pop | , pTempBeParams |
495 | c2d3219b | Iustin Pop | , pNoRemember |
496 | c2d3219b | Iustin Pop | , pStartupPaused |
497 | 34af39e8 | Jose A. Lopes | ], |
498 | 34af39e8 | Jose A. Lopes | "instance_name") |
499 | c2d3219b | Iustin Pop | , ("OpInstanceShutdown", |
500 | 34af39e8 | Jose A. Lopes | [t| () |], |
501 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceShutdown, |
502 | c2d3219b | Iustin Pop | [ pInstanceName |
503 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
504 | 0d57ce24 | Guido Trotter | , pForce |
505 | c2d3219b | Iustin Pop | , pIgnoreOfflineNodes |
506 | 5cbf7832 | Jose A. Lopes | , pShutdownTimeout' |
507 | c2d3219b | Iustin Pop | , pNoRemember |
508 | 34af39e8 | Jose A. Lopes | ], |
509 | 34af39e8 | Jose A. Lopes | "instance_name") |
510 | c2d3219b | Iustin Pop | , ("OpInstanceReboot", |
511 | 34af39e8 | Jose A. Lopes | [t| () |], |
512 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceReboot, |
513 | c2d3219b | Iustin Pop | [ pInstanceName |
514 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
515 | c2d3219b | Iustin Pop | , pShutdownTimeout |
516 | c2d3219b | Iustin Pop | , pIgnoreSecondaries |
517 | c2d3219b | Iustin Pop | , pRebootType |
518 | 34af39e8 | Jose A. Lopes | ], |
519 | 34af39e8 | Jose A. Lopes | "instance_name") |
520 | 34af39e8 | Jose A. Lopes | , ("OpInstanceReplaceDisks", |
521 | 34af39e8 | Jose A. Lopes | [t| () |], |
522 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceReplaceDisks, |
523 | 34af39e8 | Jose A. Lopes | [ pInstanceName |
524 | 34af39e8 | Jose A. Lopes | , pInstanceUuid |
525 | 34af39e8 | Jose A. Lopes | , pEarlyRelease |
526 | 34af39e8 | Jose A. Lopes | , pIgnoreIpolicy |
527 | 34af39e8 | Jose A. Lopes | , pReplaceDisksMode |
528 | 34af39e8 | Jose A. Lopes | , pReplaceDisksList |
529 | 34af39e8 | Jose A. Lopes | , pRemoteNode |
530 | 34af39e8 | Jose A. Lopes | , pRemoteNodeUuid |
531 | 34af39e8 | Jose A. Lopes | , pIallocator |
532 | 34af39e8 | Jose A. Lopes | ], |
533 | 34af39e8 | Jose A. Lopes | "instance_name") |
534 | 34af39e8 | Jose A. Lopes | , ("OpInstanceFailover", |
535 | 34af39e8 | Jose A. Lopes | [t| () |], |
536 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceFailover, |
537 | 34af39e8 | Jose A. Lopes | [ pInstanceName |
538 | 34af39e8 | Jose A. Lopes | , pInstanceUuid |
539 | 34af39e8 | Jose A. Lopes | , pShutdownTimeout |
540 | 34af39e8 | Jose A. Lopes | , pIgnoreConsistency |
541 | 34af39e8 | Jose A. Lopes | , pMigrationTargetNode |
542 | 34af39e8 | Jose A. Lopes | , pMigrationTargetNodeUuid |
543 | 34af39e8 | Jose A. Lopes | , pIgnoreIpolicy |
544 | 1ca326c8 | Thomas Thrainer | , pMigrationCleanup |
545 | 34af39e8 | Jose A. Lopes | , pIallocator |
546 | 34af39e8 | Jose A. Lopes | ], |
547 | 34af39e8 | Jose A. Lopes | "instance_name") |
548 | 34af39e8 | Jose A. Lopes | , ("OpInstanceMigrate", |
549 | 34af39e8 | Jose A. Lopes | [t| () |], |
550 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceMigrate, |
551 | 34af39e8 | Jose A. Lopes | [ pInstanceName |
552 | 34af39e8 | Jose A. Lopes | , pInstanceUuid |
553 | 34af39e8 | Jose A. Lopes | , pMigrationMode |
554 | 34af39e8 | Jose A. Lopes | , pMigrationLive |
555 | 34af39e8 | Jose A. Lopes | , pMigrationTargetNode |
556 | 34af39e8 | Jose A. Lopes | , pMigrationTargetNodeUuid |
557 | 34af39e8 | Jose A. Lopes | , pAllowRuntimeChgs |
558 | 34af39e8 | Jose A. Lopes | , pIgnoreIpolicy |
559 | 34af39e8 | Jose A. Lopes | , pMigrationCleanup |
560 | 34af39e8 | Jose A. Lopes | , pIallocator |
561 | 34af39e8 | Jose A. Lopes | , pAllowFailover |
562 | 34af39e8 | Jose A. Lopes | ], |
563 | 34af39e8 | Jose A. Lopes | "instance_name") |
564 | c2d3219b | Iustin Pop | , ("OpInstanceMove", |
565 | 34af39e8 | Jose A. Lopes | [t| () |], |
566 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceMove, |
567 | c2d3219b | Iustin Pop | [ pInstanceName |
568 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
569 | c2d3219b | Iustin Pop | , pShutdownTimeout |
570 | c2d3219b | Iustin Pop | , pIgnoreIpolicy |
571 | c2d3219b | Iustin Pop | , pMoveTargetNode |
572 | 1c3231aa | Thomas Thrainer | , pMoveTargetNodeUuid |
573 | f198cf91 | Thomas Thrainer | , pMoveCompress |
574 | c2d3219b | Iustin Pop | , pIgnoreConsistency |
575 | 34af39e8 | Jose A. Lopes | ], |
576 | 34af39e8 | Jose A. Lopes | "instance_name") |
577 | c2d3219b | Iustin Pop | , ("OpInstanceConsole", |
578 | 34af39e8 | Jose A. Lopes | [t| JSObject JSValue |], |
579 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceConsole, |
580 | da4a52a3 | Thomas Thrainer | [ pInstanceName |
581 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
582 | 34af39e8 | Jose A. Lopes | ], |
583 | 34af39e8 | Jose A. Lopes | "instance_name") |
584 | c2d3219b | Iustin Pop | , ("OpInstanceActivateDisks", |
585 | 34af39e8 | Jose A. Lopes | [t| [(NonEmptyString, NonEmptyString, NonEmptyString)] |], |
586 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceActivateDisks, |
587 | c2d3219b | Iustin Pop | [ pInstanceName |
588 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
589 | c2d3219b | Iustin Pop | , pIgnoreDiskSize |
590 | c2d3219b | Iustin Pop | , pWaitForSyncFalse |
591 | 34af39e8 | Jose A. Lopes | ], |
592 | 34af39e8 | Jose A. Lopes | "instance_name") |
593 | c2d3219b | Iustin Pop | , ("OpInstanceDeactivateDisks", |
594 | 34af39e8 | Jose A. Lopes | [t| () |], |
595 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceDeactivateDisks, |
596 | c2d3219b | Iustin Pop | [ pInstanceName |
597 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
598 | c2d3219b | Iustin Pop | , pForce |
599 | 34af39e8 | Jose A. Lopes | ], |
600 | 34af39e8 | Jose A. Lopes | "instance_name") |
601 | c2d3219b | Iustin Pop | , ("OpInstanceRecreateDisks", |
602 | 34af39e8 | Jose A. Lopes | [t| () |], |
603 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceRecreateDisks, |
604 | c2d3219b | Iustin Pop | [ pInstanceName |
605 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
606 | c2d3219b | Iustin Pop | , pRecreateDisksInfo |
607 | 34af39e8 | Jose A. Lopes | , withDoc "New instance nodes, if relocation is desired" pNodes |
608 | 34af39e8 | Jose A. Lopes | , withDoc "New instance node UUIDs, if relocation is desired" pNodeUuids |
609 | c2d3219b | Iustin Pop | , pIallocator |
610 | 34af39e8 | Jose A. Lopes | ], |
611 | 34af39e8 | Jose A. Lopes | "instance_name") |
612 | c2d3219b | Iustin Pop | , ("OpInstanceQueryData", |
613 | 34af39e8 | Jose A. Lopes | [t| JSObject (JSObject JSValue) |], |
614 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceQueryData, |
615 | c2d3219b | Iustin Pop | [ pUseLocking |
616 | c2d3219b | Iustin Pop | , pInstances |
617 | c2d3219b | Iustin Pop | , pStatic |
618 | 34af39e8 | Jose A. Lopes | ], |
619 | 34af39e8 | Jose A. Lopes | []) |
620 | c2d3219b | Iustin Pop | , ("OpInstanceSetParams", |
621 | 34af39e8 | Jose A. Lopes | [t| [(NonEmptyString, JSValue)] |], |
622 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceSetParams, |
623 | c2d3219b | Iustin Pop | [ pInstanceName |
624 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
625 | c2d3219b | Iustin Pop | , pForce |
626 | c2d3219b | Iustin Pop | , pForceVariant |
627 | c2d3219b | Iustin Pop | , pIgnoreIpolicy |
628 | c2d3219b | Iustin Pop | , pInstParamsNicChanges |
629 | c2d3219b | Iustin Pop | , pInstParamsDiskChanges |
630 | c2d3219b | Iustin Pop | , pInstBeParams |
631 | c2d3219b | Iustin Pop | , pRuntimeMem |
632 | c2d3219b | Iustin Pop | , pInstHvParams |
633 | 88127c47 | Iustin Pop | , pOptDiskTemplate |
634 | d2204b1a | Klaus Aehlig | , pPrimaryNode |
635 | 1c3231aa | Thomas Thrainer | , pPrimaryNodeUuid |
636 | 34af39e8 | Jose A. Lopes | , withDoc "Secondary node (used when changing disk template)" pRemoteNode |
637 | 34af39e8 | Jose A. Lopes | , withDoc |
638 | 34af39e8 | Jose A. Lopes | "Secondary node UUID (used when changing disk template)" |
639 | 34af39e8 | Jose A. Lopes | pRemoteNodeUuid |
640 | c2d3219b | Iustin Pop | , pOsNameChange |
641 | c2d3219b | Iustin Pop | , pInstOsParams |
642 | c2d3219b | Iustin Pop | , pWaitForSync |
643 | 34af39e8 | Jose A. Lopes | , withDoc "Whether to mark the instance as offline" pOffline |
644 | c2d3219b | Iustin Pop | , pIpConflictsCheck |
645 | df58ca1c | Dimitris Aragiorgis | , pHotplug |
646 | 34af39e8 | Jose A. Lopes | ], |
647 | 34af39e8 | Jose A. Lopes | "instance_name") |
648 | c2d3219b | Iustin Pop | , ("OpInstanceGrowDisk", |
649 | 34af39e8 | Jose A. Lopes | [t| () |], |
650 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceGrowDisk, |
651 | c2d3219b | Iustin Pop | [ pInstanceName |
652 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
653 | c2d3219b | Iustin Pop | , pWaitForSync |
654 | c2d3219b | Iustin Pop | , pDiskIndex |
655 | c2d3219b | Iustin Pop | , pDiskChgAmount |
656 | c2d3219b | Iustin Pop | , pDiskChgAbsolute |
657 | 34af39e8 | Jose A. Lopes | ], |
658 | 34af39e8 | Jose A. Lopes | "instance_name") |
659 | c2d3219b | Iustin Pop | , ("OpInstanceChangeGroup", |
660 | 34af39e8 | Jose A. Lopes | [t| JobIdListOnly |], |
661 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceChangeGroup, |
662 | c2d3219b | Iustin Pop | [ pInstanceName |
663 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
664 | c2d3219b | Iustin Pop | , pEarlyRelease |
665 | c2d3219b | Iustin Pop | , pIallocator |
666 | c2d3219b | Iustin Pop | , pTargetGroups |
667 | 34af39e8 | Jose A. Lopes | ], |
668 | 34af39e8 | Jose A. Lopes | "instance_name") |
669 | 398e9066 | Iustin Pop | , ("OpGroupAdd", |
670 | 34af39e8 | Jose A. Lopes | [t| () |], |
671 | 34af39e8 | Jose A. Lopes | OpDoc.opGroupAdd, |
672 | 398e9066 | Iustin Pop | [ pGroupName |
673 | 398e9066 | Iustin Pop | , pNodeGroupAllocPolicy |
674 | 398e9066 | Iustin Pop | , pGroupNodeParams |
675 | 398e9066 | Iustin Pop | , pDiskParams |
676 | 398e9066 | Iustin Pop | , pHvState |
677 | 398e9066 | Iustin Pop | , pDiskState |
678 | 34af39e8 | Jose A. Lopes | , withDoc "Group-wide ipolicy specs" pIpolicy |
679 | 34af39e8 | Jose A. Lopes | ], |
680 | 34af39e8 | Jose A. Lopes | "group_name") |
681 | 398e9066 | Iustin Pop | , ("OpGroupAssignNodes", |
682 | 34af39e8 | Jose A. Lopes | [t| () |], |
683 | 34af39e8 | Jose A. Lopes | OpDoc.opGroupAssignNodes, |
684 | 398e9066 | Iustin Pop | [ pGroupName |
685 | 398e9066 | Iustin Pop | , pForce |
686 | 34af39e8 | Jose A. Lopes | , withDoc "List of nodes to assign" pRequiredNodes |
687 | 34af39e8 | Jose A. Lopes | , withDoc "List of node UUIDs to assign" pRequiredNodeUuids |
688 | 34af39e8 | Jose A. Lopes | ], |
689 | 34af39e8 | Jose A. Lopes | "group_name") |
690 | 398e9066 | Iustin Pop | , ("OpGroupSetParams", |
691 | 34af39e8 | Jose A. Lopes | [t| [(NonEmptyString, JSValue)] |], |
692 | 34af39e8 | Jose A. Lopes | OpDoc.opGroupSetParams, |
693 | 398e9066 | Iustin Pop | [ pGroupName |
694 | 398e9066 | Iustin Pop | , pNodeGroupAllocPolicy |
695 | 398e9066 | Iustin Pop | , pGroupNodeParams |
696 | 398e9066 | Iustin Pop | , pDiskParams |
697 | 398e9066 | Iustin Pop | , pHvState |
698 | 398e9066 | Iustin Pop | , pDiskState |
699 | 34af39e8 | Jose A. Lopes | , withDoc "Group-wide ipolicy specs" pIpolicy |
700 | 34af39e8 | Jose A. Lopes | ], |
701 | 34af39e8 | Jose A. Lopes | "group_name") |
702 | 398e9066 | Iustin Pop | , ("OpGroupRemove", |
703 | 34af39e8 | Jose A. Lopes | [t| () |], |
704 | 34af39e8 | Jose A. Lopes | OpDoc.opGroupRemove, |
705 | 34af39e8 | Jose A. Lopes | [ pGroupName |
706 | 34af39e8 | Jose A. Lopes | ], |
707 | 34af39e8 | Jose A. Lopes | "group_name") |
708 | 398e9066 | Iustin Pop | , ("OpGroupRename", |
709 | 34af39e8 | Jose A. Lopes | [t| NonEmptyString |], |
710 | 34af39e8 | Jose A. Lopes | OpDoc.opGroupRename, |
711 | 398e9066 | Iustin Pop | [ pGroupName |
712 | 34af39e8 | Jose A. Lopes | , withDoc "New group name" pNewName |
713 | 34af39e8 | Jose A. Lopes | ], |
714 | 34af39e8 | Jose A. Lopes | []) |
715 | 398e9066 | Iustin Pop | , ("OpGroupEvacuate", |
716 | 34af39e8 | Jose A. Lopes | [t| JobIdListOnly |], |
717 | 34af39e8 | Jose A. Lopes | OpDoc.opGroupEvacuate, |
718 | 398e9066 | Iustin Pop | [ pGroupName |
719 | 398e9066 | Iustin Pop | , pEarlyRelease |
720 | 398e9066 | Iustin Pop | , pIallocator |
721 | 398e9066 | Iustin Pop | , pTargetGroups |
722 | 34af39e8 | Jose A. Lopes | ], |
723 | 34af39e8 | Jose A. Lopes | "group_name") |
724 | 398e9066 | Iustin Pop | , ("OpOsDiagnose", |
725 | 34af39e8 | Jose A. Lopes | [t| [[JSValue]] |], |
726 | 34af39e8 | Jose A. Lopes | OpDoc.opOsDiagnose, |
727 | 398e9066 | Iustin Pop | [ pOutputFields |
728 | 34af39e8 | Jose A. Lopes | , withDoc "Which operating systems to diagnose" pNames |
729 | 34af39e8 | Jose A. Lopes | ], |
730 | 34af39e8 | Jose A. Lopes | []) |
731 | b954f097 | Constantinos Venetsanopoulos | , ("OpExtStorageDiagnose", |
732 | 34af39e8 | Jose A. Lopes | [t| [[JSValue]] |], |
733 | 34af39e8 | Jose A. Lopes | OpDoc.opExtStorageDiagnose, |
734 | b954f097 | Constantinos Venetsanopoulos | [ pOutputFields |
735 | 34af39e8 | Jose A. Lopes | , withDoc "Which ExtStorage Provider to diagnose" pNames |
736 | 34af39e8 | Jose A. Lopes | ], |
737 | 34af39e8 | Jose A. Lopes | []) |
738 | 398e9066 | Iustin Pop | , ("OpBackupPrepare", |
739 | 34af39e8 | Jose A. Lopes | [t| Maybe (JSObject JSValue) |], |
740 | 34af39e8 | Jose A. Lopes | OpDoc.opBackupPrepare, |
741 | 398e9066 | Iustin Pop | [ pInstanceName |
742 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
743 | 398e9066 | Iustin Pop | , pExportMode |
744 | 34af39e8 | Jose A. Lopes | ], |
745 | 34af39e8 | Jose A. Lopes | "instance_name") |
746 | 398e9066 | Iustin Pop | , ("OpBackupExport", |
747 | 34af39e8 | Jose A. Lopes | [t| (Bool, [Bool]) |], |
748 | 34af39e8 | Jose A. Lopes | OpDoc.opBackupExport, |
749 | 398e9066 | Iustin Pop | [ pInstanceName |
750 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
751 | 896cc964 | Thomas Thrainer | , pBackupCompress |
752 | 398e9066 | Iustin Pop | , pShutdownTimeout |
753 | 398e9066 | Iustin Pop | , pExportTargetNode |
754 | 1c3231aa | Thomas Thrainer | , pExportTargetNodeUuid |
755 | 67fc4de7 | Iustin Pop | , pShutdownInstance |
756 | 398e9066 | Iustin Pop | , pRemoveInstance |
757 | 398e9066 | Iustin Pop | , pIgnoreRemoveFailures |
758 | 34af39e8 | Jose A. Lopes | , defaultField [| ExportModeLocal |] pExportMode |
759 | 398e9066 | Iustin Pop | , pX509KeyName |
760 | 398e9066 | Iustin Pop | , pX509DestCA |
761 | 34af39e8 | Jose A. Lopes | ], |
762 | 34af39e8 | Jose A. Lopes | "instance_name") |
763 | 398e9066 | Iustin Pop | , ("OpBackupRemove", |
764 | 34af39e8 | Jose A. Lopes | [t| () |], |
765 | 34af39e8 | Jose A. Lopes | OpDoc.opBackupRemove, |
766 | da4a52a3 | Thomas Thrainer | [ pInstanceName |
767 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
768 | 34af39e8 | Jose A. Lopes | ], |
769 | 34af39e8 | Jose A. Lopes | "instance_name") |
770 | 34af39e8 | Jose A. Lopes | , ("OpTagsGet", |
771 | 34af39e8 | Jose A. Lopes | [t| [NonEmptyString] |], |
772 | 34af39e8 | Jose A. Lopes | OpDoc.opTagsGet, |
773 | 34af39e8 | Jose A. Lopes | [ pTagsObject |
774 | 34af39e8 | Jose A. Lopes | , pUseLocking |
775 | 34af39e8 | Jose A. Lopes | , withDoc "Name of object to retrieve tags from" pTagsName |
776 | 34af39e8 | Jose A. Lopes | ], |
777 | 34af39e8 | Jose A. Lopes | "name") |
778 | 34af39e8 | Jose A. Lopes | , ("OpTagsSearch", |
779 | 34af39e8 | Jose A. Lopes | [t| [(NonEmptyString, NonEmptyString)] |], |
780 | 34af39e8 | Jose A. Lopes | OpDoc.opTagsSearch, |
781 | 34af39e8 | Jose A. Lopes | [ pTagSearchPattern |
782 | 34af39e8 | Jose A. Lopes | ], |
783 | 34af39e8 | Jose A. Lopes | "pattern") |
784 | 34af39e8 | Jose A. Lopes | , ("OpTagsSet", |
785 | 34af39e8 | Jose A. Lopes | [t| () |], |
786 | 34af39e8 | Jose A. Lopes | OpDoc.opTagsSet, |
787 | 34af39e8 | Jose A. Lopes | [ pTagsObject |
788 | 34af39e8 | Jose A. Lopes | , pTagsList |
789 | 34af39e8 | Jose A. Lopes | , withDoc "Name of object where tag(s) should be added" pTagsName |
790 | 34af39e8 | Jose A. Lopes | ], |
791 | 34af39e8 | Jose A. Lopes | []) |
792 | 34af39e8 | Jose A. Lopes | , ("OpTagsDel", |
793 | 34af39e8 | Jose A. Lopes | [t| () |], |
794 | 34af39e8 | Jose A. Lopes | OpDoc.opTagsDel, |
795 | 34af39e8 | Jose A. Lopes | [ pTagsObject |
796 | 34af39e8 | Jose A. Lopes | , pTagsList |
797 | 34af39e8 | Jose A. Lopes | , withDoc "Name of object where tag(s) should be deleted" pTagsName |
798 | 34af39e8 | Jose A. Lopes | ], |
799 | 34af39e8 | Jose A. Lopes | []) |
800 | 34af39e8 | Jose A. Lopes | , ("OpTestDelay", |
801 | 34af39e8 | Jose A. Lopes | [t| () |], |
802 | 34af39e8 | Jose A. Lopes | OpDoc.opTestDelay, |
803 | 34af39e8 | Jose A. Lopes | [ pDelayDuration |
804 | 34af39e8 | Jose A. Lopes | , pDelayOnMaster |
805 | 34af39e8 | Jose A. Lopes | , pDelayOnNodes |
806 | 34af39e8 | Jose A. Lopes | , pDelayOnNodeUuids |
807 | 34af39e8 | Jose A. Lopes | , pDelayRepeat |
808 | 34af39e8 | Jose A. Lopes | ], |
809 | 34af39e8 | Jose A. Lopes | "duration") |
810 | a3f02317 | Iustin Pop | , ("OpTestAllocator", |
811 | 5cbf7832 | Jose A. Lopes | [t| String |], |
812 | 34af39e8 | Jose A. Lopes | OpDoc.opTestAllocator, |
813 | a3f02317 | Iustin Pop | [ pIAllocatorDirection |
814 | a3f02317 | Iustin Pop | , pIAllocatorMode |
815 | a3f02317 | Iustin Pop | , pIAllocatorReqName |
816 | a3f02317 | Iustin Pop | , pIAllocatorNics |
817 | a3f02317 | Iustin Pop | , pIAllocatorDisks |
818 | a3f02317 | Iustin Pop | , pHypervisor |
819 | a3f02317 | Iustin Pop | , pIallocator |
820 | a3f02317 | Iustin Pop | , pInstTags |
821 | a3f02317 | Iustin Pop | , pIAllocatorMemory |
822 | a3f02317 | Iustin Pop | , pIAllocatorVCpus |
823 | a3f02317 | Iustin Pop | , pIAllocatorOs |
824 | a3f02317 | Iustin Pop | , pDiskTemplate |
825 | a3f02317 | Iustin Pop | , pIAllocatorInstances |
826 | a3f02317 | Iustin Pop | , pIAllocatorEvacMode |
827 | a3f02317 | Iustin Pop | , pTargetGroups |
828 | a3f02317 | Iustin Pop | , pIAllocatorSpindleUse |
829 | a3f02317 | Iustin Pop | , pIAllocatorCount |
830 | 34af39e8 | Jose A. Lopes | ], |
831 | 34af39e8 | Jose A. Lopes | "iallocator") |
832 | a3f02317 | Iustin Pop | , ("OpTestJqueue", |
833 | 5cbf7832 | Jose A. Lopes | [t| Bool |], |
834 | 34af39e8 | Jose A. Lopes | OpDoc.opTestJqueue, |
835 | a3f02317 | Iustin Pop | [ pJQueueNotifyWaitLock |
836 | a3f02317 | Iustin Pop | , pJQueueNotifyExec |
837 | a3f02317 | Iustin Pop | , pJQueueLogMessages |
838 | a3f02317 | Iustin Pop | , pJQueueFail |
839 | 34af39e8 | Jose A. Lopes | ], |
840 | 34af39e8 | Jose A. Lopes | []) |
841 | a3f02317 | Iustin Pop | , ("OpTestDummy", |
842 | 34af39e8 | Jose A. Lopes | [t| () |], |
843 | 34af39e8 | Jose A. Lopes | OpDoc.opTestDummy, |
844 | a3f02317 | Iustin Pop | [ pTestDummyResult |
845 | a3f02317 | Iustin Pop | , pTestDummyMessages |
846 | a3f02317 | Iustin Pop | , pTestDummyFail |
847 | a3f02317 | Iustin Pop | , pTestDummySubmitJobs |
848 | 34af39e8 | Jose A. Lopes | ], |
849 | 34af39e8 | Jose A. Lopes | []) |
850 | 8d239fa4 | Iustin Pop | , ("OpNetworkAdd", |
851 | 34af39e8 | Jose A. Lopes | [t| () |], |
852 | 34af39e8 | Jose A. Lopes | OpDoc.opNetworkAdd, |
853 | 8d239fa4 | Iustin Pop | [ pNetworkName |
854 | 8d239fa4 | Iustin Pop | , pNetworkAddress4 |
855 | 8d239fa4 | Iustin Pop | , pNetworkGateway4 |
856 | 8d239fa4 | Iustin Pop | , pNetworkAddress6 |
857 | 8d239fa4 | Iustin Pop | , pNetworkGateway6 |
858 | 8d239fa4 | Iustin Pop | , pNetworkMacPrefix |
859 | 8d239fa4 | Iustin Pop | , pNetworkAddRsvdIps |
860 | 1dbceab9 | Iustin Pop | , pIpConflictsCheck |
861 | 34af39e8 | Jose A. Lopes | , withDoc "Network tags" pInstTags |
862 | 34af39e8 | Jose A. Lopes | ], |
863 | 34af39e8 | Jose A. Lopes | "network_name") |
864 | 8d239fa4 | Iustin Pop | , ("OpNetworkRemove", |
865 | 34af39e8 | Jose A. Lopes | [t| () |], |
866 | 34af39e8 | Jose A. Lopes | OpDoc.opNetworkRemove, |
867 | 8d239fa4 | Iustin Pop | [ pNetworkName |
868 | 8d239fa4 | Iustin Pop | , pForce |
869 | 34af39e8 | Jose A. Lopes | ], |
870 | 34af39e8 | Jose A. Lopes | "network_name") |
871 | 8d239fa4 | Iustin Pop | , ("OpNetworkSetParams", |
872 | 34af39e8 | Jose A. Lopes | [t| () |], |
873 | 34af39e8 | Jose A. Lopes | OpDoc.opNetworkSetParams, |
874 | 8d239fa4 | Iustin Pop | [ pNetworkName |
875 | 8d239fa4 | Iustin Pop | , pNetworkGateway4 |
876 | 8d239fa4 | Iustin Pop | , pNetworkAddress6 |
877 | 8d239fa4 | Iustin Pop | , pNetworkGateway6 |
878 | 8d239fa4 | Iustin Pop | , pNetworkMacPrefix |
879 | 34af39e8 | Jose A. Lopes | , withDoc "Which external IP addresses to reserve" pNetworkAddRsvdIps |
880 | 8d239fa4 | Iustin Pop | , pNetworkRemoveRsvdIps |
881 | 34af39e8 | Jose A. Lopes | ], |
882 | 34af39e8 | Jose A. Lopes | "network_name") |
883 | 8d239fa4 | Iustin Pop | , ("OpNetworkConnect", |
884 | 34af39e8 | Jose A. Lopes | [t| () |], |
885 | 34af39e8 | Jose A. Lopes | OpDoc.opNetworkConnect, |
886 | 8d239fa4 | Iustin Pop | [ pGroupName |
887 | 8d239fa4 | Iustin Pop | , pNetworkName |
888 | 8d239fa4 | Iustin Pop | , pNetworkMode |
889 | 8d239fa4 | Iustin Pop | , pNetworkLink |
890 | 8d239fa4 | Iustin Pop | , pIpConflictsCheck |
891 | 34af39e8 | Jose A. Lopes | ], |
892 | 34af39e8 | Jose A. Lopes | "network_name") |
893 | 8d239fa4 | Iustin Pop | , ("OpNetworkDisconnect", |
894 | 34af39e8 | Jose A. Lopes | [t| () |], |
895 | 34af39e8 | Jose A. Lopes | OpDoc.opNetworkDisconnect, |
896 | 8d239fa4 | Iustin Pop | [ pGroupName |
897 | 8d239fa4 | Iustin Pop | , pNetworkName |
898 | 34af39e8 | Jose A. Lopes | ], |
899 | 34af39e8 | Jose A. Lopes | "network_name") |
900 | ebf38064 | Iustin Pop | ]) |
901 | 12c19659 | Iustin Pop | |
902 | a583ec5d | Iustin Pop | -- | Returns the OP_ID for a given opcode value. |
903 | 12c19659 | Iustin Pop | $(genOpID ''OpCode "opID") |
904 | 702a4ee0 | Iustin Pop | |
905 | a583ec5d | Iustin Pop | -- | A list of all defined/supported opcode IDs. |
906 | a583ec5d | Iustin Pop | $(genAllOpIDs ''OpCode "allOpIDs") |
907 | a583ec5d | Iustin Pop | |
908 | 702a4ee0 | Iustin Pop | instance JSON OpCode where |
909 | ebf38064 | Iustin Pop | readJSON = loadOpCode |
910 | ebf38064 | Iustin Pop | showJSON = saveOpCode |
911 | 4a826364 | Iustin Pop | |
912 | ad1c1e41 | Iustin Pop | -- | Generates the summary value for an opcode. |
913 | ad1c1e41 | Iustin Pop | opSummaryVal :: OpCode -> Maybe String |
914 | ad1c1e41 | Iustin Pop | opSummaryVal OpClusterVerifyGroup { opGroupName = s } = Just (fromNonEmpty s) |
915 | ad1c1e41 | Iustin Pop | opSummaryVal OpGroupVerifyDisks { opGroupName = s } = Just (fromNonEmpty s) |
916 | ad1c1e41 | Iustin Pop | opSummaryVal OpClusterRename { opName = s } = Just (fromNonEmpty s) |
917 | ad1c1e41 | Iustin Pop | opSummaryVal OpQuery { opWhat = s } = Just (queryTypeOpToRaw s) |
918 | ad1c1e41 | Iustin Pop | opSummaryVal OpQueryFields { opWhat = s } = Just (queryTypeOpToRaw s) |
919 | ad1c1e41 | Iustin Pop | opSummaryVal OpNodeRemove { opNodeName = s } = Just (fromNonEmpty s) |
920 | ad1c1e41 | Iustin Pop | opSummaryVal OpNodeAdd { opNodeName = s } = Just (fromNonEmpty s) |
921 | ad1c1e41 | Iustin Pop | opSummaryVal OpNodeModifyStorage { opNodeName = s } = Just (fromNonEmpty s) |
922 | ad1c1e41 | Iustin Pop | opSummaryVal OpRepairNodeStorage { opNodeName = s } = Just (fromNonEmpty s) |
923 | ad1c1e41 | Iustin Pop | opSummaryVal OpNodeSetParams { opNodeName = s } = Just (fromNonEmpty s) |
924 | ad1c1e41 | Iustin Pop | opSummaryVal OpNodePowercycle { opNodeName = s } = Just (fromNonEmpty s) |
925 | ad1c1e41 | Iustin Pop | opSummaryVal OpNodeMigrate { opNodeName = s } = Just (fromNonEmpty s) |
926 | ad1c1e41 | Iustin Pop | opSummaryVal OpNodeEvacuate { opNodeName = s } = Just (fromNonEmpty s) |
927 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceCreate { opInstanceName = s } = Just s |
928 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceReinstall { opInstanceName = s } = Just s |
929 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceRemove { opInstanceName = s } = Just s |
930 | ad1c1e41 | Iustin Pop | -- FIXME: instance rename should show both names; currently it shows none |
931 | ad1c1e41 | Iustin Pop | -- opSummaryVal OpInstanceRename { opInstanceName = s } = Just s |
932 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceStartup { opInstanceName = s } = Just s |
933 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceShutdown { opInstanceName = s } = Just s |
934 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceReboot { opInstanceName = s } = Just s |
935 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceReplaceDisks { opInstanceName = s } = Just s |
936 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceFailover { opInstanceName = s } = Just s |
937 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceMigrate { opInstanceName = s } = Just s |
938 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceMove { opInstanceName = s } = Just s |
939 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceConsole { opInstanceName = s } = Just s |
940 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceActivateDisks { opInstanceName = s } = Just s |
941 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceDeactivateDisks { opInstanceName = s } = Just s |
942 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceRecreateDisks { opInstanceName = s } = Just s |
943 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceSetParams { opInstanceName = s } = Just s |
944 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceGrowDisk { opInstanceName = s } = Just s |
945 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceChangeGroup { opInstanceName = s } = Just s |
946 | ad1c1e41 | Iustin Pop | opSummaryVal OpGroupAdd { opGroupName = s } = Just (fromNonEmpty s) |
947 | ad1c1e41 | Iustin Pop | opSummaryVal OpGroupAssignNodes { opGroupName = s } = Just (fromNonEmpty s) |
948 | ad1c1e41 | Iustin Pop | opSummaryVal OpGroupSetParams { opGroupName = s } = Just (fromNonEmpty s) |
949 | ad1c1e41 | Iustin Pop | opSummaryVal OpGroupRemove { opGroupName = s } = Just (fromNonEmpty s) |
950 | ad1c1e41 | Iustin Pop | opSummaryVal OpGroupEvacuate { opGroupName = s } = Just (fromNonEmpty s) |
951 | ad1c1e41 | Iustin Pop | opSummaryVal OpBackupPrepare { opInstanceName = s } = Just s |
952 | ad1c1e41 | Iustin Pop | opSummaryVal OpBackupExport { opInstanceName = s } = Just s |
953 | ad1c1e41 | Iustin Pop | opSummaryVal OpBackupRemove { opInstanceName = s } = Just s |
954 | 34af39e8 | Jose A. Lopes | opSummaryVal OpTagsGet { opKind = s } = Just (show s) |
955 | ad1c1e41 | Iustin Pop | opSummaryVal OpTagsSearch { opTagSearchPattern = s } = Just (fromNonEmpty s) |
956 | ad1c1e41 | Iustin Pop | opSummaryVal OpTestDelay { opDelayDuration = d } = Just (show d) |
957 | ad1c1e41 | Iustin Pop | opSummaryVal OpTestAllocator { opIallocator = s } = |
958 | ad1c1e41 | Iustin Pop | -- FIXME: Python doesn't handle None fields well, so we have behave the same |
959 | ad1c1e41 | Iustin Pop | Just $ maybe "None" fromNonEmpty s |
960 | ad1c1e41 | Iustin Pop | opSummaryVal OpNetworkAdd { opNetworkName = s} = Just (fromNonEmpty s) |
961 | ad1c1e41 | Iustin Pop | opSummaryVal OpNetworkRemove { opNetworkName = s} = Just (fromNonEmpty s) |
962 | ad1c1e41 | Iustin Pop | opSummaryVal OpNetworkSetParams { opNetworkName = s} = Just (fromNonEmpty s) |
963 | ad1c1e41 | Iustin Pop | opSummaryVal OpNetworkConnect { opNetworkName = s} = Just (fromNonEmpty s) |
964 | ad1c1e41 | Iustin Pop | opSummaryVal OpNetworkDisconnect { opNetworkName = s} = Just (fromNonEmpty s) |
965 | ad1c1e41 | Iustin Pop | opSummaryVal _ = Nothing |
966 | ad1c1e41 | Iustin Pop | |
967 | ad1c1e41 | Iustin Pop | -- | Computes the summary of the opcode. |
968 | ad1c1e41 | Iustin Pop | opSummary :: OpCode -> String |
969 | ad1c1e41 | Iustin Pop | opSummary op = |
970 | ad1c1e41 | Iustin Pop | case opSummaryVal op of |
971 | ad1c1e41 | Iustin Pop | Nothing -> op_suffix |
972 | ad1c1e41 | Iustin Pop | Just s -> op_suffix ++ "(" ++ s ++ ")" |
973 | ad1c1e41 | Iustin Pop | where op_suffix = drop 3 $ opID op |
974 | ad1c1e41 | Iustin Pop | |
975 | 4a826364 | Iustin Pop | -- | Generic\/common opcode parameters. |
976 | 4a826364 | Iustin Pop | $(buildObject "CommonOpParams" "op" |
977 | 4a826364 | Iustin Pop | [ pDryRun |
978 | 4a826364 | Iustin Pop | , pDebugLevel |
979 | 4a826364 | Iustin Pop | , pOpPriority |
980 | 4a826364 | Iustin Pop | , pDependencies |
981 | 4a826364 | Iustin Pop | , pComment |
982 | 516a0e94 | Michele Tartara | , pReason |
983 | 4a826364 | Iustin Pop | ]) |
984 | 4a826364 | Iustin Pop | |
985 | 4a826364 | Iustin Pop | -- | Default common parameter values. |
986 | 4a826364 | Iustin Pop | defOpParams :: CommonOpParams |
987 | 4a826364 | Iustin Pop | defOpParams = |
988 | 4a826364 | Iustin Pop | CommonOpParams { opDryRun = Nothing |
989 | 4a826364 | Iustin Pop | , opDebugLevel = Nothing |
990 | 4a826364 | Iustin Pop | , opPriority = OpPrioNormal |
991 | 4a826364 | Iustin Pop | , opDepends = Nothing |
992 | 4a826364 | Iustin Pop | , opComment = Nothing |
993 | 516a0e94 | Michele Tartara | , opReason = [] |
994 | 4a826364 | Iustin Pop | } |
995 | 4a826364 | Iustin Pop | |
996 | 62933497 | Klaus Aehlig | -- | Resolve relative dependencies to absolute ones, given the job ID. |
997 | 62933497 | Klaus Aehlig | resolveDependsCommon :: (Monad m) => CommonOpParams -> JobId -> m CommonOpParams |
998 | 62933497 | Klaus Aehlig | resolveDependsCommon p@(CommonOpParams { opDepends = Just deps}) jid = do |
999 | 62933497 | Klaus Aehlig | deps' <- mapM (`absoluteJobDependency` jid) deps |
1000 | 62933497 | Klaus Aehlig | return p { opDepends = Just deps' } |
1001 | 62933497 | Klaus Aehlig | resolveDependsCommon p _ = return p |
1002 | 62933497 | Klaus Aehlig | |
1003 | 4a826364 | Iustin Pop | -- | The top-level opcode type. |
1004 | ad1c1e41 | Iustin Pop | data MetaOpCode = MetaOpCode { metaParams :: CommonOpParams |
1005 | ad1c1e41 | Iustin Pop | , metaOpCode :: OpCode |
1006 | ad1c1e41 | Iustin Pop | } deriving (Show, Eq) |
1007 | 4a826364 | Iustin Pop | |
1008 | 62933497 | Klaus Aehlig | -- | Resolve relative dependencies to absolute ones, given the job Id. |
1009 | 62933497 | Klaus Aehlig | resolveDependencies :: (Monad m) => MetaOpCode -> JobId -> m MetaOpCode |
1010 | 62933497 | Klaus Aehlig | resolveDependencies mopc jid = do |
1011 | 62933497 | Klaus Aehlig | mpar <- resolveDependsCommon (metaParams mopc) jid |
1012 | 62933497 | Klaus Aehlig | return (mopc { metaParams = mpar }) |
1013 | 62933497 | Klaus Aehlig | |
1014 | 4a826364 | Iustin Pop | -- | JSON serialisation for 'MetaOpCode'. |
1015 | 4a826364 | Iustin Pop | showMeta :: MetaOpCode -> JSValue |
1016 | 4a826364 | Iustin Pop | showMeta (MetaOpCode params op) = |
1017 | 4a826364 | Iustin Pop | let objparams = toDictCommonOpParams params |
1018 | 4a826364 | Iustin Pop | objop = toDictOpCode op |
1019 | 4a826364 | Iustin Pop | in makeObj (objparams ++ objop) |
1020 | 4a826364 | Iustin Pop | |
1021 | 4a826364 | Iustin Pop | -- | JSON deserialisation for 'MetaOpCode' |
1022 | 4a826364 | Iustin Pop | readMeta :: JSValue -> Text.JSON.Result MetaOpCode |
1023 | 4a826364 | Iustin Pop | readMeta v = do |
1024 | 4a826364 | Iustin Pop | meta <- readJSON v |
1025 | 4a826364 | Iustin Pop | op <- readJSON v |
1026 | 4a826364 | Iustin Pop | return $ MetaOpCode meta op |
1027 | 4a826364 | Iustin Pop | |
1028 | 4a826364 | Iustin Pop | instance JSON MetaOpCode where |
1029 | 4a826364 | Iustin Pop | showJSON = showMeta |
1030 | 4a826364 | Iustin Pop | readJSON = readMeta |
1031 | 4a826364 | Iustin Pop | |
1032 | 4a826364 | Iustin Pop | -- | Wraps an 'OpCode' with the default parameters to build a |
1033 | 4a826364 | Iustin Pop | -- 'MetaOpCode'. |
1034 | 4a826364 | Iustin Pop | wrapOpCode :: OpCode -> MetaOpCode |
1035 | 4a826364 | Iustin Pop | wrapOpCode = MetaOpCode defOpParams |
1036 | 4a826364 | Iustin Pop | |
1037 | 4a826364 | Iustin Pop | -- | Sets the comment on a meta opcode. |
1038 | 4a826364 | Iustin Pop | setOpComment :: String -> MetaOpCode -> MetaOpCode |
1039 | 4a826364 | Iustin Pop | setOpComment comment (MetaOpCode common op) = |
1040 | 4a826364 | Iustin Pop | MetaOpCode (common { opComment = Just comment}) op |
1041 | 551b44e2 | Iustin Pop | |
1042 | 551b44e2 | Iustin Pop | -- | Sets the priority on a meta opcode. |
1043 | 551b44e2 | Iustin Pop | setOpPriority :: OpSubmitPriority -> MetaOpCode -> MetaOpCode |
1044 | 551b44e2 | Iustin Pop | setOpPriority prio (MetaOpCode common op) = |
1045 | 551b44e2 | Iustin Pop | MetaOpCode (common { opPriority = prio }) op |