4. Zenoss XML Schema

This XML schema describes the valid output of our zendump command.

<?xml version="1.0" encoding="UTF-8" ?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="link">
    <xs:complexType>
      <xs:attribute name="objid" type="xs:string" use="required" />
    </xs:complexType>
  </xs:element>

  <xs:element name="object">
    <xs:complexType>
      <xs:choice>
        <xs:element ref="object" />
        <xs:element ref="property" />
        <xs:element ref="tomany" />
        <xs:element ref="tomanycont" />
        <xs:element ref="toone" />
      </xs:choice>
      <xs:attribute name="module" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="class" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="id" type="xs:string" use="required" />
    </xs:complexType>
  </xs:element>

  <xs:element name="objects">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="object" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="property">
    <xs:complexType mixed="true">
      <xs:attribute name="type" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="visible" use="optional">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="True" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="mode" type="xs:string" use="optional" />
      <xs:attribute name="setter" type="xs:NMTOKEN" use="optional" />
      <xs:attribute name="select_variable" use="optional">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="lineTypes" />
            <xs:enumeration value="rrdtypes" />
            <xs:enumeration value="sourcetypes" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="id" type="xs:NMTOKEN" use="required" />
    </xs:complexType>
  </xs:element>

  <xs:element name="tomany">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="link" />
      </xs:sequence>
      <xs:attribute name="id" type="xs:NMTOKEN" use="required" />
    </xs:complexType>
  </xs:element>

  <xs:element name="tomanycont">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="object" maxOccurs="unbounded" />
      </xs:sequence>
      <xs:attribute name="id" type="xs:NMTOKEN" use="required" />
    </xs:complexType>
  </xs:element>

  <xs:element name="toone">
    <xs:complexType>
      <xs:attribute name="objid" type="xs:string" use="required" />
      <xs:attribute name="id" type="xs:NMTOKEN" use="required" />
    </xs:complexType>
  </xs:element>

</xs:schema>

4.1. XML Schema Breakdown

4.1.1. object Element

  <xs:element name="object">
    <xs:complexType>
      <xs:choice>
        <xs:element ref="object" />
        <xs:element ref="property" />
        <xs:element ref="tomany" />
        <xs:element ref="tomanycont" />
        <xs:element ref="toone" />
      </xs:choice>
      <xs:attribute name="module" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="class" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="id" type="xs:string" use="required" />
    </xs:complexType>
  </xs:element>

4.1.1.1. Object Element Example
<object id='deleteActionRuleWindows' module='Products.ZenModel.ZenMenuItem' class='ZenMenuItem'>
<property type="text" id="description" mode="w" >
Delete Rule Windows...
</property>
<property type="text" id="action" mode="w" >
dialog_deleteActionRuleWindows
</property>
<property type="boolean" id="isglobal" mode="w" >
True
</property>
<property type="lines" id="permissions" mode="w" >
('Change Alerting Rules',)
</property>
<property type="boolean" id="isdialog" mode="w" >
True
</property>
<property type="float" id="ordering" mode="w" >
80.0
</property>
</object>

The object element is an XML representation of a Zope object. The example above is the XML representation of a ZenMenuItem object.

4.1.1.2. Object Element Attributes
  • id - the unique identifier for the object instance

  • class - the classname of the object instance

  • module - the module in which this object's class is defined

4.1.1.3. Object Element Children
  • object - an object may also have objects as children

  • property - (see property element section below)

  • tomany - (see tomany element section below)

  • tomanycont - (see tomanycont element section below)

  • toone - (see toone element section below)

4.1.2. objects Element

  <xs:element name="objects">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="object" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

4.1.2.1. Objects Element Example
<objects>
<object id='deleteActionRuleWindows' module='Products.ZenModel.ZenMenuItem' class='ZenMenuItem'>
<property type="text" id="description" mode="w" >
Delete Rule Windows...
</property>
</object>
</objects>

The object element is an XML representation of a Zope object. The example above is the XML representation of a ZenMenuItem object.

