/
alarm.xsd
91 lines (80 loc) · 5.26 KB
/
alarm.xsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!--
Copyright (c) 2016 Juniper Networks, Inc. All rights reserved.
-->
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpleType name="AlarmOperation">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="=="/>
<xsd:enumeration value="!="/>
<xsd:enumeration value="<="/>
<xsd:enumeration value=">="/>
<xsd:enumeration value="in"/>
<xsd:enumeration value="not in"/>
<xsd:enumeration value="size=="/>
<xsd:enumeration value="size!="/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="AlarmOperand2">
<xsd:element name="uve_attribute" type="xsd:string" required="exclusive" description="UVE attribute specified in the dotted format. Example: NodeStatus.process_info.process_state"/>
<xsd:element name="json_value" type="xsd:string" required="exclusive" description="json value as string"/>
</xsd:complexType>
<xsd:complexType name="AlarmExpression">
<xsd:all>
<xsd:element name="operation" type="AlarmOperation" required="true" description="operation to compare operand1 and operand2"/>
<xsd:element name="operand1" type="xsd:string" required="true" description="UVE attribute specified in the dotted format. Example: NodeStatus.process_info.process_state"/>
<xsd:element name="operand2" type="AlarmOperand2" required="true" description="UVE attribute or a json value to compare with the UVE attribute in operand1"/>
<xsd:element name="variables" type="xsd:string" required="optional" maxOccurs="unbounded" description="List of UVE attributes that would be useful when the alarm is raised. For example, user may want to raise an alarm if the NodeStatus.process_info.process_state != PROCESS_STATE_RUNNING. But, it would be useful to know the process_name whose state != PROCESS_STATE_RUNNING. This UVE attribute which is neither part of operand1 nor operand2 may be specified in variables"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="AlarmAndList">
<xsd:all>
<xsd:element name="and_list" type="AlarmExpression" maxOccurs="unbounded"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="AlarmOrList">
<xsd:all>
<xsd:element name="or_list" type="AlarmAndList" maxOccurs="unbounded"/>
</xsd:all>
</xsd:complexType>
<xsd:simpleType name="AlarmSeverity">
<xsd:restriction base="xsd:integer" required="true" description="0 - CRITICAL, 1 - MAJOR and 2 - MINOR">
<xsd:minInclusive value="0"/>
<xsd:maxInclusive value="2"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="UveKeysType">
<xsd:all>
<xsd:element name="uve-key" type="xsd:string" required="true" maxOccurs="unbounded" description="List of UVE tables where this alarm config should be applied"/>
</xsd:all>
</xsd:complexType>
<xsd:element name="alarm-enable" type="xsd:boolean"/>
<!--#IFMAP-SEMANTICS-IDL
Property('alarm-enable', 'global-system-config', 'optional', 'CRUD',
'Flag to enable/disable alarms configured under global-system-config. True, if not set.') -->
<!--#IFMAP-SEMANTICS-IDL
Property('alarm-enable', 'project', 'optional', 'CRUD',
'Flag to enable/disable alarms configured under a project. True, if not set.') -->
<xsd:element name="alarm" type="ifmap:IdentityType"/>
<!--Identifier "alarm" is set of rules that may be applied to all UVE objects or a subset of UVE objects or a specific UVE in the analytics UVE table. Alarms may be anchored under "global-system-config" or "project". Alarms related to objects that are configured under global-system-config such as analytics-node, config-node, etc., should be configured under "global-system-config". If an alarm needs to be applied to objects that are anchored under a project, then the alarm should be configured under that specific project. -->
<xsd:element name="global-system-config-alarm"/>
<xsd:element name="project-alarm"/>
<!--#IFMAP-SEMANTICS-IDL
Link('global-system-config-alarm',
'global-system-config', 'alarm', ['has'], 'optional', 'CRUD',
'List of alarms that are applicable to objects anchored under global-system-config.');
Link('project-alarm', 'project', 'alarm', ['has'], 'optional', 'CRUD',
'List of alarms that are applicable to objects anchored under the project.') -->
<xsd:element name="uve-keys" type="UveKeysType"/>
<!--#IFMAP-SEMANTICS-IDL
Property('uve-keys', 'alarm', 'required', 'CRUD',
'List of UVE tables or UVE objects where this alarm config should be applied. For example, rules based on NodeStatus UVE can be applied to multiple object types or specific uve objects such as analytics-node, config-node, control-node:<hostname>, etc.,') -->
<xsd:element name="alarm-severity" type="AlarmSeverity"/>
<!--#IFMAP-SEMANTICS-IDL
Property('alarm-severity', 'alarm', 'required', 'CRUD',
'Severity level for the alarm.') -->
<xsd:element name="alarm-rules" type="AlarmOrList"/>
<!--#IFMAP-SEMANTICS-IDL
ListProperty('alarm-rules', 'alarm', 'optional', 'CRUD',
'Rules based on the UVE attributes specified as OR-of-ANDs of AlarmExpression template. Example: "alarm_rules": {"or_list": [{"and_list": [{AlarmExpression1}, {AlarmExpression2}, ...]}, {"and_list": [{AlarmExpression3}, {AlarmExpression4}, ...]}]}') -->
</xsd:schema>