Retrieving Database Users Info

You can retrieve information on users of the certain database. To retrieve information on database users, specify the ID of the database. You can retrieve information about users of multiple databases in a single get-db-users operation.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet retrieving users info from the database includes the get-db-users operation node:

<packet>
<database>
   <get-db-users>
   ...
   </get-db-users>
</database>
</packet>

 

The get-db-user node is presented by type DatabaseGetDBUserInputType (database_input.xsd), and its graphical representation is as follows:

GetDBUsers

  • The filter node is required. Specifies the filtering rule. For more information, refer to the Available Filters section. Data type: DatabaseUserFilterType.
  • The id node is optional. It specifies the ID of the database user whose information is to be retrieved. Data type: integer.
  • The db-id node is optional. It specifies the ID of the database from which information about users is retrieved. Data type: integer.

Remarks

You can retrieve information from multiple databases using a single get-db-users operation. Add as many db-id parameters to the filtering rule as the number of different databases you want to scan.

<database>
<get-db-users>
   <filter>
      <db-id>...</db-id>
      ...
      <db-id>...</db-id>
   </filter>
</get-db-users>
</database>

 

Note: Use the <filter/> parameter to retrieve information about all users from all databases available for the user identified by credentials from HTTP header.

 

Response Packet Structure

The get-db-users node of the output XML packet is presented by type DatabaseGetDBUsersOutputType (database_output.xsd) and structured as follows:

  • The result node is required. It wraps the response retrieved from the server. Data type: resultFilterType (common.xsd).
  • The status node is required. It specifies the execution status of the get-db-users operation. Data type: string. Allowed values: ok | error.
  • The errcode node is optional. Is returns the error code if the get-db--users operation fails. Data type: integer.
  • The errtext node is optional. It returns the error message if the get-db--user operation fails. Data type: string.
  • The filter-id node is optional. It returns the filtering rule parameter. For more information, refer to the Available Filters section.
  • The id node is optional. If the get-db-users operation succeeds, it specifies the database user ID. Data type: integer.
  • The login node is optional. If the get-db-users operation succeeds, it specifies login name of the database user. Data type: string.
  • The db-id node is optional. If the get-db-users operation succeeds, it specifies ID of the database where the user is located. Data type: integer.

 

 

Samples

Retrieving information about database users

This request packet retrieves information on all users of the database with ID 79.

<packet>
<database>
   <get-db-users>
      <filter>
          <db-id>79</db-id>
      </filter>
   </get-db-users>
</database>
</packet> 

Response:

<packet>
<database>
   <get-db-users>

      <result>
          <status>ok</status>
          <filter-id>79</filter-id>
          <id>15</id>
          <login>UserOne</login>
          <db-id>79</db-id>
      </result>

      <result>
          <status>ok</status>
          <filter-id>79</filter-id>
          <id>15</id>
          <login>UserTwo</login>
          <db-id>79</db-id>
      </result>

   </get-db-users>
</database>
</packet>
Retrieving information about all users of all databases

This request packet retrieves information on all users of all available databases.

<packet>
<database>
   <get-db-users>
      <filter/>
   </get-db-users>
</database>
</packet>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
  <database>
    <get-db-users>
      <result>
        <status>ok</status>
      </result>
    </get-db-users>
  </database>
</packet>
 

Leave your comments on this page

Leave your feedback or question on this documentation topic below. For technical assistance, contact your hosting service provider or submit a request to Plesk support. Suggest new features for Plesk here. Discuss general questions on the Plesk forum. All offtopic comments will be removed.