Revision 8799fb9d lib/constants.py

b/lib/constants.py
1204 1204
JQT_STARTMSG = _constants.JQT_STARTMSG
1205 1205
JQT_ALL = _constants.JQT_ALL
1206 1206

  
1207
# Query resources
1208
QR_CLUSTER = "cluster"
1209
QR_INSTANCE = "instance"
1210
QR_NODE = "node"
1211
QR_LOCK = "lock"
1212
QR_GROUP = "group"
1213
QR_OS = "os"
1214
QR_JOB = "job"
1215
QR_EXPORT = "export"
1216
QR_NETWORK = "network"
1217
QR_EXTSTORAGE = "extstorage"
1218

  
1219
#: List of resources which can be queried using L{opcodes.OpQuery}
1220
QR_VIA_OP = compat.UniqueFrozenset([
1221
  QR_CLUSTER,
1222
  QR_INSTANCE,
1223
  QR_NODE,
1224
  QR_GROUP,
1225
  QR_OS,
1226
  QR_EXPORT,
1227
  QR_NETWORK,
1228
  QR_EXTSTORAGE,
1229
  ])
1230

  
1231
#: List of resources which can be queried using Local UniX Interface
1232
QR_VIA_LUXI = QR_VIA_OP.union([
1233
  QR_LOCK,
1234
  QR_JOB,
1235
  ])
1236

  
1237
#: List of resources which can be queried using RAPI
1238
QR_VIA_RAPI = QR_VIA_LUXI
1239

  
1240
# Query field types
1241
QFT_UNKNOWN = "unknown"
1242
QFT_TEXT = "text"
1243
QFT_BOOL = "bool"
1244
QFT_NUMBER = "number"
1245
QFT_UNIT = "unit"
1246
QFT_TIMESTAMP = "timestamp"
1247
QFT_OTHER = "other"
1248

  
1249
#: All query field types
1250
QFT_ALL = compat.UniqueFrozenset([
1251
  QFT_UNKNOWN,
1252
  QFT_TEXT,
1253
  QFT_BOOL,
1254
  QFT_NUMBER,
1255
  QFT_UNIT,
1256
  QFT_TIMESTAMP,
1257
  QFT_OTHER,
1258
  ])
1259

  
1260
# Query result field status (don't change or reuse values as they're used by
1261
# clients)
1262
#: Normal field status
1263
RS_NORMAL = 0
1264
#: Unknown field
1265
RS_UNKNOWN = 1
1266
#: No data (e.g. RPC error), can be used instead of L{RS_OFFLINE}
1267
RS_NODATA = 2
1268
#: Value unavailable/unsupported for item; if this field is supported
1269
#: but we cannot get the data for the moment, RS_NODATA or
1270
#: RS_OFFLINE should be used
1271
RS_UNAVAIL = 3
1272
#: Resource marked offline
1273
RS_OFFLINE = 4
1274

  
1275
RS_ALL = compat.UniqueFrozenset([
1276
  RS_NORMAL,
1277
  RS_UNKNOWN,
1278
  RS_NODATA,
1279
  RS_UNAVAIL,
1280
  RS_OFFLINE,
1281
  ])
1282

  
1283
#: Dictionary with special field cases and their verbose/terse formatting
1284
RSS_DESCRIPTION = {
1285
  RS_UNKNOWN: ("(unknown)", "??"),
1286
  RS_NODATA: ("(nodata)", "?"),
1287
  RS_OFFLINE: ("(offline)", "*"),
1288
  RS_UNAVAIL: ("(unavail)", "-"),
1289
  }
1207
QR_CLUSTER = _constants.QR_CLUSTER
1208
QR_INSTANCE = _constants.QR_INSTANCE
1209
QR_NODE = _constants.QR_NODE
1210
QR_LOCK = _constants.QR_LOCK
1211
QR_GROUP = _constants.QR_GROUP
1212
QR_OS = _constants.QR_OS
1213
QR_JOB = _constants.QR_JOB
1214
QR_EXPORT = _constants.QR_EXPORT
1215
QR_NETWORK = _constants.QR_NETWORK
1216
QR_EXTSTORAGE = _constants.QR_EXTSTORAGE
1217
QR_VIA_OP = _constants.QR_VIA_OP
1218
QR_VIA_LUXI = _constants.QR_VIA_LUXI
1219
QR_VIA_RAPI = _constants.QR_VIA_RAPI
1220

  
1221
QFT_UNKNOWN = _constants.QFT_UNKNOWN
1222
QFT_TEXT = _constants.QFT_TEXT
1223
QFT_BOOL = _constants.QFT_BOOL
1224
QFT_NUMBER = _constants.QFT_NUMBER
1225
QFT_UNIT = _constants.QFT_UNIT
1226
QFT_TIMESTAMP = _constants.QFT_TIMESTAMP
1227
QFT_OTHER = _constants.QFT_OTHER
1228
QFT_ALL = _constants.QFT_ALL
1229

  
1230
RS_NORMAL = _constants.RS_NORMAL
1231
RS_UNKNOWN = _constants.RS_UNKNOWN
1232
RS_NODATA = _constants.RS_NODATA
1233
RS_UNAVAIL = _constants.RS_UNAVAIL
1234
RS_OFFLINE = _constants.RS_OFFLINE
1235
RS_ALL = _constants.RS_ALL
1236
RSS_DESCRIPTION = _constants.RSS_DESCRIPTION
1290 1237

  
1291 1238
# max dynamic devices
1292 1239
MAX_NICS = 8

Also available in: Unified diff