The list operation is used to retrieve the list of database servers available to the plan subscribers.

Request Packet Structure

A request XML packet retrieving the list of databases available to the plan subscribers includes the list operation node:

<packet>
<webspace>
   <db-servers>
      <list>
       ...
      </list>
   </db-servers>
</webspace>
</packet>

The list node is presented by a complex type (webspace.xsd). Its graphical representation is as follows:

image 72627

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.

  • The filter node is required. It serves to specify the criteria by which the necessary service plans will be selected from the database. Data type: domainFilterType (webspace.xsd). See the Available Filters section for details on this node.

Response Packet Structure

The list node of the output XML packet is of the type WebspaceDbServerListOutputType (webspace.xsd) which has the following presentation:

image 72655

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.

  • The result node is required. It wraps the response got from the server. Data type: resultFilterType (common.xsd).
  • The status node is required. Specifies the execution status of the operation. Data type: string. Allowed values: ok | error.
  • The errcode node is optional. Returns the error code when the operation fails. Data type: unsignedInt.
  • The errtext node is optional. Returns the error message if the operation fails. Data type: string.
  • The filter-id node is optional. Returns the parameter by which the service plan was filtered by in the request packet. Data type: anySimple.
  • The id node is optional. Returns the identifier of the service plan to which the application was added. Data type: id_type (common.xsd).
  • The db-server node is optional. Returns the information about database servers available to the plan subscribers. Data type: dbServerOutput (webspace.xsd).

Sample

The following request retrieves the list of database servers available within the subscription with id 1:

<packet>
  <webspace>
    <db-servers>
      <list>
        <filter>
          <id>1</id>
        </filter>
      </list>
    </db-servers>
  </webspace>
</packet>

Response:

<packet>
  <webspace>
    <db-servers>
      <list>
        <result>
          <status>ok</status>
          <filter-id>1</filter-id>
          <id>1</id>
          <db-server>
            <type>mysql</type>
            <id>1</id>
            <host>localhost</host>
            <port>3306</port>
          </db-server>
          <db-server>
            <type>postgresql</type>
            <id>2</id>
            <host>localhost</host>
            <port>5432</port>
          </db-server>
        </result>
      </list>
    </db-servers>
  </webspace>
</packet>