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

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

service-plan-addon > add

lippoliv

Basic Pleskian
Hey there,
currently I'am developing an ControlCenter for Managing multiple Plesk Servers with APIs to some additional Services.

My current target is to collect Hosting plans and Hosting plan addons from all Servers and sync them.

So I load the plan via API from one Server, and send it to another.

But it Fails. Here the XML:

Code:
<packet>

    <service-plan-addon>
       <add>
            <name>Domain 2</name>
            <php-settings><setting><name>safe_mode</name><value>off</value></setting></php-settings>
            <limits><limit><name>max_site</name><value>2</value></limit><limit><name>max_subdom</name><value>0</value></limit><limit><name>max_dom_aliases</name><value>0</value></limit><limit><name>disk_space</name><value>0</value></limit><limit><name>max_traffic</name><value>0</value></limit><limit><name>max_wu</name><value>0</value></limit><limit><name>max_subftp_users</name><value>0</value></limit><limit><name>max_db</name><value>0</value></limit><limit><name>max_box</name><value>0</value></limit><limit><name>mbox_quota</name><value>0</value></limit><limit><name>max_maillists</name><value>0</value></limit><limit><name>max_webapps</name><value>0</value></limit><limit><name>max_unity_mobile_sites</name><value>0</value></limit><limit><name>upsell_site_builder</name><value>0</value></limit></limits>
            <hosting><vrt_hst><property><name>ssl</name><value>false</value></property><property><name>webstat</name><value>none</value></property><property><name>webstat_protected</name><value>false</value></property><property><name>errdocs</name><value>false</value></property><property><name>wu_script</name><value>false</value></property><property><name>shell</name><value>/bin/false</value></property><property><name>ftp_quota</name><value>0</value></property><property><name>php_handler_id</name><value>fastcgi</value></property><property><name>unpaid_website_status</name><value>suspended</value></property><property><name>ssi</name><value>false</value></property><property><name>php</name><value>false</value></property><property><name>cgi</name><value>false</value></property><property><name>perl</name><value>false</value></property><property><name>python</name><value>false</value></property><property><name>coldfusion</name><value>false</value></property><property><name>asp</name><value>false</value></property><property><name>fastcgi</name><value>false</value></property><property><name>miva</name><value>false</value></property></vrt_hst></hosting>
            <performance><bandwidth>-1</bandwidth><max_connections>0</max_connections></performance>
            <permissions><permission><name>manage_dns</name><value>false</value></permission><permission><name>manage_phosting</name><value>false</value></permission><permission><name>manage_php_settings</name><value>false</value></permission><permission><name>allow_insecure_sites</name><value>true</value></permission><permission><name>manage_sh_access</name><value>true</value></permission><permission><name>manage_not_chroot_shell</name><value>false</value></permission><permission><name>manage_anonftp</name><value>false</value></permission><permission><name>manage_crontab</name><value>false</value></permission><permission><name>manage_spamfilter</name><value>false</value></permission><permission><name>manage_virusfilter</name><value>false</value></permission><permission><name>allow_local_backups</name><value>false</value></permission><permission><name>allow_ftp_backups</name><value>false</value></permission><permission><name>manage_webstat</name><value>false</value></permission><permission><name>manage_log</name><value>false</value></permission><permission><name>access_appcatalog</name><value>false</value></permission><permission><name>allow_license_stubs</name><value>false</value></permission><permission><name>create_domains</name><value>false</value></permission><permission><name>manage_subdomains</name><value>false</value></permission><permission><name>manage_domain_aliases</name><value>false</value></permission><permission><name>manage_subftp</name><value>false</value></permission><permission><name>manage_webapps</name><value>false</value></permission><permission><name>manage_mail_settings</name><value>false</value></permission><permission><name>manage_maillists</name><value>false</value></permission><permission><name>manage_performance</name><value>false</value></permission><permission><name>manage_quota</name><value>false</value></permission><permission><name>select_db_server</name><value>false</value></permission><permission><name>remote_db_connection</name><value>false</value></permission><permission><name>manage_website_maintenance</name><value>false</value></permission><permission><name>manage_protected_dirs</name><value>false</value></permission><permission><name>access_service_users</name><value>false</value></permission><permission><name>manage_wordpress_toolkit</name><value>true</value></permission><permission><name>manage_security_wordpress_toolkit</name><value>true</value></permission></permissions>
        </add>
    </service-plan-addon>
</packet>

Here the Response-Error: Parser error: Request is invalid. Error in line 6: Element 'limits': This element is not expected.

But my Request is as described here: http://download1.parallels.net/Plesk/Doc/en-US/online/plesk-api-rpc/66430.htm#

What do I do wrong?


Regards
Oli
 
Hi @lippoliv

There are several issues in your request packet:
1. The order of nodes is important. <php-settings> node should be the last one. So the order should look like: name, limits, hosting, performance, permissions, php-settings
2. Node hosting should have just list of properties without node <vrt_hst>. You can check examples here: http://download1.parallels.net/Plesk/Doc/en-US/online/plesk-api-rpc/index.htm?fileName=66431.htm
3. The following hosting properties are not compatible:
<property><name>php</name><value>false</value></property>
<property><name>php_handler_id</name><value>fastcgi</value></property>
Just don't specify php_handler_id if php is disabled
4. (possible issue) Permission "allow_license_stubs" is deprecated for Plesk 12.5 (protocol 1.6.7.0), you can just remove it.

Also you can check interactive diagrams for API-RPC schemas: http://plesk.github.io/api-schemas/ They can help with other possible requests.
 
Hey @vlikhtanskiy ,
you are right. Now it works.

But for permissions I have an question: One of my WebServers has no WordPress Toolkit.
In my XML for Permissions I define the two permissions
Code:
<permission><name>manage_wordpress_toolkit</name><value>true</value></permission><permission><name>manage_security_wordpress_toolkit</name><value>true</value></permission>

The Server Returns an error "Permissions: manage_wordpress_toolkit,manage_security_wordpress_toolkit should not be specified".
But while giving that error, ALL other permissions will be ignored.

Why?
Why don't plesk does ignore the two unknown permissions and set all others?
 
Back
Top