我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用oslo_config.cfg.DictOpt()。
def __metric_opts(self): """List of options to be used in metric defined sections""" return [ cfg.StrOpt("metric_name", help="Metric Name used to log monitoring information" " in Monasca", required=True), cfg.DictOpt("dimensions", default={}, help="Dict that contains dimensions information. " "component:nova-compute,service:compute", ), cfg.StrOpt("aggregate", choices=["any", "all"], help="How to consider the compute node is down. If you " "metric reports many states, like checking " "different services on the compute host, should we" " consider if one component down all are down or" " only if all components are down. Default is all." " This means if all components fail, freezer-dr" " will consider the host failed", default='all' ), cfg.StrOpt("undetermined", choices=['OK', 'ALARM'], default='ALARM', help="How to handle UNDETERMINED states. It can be " "ignored, will be considered OK state or can be " "considered ALARM. Default is ALARM") ]