Use the add operation to add an IP address to the Plesk's server.
Note: In Plesk powered by Virtuozzo, if the specified IP is not in VPS (Virtual Private Server) pool, the attempt to add this address to Plesk database will result in error.
A request XML packet adding IP address to Plesk server includes the add operation node:
<packet>
<ip>
<add>
...
</add>
</ip>
</packet>
The add node is of type IpInputType type (ip_input.xsd
). It has the following graphics representation:
common.xsd
).common.xsd
).ip_input.xsd
).common.xsd
).Notes
You can add multiple IP addresses in a single packet. Add as many add operations as the number of IPaddresses you want to add.
<ip>
<add>
...
</add>
...
<add>
...
</add>
</ip>
Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.
The add node of the output XML packet is structured as follows:
common.xsd
).common.xsd
).
This request packet adds a single shared IP address to Plesk server.
<packet>
<ip>
<add>
<ip_address>192.168.2.18</ip_address>
<netmask>255.255.0.0</netmask>
<type>shared</type>
<interface>Network Connection</interface>
<public_ip_address>123.123.123.123</public_ip_address>
</add>
</ip>
</packet>
Response:
<packet>
<ip>
<add>
<result>
<status>ok</status>
<ip_address>192.168.2.18</ip_address>
</result>
</add>
</ip>
</packet>
If the IP address is already in the Plesk's database, the response is as follows:
<packet>
<ip>
<add>
<result>
<status>error</status>
<errcode>1013</errcode>
<errtext>IP address was already added on the server</errtext>
</result>
</add>
</ip>
</packet>
This request packet adds two exclusive IP addresses to Plesk server.
<packet>
<ip>
<add>
<ip_address>192.0.2.17</ip_address>
<netmask>255.255.255.0</netmask>
<type>exclusive</type>
<interface>Network Connection</interface>
</add>
<add>
<ip_address>192.0.2.16</ip_address>
<netmask>255.255.255.0</netmask>
<type>exclusive</type>
<interface>Network Connection</interface>
</add>
</ip>
</packet>
Response:
<packet version ="1.4.2.0">
<ip>
<add>
<result>
<status>ok</status>
<ip_address>192.0.2.17</ip_address>
</result>
</add>
<add>
<result>
<status>ok</status>
<ip_address>192.0.2.16</ip_address>
</result>
</add>
</ip>
</packet>