Getting Download Task Status

The get-download-status operation is used to retrieve the status of an application package download task.

The following statuses are possible:

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML package that retrieves the status of an application package download task should include the get-download-status operation node:

<packet version="1.6.2.0">
<aps>
   <get-download-status>
...
   </get-download-status>
</aps>
</packet>

The get-download-status node is structured as follows:

APSPackageDownloadStatusInputType

 

Response Packet Structure

The get-download-status node of the output XML packet is structured as follows:

APSPackageDownloadStatusOutputType

APSPackageDownloadStatusOutputType-task.gif

 

Samples

Getting status of a particular download task

This packet requests status of download task with ID 18:

<packet>
  <aps>
    <get-download-status>
      <filter>
        <task-id>18</task-id>
      </filter>
    </get-download-status>
  </aps>
</packet>

Response A

Positive response may look as follows:

<packet>
  <aps>
    <get-download-status>
      <result>
        <status>ok</status>
        <filter-id>18</filter-id>
        <id>18</id>
        <task>
          <id>18</id>
          <finished>
            <package-id>13</package-id>
          </finished>
        </task>
      </result>
    </get-download-status>
  </aps>
</packet>

Response B

Such response is received in case a download task did not start or finished with errors.

<packet>
  <aps>
    <get-download-status>
      <result>
        <status>ok</status>
        <filter-id>18</filter-id>
        <id>18</id>
        <task>
          <id>18</id>
          <finished>
            <error>Cannot download package from catalog</error>
          </finished>
        </task>
      </result>
    </get-download-status>
  </aps>
</packet>

Response C

Such negative response is received in case a download task with the requested ID does not exist.

<packet>
  <aps>
    <get-download-status>
      <result>
        <status>error</status>
        <errcode>1013</errcode>
        <errtext>Download task with id 18 not found</errtext>
        <filter-id>181</filter-id>
      </result>
    </get-download-status>
  </aps>
</packet>

Getting status of all download tasks within a current download transaction

This packet requests status of all download tasks within a current download transaction.

<packet>
  <aps>
    <get-download-status>
      <filter/>
    </get-download-status>
  </aps>
</packet>

Response A

Such response is received from Linux server where the transaction with tree tasks is run: one task is finished, one is in progress and one is queued.

<packet>
  <aps>
    <get-download-status>
      <result>
        <status>ok</status>
        <filter-id>10</filter-id>
        <id>10</id>
        <task>
          <id>10</id>
          <finished>
            <package-id>5</package-id>
          </finished>
        </task>
      </result>
      <result>
        <status>ok</status>
        <filter-id>11</filter-id>
        <id>11</id>
        <task>
          <id>11</id>
          <in-progress>
            <total>3584225</total>
            <completed>2458</completed>
            <current />
          </in-progress>
        </task>
      </result>
      <result>
        <status>ok</status>
        <filter-id>12</filter-id>
        <id>12</id>
        <task>
          <id>12</id>
          <in-progress>
            <total>45888236</total>
            <completed>0</completed>
          </in-progress>
        </task>
      </result>
    </get-download-status>
  </aps>
</packet>

Response B

Such response is received from Windows server when a transaction is run:

<packet>
  <aps>
    <get-download-status>
      <result>
        <status>ok</status>
        <filter-id>38</filter-id>
        <id>38</id>
        <task>
          <id>38</id>
          <in-progress>
            <total>0</total>
            <completed>0</completed>
          </in-progress>
        </task>
      </result>
    </get-download-status>
  </aps>
</packet>

Response C

Such response is received when there is no download transaction running.

<packet>
  <aps>
    <get-download-status>
      <result>
        <status>ok</status>
      </result>
    </get-download-status>
  </aps>
</packet>