<?xml version="1.0"?>
<!-- These are the examples for XSF XEP-0050: Ad-Hoc Commands-->
<stream xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" xml:lang="en"><!-- Example 1-->
<iq type='get'
    to='responder@domain'
    from='requester@domain'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
    <!-- Example 2-->
<iq type='result'
    from='responder@domain'
    to='requester@domain'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    ...
    <feature var='http://jabber.org/protocol/commands'/>
    ...
  </query>
</iq>
    <!-- Example 3-->
<iq type='get'
    from='requester@domain'
    to='responder@domain'>
  <query xmlns='http://jabber.org/protocol/disco#items'
         node='http://jabber.org/protocol/commands'/>
</iq>
    <!-- Example 4-->
<iq type='result'
    to='requester@domain'
    from='responder@domain'>
  <query xmlns='http://jabber.org/protocol/disco#items'
         node='http://jabber.org/protocol/commands'>
    <item jid='responder@domain'
          node='list'
          name='List Service Configurations'/>
    <item jid='responder@domain'
          node='config'
          name='Configure Service'/>
    <item jid='responder@domain'
          node='reset'
          name='Reset Service Configuration'/>
    <item jid='responder@domain'
          node='start'
          name='Start Service'/>
    <item jid='responder@domain'
          node='stop'
          name='Stop Service'/>
    <item jid='responder@domain'
          node='restart'
          name='Restart Service'/>
  </query>
</iq>
    <!-- Example 5-->
<iq type='get'
    from='requester@domain'
    to='responder@domain'>
  <query xmlns='http://jabber.org/protocol/disco#info'
         node='config'/>
</iq>
    <!-- Example 6-->
<iq type='result'
    to='requester@domain'
    from='responder@domain'>
  <query xmlns='http://jabber.org/protocol/disco#info'
         node='config'>
    <identity name='Configure Service'
              category='automation'
              type='command-node'/>
    <feature var='http://jabber.org/protocol/commands'/>
    <feature var='jabber:x:data'/>
  </query>
</iq>
    <!-- Example 7-->
<message from='responder@domain' to='requester@domain'>
  <subject>Service Controls</subject>
  <query xmlns='http://jabber.org/protocol/disco#items'
         node='http://jabber.org/protocol/commands'>
    <item jid='responder@domain'
          node='list'
          name='List Service Configurations'/>
    <item jid='responder@domain'
          node='config'
          name='Configure Service'/>
    <item jid='responder@domain'
          node='reset'
          name='Reset Service Configuration'/>
    <item jid='responder@domain'
          node='start'
          name='Start Service'/>
    <item jid='responder@domain'
          node='stop'
          name='Stop Service'/>
    <item jid='responder@domain'
          node='restart'
          name='Restart Service'/>
  </query>
</message>
    <!-- Example 8-->
<iq type='set' to='responder@domain' id='exec1'>
  <command xmlns='http://jabber.org/protocol/commands'
           node='list'
           action='execute'/>
</iq>
      <!-- Example 9-->
<iq type='result' from='responder@domain' to='requester@domain' id='exec1'>
  <command xmlns='http://jabber.org/protocol/commands'
           sessionid='list:20020923T213616Z-700'
           node='list'
           status='completed'>
    <x xmlns='jabber:x:data' type='result'>
      <title>Available Services</title>
      <reported>
        <field var='service' label='Service'/>
        <field var='runlevel-1' label='Single-User mode'/>
        <field var='runlevel-2' label='Non-Networked Multi-User mode'/>
        <field var='runlevel-3' label='Full Multi-User mode'/>
        <field var='runlevel-5' label='X-Window mode'/>
      </reported>
      <item>
        <field var='service'><value>httpd</value></field>
        <field var='runlevel-1'><value>off</value></field>
        <field var='runlevel-2'><value>off</value></field>
        <field var='runlevel-3'><value>on</value></field>
        <field var='runlevel-5'><value>on</value></field>
      </item>
      <item>
        <field var='service'><value>postgresql</value></field>
        <field var='runlevel-1'><value>off</value></field>
        <field var='runlevel-2'><value>off</value></field>
        <field var='runlevel-3'><value>on</value></field>
        <field var='runlevel-5'><value>on</value></field>
      </item>
      <item>
        <field var='service'><value>jabberd</value></field>
        <field var='runlevel-1'><value>off</value></field>
        <field var='runlevel-2'><value>off</value></field>
        <field var='runlevel-3'><value>on</value></field>
        <field var='runlevel-5'><value>on</value></field>
      </item>
    </x>
  </command>
