Use the set operation to change IP address type, and/or assign an SSL/TLS certificate to it.

Note: You cannot change type of IP address from shared to exclusive if it is assigned to two or more resellers/customers.

Request Packet Structure

A request XML packet changing the IP address type includes the set operation node:

<packet>
<ip>
  <set>
  ...
  </set>
</ip>
</packet>

The set node graphical representation is as follows:

image 63588

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.

  • filter, required

    Specifies the filtering rule. Data type: ipFilterType (ip_input.xsd).

  • ip_address, required

    Specifies the IP address to be updated. Data type: ip_address (common.xsd) .

  • Either type or certificate_name or public_ip_address element is required.

    • type, optional

      Specifies the type of IP address. Data type: ipType (plesk_common.xsd) . Allowed values: shared | exclusive.

    • certificate_name, optional

      Specifies the name of certificate to be assigned to the IP address. Data type: string.

    • public_ip_address, required. For Plesk servers behind NAT you can match private IP addresses to corresponding public ones. This node specifies the public IP address corresponding to the IP address that you are editing. Data type: ip_address (common.xsd).

  • service-node, optional. It specifies the service node. Data type: serviceNodeSpecType (ip_input.xsd).

Note: When creating request packets, put nodes and elements in the order they follow in the packet structure.

Response Packet Structure

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

image 35435

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.

  • 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: unsignedInt.

  • errtext, required if the operation fails

    Returns the error message . Data type: string.

  • id_address, optional

    Returns the IP address which was updated. Data type: ip_address (common.xsd).

Samples

Assigning a public IP address to an internal IP address

This packet assigns a public IP address to 192.168.0.1.

<packet>
<ip>
   <set>
      <filter>
         <ip_address>192.168.0.1</ip_address>
      </filter>
      <public_ip_address>123.123.123.123</public_ip_address>
   </set>
</ip>
</packet>

Response:

<packet>
<ip>
   <set>
      <result>
         <status>ok</status>
         <ip_address>192.0.2.1</ip_address>
      </result>
   </set>
</ip>
</packet>

Changing type of a single IP address

This packet changes the type of 123.123.123.123 IP address to exclusive.

<packet>
<ip>
   <set>
      <filter>
         <ip_address>10.58.103.100</ip_address>
      </filter>
      <type>exclusive</type>
   </set>
</ip>
</packet>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
  <ip>
    <set>
      <result>
        <status>ok</status>
        <ip_address>10.58.103.100</ip_address>
      </result>
    </set>
  </ip>
</packet>

Changing type of multiple IP addresses

This packet changes the type of IP addresses 123.123.123.123 and 123.123.123.124 to exclusive.

<packet>
<ip>
   <set>
      <filter>
         <ip_address>123.123.123.123</ip_address>
         <ip_address>123.123.123.124</ip_address>
      </filter>
      <type>exclusive</type>
   </set>
</ip>
</packet>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
  <ip>
    <set>
      <result>
        <status>ok</status>
        <ip_address>123.123.123.123</ip_address>
      </result>
      <result>
        <status>ok</status>
        <ip_address>123.123.123.124</ip_address>
      </result>
    </set>
  </ip>
</packet>

Assigning a certificate to an IP address

This packet assigns SSL/TLS certificate named Common to IP address 123.123.123.123.

<packet>
<ip>
   <set>
      <filter>
         <ip_address>123.123.123.123</ip_address>
      </filter>
      <certificate_name>Common</certificate_name>
   </set>
</ip>
</packet>