ref: refs/heads/master
commit 0eb0cc224fb2e5d28d104110c3377be1151e86d5
Author: Jiri Suchomel
Date: Mon Oct 5 14:42:34 2009 +0200
basic REST service documentation
---
.../package/yast2-webservice-administrator.changes | 7 ++
.../package/yast2-webservice-administrator.spec | 3 +-
.../public/administrator/restdoc/.gitignore | 3 +
plugins/administrator/restdoc/administrator.xml | 5 ++
plugins/administrator/restdoc/api.txt | 66 ++++++++++++++++++++
plugins/administrator/restdoc/save_all_request.xml | 5 ++
.../administrator/restdoc/save_all_response.xml | 5 ++
.../administrator/restdoc/save_mail_request.xml | 4 +
.../administrator/restdoc/save_mail_response.xml | 5 ++
9 files changed, 102 insertions(+), 1 deletions(-)
diff --git a/plugins/administrator/package/yast2-webservice-administrator.changes b/plugins/administrator/package/yast2-webservice-administrator.changes
index 082dbfb..97582d0 100644
--- a/plugins/administrator/package/yast2-webservice-administrator.changes
+++ b/plugins/administrator/package/yast2-webservice-administrator.changes
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Mon Oct 5 12:43:42 CEST 2009 - jsuchome@suse.cz
+
+- grant permissions to root (bnc#543756)
+- added basic documentation of REST service (bnc#537200)
+- 0.0.3
+
+-------------------------------------------------------------------
Tue Sep 29 10:18:50 CEST 2009 - schubi@suse.de
- version 0.0.2
diff --git a/plugins/administrator/package/yast2-webservice-administrator.spec b/plugins/administrator/package/yast2-webservice-administrator.spec
index c8a9bb8..bb794a1 100644
--- a/plugins/administrator/package/yast2-webservice-administrator.spec
+++ b/plugins/administrator/package/yast2-webservice-administrator.spec
@@ -15,7 +15,7 @@ Provides: yast2-webservice:/srv/www/yastws/app/controllers/administrator_c
License: MIT
Group: Productivity/Networking/Web/Utilities
Autoreqprov: on
-Version: 0.0.2
+Version: 0.0.3
Release: 0
Summary: YaST2 - Webservice - Administrator
Source: www.tar.bz2
@@ -90,6 +90,7 @@ rm -rf $RPM_BUILD_ROOT
/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/app
/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/config
/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/doc
+/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/public
%dir /usr/share/PolicyKit
%dir /usr/share/PolicyKit/policy
%attr(644,root,root) %config /usr/share/PolicyKit/policy/org.opensuse.yast.modules.yapi.%{plugin_name}.policy
diff --git a/plugins/administrator/public/administrator/restdoc/.gitignore b/plugins/administrator/public/administrator/restdoc/.gitignore
new file mode 100644
index 0000000..b66eeae
--- /dev/null
+++ b/plugins/administrator/public/administrator/restdoc/.gitignore
@@ -0,0 +1,3 @@
+index.html
+*.xml
+*.xsd
diff --git a/plugins/administrator/restdoc/administrator.xml b/plugins/administrator/restdoc/administrator.xml
new file mode 100644
index 0000000..fd02ab7
--- /dev/null
+++ b/plugins/administrator/restdoc/administrator.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<administrator>
+ <password></password>
+ <aliases>administrator@my-company.com,tux-local</aliases>
+</administrator>
diff --git a/plugins/administrator/restdoc/api.txt b/plugins/administrator/restdoc/api.txt
new file mode 100644
index 0000000..b89ce30
--- /dev/null
+++ b/plugins/administrator/restdoc/api.txt
@@ -0,0 +1,66 @@
+= YaST REST Service Documentation
+== Administrator Service
+
+ 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
+
+Contents:
+
+== Formats
+
+ The system REST service supports only XML and JSON input/output formats.
+
+== Overview
+
+ This module provides access to system administrator's configuration.
+
+ Curretly it is possible to set administrator's password and define email addresses for notifications.
+
+
+== PolicyKit Access Rights
+
+ The following PolicyKit permission is needed to perform configutation actions:
+
+ <i>org.opensuse.yast.modules.yapi.administrator.write</i>
+
+ For read access (currently reading list of mail aliases), it is needed
+
+ <i>org.opensuse.yast.modules.yapi.administrator.read</i>
+
+== Actions
+
+
+GET /administrator
+
+ Get the list of current mail aliases. Password is never returned in the GET request.
+
+ CURL Example: curl -u <user> http://localhost:8080/administrator.xml
+
+XmlResult: administrator
+
+
+PUT /administrator
+
+ Update the administrator's configuration. It is possible to save both password and mail aliases or just one part.
+ Password must be in plain text.
+
+ To remove all mail aliases, special 'NONE' string must be passed as a value.
+
+ CURL example: curl -u <user> -X PUT -H 'Content-type: text/xml' -d @save_mail_request.xml http://localhost:8080/administrator.xml
+
+XmlBody: save_mail_request
+
+XmlResult: save_mail_response
+
+ CURL example: curl -u <user> -X PUT -H 'Content-type: text/xml' -d @save_all_request.xml http://localhost:8080/administrator.xml
+
+XmlBody: save_all_request
+
+XmlResult: save_all_response
+
+
diff --git a/plugins/administrator/restdoc/save_all_request.xml b/plugins/administrator/restdoc/save_all_request.xml
new file mode 100644
index 0000000..cd5dda8
--- /dev/null
+++ b/plugins/administrator/restdoc/save_all_request.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<administrator>
+ <password>plaintextpassword</password>
+ <aliases>NONE</aliases>
+</administrator>
diff --git a/plugins/administrator/restdoc/save_all_response.xml b/plugins/administrator/restdoc/save_all_response.xml
new file mode 100644
index 0000000..07efe55
--- /dev/null
+++ b/plugins/administrator/restdoc/save_all_response.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<administrator>
+ <password></password>
+ <aliases></aliases>
+</administrator>
diff --git a/plugins/administrator/restdoc/save_mail_request.xml b/plugins/administrator/restdoc/save_mail_request.xml
new file mode 100644
index 0000000..c910953
--- /dev/null
+++ b/plugins/administrator/restdoc/save_mail_request.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<administrator>
+ <aliases>administrator@other-company.com</aliases>
+</administrator>
diff --git a/plugins/administrator/restdoc/save_mail_response.xml b/plugins/administrator/restdoc/save_mail_response.xml
new file mode 100644
index 0000000..7ddee56
--- /dev/null
+++ b/plugins/administrator/restdoc/save_mail_response.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<administrator>
+ <password></password>
+ <aliases>administrator@other-company.com</aliases>
+</administrator>
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org