Plesk Utility - CLI RPC

The XML API protocol was designed to support interaction between Plesk and third-party software remotely. To perform an operation through XML API, you should send a specifically-structured HTTP message to a particular Plesk endpoint (https://<your-host-or-IP>:8443/enterprise/control/agent.php). Plesk receives the message, transforms the message into operation instructions, attempts to perform the operations, and returns operation statuses and details. For more information about packets structure and messages transport, see Client-Server Model and XML API Packets.

CLI Packets

Command Description Parameter Example
<add>

Add IP address to a rule.

Requires <RULEID>IP</RULEID>

To add 1.2.3.4 into the SMTP rule:

<packet><extension><call><flex-firewall-manager><add><SMTP>1.2.3.4</SMTP></add></flex-firewall-manager></call></extension></packet>

<remove>

Delete IP address from a rule.

Requires <RULEID>IP</RULEID>

To remove 1.2.3.4 into the SMTP rule:

<packet><extension><call><flex-firewall-manager><remove><SMTP>1.2.3.4</SMTP></remove></flex-firewall-manager></call></extension></packet>

<find>

Find IP address in Firewall or MailEnable rules.

Requires -firewall -mailenable
<PARAM>IP</PARAM>

To search 1.2.3.4 in Firewall:

<packet><extension><call><flex-firewall-manager><find><firewall>1.2.3.4</firewall></find></flex-firewall-manager></call></extension></packet>

To search 1.2.3.4 in MailEnable:

<packet><extension><call><flex-firewall-manager><find><mailenable>1.2.3.4</mailenable></find></flex-firewall-manager></call></extension></packet>

<enable>

Enable a rule.

Requires <RULEID>

To enable SMTP rule:

<packet><extension><call><flex-firewall-manager><enable>SMTP</disable></flex-firewall-manager></call></extension></packet>

<disable>

Disable a rule

Requires <RULEID>

To disable SMTP rule:

<packet><extension><call><flex-firewall-manager><disable>SMTP</disable></flex-firewall-manager></call></extension></packet>

<list>

Show list of available rule or ID.

id | exist

<list>ID</list>

To get the ListID list:

<packet><extension><call><flex-firewall-manager><list>id</list></flex-firewall-manager></call></extension></packet>

To get rule names:

<packet><extension><call><flex-firewall-manager><list>exist</list></flex-firewall-manager></call></extension></packet>

<on>

Turn on Windows Firewall or Turn on Extension.

firewall | extension

<on>ID</on>

To enable Firewall:

<packet><extension><call><flex-firewall-manager><on>firewall</on></flex-firewall-manager></call></extension></packet>

To enable the Extension:

<packet><extension><call><flex-firewall-manager><on>extension</on></flex-firewall-manager></call></extension></packet>

<off>

Turn off Windows Firewall or Disable Extension.

firewall | extension

<off>ID</off>

To disable the Firewall:

<packet><extension><call><flex-firewall-manager><off>firewall</off></flex-firewall-manager></call></extension></packet>

To disable Extension:

<packet><extension><call><flex-firewall-manager><off>extension</off></flex-firewall-manager></call></extension></packet>

<status>

View the status of Windows Firewall, Extension or Protections.

firewall | extension | protection | mailenable | smartermail


<status>ID</status>

To view the Firewall status:

<packet><extension><call><flex-firewall-manager><status>firewall</status></flex-firewall-manager></call></extension></packet>

To view the status of the extension:

<packet><extension><call><flex-firewall-manager><status>extension</status></flex-firewall-manager></call></extension></packet>

To list the status of protections:

<packet><extension><call><flex-firewall-manager><status>protection</status></flex-firewall-manager></call></extension></packet>

To list the MailEnable status:

<packet><extension><call><flex-firewall-manager><status>mailenable</status></flex-firewall-manager></call></extension></packet>

To list SmarterMail status:

<packet><extension><call><flex-firewall-manager><status>smartermail</status></flex-firewall-manager></call></extension></packet>

<protection>

Change the protection status.

Requires indicating which module you want to change state:
SMTP | IMAP | POP | FTP | SECURITY | DB | RDP | WEB


<protection>ID</protection>

To change the ENABLE/DISABLED status of module SMTP:

<packet><extension><call><flex-firewall-manager><protection>SMTP</protection></flex-firewall-manager></call></extension></packet>

To change the ENABLE/DISABLED status of module RDP:

<packet><extension><call><flex-firewall-manager><protection>RDP</protection></flex-firewall-manager></call></extension></packet>

<whitelist>

Add IP to exception list.

<whitelist>IP</whitelist>

To add IP:

<packet><extension><call><flex-firewall-manager><whitelist>1.2.3.4</whitelist></flex-firewall-manager></call></extension></packet>

<help> Shows the available commands.

Command list:

<packet><extension><call><flex-firewall-manager><help/></flex-firewall-manager></call></extension></packet>