</iq>
      <!-- Example 10-->
<iq type='set' to='responder@domain' id='exec1'>
  <command xmlns='http://jabber.org/protocol/commands'
           node='config'
           action='execute'/>
</iq>
   <!-- Example 11-->
<iq type='result' from='responder@domain' to='requester@domain' id='exec1'>
  <command xmlns='http://jabber.org/protocol/commands'
           sessionid='config:20020923T213616Z-700'
           node='config'
           status='executing'>
    <actions execute='next'>
      <next/>
    </actions>
    <x xmlns='jabber:x:data' type='form'>
      <title>Configure Service</title>
      <instructions>
        Please select the service to configure.
      </instructions>
      <field var='service' label='Service' type='list-single'>
        <option><value>httpd</value></option>
        <option><value>jabberd</value></option>
        <option><value>postgresql</value></option>
      </field>
    </x>
  </command>
</iq>
    <!-- Example 12-->
<iq type='set' to='responder@domain' id='exec2'>
  <command xmlns='http://jabber.org/protocol/commands'
           sessionid='config:20020923T213616Z-700'
           node='config'>
    <x xmlns='jabber:x:data' type='submit'>
      <field var='service'>
        <value>httpd</value>
      </field>
    </x>
  </command>
</iq>
    <!-- Example 13-->
<iq type='result' from='responder@domain' to='requester@domain' id='exec2'>
  <command xmlns='http://jabber.org/protocol/commands'
           sessionid='config:20020923T213616Z-700'
           node='config'
           status='executing'>
    <actions execute='complete'>
      <prev/>
      <complete/>
    </actions>
    <x xmlns='jabber:x:data' type='form'>
      <title>Configure Service</title>
      <instructions>
        Please select the run modes and state for 'httpd'.
      </instructions>
      <field var='runlevel' label='Run Modes' type='list-multi'>
        <value>3</value>
        <value>5</value>
        <option label='Single-User'><value>1</value></option>
        <option label='Non-Networked Multi-User'><value>2</value></option>
        <option label='Full Multi-User'><value>3</value></option>
        <option label='X-Window'><value>5</value></option>
      </field>
      <field var='state' label='Run State' type='list-single'>
        <value>off</value>
        <option label='Active'><value>off</value></option>
        <option label='Inactive'><value>on</value></option>
      </field>
    </x>
  </command>
</iq>
    <!-- Example 14-->
<iq type='set' to='responder@domain' id='exec3'>
  <command xmlns='http://jabber.org/protocol/commands'
           sessionid='config:20020923T213616Z-700'
           node='config'>
    <x xmlns='jabber:x:data' type='submit'>
      <field var='mode'>
        <value>3</value>
      </field>
      <field var='state'>
        <value>on</value>
      </field>
    </x>
  </command>
</iq>
    <!-- Example 15-->
<iq type='result' from='responder@domain' to='requester@domain' id='exec3'>
  <command xmlns='http://jabber.org/protocol/commands'
           sessionid='config:20020923T213616Z-700'
           node='config'
           status='completed'>
    <note type='info'>Service 'httpd' has been configured.</note>
  </command>
</iq>
    <!-- Example 16-->
<iq type='set' to='responder@domain' id='exec2'>
  <command xmlns='http://jabber.org/protocol/commands'
           sessionid='config:20020923T213616Z-700'
           node='config'
           action='prev'/>
</iq>
    <!-- Example 17-->
