• We value your experience with Plesk during 2025
    Plesk strives to perform even better in 2026. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2025.
    Please take this short survey:

    https://survey.webpros.com/

XML-RPC API disk space usage for subscription/webspace does not include subdomains

Kaspar

API expert
Plesk Guru
Username:

TITLE


XML-RPC API disk space usage for subscription/webspace does not include subdomains

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE

Plesk: 18.0.73#5
OS: Alma 9

PROBLEM DESCRIPTION

It looks like there is a discrepancy in the way disk space usage is calculated on the webspace operator with the XML-RPC API. The disk space usage (returned by the real_size operator) does not include the disk usage for any sub domain belonging to the subscription, but surprisingly it does include the disk usage for any other domains in the same subscription.

I have a couple of scripts that utilize the XML-RPC API to return the disk space usage of all subscriptions. I've been using these scripts for years (since Plesk 17.8) and never noticed this inconsistency before. Which makes me wonder if sub domains have always been excluded from the disk space calculation when using the webspace operator on the XML-RPC API or that this behavior has changed unnoticed some time ago. Of course it could be that I just never noticed that sub domains have been excluded from the disk space calculation.

Regardless, the current logic feels inconsistent. As additional domains are included in the disk space calculation, but sub domains are not.

STEPS TO REPRODUCE

1) Setup a subscription in Plesk
2) Add a sub domain and an additional domain to it
3) Fill some of the disk space for demonstration purposes

On the primary domain (download or create a binary file)​
Code:
sudo -u <subscription system user> wget -qP /var/www/vhosts/example.com/httpdocs/ http://speed.transip.nl/10mb.bin
On the sub domain fill the logs​
Code:
for i in {1..6000}; do curl -v 'http://sub.example.com?fill=some_content&count='$i;done
On the additional domain fill the logs​
Code:
for i in {1..5000}; do curl -v 'http://example.bg?fill=some_content&count='$i;done

4) Recalculate statistics
Code:
plesk sbin statistics --calculate-all

5) View disk space usage in Plesk
(The disk space shown for each individual domain add up to the total disk space usage of the subscription)
diskspace.png
6) Run API call to get subscription disk space usage. Notice the difference between the subscription disk space returned by the API and the total disk space shown in Plesk.
Code:
curl -kLi -X POST -H "Content-Type: text/xml" -H "HTTP_PRETTY_PRINT: TRUE" -H "HTTP_AUTH_LOGIN: admin" -H "HTTP_AUTH_PASSWD: 1234567890" -d '<?xml version="1.0" encoding="UTF-8"?><packet><webspace><get><filter><name>example.com</name></filter><dataset><gen_info/></dataset></get></webspace></packet>' https://123.123.123.123:8443/enterprise/control/agent.php | grep real_size

ACTUAL RESULT

Notice how the disk space usage returned by the API call for the subscription is not equal to the total disk space usage shown for the subscription in Plesk. The returned value of the API call is only equal to the disk space usage of the primary domain + that of the additional domain.

EXPECTED RESULT

Expected is that the value of the disk space usage of the subscription returned by the API actually matches the total disk space usage.

ANY ADDITIONAL INFORMATION

(DID NOT ANSWER QUESTION)

YOUR EXPECTATIONS FROM PLESK SERVICE TEAM

Confirm bug
 
Last edited:
Back
Top