GETHISTORY

From CLAWSWiki

Jump to: navigation, search

GETHISTORY takes the object that is being searched for as well as a few additional optional arguments. Here is an example:

  →	
  <GETHISTORY src="fxltch">
   <User id="USERNAME" source="" src="fxltch"/>
   <Arguments src="fxltch">
    <OPER src="fxltch">OPER</OPER>
    <NEARDATE src="fxltch">DATE</NEARDATE>
   </Arguments>
  </GETHISTORY>

The optional arguments are as follows:

  1. . <NEARDATE/> - Time when the operation occurred
  2. . <OPER/> - Operator that performed the operation
  3. . <JOBID/> - ID of the job that this operation was performed in
  4. . <COMMENT/> - Comment that this operation had attached to it
  5. . <ATTRIBUTE id="name">value</ATTRIBUTE> Name (and optional value) of an attribute modified in this operation

Please note that the Computers Registration attribute is serialized before sent to history, thus if you wish to search by mac you would use something like:

  <ATTRIBUTE id="Registration">%00:00:00:20:00:00%</ATTRIBUTE>

In this case, we want any adds/mods/dels that involve the mac 00:00:00:20:00:00


The original query is returned along with the results appended to the GETHISTORY element.

  ←
  <GETHISTORY src="fxltch">
   <User id="USERNAME" source="" src="fxltch"/>
   <Arguments src="fxltch">
    <OPER src="fxltch">OPER</OPER>
    <NEARDATE src="fxltch">DATE</NEARDATE>
   </Arguments>
   <History src="history">
    <Hist id="318562" src="history">...</Hist>
   </History>
  </GETHISTORY>

Possible Errors

Example

  →	
  <soap:Envelope>
   <soap:Header>
    <login:Username>fxltch</login:Username>
   </soap:Header>
   <soap:Body>
    <GETHISTORY>
     <User id="mrc0669" source=""/>
    </GETHISTORY>
   </soap:Body>
  </soap:Envelope>
  ←
  <soap:Envelope src="fxltch,history">
   <soap:Header src="fxltch">
    <login:Username src="fxltch">fxltch</login:Username>
    <claws:DocumentID>318684</claws:DocumentID>
   </soap:Header>
   <soap:Body src="fxltch,history">
    <GETHISTORY src="fxltch,history">
     <User id="mrc0669" source="" src="fxltch"/>
     <History src="history">
      <Hist id="318562" src="history">
       <Object src="history">
         <User id="mrc0669"/>
       </Object>
       <Operator id="mrcsys" src="history"/>
       <UpdateTime src="history">11-14-2005 14:57:09</UpdateTime>
       <Operation src="history">MODUSER</Operation>
       <Changes src="history">
        <Attr src="history">
         <Param src="history">EXPIRE</Param>
         <NewValue src="history">11/14/2005</NewValue>
        </Attr>
        <Attr src="history">
         <Param src="history">SECRETWORD</Param>
         <NewValue src="history">zasdfga</NewValue>
        </Attr>
        <Attr src="history">
         <Param src="history">SECRETQUEST</Param>
         <NewValue src="history">What was the name of your first pet?</NewValue>
        </Attr>
       </Changes>
      </Hist>
     </History>
    </GETHISTORY>
   </soap:Body>
  </soap:Envelope>