root / src / Ganeti / OpCodes.hs @ dcd54d32
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 | b711450c | Petr Pudlak | import Ganeti.PyValue () |
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 | 0359e5d0 | Spyros Trigazis | , pDefaultIAllocatorParams |
229 | c66f09f5 | Iustin Pop | , pMasterNetdev |
230 | 67fc4de7 | Iustin Pop | , pMasterNetmask |
231 | c66f09f5 | Iustin Pop | , pReservedLvs |
232 | c66f09f5 | Iustin Pop | , pHiddenOs |
233 | c66f09f5 | Iustin Pop | , pBlacklistedOs |
234 | c66f09f5 | Iustin Pop | , pUseExternalMipScript |
235 | 66af5ec5 | Helga Velroyen | , pEnabledDiskTemplates |
236 | 75f2ff7d | Michele Tartara | , pModifyEtcHosts |
237 | 5ce621ab | Helga Velroyen | , pClusterFileStorageDir |
238 | 5ce621ab | Helga Velroyen | , pClusterSharedFileStorageDir |
239 | d3e6fd0e | Santi Raffa | , pClusterGlusterStorageDir |
240 | 34af39e8 | Jose A. Lopes | ], |
241 | 34af39e8 | Jose A. Lopes | []) |
242 | 34af39e8 | Jose A. Lopes | , ("OpClusterRedistConf", |
243 | 34af39e8 | Jose A. Lopes | [t| () |], |
244 | 34af39e8 | Jose A. Lopes | OpDoc.opClusterRedistConf, |
245 | 34af39e8 | Jose A. Lopes | [], |
246 | 34af39e8 | Jose A. Lopes | []) |
247 | 34af39e8 | Jose A. Lopes | , ("OpClusterActivateMasterIp", |
248 | 34af39e8 | Jose A. Lopes | [t| () |], |
249 | 34af39e8 | Jose A. Lopes | OpDoc.opClusterActivateMasterIp, |
250 | 34af39e8 | Jose A. Lopes | [], |
251 | 34af39e8 | Jose A. Lopes | []) |
252 | 34af39e8 | Jose A. Lopes | , ("OpClusterDeactivateMasterIp", |
253 | 34af39e8 | Jose A. Lopes | [t| () |], |
254 | 34af39e8 | Jose A. Lopes | OpDoc.opClusterDeactivateMasterIp, |
255 | 34af39e8 | Jose A. Lopes | [], |
256 | 34af39e8 | Jose A. Lopes | []) |
257 | c66f09f5 | Iustin Pop | , ("OpQuery", |
258 | 34af39e8 | Jose A. Lopes | [t| QueryResponse |], |
259 | 34af39e8 | Jose A. Lopes | OpDoc.opQuery, |
260 | c66f09f5 | Iustin Pop | [ pQueryWhat |
261 | c66f09f5 | Iustin Pop | , pUseLocking |
262 | c66f09f5 | Iustin Pop | , pQueryFields |
263 | c66f09f5 | Iustin Pop | , pQueryFilter |
264 | 34af39e8 | Jose A. Lopes | ], |
265 | 34af39e8 | Jose A. Lopes | "what") |
266 | c66f09f5 | Iustin Pop | , ("OpQueryFields", |
267 | 34af39e8 | Jose A. Lopes | [t| QueryFieldsResponse |], |
268 | 34af39e8 | Jose A. Lopes | OpDoc.opQueryFields, |
269 | c66f09f5 | Iustin Pop | [ pQueryWhat |
270 | 34af39e8 | Jose A. Lopes | , pQueryFieldsFields |
271 | 34af39e8 | Jose A. Lopes | ], |
272 | 34af39e8 | Jose A. Lopes | "what") |
273 | c66f09f5 | Iustin Pop | , ("OpOobCommand", |
274 | 34af39e8 | Jose A. Lopes | [t| [[(QueryResultCode, JSValue)]] |], |
275 | 34af39e8 | Jose A. Lopes | OpDoc.opOobCommand, |
276 | c66f09f5 | Iustin Pop | [ pNodeNames |
277 | 34af39e8 | Jose A. Lopes | , withDoc "List of node UUIDs to run the OOB command against" pNodeUuids |
278 | c66f09f5 | Iustin Pop | , pOobCommand |
279 | c66f09f5 | Iustin Pop | , pOobTimeout |
280 | c66f09f5 | Iustin Pop | , pIgnoreStatus |
281 | c66f09f5 | Iustin Pop | , pPowerDelay |
282 | 34af39e8 | Jose A. Lopes | ], |
283 | 34af39e8 | Jose A. Lopes | []) |
284 | 34af39e8 | Jose A. Lopes | , ("OpRestrictedCommand", |
285 | 34af39e8 | Jose A. Lopes | [t| [(Bool, String)] |], |
286 | 34af39e8 | Jose A. Lopes | OpDoc.opRestrictedCommand, |
287 | 34af39e8 | Jose A. Lopes | [ pUseLocking |
288 | 34af39e8 | Jose A. Lopes | , withDoc |
289 | 34af39e8 | Jose A. Lopes | "Nodes on which the command should be run (at least one)" |
290 | 34af39e8 | Jose A. Lopes | pRequiredNodes |
291 | 34af39e8 | Jose A. Lopes | , withDoc |
292 | 34af39e8 | Jose A. Lopes | "Node UUIDs on which the command should be run (at least one)" |
293 | 34af39e8 | Jose A. Lopes | pRequiredNodeUuids |
294 | 34af39e8 | Jose A. Lopes | , pRestrictedCommand |
295 | 34af39e8 | Jose A. Lopes | ], |
296 | 34af39e8 | Jose A. Lopes | []) |
297 | 1c3231aa | Thomas Thrainer | , ("OpNodeRemove", |
298 | 34af39e8 | Jose A. Lopes | [t| () |], |
299 | 34af39e8 | Jose A. Lopes | OpDoc.opNodeRemove, |
300 | 1c3231aa | Thomas Thrainer | [ pNodeName |
301 | 1c3231aa | Thomas Thrainer | , pNodeUuid |
302 | 34af39e8 | Jose A. Lopes | ], |
303 | 34af39e8 | Jose A. Lopes | "node_name") |
304 | c66f09f5 | Iustin Pop | , ("OpNodeAdd", |
305 | 34af39e8 | Jose A. Lopes | [t| () |], |
306 | 34af39e8 | Jose A. Lopes | OpDoc.opNodeAdd, |
307 | c66f09f5 | Iustin Pop | [ pNodeName |
308 | c66f09f5 | Iustin Pop | , pHvState |
309 | c66f09f5 | Iustin Pop | , pDiskState |
310 | c66f09f5 | Iustin Pop | , pPrimaryIp |
311 | c66f09f5 | Iustin Pop | , pSecondaryIp |
312 | c66f09f5 | Iustin Pop | , pReadd |
313 | c66f09f5 | Iustin Pop | , pNodeGroup |
314 | c66f09f5 | Iustin Pop | , pMasterCapable |
315 | c66f09f5 | Iustin Pop | , pVmCapable |
316 | c66f09f5 | Iustin Pop | , pNdParams |
317 | 34af39e8 | Jose A. Lopes | ], |
318 | 34af39e8 | Jose A. Lopes | "node_name") |
319 | c66f09f5 | Iustin Pop | , ("OpNodeQueryvols", |
320 | 34af39e8 | Jose A. Lopes | [t| [JSValue] |], |
321 | 34af39e8 | Jose A. Lopes | OpDoc.opNodeQueryvols, |
322 | c66f09f5 | Iustin Pop | [ pOutputFields |
323 | 34af39e8 | Jose A. Lopes | , withDoc "Empty list to query all nodes, node names otherwise" pNodes |
324 | 34af39e8 | Jose A. Lopes | ], |
325 | 34af39e8 | Jose A. Lopes | []) |
326 | c66f09f5 | Iustin Pop | , ("OpNodeQueryStorage", |
327 | 34af39e8 | Jose A. Lopes | [t| [[JSValue]] |], |
328 | 34af39e8 | Jose A. Lopes | OpDoc.opNodeQueryStorage, |
329 | c66f09f5 | Iustin Pop | [ pOutputFields |
330 | 4f90370c | Helga Velroyen | , pStorageTypeOptional |
331 | 34af39e8 | Jose A. Lopes | , withDoc |
332 | 34af39e8 | Jose A. Lopes | "Empty list to query all, list of names to query otherwise" |
333 | 34af39e8 | Jose A. Lopes | pNodes |
334 | c66f09f5 | Iustin Pop | , pStorageName |
335 | 34af39e8 | Jose A. Lopes | ], |
336 | 34af39e8 | Jose A. Lopes | []) |
337 | c66f09f5 | Iustin Pop | , ("OpNodeModifyStorage", |
338 | 34af39e8 | Jose A. Lopes | [t| () |], |
339 | 34af39e8 | Jose A. Lopes | OpDoc.opNodeModifyStorage, |
340 | c66f09f5 | Iustin Pop | [ pNodeName |
341 | 1c3231aa | Thomas Thrainer | , pNodeUuid |
342 | c66f09f5 | Iustin Pop | , pStorageType |
343 | c66f09f5 | Iustin Pop | , pStorageName |
344 | c66f09f5 | Iustin Pop | , pStorageChanges |
345 | 34af39e8 | Jose A. Lopes | ], |
346 | 34af39e8 | Jose A. Lopes | "node_name") |
347 | c66f09f5 | Iustin Pop | , ("OpRepairNodeStorage", |
348 | 34af39e8 | Jose A. Lopes | [t| () |], |
349 | 34af39e8 | Jose A. Lopes | OpDoc.opRepairNodeStorage, |
350 | c66f09f5 | Iustin Pop | [ pNodeName |
351 | 1c3231aa | Thomas Thrainer | , pNodeUuid |
352 | c66f09f5 | Iustin Pop | , pStorageType |
353 | c66f09f5 | Iustin Pop | , pStorageName |
354 | c66f09f5 | Iustin Pop | , pIgnoreConsistency |
355 | 34af39e8 | Jose A. Lopes | ], |
356 | 34af39e8 | Jose A. Lopes | "node_name") |
357 | c66f09f5 | Iustin Pop | , ("OpNodeSetParams", |
358 | 34af39e8 | Jose A. Lopes | [t| [(NonEmptyString, JSValue)] |], |
359 | 34af39e8 | Jose A. Lopes | OpDoc.opNodeSetParams, |
360 | c66f09f5 | Iustin Pop | [ pNodeName |
361 | 1c3231aa | Thomas Thrainer | , pNodeUuid |
362 | c66f09f5 | Iustin Pop | , pForce |
363 | c66f09f5 | Iustin Pop | , pHvState |
364 | c66f09f5 | Iustin Pop | , pDiskState |
365 | c66f09f5 | Iustin Pop | , pMasterCandidate |
366 | 34af39e8 | Jose A. Lopes | , withDoc "Whether to mark the node offline" pOffline |
367 | c66f09f5 | Iustin Pop | , pDrained |
368 | c66f09f5 | Iustin Pop | , pAutoPromote |
369 | c66f09f5 | Iustin Pop | , pMasterCapable |
370 | c66f09f5 | Iustin Pop | , pVmCapable |
371 | c66f09f5 | Iustin Pop | , pSecondaryIp |
372 | c66f09f5 | Iustin Pop | , pNdParams |
373 | 67fc4de7 | Iustin Pop | , pPowered |
374 | 34af39e8 | Jose A. Lopes | ], |
375 | 34af39e8 | Jose A. Lopes | "node_name") |
376 | c66f09f5 | Iustin Pop | , ("OpNodePowercycle", |
377 | 34af39e8 | Jose A. Lopes | [t| Maybe NonEmptyString |], |
378 | 34af39e8 | Jose A. Lopes | OpDoc.opNodePowercycle, |
379 | c66f09f5 | Iustin Pop | [ pNodeName |
380 | 1c3231aa | Thomas Thrainer | , pNodeUuid |
381 | c66f09f5 | Iustin Pop | , pForce |
382 | 34af39e8 | Jose A. Lopes | ], |
383 | 34af39e8 | Jose A. Lopes | "node_name") |
384 | c66f09f5 | Iustin Pop | , ("OpNodeMigrate", |
385 | 34af39e8 | Jose A. Lopes | [t| JobIdListOnly |], |
386 | 34af39e8 | Jose A. Lopes | OpDoc.opNodeMigrate, |
387 | c66f09f5 | Iustin Pop | [ pNodeName |
388 | 1c3231aa | Thomas Thrainer | , pNodeUuid |
389 | c66f09f5 | Iustin Pop | , pMigrationMode |
390 | c66f09f5 | Iustin Pop | , pMigrationLive |
391 | c66f09f5 | Iustin Pop | , pMigrationTargetNode |
392 | 1c3231aa | Thomas Thrainer | , pMigrationTargetNodeUuid |
393 | c66f09f5 | Iustin Pop | , pAllowRuntimeChgs |
394 | c66f09f5 | Iustin Pop | , pIgnoreIpolicy |
395 | c66f09f5 | Iustin Pop | , pIallocator |
396 | 34af39e8 | Jose A. Lopes | ], |
397 | 34af39e8 | Jose A. Lopes | "node_name") |
398 | c66f09f5 | Iustin Pop | , ("OpNodeEvacuate", |
399 | 34af39e8 | Jose A. Lopes | [t| JobIdListOnly |], |
400 | 34af39e8 | Jose A. Lopes | OpDoc.opNodeEvacuate, |
401 | c66f09f5 | Iustin Pop | [ pEarlyRelease |
402 | c66f09f5 | Iustin Pop | , pNodeName |
403 | 1c3231aa | Thomas Thrainer | , pNodeUuid |
404 | c66f09f5 | Iustin Pop | , pRemoteNode |
405 | 1c3231aa | Thomas Thrainer | , pRemoteNodeUuid |
406 | c66f09f5 | Iustin Pop | , pIallocator |
407 | c66f09f5 | Iustin Pop | , pEvacMode |
408 | 34af39e8 | Jose A. Lopes | ], |
409 | 34af39e8 | Jose A. Lopes | "node_name") |
410 | 6d558717 | Iustin Pop | , ("OpInstanceCreate", |
411 | 34af39e8 | Jose A. Lopes | [t| [NonEmptyString] |], |
412 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceCreate, |
413 | 6d558717 | Iustin Pop | [ pInstanceName |
414 | 6d558717 | Iustin Pop | , pForceVariant |
415 | 6d558717 | Iustin Pop | , pWaitForSync |
416 | 6d558717 | Iustin Pop | , pNameCheck |
417 | 6d558717 | Iustin Pop | , pIgnoreIpolicy |
418 | 34af39e8 | Jose A. Lopes | , pOpportunisticLocking |
419 | 6d558717 | Iustin Pop | , pInstBeParams |
420 | 6d558717 | Iustin Pop | , pInstDisks |
421 | 7b6996a8 | Thomas Thrainer | , pOptDiskTemplate |
422 | 6d558717 | Iustin Pop | , pFileDriver |
423 | 6d558717 | Iustin Pop | , pFileStorageDir |
424 | 6d558717 | Iustin Pop | , pInstHvParams |
425 | 6d558717 | Iustin Pop | , pHypervisor |
426 | 6d558717 | Iustin Pop | , pIallocator |
427 | 6d558717 | Iustin Pop | , pResetDefaults |
428 | 6d558717 | Iustin Pop | , pIpCheck |
429 | 6d558717 | Iustin Pop | , pIpConflictsCheck |
430 | 6d558717 | Iustin Pop | , pInstCreateMode |
431 | 6d558717 | Iustin Pop | , pInstNics |
432 | 6d558717 | Iustin Pop | , pNoInstall |
433 | 6d558717 | Iustin Pop | , pInstOsParams |
434 | 6d558717 | Iustin Pop | , pInstOs |
435 | 6d558717 | Iustin Pop | , pPrimaryNode |
436 | 1c3231aa | Thomas Thrainer | , pPrimaryNodeUuid |
437 | 6d558717 | Iustin Pop | , pSecondaryNode |
438 | 1c3231aa | Thomas Thrainer | , pSecondaryNodeUuid |
439 | 6d558717 | Iustin Pop | , pSourceHandshake |
440 | 6d558717 | Iustin Pop | , pSourceInstance |
441 | 6d558717 | Iustin Pop | , pSourceShutdownTimeout |
442 | 6d558717 | Iustin Pop | , pSourceX509Ca |
443 | 6d558717 | Iustin Pop | , pSrcNode |
444 | 1c3231aa | Thomas Thrainer | , pSrcNodeUuid |
445 | 6d558717 | Iustin Pop | , pSrcPath |
446 | 51d7ac96 | Thomas Thrainer | , pBackupCompress |
447 | 6d558717 | Iustin Pop | , pStartInstance |
448 | 6d558717 | Iustin Pop | , pInstTags |
449 | 34af39e8 | Jose A. Lopes | ], |
450 | 34af39e8 | Jose A. Lopes | "instance_name") |
451 | c2d3219b | Iustin Pop | , ("OpInstanceMultiAlloc", |
452 | 34af39e8 | Jose A. Lopes | [t| InstanceMultiAllocResponse |], |
453 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceMultiAlloc, |
454 | 34af39e8 | Jose A. Lopes | [ pOpportunisticLocking |
455 | 34af39e8 | Jose A. Lopes | , pIallocator |
456 | c2d3219b | Iustin Pop | , pMultiAllocInstances |
457 | 34af39e8 | Jose A. Lopes | ], |
458 | 34af39e8 | Jose A. Lopes | []) |
459 | c2d3219b | Iustin Pop | , ("OpInstanceReinstall", |
460 | 34af39e8 | Jose A. Lopes | [t| () |], |
461 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceReinstall, |
462 | c2d3219b | Iustin Pop | [ pInstanceName |
463 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
464 | c2d3219b | Iustin Pop | , pForceVariant |
465 | c2d3219b | Iustin Pop | , pInstOs |
466 | c2d3219b | Iustin Pop | , pTempOsParams |
467 | 34af39e8 | Jose A. Lopes | ], |
468 | 34af39e8 | Jose A. Lopes | "instance_name") |
469 | c2d3219b | Iustin Pop | , ("OpInstanceRemove", |
470 | 34af39e8 | Jose A. Lopes | [t| () |], |
471 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceRemove, |
472 | c2d3219b | Iustin Pop | [ pInstanceName |
473 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
474 | c2d3219b | Iustin Pop | , pShutdownTimeout |
475 | c2d3219b | Iustin Pop | , pIgnoreFailures |
476 | 34af39e8 | Jose A. Lopes | ], |
477 | 34af39e8 | Jose A. Lopes | "instance_name") |
478 | c2d3219b | Iustin Pop | , ("OpInstanceRename", |
479 | 34af39e8 | Jose A. Lopes | [t| NonEmptyString |], |
480 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceRename, |
481 | c2d3219b | Iustin Pop | [ pInstanceName |
482 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
483 | 34af39e8 | Jose A. Lopes | , withDoc "New instance name" pNewName |
484 | c2d3219b | Iustin Pop | , pNameCheck |
485 | c2d3219b | Iustin Pop | , pIpCheck |
486 | 34af39e8 | Jose A. Lopes | ], |
487 | 34af39e8 | Jose A. Lopes | []) |
488 | c2d3219b | Iustin Pop | , ("OpInstanceStartup", |
489 | 34af39e8 | Jose A. Lopes | [t| () |], |
490 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceStartup, |
491 | c2d3219b | Iustin Pop | [ pInstanceName |
492 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
493 | c2d3219b | Iustin Pop | , pForce |
494 | c2d3219b | Iustin Pop | , pIgnoreOfflineNodes |
495 | c2d3219b | Iustin Pop | , pTempHvParams |
496 | c2d3219b | Iustin Pop | , pTempBeParams |
497 | c2d3219b | Iustin Pop | , pNoRemember |
498 | c2d3219b | Iustin Pop | , pStartupPaused |
499 | 34af39e8 | Jose A. Lopes | ], |
500 | 34af39e8 | Jose A. Lopes | "instance_name") |
501 | c2d3219b | Iustin Pop | , ("OpInstanceShutdown", |
502 | 34af39e8 | Jose A. Lopes | [t| () |], |
503 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceShutdown, |
504 | c2d3219b | Iustin Pop | [ pInstanceName |
505 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
506 | 0d57ce24 | Guido Trotter | , pForce |
507 | c2d3219b | Iustin Pop | , pIgnoreOfflineNodes |
508 | 5cbf7832 | Jose A. Lopes | , pShutdownTimeout' |
509 | c2d3219b | Iustin Pop | , pNoRemember |
510 | 34af39e8 | Jose A. Lopes | ], |
511 | 34af39e8 | Jose A. Lopes | "instance_name") |
512 | c2d3219b | Iustin Pop | , ("OpInstanceReboot", |
513 | 34af39e8 | Jose A. Lopes | [t| () |], |
514 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceReboot, |
515 | c2d3219b | Iustin Pop | [ pInstanceName |
516 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
517 | c2d3219b | Iustin Pop | , pShutdownTimeout |
518 | c2d3219b | Iustin Pop | , pIgnoreSecondaries |
519 | c2d3219b | Iustin Pop | , pRebootType |
520 | 34af39e8 | Jose A. Lopes | ], |
521 | 34af39e8 | Jose A. Lopes | "instance_name") |
522 | 34af39e8 | Jose A. Lopes | , ("OpInstanceReplaceDisks", |
523 | 34af39e8 | Jose A. Lopes | [t| () |], |
524 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceReplaceDisks, |
525 | 34af39e8 | Jose A. Lopes | [ pInstanceName |
526 | 34af39e8 | Jose A. Lopes | , pInstanceUuid |
527 | 34af39e8 | Jose A. Lopes | , pEarlyRelease |
528 | 34af39e8 | Jose A. Lopes | , pIgnoreIpolicy |
529 | 34af39e8 | Jose A. Lopes | , pReplaceDisksMode |
530 | 34af39e8 | Jose A. Lopes | , pReplaceDisksList |
531 | 34af39e8 | Jose A. Lopes | , pRemoteNode |
532 | 34af39e8 | Jose A. Lopes | , pRemoteNodeUuid |
533 | 34af39e8 | Jose A. Lopes | , pIallocator |
534 | 34af39e8 | Jose A. Lopes | ], |
535 | 34af39e8 | Jose A. Lopes | "instance_name") |
536 | 34af39e8 | Jose A. Lopes | , ("OpInstanceFailover", |
537 | 34af39e8 | Jose A. Lopes | [t| () |], |
538 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceFailover, |
539 | 34af39e8 | Jose A. Lopes | [ pInstanceName |
540 | 34af39e8 | Jose A. Lopes | , pInstanceUuid |
541 | 34af39e8 | Jose A. Lopes | , pShutdownTimeout |
542 | 34af39e8 | Jose A. Lopes | , pIgnoreConsistency |
543 | 34af39e8 | Jose A. Lopes | , pMigrationTargetNode |
544 | 34af39e8 | Jose A. Lopes | , pMigrationTargetNodeUuid |
545 | 34af39e8 | Jose A. Lopes | , pIgnoreIpolicy |
546 | 1ca326c8 | Thomas Thrainer | , pMigrationCleanup |
547 | 34af39e8 | Jose A. Lopes | , pIallocator |
548 | 34af39e8 | Jose A. Lopes | ], |
549 | 34af39e8 | Jose A. Lopes | "instance_name") |
550 | 34af39e8 | Jose A. Lopes | , ("OpInstanceMigrate", |
551 | 34af39e8 | Jose A. Lopes | [t| () |], |
552 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceMigrate, |
553 | 34af39e8 | Jose A. Lopes | [ pInstanceName |
554 | 34af39e8 | Jose A. Lopes | , pInstanceUuid |
555 | 34af39e8 | Jose A. Lopes | , pMigrationMode |
556 | 34af39e8 | Jose A. Lopes | , pMigrationLive |
557 | 34af39e8 | Jose A. Lopes | , pMigrationTargetNode |
558 | 34af39e8 | Jose A. Lopes | , pMigrationTargetNodeUuid |
559 | 34af39e8 | Jose A. Lopes | , pAllowRuntimeChgs |
560 | 34af39e8 | Jose A. Lopes | , pIgnoreIpolicy |
561 | 34af39e8 | Jose A. Lopes | , pMigrationCleanup |
562 | 34af39e8 | Jose A. Lopes | , pIallocator |
563 | 34af39e8 | Jose A. Lopes | , pAllowFailover |
564 | 34af39e8 | Jose A. Lopes | ], |
565 | 34af39e8 | Jose A. Lopes | "instance_name") |
566 | c2d3219b | Iustin Pop | , ("OpInstanceMove", |
567 | 34af39e8 | Jose A. Lopes | [t| () |], |
568 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceMove, |
569 | c2d3219b | Iustin Pop | [ pInstanceName |
570 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
571 | c2d3219b | Iustin Pop | , pShutdownTimeout |
572 | c2d3219b | Iustin Pop | , pIgnoreIpolicy |
573 | c2d3219b | Iustin Pop | , pMoveTargetNode |
574 | 1c3231aa | Thomas Thrainer | , pMoveTargetNodeUuid |
575 | f198cf91 | Thomas Thrainer | , pMoveCompress |
576 | c2d3219b | Iustin Pop | , pIgnoreConsistency |
577 | 34af39e8 | Jose A. Lopes | ], |
578 | 34af39e8 | Jose A. Lopes | "instance_name") |
579 | c2d3219b | Iustin Pop | , ("OpInstanceConsole", |
580 | 34af39e8 | Jose A. Lopes | [t| JSObject JSValue |], |
581 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceConsole, |
582 | da4a52a3 | Thomas Thrainer | [ pInstanceName |
583 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
584 | 34af39e8 | Jose A. Lopes | ], |
585 | 34af39e8 | Jose A. Lopes | "instance_name") |
586 | c2d3219b | Iustin Pop | , ("OpInstanceActivateDisks", |
587 | 34af39e8 | Jose A. Lopes | [t| [(NonEmptyString, NonEmptyString, NonEmptyString)] |], |
588 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceActivateDisks, |
589 | c2d3219b | Iustin Pop | [ pInstanceName |
590 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
591 | c2d3219b | Iustin Pop | , pIgnoreDiskSize |
592 | c2d3219b | Iustin Pop | , pWaitForSyncFalse |
593 | 34af39e8 | Jose A. Lopes | ], |
594 | 34af39e8 | Jose A. Lopes | "instance_name") |
595 | c2d3219b | Iustin Pop | , ("OpInstanceDeactivateDisks", |
596 | 34af39e8 | Jose A. Lopes | [t| () |], |
597 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceDeactivateDisks, |
598 | c2d3219b | Iustin Pop | [ pInstanceName |
599 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
600 | c2d3219b | Iustin Pop | , pForce |
601 | 34af39e8 | Jose A. Lopes | ], |
602 | 34af39e8 | Jose A. Lopes | "instance_name") |
603 | c2d3219b | Iustin Pop | , ("OpInstanceRecreateDisks", |
604 | 34af39e8 | Jose A. Lopes | [t| () |], |
605 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceRecreateDisks, |
606 | c2d3219b | Iustin Pop | [ pInstanceName |
607 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
608 | c2d3219b | Iustin Pop | , pRecreateDisksInfo |
609 | 34af39e8 | Jose A. Lopes | , withDoc "New instance nodes, if relocation is desired" pNodes |
610 | 34af39e8 | Jose A. Lopes | , withDoc "New instance node UUIDs, if relocation is desired" pNodeUuids |
611 | c2d3219b | Iustin Pop | , pIallocator |
612 | 34af39e8 | Jose A. Lopes | ], |
613 | 34af39e8 | Jose A. Lopes | "instance_name") |
614 | c2d3219b | Iustin Pop | , ("OpInstanceQueryData", |
615 | 34af39e8 | Jose A. Lopes | [t| JSObject (JSObject JSValue) |], |
616 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceQueryData, |
617 | c2d3219b | Iustin Pop | [ pUseLocking |
618 | c2d3219b | Iustin Pop | , pInstances |
619 | c2d3219b | Iustin Pop | , pStatic |
620 | 34af39e8 | Jose A. Lopes | ], |
621 | 34af39e8 | Jose A. Lopes | []) |
622 | c2d3219b | Iustin Pop | , ("OpInstanceSetParams", |
623 | 34af39e8 | Jose A. Lopes | [t| [(NonEmptyString, JSValue)] |], |
624 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceSetParams, |
625 | c2d3219b | Iustin Pop | [ pInstanceName |
626 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
627 | c2d3219b | Iustin Pop | , pForce |
628 | c2d3219b | Iustin Pop | , pForceVariant |
629 | c2d3219b | Iustin Pop | , pIgnoreIpolicy |
630 | c2d3219b | Iustin Pop | , pInstParamsNicChanges |
631 | c2d3219b | Iustin Pop | , pInstParamsDiskChanges |
632 | c2d3219b | Iustin Pop | , pInstBeParams |
633 | c2d3219b | Iustin Pop | , pRuntimeMem |
634 | c2d3219b | Iustin Pop | , pInstHvParams |
635 | 88127c47 | Iustin Pop | , pOptDiskTemplate |
636 | d2204b1a | Klaus Aehlig | , pPrimaryNode |
637 | 1c3231aa | Thomas Thrainer | , pPrimaryNodeUuid |
638 | 34af39e8 | Jose A. Lopes | , withDoc "Secondary node (used when changing disk template)" pRemoteNode |
639 | 34af39e8 | Jose A. Lopes | , withDoc |
640 | 34af39e8 | Jose A. Lopes | "Secondary node UUID (used when changing disk template)" |
641 | 34af39e8 | Jose A. Lopes | pRemoteNodeUuid |
642 | c2d3219b | Iustin Pop | , pOsNameChange |
643 | c2d3219b | Iustin Pop | , pInstOsParams |
644 | c2d3219b | Iustin Pop | , pWaitForSync |
645 | 34af39e8 | Jose A. Lopes | , withDoc "Whether to mark the instance as offline" pOffline |
646 | c2d3219b | Iustin Pop | , pIpConflictsCheck |
647 | df58ca1c | Dimitris Aragiorgis | , pHotplug |
648 | 34af39e8 | Jose A. Lopes | ], |
649 | 34af39e8 | Jose A. Lopes | "instance_name") |
650 | c2d3219b | Iustin Pop | , ("OpInstanceGrowDisk", |
651 | 34af39e8 | Jose A. Lopes | [t| () |], |
652 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceGrowDisk, |
653 | c2d3219b | Iustin Pop | [ pInstanceName |
654 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
655 | c2d3219b | Iustin Pop | , pWaitForSync |
656 | c2d3219b | Iustin Pop | , pDiskIndex |
657 | c2d3219b | Iustin Pop | , pDiskChgAmount |
658 | c2d3219b | Iustin Pop | , pDiskChgAbsolute |
659 | 34af39e8 | Jose A. Lopes | ], |
660 | 34af39e8 | Jose A. Lopes | "instance_name") |
661 | c2d3219b | Iustin Pop | , ("OpInstanceChangeGroup", |
662 | 34af39e8 | Jose A. Lopes | [t| JobIdListOnly |], |
663 | 34af39e8 | Jose A. Lopes | OpDoc.opInstanceChangeGroup, |
664 | c2d3219b | Iustin Pop | [ pInstanceName |
665 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
666 | c2d3219b | Iustin Pop | , pEarlyRelease |
667 | c2d3219b | Iustin Pop | , pIallocator |
668 | c2d3219b | Iustin Pop | , pTargetGroups |
669 | 34af39e8 | Jose A. Lopes | ], |
670 | 34af39e8 | Jose A. Lopes | "instance_name") |
671 | 398e9066 | Iustin Pop | , ("OpGroupAdd", |
672 | 34af39e8 | Jose A. Lopes | [t| () |], |
673 | 34af39e8 | Jose A. Lopes | OpDoc.opGroupAdd, |
674 | 398e9066 | Iustin Pop | [ pGroupName |
675 | 398e9066 | Iustin Pop | , pNodeGroupAllocPolicy |
676 | 398e9066 | Iustin Pop | , pGroupNodeParams |
677 | 398e9066 | Iustin Pop | , pDiskParams |
678 | 398e9066 | Iustin Pop | , pHvState |
679 | 398e9066 | Iustin Pop | , pDiskState |
680 | 34af39e8 | Jose A. Lopes | , withDoc "Group-wide ipolicy specs" pIpolicy |
681 | 34af39e8 | Jose A. Lopes | ], |
682 | 34af39e8 | Jose A. Lopes | "group_name") |
683 | 398e9066 | Iustin Pop | , ("OpGroupAssignNodes", |
684 | 34af39e8 | Jose A. Lopes | [t| () |], |
685 | 34af39e8 | Jose A. Lopes | OpDoc.opGroupAssignNodes, |
686 | 398e9066 | Iustin Pop | [ pGroupName |
687 | 398e9066 | Iustin Pop | , pForce |
688 | 34af39e8 | Jose A. Lopes | , withDoc "List of nodes to assign" pRequiredNodes |
689 | 34af39e8 | Jose A. Lopes | , withDoc "List of node UUIDs to assign" pRequiredNodeUuids |
690 | 34af39e8 | Jose A. Lopes | ], |
691 | 34af39e8 | Jose A. Lopes | "group_name") |
692 | 398e9066 | Iustin Pop | , ("OpGroupSetParams", |
693 | 34af39e8 | Jose A. Lopes | [t| [(NonEmptyString, JSValue)] |], |
694 | 34af39e8 | Jose A. Lopes | OpDoc.opGroupSetParams, |
695 | 398e9066 | Iustin Pop | [ pGroupName |
696 | 398e9066 | Iustin Pop | , pNodeGroupAllocPolicy |
697 | 398e9066 | Iustin Pop | , pGroupNodeParams |
698 | 398e9066 | Iustin Pop | , pDiskParams |
699 | 398e9066 | Iustin Pop | , pHvState |
700 | 398e9066 | Iustin Pop | , pDiskState |
701 | 34af39e8 | Jose A. Lopes | , withDoc "Group-wide ipolicy specs" pIpolicy |
702 | 34af39e8 | Jose A. Lopes | ], |
703 | 34af39e8 | Jose A. Lopes | "group_name") |
704 | 398e9066 | Iustin Pop | , ("OpGroupRemove", |
705 | 34af39e8 | Jose A. Lopes | [t| () |], |
706 | 34af39e8 | Jose A. Lopes | OpDoc.opGroupRemove, |
707 | 34af39e8 | Jose A. Lopes | [ pGroupName |
708 | 34af39e8 | Jose A. Lopes | ], |
709 | 34af39e8 | Jose A. Lopes | "group_name") |
710 | 398e9066 | Iustin Pop | , ("OpGroupRename", |
711 | 34af39e8 | Jose A. Lopes | [t| NonEmptyString |], |
712 | 34af39e8 | Jose A. Lopes | OpDoc.opGroupRename, |
713 | 398e9066 | Iustin Pop | [ pGroupName |
714 | 34af39e8 | Jose A. Lopes | , withDoc "New group name" pNewName |
715 | 34af39e8 | Jose A. Lopes | ], |
716 | 34af39e8 | Jose A. Lopes | []) |
717 | 398e9066 | Iustin Pop | , ("OpGroupEvacuate", |
718 | 34af39e8 | Jose A. Lopes | [t| JobIdListOnly |], |
719 | 34af39e8 | Jose A. Lopes | OpDoc.opGroupEvacuate, |
720 | 398e9066 | Iustin Pop | [ pGroupName |
721 | 398e9066 | Iustin Pop | , pEarlyRelease |
722 | 398e9066 | Iustin Pop | , pIallocator |
723 | 398e9066 | Iustin Pop | , pTargetGroups |
724 | 34af39e8 | Jose A. Lopes | ], |
725 | 34af39e8 | Jose A. Lopes | "group_name") |
726 | 398e9066 | Iustin Pop | , ("OpOsDiagnose", |
727 | 34af39e8 | Jose A. Lopes | [t| [[JSValue]] |], |
728 | 34af39e8 | Jose A. Lopes | OpDoc.opOsDiagnose, |
729 | 398e9066 | Iustin Pop | [ pOutputFields |
730 | 34af39e8 | Jose A. Lopes | , withDoc "Which operating systems to diagnose" pNames |
731 | 34af39e8 | Jose A. Lopes | ], |
732 | 34af39e8 | Jose A. Lopes | []) |
733 | b954f097 | Constantinos Venetsanopoulos | , ("OpExtStorageDiagnose", |
734 | 34af39e8 | Jose A. Lopes | [t| [[JSValue]] |], |
735 | 34af39e8 | Jose A. Lopes | OpDoc.opExtStorageDiagnose, |
736 | b954f097 | Constantinos Venetsanopoulos | [ pOutputFields |
737 | 34af39e8 | Jose A. Lopes | , withDoc "Which ExtStorage Provider to diagnose" pNames |
738 | 34af39e8 | Jose A. Lopes | ], |
739 | 34af39e8 | Jose A. Lopes | []) |
740 | 398e9066 | Iustin Pop | , ("OpBackupPrepare", |
741 | 34af39e8 | Jose A. Lopes | [t| Maybe (JSObject JSValue) |], |
742 | 34af39e8 | Jose A. Lopes | OpDoc.opBackupPrepare, |
743 | 398e9066 | Iustin Pop | [ pInstanceName |
744 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
745 | 398e9066 | Iustin Pop | , pExportMode |
746 | 34af39e8 | Jose A. Lopes | ], |
747 | 34af39e8 | Jose A. Lopes | "instance_name") |
748 | 398e9066 | Iustin Pop | , ("OpBackupExport", |
749 | 34af39e8 | Jose A. Lopes | [t| (Bool, [Bool]) |], |
750 | 34af39e8 | Jose A. Lopes | OpDoc.opBackupExport, |
751 | 398e9066 | Iustin Pop | [ pInstanceName |
752 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
753 | 896cc964 | Thomas Thrainer | , pBackupCompress |
754 | 398e9066 | Iustin Pop | , pShutdownTimeout |
755 | 398e9066 | Iustin Pop | , pExportTargetNode |
756 | 1c3231aa | Thomas Thrainer | , pExportTargetNodeUuid |
757 | 67fc4de7 | Iustin Pop | , pShutdownInstance |
758 | 398e9066 | Iustin Pop | , pRemoveInstance |
759 | 398e9066 | Iustin Pop | , pIgnoreRemoveFailures |
760 | 34af39e8 | Jose A. Lopes | , defaultField [| ExportModeLocal |] pExportMode |
761 | 398e9066 | Iustin Pop | , pX509KeyName |
762 | 398e9066 | Iustin Pop | , pX509DestCA |
763 | 34af39e8 | Jose A. Lopes | ], |
764 | 34af39e8 | Jose A. Lopes | "instance_name") |
765 | 398e9066 | Iustin Pop | , ("OpBackupRemove", |
766 | 34af39e8 | Jose A. Lopes | [t| () |], |
767 | 34af39e8 | Jose A. Lopes | OpDoc.opBackupRemove, |
768 | da4a52a3 | Thomas Thrainer | [ pInstanceName |
769 | da4a52a3 | Thomas Thrainer | , pInstanceUuid |
770 | 34af39e8 | Jose A. Lopes | ], |
771 | 34af39e8 | Jose A. Lopes | "instance_name") |
772 | 34af39e8 | Jose A. Lopes | , ("OpTagsGet", |
773 | 34af39e8 | Jose A. Lopes | [t| [NonEmptyString] |], |
774 | 34af39e8 | Jose A. Lopes | OpDoc.opTagsGet, |
775 | 34af39e8 | Jose A. Lopes | [ pTagsObject |
776 | 34af39e8 | Jose A. Lopes | , pUseLocking |
777 | 34af39e8 | Jose A. Lopes | , withDoc "Name of object to retrieve tags from" pTagsName |
778 | 34af39e8 | Jose A. Lopes | ], |
779 | 34af39e8 | Jose A. Lopes | "name") |
780 | 34af39e8 | Jose A. Lopes | , ("OpTagsSearch", |
781 | 34af39e8 | Jose A. Lopes | [t| [(NonEmptyString, NonEmptyString)] |], |
782 | 34af39e8 | Jose A. Lopes | OpDoc.opTagsSearch, |
783 | 34af39e8 | Jose A. Lopes | [ pTagSearchPattern |
784 | 34af39e8 | Jose A. Lopes | ], |
785 | 34af39e8 | Jose A. Lopes | "pattern") |
786 | 34af39e8 | Jose A. Lopes | , ("OpTagsSet", |
787 | 34af39e8 | Jose A. Lopes | [t| () |], |
788 | 34af39e8 | Jose A. Lopes | OpDoc.opTagsSet, |
789 | 34af39e8 | Jose A. Lopes | [ pTagsObject |
790 | 34af39e8 | Jose A. Lopes | , pTagsList |
791 | 34af39e8 | Jose A. Lopes | , withDoc "Name of object where tag(s) should be added" pTagsName |
792 | 34af39e8 | Jose A. Lopes | ], |
793 | 34af39e8 | Jose A. Lopes | []) |
794 | 34af39e8 | Jose A. Lopes | , ("OpTagsDel", |
795 | 34af39e8 | Jose A. Lopes | [t| () |], |
796 | 34af39e8 | Jose A. Lopes | OpDoc.opTagsDel, |
797 | 34af39e8 | Jose A. Lopes | [ pTagsObject |
798 | 34af39e8 | Jose A. Lopes | , pTagsList |
799 | 34af39e8 | Jose A. Lopes | , withDoc "Name of object where tag(s) should be deleted" pTagsName |
800 | 34af39e8 | Jose A. Lopes | ], |
801 | 34af39e8 | Jose A. Lopes | []) |
802 | 34af39e8 | Jose A. Lopes | , ("OpTestDelay", |
803 | 34af39e8 | Jose A. Lopes | [t| () |], |
804 | 34af39e8 | Jose A. Lopes | OpDoc.opTestDelay, |
805 | 34af39e8 | Jose A. Lopes | [ pDelayDuration |
806 | 34af39e8 | Jose A. Lopes | , pDelayOnMaster |
807 | 34af39e8 | Jose A. Lopes | , pDelayOnNodes |
808 | 34af39e8 | Jose A. Lopes | , pDelayOnNodeUuids |
809 | 34af39e8 | Jose A. Lopes | , pDelayRepeat |
810 | 34af39e8 | Jose A. Lopes | ], |
811 | 34af39e8 | Jose A. Lopes | "duration") |
812 | a3f02317 | Iustin Pop | , ("OpTestAllocator", |
813 | 5cbf7832 | Jose A. Lopes | [t| String |], |
814 | 34af39e8 | Jose A. Lopes | OpDoc.opTestAllocator, |
815 | a3f02317 | Iustin Pop | [ pIAllocatorDirection |
816 | a3f02317 | Iustin Pop | , pIAllocatorMode |
817 | a3f02317 | Iustin Pop | , pIAllocatorReqName |
818 | a3f02317 | Iustin Pop | , pIAllocatorNics |
819 | a3f02317 | Iustin Pop | , pIAllocatorDisks |
820 | a3f02317 | Iustin Pop | , pHypervisor |
821 | a3f02317 | Iustin Pop | , pIallocator |
822 | a3f02317 | Iustin Pop | , pInstTags |
823 | a3f02317 | Iustin Pop | , pIAllocatorMemory |
824 | a3f02317 | Iustin Pop | , pIAllocatorVCpus |
825 | a3f02317 | Iustin Pop | , pIAllocatorOs |
826 | a3f02317 | Iustin Pop | , pDiskTemplate |
827 | a3f02317 | Iustin Pop | , pIAllocatorInstances |
828 | a3f02317 | Iustin Pop | , pIAllocatorEvacMode |
829 | a3f02317 | Iustin Pop | , pTargetGroups |
830 | a3f02317 | Iustin Pop | , pIAllocatorSpindleUse |
831 | a3f02317 | Iustin Pop | , pIAllocatorCount |
832 | 34af39e8 | Jose A. Lopes | ], |
833 | 34af39e8 | Jose A. Lopes | "iallocator") |
834 | a3f02317 | Iustin Pop | , ("OpTestJqueue", |
835 | 5cbf7832 | Jose A. Lopes | [t| Bool |], |
836 | 34af39e8 | Jose A. Lopes | OpDoc.opTestJqueue, |
837 | a3f02317 | Iustin Pop | [ pJQueueNotifyWaitLock |
838 | a3f02317 | Iustin Pop | , pJQueueNotifyExec |
839 | a3f02317 | Iustin Pop | , pJQueueLogMessages |
840 | a3f02317 | Iustin Pop | , pJQueueFail |
841 | 34af39e8 | Jose A. Lopes | ], |
842 | 34af39e8 | Jose A. Lopes | []) |
843 | a3f02317 | Iustin Pop | , ("OpTestDummy", |
844 | 34af39e8 | Jose A. Lopes | [t| () |], |
845 | 34af39e8 | Jose A. Lopes | OpDoc.opTestDummy, |
846 | a3f02317 | Iustin Pop | [ pTestDummyResult |
847 | a3f02317 | Iustin Pop | , pTestDummyMessages |
848 | a3f02317 | Iustin Pop | , pTestDummyFail |
849 | a3f02317 | Iustin Pop | , pTestDummySubmitJobs |
850 | 34af39e8 | Jose A. Lopes | ], |
851 | 34af39e8 | Jose A. Lopes | []) |
852 | 8d239fa4 | Iustin Pop | , ("OpNetworkAdd", |
853 | 34af39e8 | Jose A. Lopes | [t| () |], |
854 | 34af39e8 | Jose A. Lopes | OpDoc.opNetworkAdd, |
855 | 8d239fa4 | Iustin Pop | [ pNetworkName |
856 | 8d239fa4 | Iustin Pop | , pNetworkAddress4 |
857 | 8d239fa4 | Iustin Pop | , pNetworkGateway4 |
858 | 8d239fa4 | Iustin Pop | , pNetworkAddress6 |
859 | 8d239fa4 | Iustin Pop | , pNetworkGateway6 |
860 | 8d239fa4 | Iustin Pop | , pNetworkMacPrefix |
861 | 8d239fa4 | Iustin Pop | , pNetworkAddRsvdIps |
862 | 1dbceab9 | Iustin Pop | , pIpConflictsCheck |
863 | 34af39e8 | Jose A. Lopes | , withDoc "Network tags" pInstTags |
864 | 34af39e8 | Jose A. Lopes | ], |
865 | 34af39e8 | Jose A. Lopes | "network_name") |
866 | 8d239fa4 | Iustin Pop | , ("OpNetworkRemove", |
867 | 34af39e8 | Jose A. Lopes | [t| () |], |
868 | 34af39e8 | Jose A. Lopes | OpDoc.opNetworkRemove, |
869 | 8d239fa4 | Iustin Pop | [ pNetworkName |
870 | 8d239fa4 | Iustin Pop | , pForce |
871 | 34af39e8 | Jose A. Lopes | ], |
872 | 34af39e8 | Jose A. Lopes | "network_name") |
873 | 8d239fa4 | Iustin Pop | , ("OpNetworkSetParams", |
874 | 34af39e8 | Jose A. Lopes | [t| () |], |
875 | 34af39e8 | Jose A. Lopes | OpDoc.opNetworkSetParams, |
876 | 8d239fa4 | Iustin Pop | [ pNetworkName |
877 | 8d239fa4 | Iustin Pop | , pNetworkGateway4 |
878 | 8d239fa4 | Iustin Pop | , pNetworkAddress6 |
879 | 8d239fa4 | Iustin Pop | , pNetworkGateway6 |
880 | 8d239fa4 | Iustin Pop | , pNetworkMacPrefix |
881 | 34af39e8 | Jose A. Lopes | , withDoc "Which external IP addresses to reserve" pNetworkAddRsvdIps |
882 | 8d239fa4 | Iustin Pop | , pNetworkRemoveRsvdIps |
883 | 34af39e8 | Jose A. Lopes | ], |
884 | 34af39e8 | Jose A. Lopes | "network_name") |
885 | 8d239fa4 | Iustin Pop | , ("OpNetworkConnect", |
886 | 34af39e8 | Jose A. Lopes | [t| () |], |
887 | 34af39e8 | Jose A. Lopes | OpDoc.opNetworkConnect, |
888 | 8d239fa4 | Iustin Pop | [ pGroupName |
889 | 8d239fa4 | Iustin Pop | , pNetworkName |
890 | 8d239fa4 | Iustin Pop | , pNetworkMode |
891 | 8d239fa4 | Iustin Pop | , pNetworkLink |
892 | 8d239fa4 | Iustin Pop | , pIpConflictsCheck |
893 | 34af39e8 | Jose A. Lopes | ], |
894 | 34af39e8 | Jose A. Lopes | "network_name") |
895 | 8d239fa4 | Iustin Pop | , ("OpNetworkDisconnect", |
896 | 34af39e8 | Jose A. Lopes | [t| () |], |
897 | 34af39e8 | Jose A. Lopes | OpDoc.opNetworkDisconnect, |
898 | 8d239fa4 | Iustin Pop | [ pGroupName |
899 | 8d239fa4 | Iustin Pop | , pNetworkName |
900 | 34af39e8 | Jose A. Lopes | ], |
901 | 34af39e8 | Jose A. Lopes | "network_name") |
902 | ebf38064 | Iustin Pop | ]) |
903 | 12c19659 | Iustin Pop | |
904 | a583ec5d | Iustin Pop | -- | Returns the OP_ID for a given opcode value. |
905 | 12c19659 | Iustin Pop | $(genOpID ''OpCode "opID") |
906 | 702a4ee0 | Iustin Pop | |
907 | a583ec5d | Iustin Pop | -- | A list of all defined/supported opcode IDs. |
908 | a583ec5d | Iustin Pop | $(genAllOpIDs ''OpCode "allOpIDs") |
909 | a583ec5d | Iustin Pop | |
910 | 702a4ee0 | Iustin Pop | instance JSON OpCode where |
911 | ebf38064 | Iustin Pop | readJSON = loadOpCode |
912 | ebf38064 | Iustin Pop | showJSON = saveOpCode |
913 | 4a826364 | Iustin Pop | |
914 | ad1c1e41 | Iustin Pop | -- | Generates the summary value for an opcode. |
915 | ad1c1e41 | Iustin Pop | opSummaryVal :: OpCode -> Maybe String |
916 | ad1c1e41 | Iustin Pop | opSummaryVal OpClusterVerifyGroup { opGroupName = s } = Just (fromNonEmpty s) |
917 | ad1c1e41 | Iustin Pop | opSummaryVal OpGroupVerifyDisks { opGroupName = s } = Just (fromNonEmpty s) |
918 | ad1c1e41 | Iustin Pop | opSummaryVal OpClusterRename { opName = s } = Just (fromNonEmpty s) |
919 | ad1c1e41 | Iustin Pop | opSummaryVal OpQuery { opWhat = s } = Just (queryTypeOpToRaw s) |
920 | ad1c1e41 | Iustin Pop | opSummaryVal OpQueryFields { opWhat = s } = Just (queryTypeOpToRaw s) |
921 | ad1c1e41 | Iustin Pop | opSummaryVal OpNodeRemove { opNodeName = s } = Just (fromNonEmpty s) |
922 | ad1c1e41 | Iustin Pop | opSummaryVal OpNodeAdd { opNodeName = s } = Just (fromNonEmpty s) |
923 | ad1c1e41 | Iustin Pop | opSummaryVal OpNodeModifyStorage { opNodeName = s } = Just (fromNonEmpty s) |
924 | ad1c1e41 | Iustin Pop | opSummaryVal OpRepairNodeStorage { opNodeName = s } = Just (fromNonEmpty s) |
925 | ad1c1e41 | Iustin Pop | opSummaryVal OpNodeSetParams { opNodeName = s } = Just (fromNonEmpty s) |
926 | ad1c1e41 | Iustin Pop | opSummaryVal OpNodePowercycle { opNodeName = s } = Just (fromNonEmpty s) |
927 | ad1c1e41 | Iustin Pop | opSummaryVal OpNodeMigrate { opNodeName = s } = Just (fromNonEmpty s) |
928 | ad1c1e41 | Iustin Pop | opSummaryVal OpNodeEvacuate { opNodeName = s } = Just (fromNonEmpty s) |
929 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceCreate { opInstanceName = s } = Just s |
930 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceReinstall { opInstanceName = s } = Just s |
931 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceRemove { opInstanceName = s } = Just s |
932 | ad1c1e41 | Iustin Pop | -- FIXME: instance rename should show both names; currently it shows none |
933 | ad1c1e41 | Iustin Pop | -- opSummaryVal OpInstanceRename { opInstanceName = s } = Just s |
934 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceStartup { opInstanceName = s } = Just s |
935 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceShutdown { opInstanceName = s } = Just s |
936 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceReboot { opInstanceName = s } = Just s |
937 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceReplaceDisks { opInstanceName = s } = Just s |
938 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceFailover { opInstanceName = s } = Just s |
939 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceMigrate { opInstanceName = s } = Just s |
940 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceMove { opInstanceName = s } = Just s |
941 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceConsole { opInstanceName = s } = Just s |
942 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceActivateDisks { opInstanceName = s } = Just s |
943 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceDeactivateDisks { opInstanceName = s } = Just s |
944 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceRecreateDisks { opInstanceName = s } = Just s |
945 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceSetParams { opInstanceName = s } = Just s |
946 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceGrowDisk { opInstanceName = s } = Just s |
947 | ad1c1e41 | Iustin Pop | opSummaryVal OpInstanceChangeGroup { opInstanceName = s } = Just s |
948 | ad1c1e41 | Iustin Pop | opSummaryVal OpGroupAdd { opGroupName = s } = Just (fromNonEmpty s) |
949 | ad1c1e41 | Iustin Pop | opSummaryVal OpGroupAssignNodes { opGroupName = s } = Just (fromNonEmpty s) |
950 | ad1c1e41 | Iustin Pop | opSummaryVal OpGroupSetParams { opGroupName = s } = Just (fromNonEmpty s) |
951 | ad1c1e41 | Iustin Pop | opSummaryVal OpGroupRemove { opGroupName = s } = Just (fromNonEmpty s) |
952 | ad1c1e41 | Iustin Pop | opSummaryVal OpGroupEvacuate { opGroupName = s } = Just (fromNonEmpty s) |
953 | ad1c1e41 | Iustin Pop | opSummaryVal OpBackupPrepare { opInstanceName = s } = Just s |
954 | ad1c1e41 | Iustin Pop | opSummaryVal OpBackupExport { opInstanceName = s } = Just s |
955 | ad1c1e41 | Iustin Pop | opSummaryVal OpBackupRemove { opInstanceName = s } = Just s |
956 | 34af39e8 | Jose A. Lopes | opSummaryVal OpTagsGet { opKind = s } = Just (show s) |
957 | ad1c1e41 | Iustin Pop | opSummaryVal OpTagsSearch { opTagSearchPattern = s } = Just (fromNonEmpty s) |
958 | ad1c1e41 | Iustin Pop | opSummaryVal OpTestDelay { opDelayDuration = d } = Just (show d) |
959 | ad1c1e41 | Iustin Pop | opSummaryVal OpTestAllocator { opIallocator = s } = |
960 | ad1c1e41 | Iustin Pop | -- FIXME: Python doesn't handle None fields well, so we have behave the same |
961 | ad1c1e41 | Iustin Pop | Just $ maybe "None" fromNonEmpty s |
962 | ad1c1e41 | Iustin Pop | opSummaryVal OpNetworkAdd { opNetworkName = s} = Just (fromNonEmpty s) |
963 | ad1c1e41 | Iustin Pop | opSummaryVal OpNetworkRemove { opNetworkName = s} = Just (fromNonEmpty s) |
964 | ad1c1e41 | Iustin Pop | opSummaryVal OpNetworkSetParams { opNetworkName = s} = Just (fromNonEmpty s) |
965 | ad1c1e41 | Iustin Pop | opSummaryVal OpNetworkConnect { opNetworkName = s} = Just (fromNonEmpty s) |
966 | ad1c1e41 | Iustin Pop | opSummaryVal OpNetworkDisconnect { opNetworkName = s} = Just (fromNonEmpty s) |
967 | ad1c1e41 | Iustin Pop | opSummaryVal _ = Nothing |
968 | ad1c1e41 | Iustin Pop | |
969 | ad1c1e41 | Iustin Pop | -- | Computes the summary of the opcode. |
970 | ad1c1e41 | Iustin Pop | opSummary :: OpCode -> String |
971 | ad1c1e41 | Iustin Pop | opSummary op = |
972 | ad1c1e41 | Iustin Pop | case opSummaryVal op of |
973 | ad1c1e41 | Iustin Pop | Nothing -> op_suffix |
974 | ad1c1e41 | Iustin Pop | Just s -> op_suffix ++ "(" ++ s ++ ")" |
975 | ad1c1e41 | Iustin Pop | where op_suffix = drop 3 $ opID op |
976 | ad1c1e41 | Iustin Pop | |
977 | 4a826364 | Iustin Pop | -- | Generic\/common opcode parameters. |
978 | 4a826364 | Iustin Pop | $(buildObject "CommonOpParams" "op" |
979 | 4a826364 | Iustin Pop | [ pDryRun |
980 | 4a826364 | Iustin Pop | , pDebugLevel |
981 | 4a826364 | Iustin Pop | , pOpPriority |
982 | 4a826364 | Iustin Pop | , pDependencies |
983 | 4a826364 | Iustin Pop | , pComment |
984 | 516a0e94 | Michele Tartara | , pReason |
985 | 4a826364 | Iustin Pop | ]) |
986 | 4a826364 | Iustin Pop | |
987 | 4a826364 | Iustin Pop | -- | Default common parameter values. |
988 | 4a826364 | Iustin Pop | defOpParams :: CommonOpParams |
989 | 4a826364 | Iustin Pop | defOpParams = |
990 | 4a826364 | Iustin Pop | CommonOpParams { opDryRun = Nothing |
991 | 4a826364 | Iustin Pop | , opDebugLevel = Nothing |
992 | 4a826364 | Iustin Pop | , opPriority = OpPrioNormal |
993 | 4a826364 | Iustin Pop | , opDepends = Nothing |
994 | 4a826364 | Iustin Pop | , opComment = Nothing |
995 | 516a0e94 | Michele Tartara | , opReason = [] |
996 | 4a826364 | Iustin Pop | } |
997 | 4a826364 | Iustin Pop | |
998 | 62933497 | Klaus Aehlig | -- | Resolve relative dependencies to absolute ones, given the job ID. |
999 | 62933497 | Klaus Aehlig | resolveDependsCommon :: (Monad m) => CommonOpParams -> JobId -> m CommonOpParams |
1000 | 62933497 | Klaus Aehlig | resolveDependsCommon p@(CommonOpParams { opDepends = Just deps}) jid = do |
1001 | 62933497 | Klaus Aehlig | deps' <- mapM (`absoluteJobDependency` jid) deps |
1002 | 62933497 | Klaus Aehlig | return p { opDepends = Just deps' } |
1003 | 62933497 | Klaus Aehlig | resolveDependsCommon p _ = return p |
1004 | 62933497 | Klaus Aehlig | |
1005 | 4a826364 | Iustin Pop | -- | The top-level opcode type. |
1006 | ad1c1e41 | Iustin Pop | data MetaOpCode = MetaOpCode { metaParams :: CommonOpParams |
1007 | ad1c1e41 | Iustin Pop | , metaOpCode :: OpCode |
1008 | ad1c1e41 | Iustin Pop | } deriving (Show, Eq) |
1009 | 4a826364 | Iustin Pop | |
1010 | 62933497 | Klaus Aehlig | -- | Resolve relative dependencies to absolute ones, given the job Id. |
1011 | 62933497 | Klaus Aehlig | resolveDependencies :: (Monad m) => MetaOpCode -> JobId -> m MetaOpCode |
1012 | 62933497 | Klaus Aehlig | resolveDependencies mopc jid = do |
1013 | 62933497 | Klaus Aehlig | mpar <- resolveDependsCommon (metaParams mopc) jid |
1014 | 62933497 | Klaus Aehlig | return (mopc { metaParams = mpar }) |
1015 | 62933497 | Klaus Aehlig | |
1016 | 4a826364 | Iustin Pop | -- | JSON serialisation for 'MetaOpCode'. |
1017 | 4a826364 | Iustin Pop | showMeta :: MetaOpCode -> JSValue |
1018 | 4a826364 | Iustin Pop | showMeta (MetaOpCode params op) = |
1019 | 4a826364 | Iustin Pop | let objparams = toDictCommonOpParams params |
1020 | 4a826364 | Iustin Pop | objop = toDictOpCode op |
1021 | 4a826364 | Iustin Pop | in makeObj (objparams ++ objop) |
1022 | 4a826364 | Iustin Pop | |
1023 | 4a826364 | Iustin Pop | -- | JSON deserialisation for 'MetaOpCode' |
1024 | 4a826364 | Iustin Pop | readMeta :: JSValue -> Text.JSON.Result MetaOpCode |
1025 | 4a826364 | Iustin Pop | readMeta v = do |
1026 | 4a826364 | Iustin Pop | meta <- readJSON v |
1027 | 4a826364 | Iustin Pop | op <- readJSON v |
1028 | 4a826364 | Iustin Pop | return $ MetaOpCode meta op |
1029 | 4a826364 | Iustin Pop | |
1030 | 4a826364 | Iustin Pop | instance JSON MetaOpCode where |
1031 | 4a826364 | Iustin Pop | showJSON = showMeta |
1032 | 4a826364 | Iustin Pop | readJSON = readMeta |
1033 | 4a826364 | Iustin Pop | |
1034 | 4a826364 | Iustin Pop | -- | Wraps an 'OpCode' with the default parameters to build a |
1035 | 4a826364 | Iustin Pop | -- 'MetaOpCode'. |
1036 | 4a826364 | Iustin Pop | wrapOpCode :: OpCode -> MetaOpCode |
1037 | 4a826364 | Iustin Pop | wrapOpCode = MetaOpCode defOpParams |
1038 | 4a826364 | Iustin Pop | |
1039 | 4a826364 | Iustin Pop | -- | Sets the comment on a meta opcode. |
1040 | 4a826364 | Iustin Pop | setOpComment :: String -> MetaOpCode -> MetaOpCode |
1041 | 4a826364 | Iustin Pop | setOpComment comment (MetaOpCode common op) = |
1042 | 4a826364 | Iustin Pop | MetaOpCode (common { opComment = Just comment}) op |
1043 | 551b44e2 | Iustin Pop | |
1044 | 551b44e2 | Iustin Pop | -- | Sets the priority on a meta opcode. |
1045 | 551b44e2 | Iustin Pop | setOpPriority :: OpSubmitPriority -> MetaOpCode -> MetaOpCode |
1046 | 551b44e2 | Iustin Pop | setOpPriority prio (MetaOpCode common op) = |
1047 | 551b44e2 | Iustin Pop | MetaOpCode (common { opPriority = prio }) op |