LSSTApplications  11.0-13-gbb96280,12.1.rc1,12.1.rc1+1,12.1.rc1+2,12.1.rc1+5,12.1.rc1+8,12.1.rc1-1-g06d7636+1,12.1.rc1-1-g253890b+5,12.1.rc1-1-g3d31b68+7,12.1.rc1-1-g3db6b75+1,12.1.rc1-1-g5c1385a+3,12.1.rc1-1-g83b2247,12.1.rc1-1-g90cb4cf+6,12.1.rc1-1-g91da24b+3,12.1.rc1-2-g3521f8a,12.1.rc1-2-g39433dd+4,12.1.rc1-2-g486411b+2,12.1.rc1-2-g4c2be76,12.1.rc1-2-gc9c0491,12.1.rc1-2-gda2cd4f+6,12.1.rc1-3-g3391c73+2,12.1.rc1-3-g8c1bd6c+1,12.1.rc1-3-gcf4b6cb+2,12.1.rc1-4-g057223e+1,12.1.rc1-4-g19ed13b+2,12.1.rc1-4-g30492a7
LSSTDataManagementBasePackage
DatabaseConfig.py
Go to the documentation of this file.
1 import sys
2 import lsst.pex.config as pexConfig
3 import FakeTypeMap as fake
4 import WorkflowConfig as work
5 
6 ## authorization information
7 class AuthInfo(pexConfig.Config):
8  ## host name
9  host = pexConfig.Field("hostname",str)
10  ## port number
11  port = pexConfig.Field("database port",int)
12 
13 ## run cleanup configuration
14 class RunCleanup(pexConfig.Config):
15  ## days until first notice is sent
16  daysFirstNotice = pexConfig.Field("first notice",int)
17  ## days until final notice is sent
18  daysFinalNotice = pexConfig.Field("last notice",int)
19 
20 ## database system configuration
21 class DatabaseSystem(pexConfig.Config):
22  ## authorization configuration
23  authInfo = pexConfig.ConfigField("database authorization information",AuthInfo)
24  ## run clean up configuration
25  runCleanup = pexConfig.ConfigField("runCleanup ",RunCleanup)
26 
27 ## database logger configuration
28 class DBLogger(pexConfig.Config):
29  ## should a database logger be launched?
30  launch = pexConfig.Field("launch",bool)
31 
32 ## production database configuration
33 class ProductionDatabaseConfig(pexConfig.Config):
34  ## global database name
35  globalDbName = pexConfig.Field("global db name",str)
36  ## data challenge version
37  dcVersion = pexConfig.Field("data challenge version",str)
38  ## data challenge database name
39  dcDbName = pexConfig.Field("data challenge database name",str)
40  ## minimum percent free disk space required
41  minPercDiskSpaceReq = pexConfig.Field("minimum percent disk space required",int)
42  ## user run life
43  userRunLife = pexConfig.Field("user run life",int)
44 
45 ## workflow database configuration
46 class WorkflowDatabaseConfig(pexConfig.Config):
47  ## workflow database name
48  dbName = pexConfig.Field("database name",str)
49 
50 dbTypemap = {"production":ProductionDatabaseConfig,"workflow":WorkflowDatabaseConfig}
51 
52 ## database configuration
53 class DatabaseConfig(pexConfig.Config):
54  ## database name
55  name = pexConfig.Field("database name",str)
56  ## database system configuration
57  system = pexConfig.ConfigField("database system info",DatabaseSystem)
58  ## class used to configure database
59  configurationClass = pexConfig.Field("database configuration class",str)
60  ## type of database configuration
61  configuration = pexConfig.ConfigChoiceField("configuration",dbTypemap)
62  ## database logger configuration
63  logger = pexConfig.ConfigField("logger to database",DBLogger)