YaST REST Service Documentation FIXME dependencies, filtering!

Copyright © 2009-10 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".

System services

Only authenticated users are allowed to access the API. Authentication is done by sending a Basic HTTP Authorisation header.

All names aren't allowed to contain spaces, slashes or colons.

Table of Contents

Formats

The system REST service supports only XML and JSON input/output formats.

Overview

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.

PolicyKit Access Rights

The following PolicyKit permission is needed to perform configutation actions:

org.opensuse.yast.modules.yapi.services.read

org.opensuse.yast.modules.yapi.services.write

Actions

GET /services

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> http://localhost:4984/services.xml

Result: Example

The information about service status is read with read_status=true argument.

CURL Example: curl -u <user> http://localhost:4984/services.xml?read_status=true

Result: Example

GET /services/service_name.xml

Return information about service with given name, including service status.

CURL Example: curl -u <user> http://localhost:4984/services/database.xml?custom=true

CURL Example: curl -u <user> http://localhost:4984/services/cron.xml

Result: Example

PUT /service/service_name.xml

Execute an action with given service. Example of actions are "stop", "start", "restart".

CURL example: curl -u -X PUT -H 'Content-type: text/xml' -d @stop_cron_request.xml http://localhost:4984/services/cron.xml

Body: Example

Result: Example