AnsweredAssumed Answered

v2 API purge odd-ness

Question asked by mcalvi on Aug 8, 2013
Latest reply on Aug 9, 2013 by Brandon Reeves

I was working on a purge script and noticed that the call to purge ' /api/2.0/fo/asset/host/?action-purge ' returns a batch_return on success but a simple return on some errors?  Has anyone else noticed this?  Is this expected behavior?

 

 

Successful purge return:

<!DOCTYPE BATCH_RETURN SYSTEM "https://qualysapi.qualys.com/api/2.0/batch_return.dtd">

<BATCH_RETURN>

  <RESPONSE>

    <DATETIME>2013-08-08T18:40:44Z</DATETIME>

    <BATCH_LIST>

      <BATCH>

        <TEXT>Hosts Queued for Purging</TEXT>

        <ID_SET>

          <ID>68028045</ID>

        </ID_SET>

      </BATCH>

    </BATCH_LIST>

  </RESPONSE>

</BATCH_RETURN>

 

Formatting error:

<!DOCTYPE SIMPLE_RETURN SYSTEM "https://qualysapi.qualys.com/api/2.0/simple_return.dtd">

<SIMPLE_RETURN>

  <RESPONSE>

    <DATETIME>2013-08-08T18:38:39Z</DATETIME>

    <CODE>1905</CODE>

    <TEXT>parameter ips has invalid value: 10.2.16.172.33 (Invalid IP or range.)

</TEXT>

  </RESPONSE>

</SIMPLE_RETURN>

 

Attempt to purge a host which DNE:

 

<!DOCTYPE BATCH_RETURN SYSTEM "https://qualysapi.qualys.com/api/2.0/batch_return.dtd">

<BATCH_RETURN>

  <RESPONSE>

    <DATETIME>2013-08-08T18:33:56Z</DATETIME>

    <BATCH_LIST>

      <BATCH>

        <CODE>1921</CODE>

        <TEXT>No Hosts Queued for Purging</TEXT>

      </BATCH>

    </BATCH_LIST>

  </RESPONSE>

</BATCH_RETURN>

Outcomes