Yunus Aslam
Yunus Aslam

Reputation: 2466

Plesk Api to create a new domain with Hosting type

I am new to plesk and till now I have been able to create a new domain in plesk using the API. I have also created a skeleton folder. Now I want to add a hosting type to the new domain which gets created via the API.

I have the packet to create new domain like this

<?xml version="1.0" encoding="UTF-8"?>
<packet>
  <webspace>
    <add>
      <gen_setup>
        <name>ezb2550.info</name>
        <ip_address>10.64.2.30</ip_address>
      </gen_setup>
    </add>
  </webspace>
</packet>

This creates a new domain but does not add a hosting type. How can I add a Hosting type ?

Upvotes: 2

Views: 1333

Answers (1)

Oleg Neumyvakin
Oleg Neumyvakin

Reputation: 10272

To create by hosting plan:

<packet>
  <webspace>
    <add>
      <gen_setup>
        <name>ezb2550.info</name>
        <ip_address>10.64.2.30</ip_address>
      </gen_setup>
      <plan-name>Default Domain</plan-name>
    </add>
  </webspace>
</packet>

To create with custom virtual hosting settings(pay attention for "vrt_hst" it's a hosting type):

<packet>
<webspace>
    <add>
      <gen_setup>
        <name>ezb2550.info</name>
        <ip_address>10.64.2.30</ip_address>
      </gen_setup>
      <hosting>
        <vrt_hst>
          <property>
            <name>ftp_login</name>
            <value>illusion</value>
          </property>
          <property>
            <name>ftp_password</name>
            <value>qweqwe</value>
          </property>
        </vrt_hst>
      </hosting>
    </add>
  </webspace>
</packet>

Possible hosting types are vrt_hst(Virtual Hosting), std_fwd(Standard forwarding), and frm_fwd(Frame forwarding)

Just in case, always check image of "request packet structure" it actually describes all of possible options.

Upvotes: 3

Related Questions