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