Copyright © 2009-13 Novell, Inc.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or (at your option) version 1.3; with the Invariant Section being this copyright notice and license. A copy of the license version 1.2 is included in the section entitled "GNU Free Documentation License".
Only authenticated users are allowed to access the API. Authentication is done by sending a Basic HTTP Authorisation header.
All names must not contain spaces, slashes or colons.
The system REST service supports only XML and JSON input/output formats.
This module provides access to system services. It shows the service status, and allows to exectute LSB commands (start,stop,restart) with given service.
Additionally, it uses the same interface for accessing and managing "custom services" - actually any application defined in /etc/webyast/custom_services.yml.
The following PolicyKit permissions are needed to perform configutation actions:
org.opensuse.yast.modules.yapi.services.read
org.opensuse.yast.modules.yapi.services.write
Get the list of all available services, both system (/etc/init.d) and custom (defined in /etc/webyast/custom_services.yml config file) ones.
The result is filtered by the content of the /etc/webyast/filter_services.yml file. If filter file is not present or empty, returns everything.
Each service has a name, description and short description (summary). It provides also the infomration about dependencies (based on the service definition under /etc/init.d/): which other services need to be started or stopped when selected service is started or stopped.
CURL Example: curl -u <user> https://<hostname>:4984/services.xml
Result: Example
The information about service status is read with read_status=true argument.
CURL Example: curl -u <user> https://<hostname>:4984/services.xml?read_status=true
Result: Example
GET /services/service_name.xml
Returns information about service with given name, including service status.
CURL Example: curl -u <user> https://<hostname>:4984/services/database.xml?custom=true
CURL Example: curl -u <user> https://<hostname>:4984/services/cron.xml
Result: Example
Executes an action with given service. Example of actions are "stop", "start", "restart".
CURL example: curl -u <user> -X PUT -H "Content-type: text/xml" -d @stop_cron_request.xml https://<hostname>:4984/services/cron.xml
Body: Example
Result: Example
PUT /service/service_name.xml?execute=<action>
Alternative way to execute an action with given service. Example of actions are "stop", "start", "restart".
CURL example: curl -u <user> -X PUT -H "Content-type: text/xml" -d "" https://<hostname>:4984/services/cron.xml?execute=stop
Result: Example