Importing Application Package to Plesk

The import-package operation is used to import to Plesk an application package uploaded to the server.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet importing APS package to the Plesk contains the import-package operation node:

<packet version="1.6.2.0">
<aps>
   <import-package>
...
   </import-package>
</aps>
</packet>

The import-package node is structured as follows:

APSPackageImportInputType

 

Response Packet Structure

The import-package node of the output XML packet is structured as follows:

APSPackageImportOutputType

 

Samples

Request packets importing to Plesk the APS package previously uploaded to the server looks as follows.

On Linux/Unix:

<packet version="1.6.2.0">
  <aps>
    <import-package>
      <filename>/usr/local/psa/tmp/li_8FZruf</filename>
    </import-package>
  </aps>
</packet>

 

On Windows:

<packet version="1.6.2.0">
  <aps>
    <import-package>
      <filename>"C:/Program Files/Parallels/Plesk/tmp/li_9D.tmp"</filename>
    </import-package>
  </aps>
</packet>

 Response:

<packet version="1.6.2.0">
  <aps>
    <import-package>
      <result>
        <status>ok</status>
        <package-id>13</package-id>
      </result>
    </import-package>
  </aps>
</packet>

 

Such negative response is received if a requested file is not found:

<packet version="1.6.2.0">
  <aps>
    <import-package>
      <result>
        <status>error</status>
        <errcode>1013</errcode>
        <errtext>File "/usr/local/psa/tmp/li_8FZruf" does not exist</errtext>
      </result>
    </import-package>
  </aps>
</packet>

Such negative responses are received in cases a file being imported is not a valid APS application package.

1) The archive being imported lacks APP-META.xml package metadata file.

<packet version="1.6.2.0">
  <aps>
    <import-package>
      <result>
        <status>error</status>
        <errcode>1023</errcode>
        <errtext>Entry 'APP-META.xml' not found</errtext>
      </result>
    </import-package>
  </aps>
</packet>

2) APP-META.xml is not validated against the XML schema.

<packet version="1.6.2.0">
  <aps>
    <import-package>
      <result>
        <status>error</status>
        <errcode>1023</errcode>
        <errtext>Unable to acquire metadata description</errtext>
      </result>
    </import-package>
  </aps>
</packet>