Creating a Site

The add operation lets you add a site or a subdomain to an already existing subscription.

Next in this section:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet adding a new webspace to Plesk database includes the add operation node:

<packet>
<site>
   <add>
   ...
   </add>
</site>
</packet>

 

The add node does not have a separate type, it is nested within the complex type (site.xsd). The add node has the following graphics representation:

site-add-rps.gif

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

 

Response Packet Structure

The add node of the response packet is structured as follows:

site-add-reps.gif

 

Samples

Creating a subdomain

The following request creates a subdomain named sub555.example.com for the domain example.com (id=1) belonging to the subscription with id 12 using the default values for the subdomain's hosting settings:

<packet>
  <site>
   <add>
      <gen_setup>
        <name>sub555.example.com</name>
        <webspace-id>12</webspace-id>
        <parent-site-id>1</parent-site-id>
      </gen_setup>
    </add>
  </site>
</packet> 

Response:

<packet version="1.6.3.0">
  <site>
    <add>
      <result>
        <status>ok</status>
        <id>19</id>
        <guid>54f7b3ae-f138-4b60-9a55-d897eec2a8e0</guid>
      </result>
    </add>
  </site>
</packet>
Creating a site

This is a sample request packet that creates a site named sample.tst belonging to the subscription with id 10.

<?xml version="1.0" encoding="UTF-8"?>
<packet>
  <site>
   <add>
      <gen_setup>
        <name>sample.tst</name>
        <webspace-id>10</webspace-id>
      </gen_setup>
      <hosting>
        <vrt_hst>
              <property>
                <name>fp</name>
                <value>false</value>
              </property>
              <property>
                <name>fp_ssl</name>
                <value>false</value>
              </property>
              <property>
                <name>fp_auth</name>
                <value>false</value>
              </property>
              <property>
                <name>fp_admin_login</name>
                <value/>
              </property>
              <property>
                <name>fp_admin_password</name>
                <value/>
              </property>
              <property>
                <name>ssl</name>
                <value>true</value>
              </property>
              <property>
                <name>php</name>
                <value>true</value>
              </property>
              <property>
                <name>php_handler_id</name>
                <value>fastcgi-5.3</value>
              </property>
              <property>
                <name>ssi</name>
                <value>false</value>
              </property>
              <property>
                <name>cgi</name>
                <value>true</value>
              </property>
              <property>
                <name>perl</name>
                <value>true</value>
              </property>
              <property>
                <name>python</name>
                <value>true</value>
              </property>
              <property>
                <name>asp</name>
                <value>false</value>
              </property>
              <property>
                <name>miva</name>
                <value>false</value>
              </property>
              <property>
                <name>webstat</name>
                <value>awstats</value>
              </property>
              <property>
                <name>webstat_protected</name>
                <value>true</value>
              </property>
              <property>
                <name>errdocs</name>
                <value>true</value>
              </property>
              <property>
                <name>fastcgi</name>
                <value>true</value>
              </property>
              <property>
                <name>cgi_mode</name>
                <value>webspace</value>
              </property>
              <property>
                <name>www_root</name>
                <value>/sample</value>
              </property>
              <property>
                <name>safe_mode</name>
                <value>off</value>
              </property>
              <property>
                <name>open_basedir</name>
                <value>{WEBSPACEROOT}{/}{:}{TMP}{/}</value>
              </property>
            </vrt_hst>
      </hosting>
    </add>
  </site>
</packet>