Retrieving Info on Secret Keys

Use the get_info operation to retrieve information on secret keys located on the server.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet retrieving info on secret keys includes the get_info operation node:

<packet version="1.4.2.0">
<secret_key>
<get_info>
...  
</get_info>
</secret_key>
</packet>

 

The get_info node has the following graphical representation:

  • The filter node is required. It specifies the filtering rule. To retrieve all secret keys located on the server, use the blank filter node (<filter/>). Data type: complex.
  • The key node is optional. To retrieve info on a specified key, set the key value for this node. Data type: string.

 

Remarks

You can retrieve info on multiple secret keys in a single packet. Add as many key parameters to the filter as the number of keys.

<filter>
<key>...</key>
   ...
<key>...</key>
</filter>
 

Response Packet Structure

The get_info node of the output XML packet is structured as follows:

  • The result node is required. It wraps the response retrieved from the server. Data type: resultType (common.xsd).
  • The status node is required. It specifies the execution status of the get_info operation. Data type: string. Allowed values: ok | error.
  • The errcode node is optional. Is returns the error code if the get_info operation fails. Data type: integer.
  • The errtext node is optional. It returns the error message if the get_info operation fails. Data type: string.
  • The key node is optional. It holds the key value if the operation fails. Data type: string.
  • The key_info node is optional. It holds info on the key if the operation succeeds. Data type: SecretKeyInfo (plesk_secretkeys.xsd).

    The following parameters are nested in the key_info node:

    • The key node is required. It specifies the secret key value. Data type: string.
    • The ip_address node is required. It specifies the IP address linked to the secret key. Data type: ip_address (common.xsd).
    • The description node is required. It specifies the secret key description. Data type: string.

 

 

Samples

Retrieving info on a secret key

This request packet retrieves info on secret key 6575fae36288be6d1bad40b99808e37f.

<packet>
<secret_key>
   <get_info>
      <filter>
         <key>6575fae36288be6d1bad40b99808e37f</key>
      </filter>
   </get_info>
</secret_key>
</packet>

Response:

<packet>
<secret_key>
   <get_info>
      <result>
         <status>ok</status>
 
         <key_info>
            <key>6575fae36288be6d1bad40b99808e37f</key>
            <ip_address>192.0.2.1</ip_address>
            <description></description>
         </key_info>
 
      </result>
   </get_info>
</secret_key>
</packet>

 

If the key was not found on the server, the response looks as follows:

<packet>
<secret_key>
<get_info>
   <result>
      <status>error</status>
      <errcode>1013</errcode>
      <errtext>Key is not found</errtext>
      <key>6575fae36288be6d1bad40b99808e37f</key>
   </result>
</get_info>
</secret_key>
</packet>
Retrieving info on multiple secret keys

This request packet retrieves info on secret keys 6575def8 and 6576d1ef7.

<packet>
<secret_key>
   <get_info>
      <filter>
         <key>6575def8</key>
         <key>6576d1ef7</key>
      </filter>
   </get_info>
</secret_key>
</packet>

Response:

<packet>
<secret_key>
   <get_info>
 
      <result>
         <status>ok</status>
         <key_info>
            <key>6575def8</key>
            <ip_address>192.0.2.1</ip_address>
            <description>For User3</description>
         </key_info>
      </result>
 
      <result>
         <status>ok</status>
         <key_info>
            <key>6576d1ef7</key>
            <ip_address>192.0.2.2</ip_address>
            <description></description>
         </key_info>
      </result>
 
   </get_info>
</secret_key>
</packet>