示例#1
0
class BIAggregationPackSchema(Schema):
    id = ReqString(default="", example="bi_pack1")
    title = ReqString(default="", example="BI Title")
    comment = String(
        description=
        "An optional comment that may be used to explain the purpose of this object.",
        allow_none=True,
        example="Rule comment",
    )
    contact_groups = ReqList(fields.String(),
                             default=[],
                             example=["contactgroup_a", "contactgroup_b"])
    public = ReqBoolean(default=False)
    rules = ReqList(fields.Nested(BIRuleSchema()), default=[])
    aggregations = ReqList(fields.Nested(BIAggregationSchema()), default=[])

    @pre_dump
    def pre_dumper(self, obj: BIAggregationPack, many=False) -> Dict:
        # Convert aggregations and rules to list
        return {
            "id": obj.id,
            "title": obj.title,
            "comment": obj.comment,
            "contact_groups": obj.contact_groups,
            "public": obj.public,
            "rules": obj.get_rules().values(),
            "aggregations": obj.get_aggregations().values(),
        }
示例#2
0
文件: bi.py 项目: LinuxHaus/checkmk
class BIPackEndpointSchema(Schema):
    title = ReqString(
        dump_default="",
        example="BI Title",
        description="The title of the BI pack.",
    )
    contact_groups = ReqList(
        fields.String(),
        dump_default=[],
        example=["contact", "contactgroup_b"],
        description="A list of contact group identifiers.",
    )
    public = ReqBoolean(
        dump_default=False,
        example="false",
        description="Should the BI pack be public or not.",
    )
示例#3
0
文件: bi.py 项目: m3rlinux/checkmk
class BIPackEndpointSchema(Schema):
    title = ReqString(
        dump_default="",
        example="BI Title",
        description="TODO: Hier muß Andreas noch etwas reinschreiben!",
    )
    contact_groups = ReqList(
        fields.String(),
        dump_default=[],
        example=["contact", "contactgroup_b"],
        description="TODO: Hier muß Andreas noch etwas reinschreiben!",
    )
    public = ReqBoolean(
        dump_default=False,
        example="false",
        description="TODO: Hier muß Andreas noch etwas reinschreiben!",
    )
示例#4
0
class BIAggregationPackSchema(Schema):
    id = ReqString(default="", example="bi_pack1")
    title = ReqString(default="", example="BI Title")
    contact_groups = ReqList(fields.String(),
                             default=[],
                             example=["contactgroup_a", "contactgroup_b"])
    public = ReqBoolean(default=False)
    rules = ReqList(fields.Nested(BIRuleSchema()), default=[])
    aggregations = ReqList(fields.Nested(BIAggregationSchema()), default=[])

    @pre_dump
    def pre_dumper(self, obj: BIAggregationPack, many=False) -> Dict:
        # Convert aggregations and rules to list
        return {
            "id": obj.id,
            "title": obj.title,
            "contact_groups": obj.contact_groups,
            "public": obj.public,
            "rules": obj.get_rules().values(),
            "aggregations": obj.get_aggregations().values(),
        }
示例#5
0
class BIAggregationVisualizationSchema(Schema):
    ignore_rule_styles = ReqBoolean(default=False, example=False)
    layout_id = ReqString(default="builtin_default", example="radial_layout2")
    line_style = ReqString(default="round", example="round")
示例#6
0
class BIRuleComputationOptionsSchema(Schema):
    disabled = ReqBoolean(dump_default=False, example=False)
示例#7
0
文件: bi.py 项目: tklecker/checkmk
class BIPackEndpointSchema(Schema):
    title = ReqString(default="", example="BI Title")
    contact_groups = ReqList(fields.String(),
                             default=[],
                             example=["contact", "contactgroup_b"])
    public = ReqBoolean(default=False, example="false")