• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Plesk XML API

Deepak Sharma

New Pleskian
Hi,

I am using Plesk XML API to automate Virtual Directory creation for a subdomain xyz.mydomain.com and request packet structure is as below.

<?xml version="1.0" encoding="utf-8" ?>
<packet>
<virtdir>
<create>
<site-id>27</site-id>
<name>/vd1</name>
<properties/>
</create>
</virtdir>
</packet>

I am getting error which error code is 1015 and error description says "Virtual host does not exist"

xyz.mydomain.com has dedicated IP assigned.

I tried with adding an entry in \etc\hosts file that map the IP address to above host name. No luck.

Any help is much appreciated.
 
Error message 1015 means - Parent site/subdomain is not found.
Are you sure that site-id=27 is correct?
 
I am assuming this is ID that we found from this location
IIS >> Advanced Settings of site >> ID property under General section
 
You can find correct site-id in Plesk database with following SQL query:

mysql> select id from domains where name='xyz.mydomain.com';
 
Thanks for your help.

There is an option to create a new database in Plesk but that is specific to site under which we are creating and its completely blank. No default structure or table in it.
Doesn't Plesk maintain a common database that used to store information from all domains?
 
IgorG,

Finally, I got a way to obtain Information about all sites using request packet as below

<packet>
<webspace>
<get>
<filter/>
<dataset>
<hosting/>
</dataset>
</get>
</webspace>
</packet>

This gives me Pesk's Site ID for each Primary domain. For non-primary domain, need to replace <webspace> with <site>

Thanks a lot for your help and suggestion.
 
Back
Top