4.1.2.2. Objects Element Attributes

none

4.1.2.3. Objects Element Children
  • object - the objects element may also have object as children

4.1.3. property Element

  <xs:element name="property">
    <xs:complexType mixed="true">
      <xs:attribute name="type" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="visible" use="optional">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="True" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="mode" type="xs:string" use="optional" />
      <xs:attribute name="setter" type="xs:NMTOKEN" use="optional" />
      <xs:attribute name="select_variable" use="optional">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="lineTypes" />
            <xs:enumeration value="rrdtypes" />
            <xs:enumeration value="sourcetypes" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="id" type="xs:NMTOKEN" use="required" />
    </xs:complexType>
  </xs:element>>

4.1.3.1. Property Element Example
<property type="float" id="ordering" mode="w" >
80.0
</property>

The property element represents a property of an object in Zope. The example above represents an "ordering" property of an object. The value of the "ordering" property is 80.0 and is of type float.

4.1.3.2. Property Element Attributes
  • id - the unique identifier of this property

  • type - the datatype of the property's value

  • visible - an optional boolean, a flag used to display or hide the property

  • mode - read/write permission of this property

  • setter - the name of the method to set this property

  • select_variable - the name of the list which hold the possible values of this property

4.1.3.3. Property Element Children

None.

4.1.4. tomany Element

  <xs:element name="tomany">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="link" />
      </xs:sequence>
      <xs:attribute name="id" type="xs:NMTOKEN" use="required" />
    </xs:complexType>
  </xs:element>

4.1.4.1. tomany Element Example
<tomany id='devices'>
<link objid='/zport/dmd/Devices/Server/Linux/devices/MYDEVICE'/>
</tomany>

The tomany element represent a ToManyRelationship object in Zope. The example above is of the "devices" to many relationship on an object.

4.1.4.2. tomany Element Attributes
  • id - unique name of the to many relationship

4.1.4.3. tomany Element Children
  • link - (see link element below) These links are the XML representations of the references to related objects

4.1.5. tomanycont Element

  <xs:element name="tomanycont">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="object" maxOccurs="unbounded" />
      </xs:sequence>
      <xs:attribute name="id" type="xs:NMTOKEN" use="required" />
    </xs:complexType>
  </xs:element>

4.1.5.1. tomanycont Element Example
<tomanycont id='instances'>
<object id='dropbear' module='Products.ZenEvents.EventClassInst' class='EventClassInst'>
<property type="string" id="eventClassKey" mode="w" >
dropbear
</property>
<property type="int" id="sequence" mode="w" >
1
</property>
...
</tomanycont>

4.1.5.2. tomanycont Element Attributes
  • id - the name of the to many cont relationship

4.1.5.3. tomanycont Element Children
  • object - the tomanycont element may have objects elements as children, these subobjects are the XML representations of these related objects

4.1.6. toone Element

  <xs:element name="toone">
    <xs:complexType>
      <xs:attribute name="objid" type="xs:string" use="required" />
      <xs:attribute name="id" type="xs:NMTOKEN" use="required" />
    </xs:complexType>
  </xs:element>

4.1.6.1. toone Element Example
<toone id='perfServer' objid='/zport/dmd/Monitors/Performance/localhost'/>

The toone element represents a ToOneRelationship on an object. The example above is a toone relationship named "perfServer". It represents a device's relationship to only one perfomance server "localhost"

4.1.6.2. toone Element Attributes
  • id - the name of the toone relationship of an object

  • objid - the path to the related object

4.1.6.3. toone Element Children

None.

4.1.7. link Element

  <xs:element name="link">
    <xs:complexType>
      <xs:attribute name="objid" type="xs:string" use="required" />
    </xs:complexType>
  </xs:element>

4.1.7.1. link Element Example
<link objid='/zport/dmd/Devices/Server/Linux/devices/MYDEVICE'/>

The link is a reference to another object element rather than a new instance of an object element.

4.1.7.2. link Element Attributes
  • objid - is the path to the object

4.1.7.3. link Element Children

None.