LSSTApplications  11.0-13-gbb96280,12.1+18,12.1+7,12.1-1-g14f38d3+72,12.1-1-g16c0db7+5,12.1-1-g5961e7a+84,12.1-1-ge22e12b+23,12.1-11-g06625e2+4,12.1-11-g0d7f63b+4,12.1-19-gd507bfc,12.1-2-g7dda0ab+38,12.1-2-gc0bc6ab+81,12.1-21-g6ffe579+2,12.1-21-gbdb6c2a+4,12.1-24-g941c398+5,12.1-3-g57f6835+7,12.1-3-gf0736f3,12.1-37-g3ddd237,12.1-4-gf46015e+5,12.1-5-g06c326c+20,12.1-5-g648ee80+3,12.1-5-gc2189d7+4,12.1-6-ga608fc0+1,12.1-7-g3349e2a+5,12.1-7-gfd75620+9,12.1-9-g577b946+5,12.1-9-gc4df26a+10
LSSTDataManagementBasePackage
DatabaseConfig.py
Go to the documentation of this file.
1 from __future__ import absolute_import
2 # import sys
3 import lsst.pex.config as pexConfig
4 # from . import FakeTypeMap as fake
5 # from . import WorkflowConfig as work
6 
7 # authorization information
8 
9 
10 class AuthInfo(pexConfig.Config):
11  # host name
12  host = pexConfig.Field("hostname", str)
13  # port number
14  port = pexConfig.Field("database port", int)
15 
16 # run cleanup configuration
17 
18 
19 class RunCleanup(pexConfig.Config):
20  # days until first notice is sent
21  daysFirstNotice = pexConfig.Field("first notice", int)
22  # days until final notice is sent
23  daysFinalNotice = pexConfig.Field("last notice", int)
24 
25 # database system configuration
26 
27 
28 class DatabaseSystem(pexConfig.Config):
29  # authorization configuration
30  authInfo = pexConfig.ConfigField("database authorization information", AuthInfo)
31  # run clean up configuration
32  runCleanup = pexConfig.ConfigField("runCleanup ", RunCleanup)
33 
34 # production database configuration
35 
36 
37 class ProductionDatabaseConfig(pexConfig.Config):
38  # global database name
39  globalDbName = pexConfig.Field("global db name", str)
40 
41 # workflow database configuration
42 
43 
44 class WorkflowDatabaseConfig(pexConfig.Config):
45  # workflow database name
46  dbName = pexConfig.Field("database name", str)
47 
48 dbTypemap = {"production": ProductionDatabaseConfig, "workflow": WorkflowDatabaseConfig}
49 
50 # database configuration
51 
52 
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)