Managing Plesk Services
Server services, such as mail service, DNS service, FTP and so on, can be started, stopped and restarted via both Plesk GUI and Plesk API RPC protocol. To start, stop or restart a particular service, use the srv_man operation.
To get information on the current state of the server services (whether each is started or stopped at the moment), use the get operation with services_state parameter specified.
Request Packet Structure
A request XML packet starting, stopping or restarting server services contains the srv_man operation node:
The srv_man node is presented by complex type ServicesManagementType (
server_input.xsd) and structured as follows:
- The id node is required. It specifies the ID of the service that should be started/ restarted/ stopped. Data type: srvIdType (
- The operation node is required. It specifies what should be done to the server specified by the id node. Data type: srvOpType (
plesk_server.xsd). Allowed values: start | stop | restart.
Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.
Response Packet Structure
The srv_man node of the response packet is structured as follows:
- The result node is required. It wraps the result of the srv_man operation. Data type: ServicesManagementResultType (
- The status node is required. It returns the execution status of the srv_man operation. Data type: string. Allowed values: ok | error.
- The errcode node is optional. It returns the error code when the srv_man operation fails. Data type: unsignedInt.
- The errtext node is optional. It returns the error message if the srv_man operation fails. Data type: string.
- The id node is required if the srv_man operation succeeds. It returns the ID of the service which was successfully started, stopped or restarted. Data type: srvIdType (
Stopping the web and Fail2Ban services
This packet stops the web and Fail2Ban services on Linux-based servers.
Starting PostgreSQL and MySQL database services
This packet starts PostgreSQL and MySQL database services.