The import-config operation is used to import a custom list (configuration file) of APS Catalogs to Plesk.

The configuration file should previously be uploaded to the server by means of the upload operator.

Request Packet Structure

A request XML packet that imports a custom list (configuration file) of APS Catalogs to Plesk should include the import-config operation node:

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

The node has the following graphical representation:

image 63544

Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_input.svg.

  • filename, required

    Specifies the name of the configuration file uploaded to the Panel. Data type: string.

    Value should be the temporary file name returned in the upload response (in the "upload/result/file" element).

Response Packet Structure

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

image 63545

Note: The interactive schema navigator for all response packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_output.svg.

  • result, required

    Wraps the response retrieved from the server. Data type: resultType (common.xsd).

  • status, required

    Specifies the execution status of the operation. Data type: string. Allowed values: ok | error.

  • errcode, required if the operation fails

    Returns the error code. Data type: integer.

  • errtext, required if the operation fails

    Returns the error message. Data type: string.

Samples

Request packets importing the APS Catalogs configuration previously uploaded to the server look as follows.

On Linux/Unix:

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

 On Windows:

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

 Response:

<packet version="1.6.2.0">
  <aps>
    <install>
      <result>
        <status>ok</status>
      </result>
    </install>
  </aps>
</packet>

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

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

Such negative response is received if a requested file has improper access rights (most probably, as a result of uploading it the way different from using the upload agent):

<packet version="1.6.2.0">
  <aps>
    <import-config>
      <result>
        <status>error</status>
        <errcode>1023</errcode>
        <errtext>Unable to use specified file as config file</errtext>
      </result>
    </import-config>
  </aps>
</packet>