ref: refs/heads/jr_ntp
commit 94e0a3743a816beef2bc56b7ee9071211af7c526
Author: Martin Vidner
Date: Fri Sep 11 09:40:12 2009 +0200
Initial REST documentation: /network/restdoc/index.html (bnc#537188).
---
plugins/network/public/network/restdoc/.gitignore | 2 +
plugins/network/restdoc/api.txt | 114 +++++++++++++++++++++
plugins/network/restdoc/dns_get.xml | 10 ++
plugins/network/restdoc/hostname_get.xml | 5 +
plugins/network/restdoc/interfaces_eth0_get.xml | 6 +
plugins/network/restdoc/interfaces_get.xml | 13 +++
plugins/network/restdoc/routes_default_get.xml | 5 +
plugins/network/restdoc/routes_get.xml | 7 ++
8 files changed, 162 insertions(+), 0 deletions(-)
diff --git a/plugins/network/public/network/restdoc/.gitignore b/plugins/network/public/network/restdoc/.gitignore
new file mode 100644
index 0000000..4092fac
--- /dev/null
+++ b/plugins/network/public/network/restdoc/.gitignore
@@ -0,0 +1,2 @@
+index.html
+*.xml
diff --git a/plugins/network/restdoc/api.txt b/plugins/network/restdoc/api.txt
new file mode 100644
index 0000000..1845ed6
--- /dev/null
+++ b/plugins/network/restdoc/api.txt
@@ -0,0 +1,114 @@
+= YaST REST Service Documentation
+ <!-- it uses restility, TODO URL -->
+
+== Network
+
+ TODO link to a master API document that contains the common
+ conventions like the authentication below.
+
+ 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.
+
+ TODO how to document errors?
+
+ <b>FIXME</b> for PUT requests the XmlBody and XmlResult documents are
+ faked, they need to match the implementation.
+
+== Table of Contents
+
+Contents
+
+== Overview
+
+ network...
+
+== PolicyKit Access Rights
+
+ The following PolicyKit permissions are defined:
+
+ org.opensuse.yast.modules.yapi.network.read
+
+ org.opensuse.yast.modules.yapi.network.write
+
+== Interfaces
+
+ Actually currently it operates on the interface
+ <b>configurations</b> (/etc/sysconfig/network/ifcfg-*)
+
+GET /network/interfaces
+
+ Get the list of interfaces.
+
+XmlResult: interfaces_get
+
+GET /network/interfaces/<id>
+<id>: interface ID, as in /etc/sysconfig/network/ifcfg-ID
+
+ Get the details of an interface.
+
+XmlResult: interfaces_eth0_get
+
+PUT /network/interfaces/<id>
+<id>: interface ID, as in /etc/sysconfig/network/ifcfg-ID
+
+ Update an interface config.
+
+XmlBody: interfaces_eth0_get
+XmlResult: interfaces_eth0_get
+
+== Hostname
+
+GET /network/hostname
+
+ Get the host name and domain.
+
+XmlResult: hostname_get
+
+PUT /network/hostname
+
+ Set the host name and domain.
+
+XmlBody: hostname_get
+XmlResult: hostname_get
+
+== DNS
+
+GET /network/dns
+
+ Get the nameservers and DNS search list.
+
+XmlResult: dns_get
+
+PUT /network/dns
+
+ Set the nameservers and DNS search list.
+
+XmlBody: dns_get
+XmlResult: dns_get
+
+== Routes
+
+GET /network/routes
+
+ Get the list of configured routes.
+
+XmlResult: routes_get
+
+GET /network/routes/<id>
+<id>: route ID
+
+ Get the details of a route.
+
+XmlResult: routes_default_get
+
+PUT /network/routes/<id>
+
+<id>: route ID, currently only "default" is valid
+
+ Update a route.
+
+
+XmlBody: routes_default_get
+XmlResult: routes_default_get
diff --git a/plugins/network/restdoc/dns_get.xml b/plugins/network/restdoc/dns_get.xml
new file mode 100644
index 0000000..08c6666
--- /dev/null
+++ b/plugins/network/restdoc/dns_get.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dns>
+ <nameservers type="array">
+ <nameserver>192.168.1.2</nameserver>
+ </nameservers>
+ <searches type="array">
+ <search>labs.example.com</search>
+ <search>example.com</search>
+ </searches>
+</dns>
diff --git a/plugins/network/restdoc/hostname_get.xml b/plugins/network/restdoc/hostname_get.xml
new file mode 100644
index 0000000..4a11604
--- /dev/null
+++ b/plugins/network/restdoc/hostname_get.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hostname>
+ <name>trikolka</name>
+ <domain>example.com</domain>
+</hostname>
diff --git a/plugins/network/restdoc/interfaces_eth0_get.xml b/plugins/network/restdoc/interfaces_eth0_get.xml
new file mode 100644
index 0000000..e727b4b
--- /dev/null
+++ b/plugins/network/restdoc/interfaces_eth0_get.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <id>eth0</id>
+ <bootproto>dhcp4</bootproto>
+ <ipaddr/>
+</interface>
diff --git a/plugins/network/restdoc/interfaces_get.xml b/plugins/network/restdoc/interfaces_get.xml
new file mode 100644
index 0000000..f4a915a
--- /dev/null
+++ b/plugins/network/restdoc/interfaces_get.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interfaces type="array">
+ <interface>
+ <id>eth0</id>
+ <bootproto>dhcp4</bootproto>
+ <ipaddr></ipaddr>
+ </interface>
+ <interface>
+ <id>eth7</id>
+ <bootproto>static</bootproto>
+ <ipaddr>7.7.7.7/7</ipaddr>
+ </interface>
+</interfaces>
diff --git a/plugins/network/restdoc/routes_default_get.xml b/plugins/network/restdoc/routes_default_get.xml
new file mode 100644
index 0000000..25a3387
--- /dev/null
+++ b/plugins/network/restdoc/routes_default_get.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<route>
+ <id>default</id>
+ <via>192.168.1.1</via>
+</route>
diff --git a/plugins/network/restdoc/routes_get.xml b/plugins/network/restdoc/routes_get.xml
new file mode 100644
index 0000000..ba73f1b
--- /dev/null
+++ b/plugins/network/restdoc/routes_get.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<routes type="array">
+ <route>
+ <id>default</id>
+ <via>192.168.1.1</via>
+ </route>
+</routes>
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org