Creating a Subscription (Webspace)

To register a new subscription, it is enough to specify some general setup information. If the webspace is created by Administrator or reseller, the subscription owner needs to be specified too. In addition, you can specify various settings when creating a subscription.

A subscription can have all these settings specified, or it can hold just some of them. You can specify settings on creation or later (they can be set using the set operation). The only exception from this rule is a service plan: it cannot be applied to a subscription after it is created. To learn more about the service plan management via API RPC, proceed to section Managing Service Plans.

In this chapter:

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>
<webspace>
   <add>
   ...
   </add>
</webspace>
</packet>

 

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

webspace_add

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:

 

 

Samples

Creating subscriptions under different Plesk users

Subscriptions can be created by the Administrator, resellers, or customers.

Here is a sample request packet that can be used by a customer to create a web hosting subscription. The account is created with a minimal collection of Web hosting settings.

<packet>
<webspace>
    <add>
      <gen_setup>
        <name>sample.com</name>
        <ip_address>10.58.103.100</ip_address>
      </gen_setup>
      <hosting>
        <vrt_hst>
          <property>
            <name>ftp_login</name>
            <value>ftp16se4fdf0</value>
          </property>
          <property>
            <name>ftp_password</name>
            <value>qweqwe</value>
          </property>
          <ip_address>10.58.103.100</ip_address>
        </vrt_hst>
      </hosting>
    </add>
  </webspace>
</packet>


Response:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
  <webspace>
    <add>
      <result>
        <status>ok</status>
        <id>4</id>
        <guid>5ff343c1-a40b-4305-8986-2f27c240db7e</guid>
      </result>
    </add>
  </webspace>
</packet>

The following packet creates a subscription for customer with ID 1234:

<packet>
<webspace>
<add>
   <gen_setup>
      <name>example.com</name>
      <owner-id>1234</owner-id>
      <htype>vrt_hst</htype>
      <ip_address>192.0.2.123</ip_address>
      <status>0</status>
   </gen_setup>
   <hosting>
      <vrt_hst>
          <property>
            <name>ftp_login</name>
            <value>ftp16se4fdf0</value>
          </property>
          <property>
            <name>ftp_password</name>
            <value>qweqwe</value>
          </property>
          <ip_address>192.0.2.54</ip_address>
       </vrt_hst>
    </hosting>
</add>
</webspace>
</packet> 
Creating multiple subscriptions

To create two subscriptions with a single packet, include two different add nodes:

<packet>
<webspace>
<add>
   <gen_setup>
      <name>example.com</name>
      <htype>vrt_hst</htype>
      <ip_address>192.0.2.123</ip_address>
      <status>0</status>
   </gen_setup>
   <hosting>
      <vrt_hst>
		      <ip_address>192.0.2.123</ip_address>
      </vrt_hst>
    </hosting>
</add>
<add>
   <gen_setup>
      <name>sample.com</name>
      <ip_address>192.0.2.124</ip_address>
      <status>0</status>
   </gen_setup>
   <hosting>
      <vrt_hst>
			<property>
				<name>ssl</name>
				<value>false</value>
			</property>
    	      <ip_address>192.0.2.123</ip_address>
       </vrt_hst>
    </hosting>
</add>
</webspace>
</packet> 
Using a particular service plan

The following sample packet creates a subscription to a service plan Bronze.

<packet>
<webspace>
<add>
   <gen_setup>
      <name>example.com</name>
      <htype>vrt_hst</htype>
      <ip_address>192.0.2.123</ip_address>
      <status>0</status>
   </gen_setup>

   <hosting>
      <vrt_hst>
			<property>
				<name>ssl</name>
				<value>false</value>
			</property>
    	      <ip_address>192.0.2.123</ip_address>
       </vrt_hst>
    </hosting>
   <plan-name>base_template</plan-name>
</add>
</webspace>
</packet>

Note: To see the sample packets that set optional settings (hosting settings, limits, preferences, and others), refer to the related section in the Subscription Settings section.