<iq type='result' from='responder@domain' to='requester@domain' id='exec2'>
  <command xmlns='http://jabber.org/protocol/commands'
           sessionid='config:20020923T213616Z-700'
           node='config'
           status='executing'>
    <actions execute='next'>
      <next/>
    </actions>
    <x xmlns='jabber:x:data' type='form'>
      <title>Configure Service</title>
      <instructions>
        Please select the service to configure.
      </instructions>
      <field var='service' label='Service' type='list-single'>
        <value>httpd</value>
        <option><value>httpd</value></option>
        <option><value>jabberd</value></option>
        <option><value>postgresql</value></option>
      </field>
    </x>
  </command>
</iq>
    <!-- Example 18-->
<iq type='set' to='responder@domain' id='exec3'>
  <command xmlns='http://jabber.org/protocol/commands'
           sessionid='config:20020923T213616Z-700'
           node='config'
           action='cancel'/>
</iq>
    <!-- Example 19-->
<iq type='result' from='responder@domain' to='requester@domain' id='exec3'>
  <command xmlns='http://jabber.org/protocol/commands'
           sessionid='config:20020923T213616Z-700'
           node='config'
           status='canceled'/>
</iq>
    <!-- Example 20-->
<iq type='set' to='responder@domain' id='exec1' xml:lang='en-us'>
  <command xmlns='http://jabber.org/protocol/commands'
           node='list'
           action='execute'/>
</iq>
    <!-- Example 21-->
<iq type='result' 
    from='responder@domain' 
    to='requester@domain' 
    id='exec1' 
    xml:lang='en-us'>
  <command xmlns='http://jabber.org/protocol/commands'
           sessionid='list:20020923T213616Z-700'
           node='list'
           status='completed'>
    <x xmlns='jabber:x:data' type='result'>
      <title>Available Services</title>
      <reported>
        <field var='service' label='Service'/>
        <field var='runlevel-1' label='Single-User mode'/>
        <field var='runlevel-2' label='Non-Networked Multi-User mode'/>
        <field var='runlevel-3' label='Full Mult-User mode'/>
        <field var='runlevel-5' label='X-Window mode'/>
      </reported>
      <item>
        <field var='service'><value>httpd</value></field>
        <field var='runlevel-1'><value>off</value></field>
        <field var='runlevel-2'><value>off</value></field>
        <field var='runlevel-3'><value>on</value></field>
        <field var='runlevel-5'><value>on</value></field>
      </item>
      <item>
        <field var='service'><value>postgresql</value></field>
        <field var='runlevel-1'><value>off</value></field>
        <field var='runlevel-2'><value>off</value></field>
        <field var='runlevel-3'><value>on</value></field>
        <field var='runlevel-5'><value>on</value></field>
      </item>
      <item>
        <field var='service'><value>jabberd</value></field>
        <field var='runlevel-1'><value>off</value></field>
        <field var='runlevel-2'><value>off</value></field>
        <field var='runlevel-3'><value>on</value></field>
        <field var='runlevel-5'><value>on</value></field>
      </item>
    </x>
  </command>
</iq>
      <!-- Example 22-->
<iq type='set' to='responder@domain' id='exec1' xml:lang='fr-ca'>
  <command xmlns='http://jabber.org/protocol/commands'
           node='list'
           action='execute'/>
</iq>
    <!-- Example 23-->
<iq type='error' from='responder@domain' to='requester@domain/resource' id='exec1'>
  <command xmlns='http://jabber.org/protocol/commands'
           node='list'
           action='execute'
           xml:lang='fr-ca'/>
  <error type='modify' code='400'>
    <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
    <bad-locale xmlns='http://jabber.org/protocol/commands'/>
  </error>
</iq>
    <!-- Example 24-->
xmpp:montague.net?command;node=stats
    <!-- Example 25-->
<iq to='montague.net' type='set'>
  <command xmlns='http://jabber.org/protocol/commands' node='stats'/>
</iq>
    </stream>

