Developer's Guide

  • Docs Home
  • Community Home

4. Zenoss XML Schema

This XML schema describes the output of the 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. object

  <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. 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.2. 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.3. 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.2. objects

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

4.2.1. 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.2.2. Children

  • object - the objects element may also have object as children

4.3. property

  <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.3.1. 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.3.2. 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.4. tomany

  <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.4.1. 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.4.2. Attributes

  • id - unique name of the to many relationship

4.4.3. Children

  • link - (see link element below) These links are the XML representations of the references to related objects

4.5. tomanycont

  <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.5.1. 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.5.2. Attributes

  • id - the name of the to many cont relationship

4.5.3. Children

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

4.6. toone

  <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.6.1. 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 performance server "localhost."

4.6.2. Attributes

  • id - the name of the toone relationship of an object

  • objid - the path to the related object

4.7. link

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

4.7.1. 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.7.2. Attributes

  • objid - is the path to the object