<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [

  <!-- Fill in your name for FIRSTNAME and SURNAME. -->
  <!-- Please adjust the date whenever revising the manpage. -->
  <!ENTITY dhdate      "<date>June 08, 2010</date>">
  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
       allowed: see man(7), man(1). -->
  <!ENTITY dhsection   "<manvolnum>8</manvolnum>">
  <!ENTITY dhucpackage "<refentrytitle>gnt-job</refentrytitle>">
  <!ENTITY dhpackage   "gnt-job">

  <!ENTITY debian      "<productname>Debian</productname>">
  <!ENTITY gnu         "<acronym>GNU</acronym>">
  <!ENTITY gpl         "&gnu; <acronym>GPL</acronym>">
  <!ENTITY footer SYSTEM "footer.sgml">
]>

<refentry>
  <refentryinfo>
    <copyright>
      <year>2008</year>
      <year>2009</year>
      <holder>Google Inc.</holder>
    </copyright>
    &dhdate;
  </refentryinfo>
  <refmeta>
    &dhucpackage;

    &dhsection;
    <refmiscinfo>Ganeti 2.2</refmiscinfo>
  </refmeta>
  <refnamediv>
    <refname>&dhpackage;</refname>

    <refpurpose>Job commands</refpurpose>
  </refnamediv>
  <refsynopsisdiv>
    <cmdsynopsis>
      <command>&dhpackage; </command>

      <arg choice="req">command</arg>
      <arg>arguments...</arg>
    </cmdsynopsis>
  </refsynopsisdiv>
  <refsect1>
    <title>DESCRIPTION</title>

    <para>
      The <command>&dhpackage;</command> is used for examining and
      manipulating the job queue.
    </para>

  </refsect1>
  <refsect1>
    <title>COMMANDS</title>

    <refsect2>
      <title>ARCHIVE</title>
      <cmdsynopsis>
        <command>archive</command>

        <arg choice="req" rep="repeat">id</arg>
      </cmdsynopsis>

      <para>This command can be used to archive job by their IDs. Only
      jobs that have finished execution (i.e either
      <emphasis>success</emphasis>, <emphasis>error</emphasis> or
      <emphasis>canceled</emphasis> jobs).</para>

    </refsect2>

    <refsect2>
      <title>AUTOARCHIVE</title>
      <cmdsynopsis>
        <command>autoarchive</command>
        <group choice="req">
          <arg><replaceable>age</replaceable></arg>
          <arg>all</arg>
        </group>
      </cmdsynopsis>

      <para>
        Archive jobs by their age. This command can archive jobs older
        than <replaceable>age</replaceable> seconds, or alternatively
        all finished jobs can be archived if the string <literal>all
        </literal> is passed.
      </para>
    </refsect2>

    <refsect2>
      <title>CANCEL</title>
      <cmdsynopsis>
        <command>cancel</command>
        <arg choice="req"><replaceable>id</replaceable></arg>
      </cmdsynopsis>

      <para>
        Cancel the job identified by the given
        <replaceable>id</replaceable>. Only jobs that have not yet
        started to run can be canceled; that is, jobs in either the
        <emphasis>queued</emphasis> or <emphasis>waiting</emphasis>
        state.
      </para>
    </refsect2>

    <refsect2>
      <title>INFO</title>
      <cmdsynopsis>
        <command>info</command>
        <arg choice="req" rep="repeat"><replaceable>id</replaceable></arg>
      </cmdsynopsis>

      <para>
        Show detailed information about the given job id(s). If no job
        id is given, all jobs are examined (warning, this is a lot of
        information).
      </para>

    </refsect2>

    <refsect2>
      <title>LIST</title>
      <cmdsynopsis>
        <command>list</command>
        <arg>--no-headers</arg>
        <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
        <sbr>
        <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
        <sbr>
      </cmdsynopsis>

      <para>
        Lists the jobs and their status. By default, the job id, job
        status, and a small job description is listed, but additional
        parameters can be selected.
      </para>

      <para>
        The <option>--no-headers</option> option will skip the initial
        header line. The <option>--separator</option> option takes an
        argument which denotes what will be used between the output
        fields. Both these options are to help scripting.
      </para>

      <para>
        The <option>-o</option> option takes a comma-separated list of
        output fields. The available fields and their meaning are:
        <variablelist>
          <varlistentry>
            <term>id</term>
            <listitem>
              <simpara>the job id</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>status</term>
            <listitem>
              <simpara>the status of the job</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>priority</term>
            <listitem>
              <simpara>current priority of the job</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>received_ts</term>
            <listitem>
              <simpara>the timestamp the job was received</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>start_ts</term>
            <listitem>
              <simpara>the timestamp when the job was started</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>end_ts</term>
            <listitem>
              <simpara>the timestamp when the job was ended</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>summary</term>
            <listitem>
              <simpara>a summary of the opcodes that define the job</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>ops</term>
            <listitem>
              <simpara>the list of opcodes defining the job</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>opresult</term>
            <listitem>
              <simpara>the list of opcode results</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>opstatus</term>
            <listitem>
              <simpara>the list of opcode statuses</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>oplog</term>
            <listitem>
              <simpara>the list of opcode logs</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>opstart</term>
            <listitem>
              <simpara>the list of opcode start times (before
              acquiring locks)</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>opexec</term>
            <listitem>
              <simpara>the list of opcode execution start times (after
              acquiring any necessary locks)</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>opend</term>
            <listitem>
              <simpara>the list of opcode end times</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>oppriority</term>
            <listitem>
              <simpara>the priority of each opcode</simpara>
            </listitem>
          </varlistentry>
        </variablelist>
      </para>

      <para>
        If the value of the option starts with the character
        <constant>+</constant>, the new fields will be added to the
        default list. This allows to quickly see the default list plus
        a few other fields, instead of retyping the entire list of
        fields.
      </para>

    </refsect2>

    <refsect2>
      <title>WATCH</title>
      <cmdsynopsis>
        <command>watch</command>
        <arg>id</arg>
      </cmdsynopsis>

      <para>
        This command follows the output of the job by the given
        <replaceable>id</replaceable> and prints it.
      </para>
    </refsect2>

  </refsect1>

  &footer;

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->