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