summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2016-10-09 15:25:22 -0500
committerPatrick Williams <patrick@stwcx.xyz>2016-10-11 12:32:02 -0500
commit696fa72a9e7c3ed20900a54a05f3be7396cce7fd (patch)
treec9cea8ae53156913f52dc4dbb5942266d4851ee8
parent9d3ec7fb91cc20a428e4eb72b133e91d5f57370a (diff)
downloadsdbusplus-696fa72a9e7c3ed20900a54a05f3be7396cce7fd.tar.gz
sdbusplus-696fa72a9e7c3ed20900a54a05f3be7396cce7fd.zip
Example interface YAML file
We are defining a YAML file format for dbus interfaces, from which we will generate documentation and client/server bindings for the sdbus++ library. This is a proposed example definition for the net.poettering.Calculator interface. Change-Id: Ib7ff063eb00e9fd801d945eaa146801ebd6fdeb0 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
-rw-r--r--tools/example/net/poettering/Calculator.interface.yaml62
1 files changed, 62 insertions, 0 deletions
diff --git a/tools/example/net/poettering/Calculator.interface.yaml b/tools/example/net/poettering/Calculator.interface.yaml
new file mode 100644
index 0000000..2c288b6
--- /dev/null
+++ b/tools/example/net/poettering/Calculator.interface.yaml
@@ -0,0 +1,62 @@
+description: >
+ An example interface originally described as part of the announcment
+ of new sd-bus interfaces at:
+ http://0pointer.net/blog/the-new-sd-bus-api-of-systemd.html
+methods:
+ - name: Multiply
+ description: >
+ Multiplies two integers 'x' and 'y' and returns the result.
+ parameters:
+ - name: x
+ type: integer
+ description: >
+ The first integer to multiply.
+ - name: y
+ type: integer
+ description: >
+ The second integer to multiply.
+ default: 1
+ returns:
+ - name: z
+ type: integer
+ description: >
+ The result of (x*y).
+ - name: Divide
+ description: >
+ Divides two integers 'x' and 'y' and returns the result.
+ parameters:
+ - name: x
+ type: integer
+ description: >
+ The first integer to divide.
+ - name: y
+ type: integer
+ description: >
+ The second integer to divide.
+ default: 1
+ returns:
+ - name: z
+ type: integer
+ description: >
+ The result of (x/y).
+ errors:
+ - self.DivisionByZero
+ - name: Clear
+ description: >
+ Reset the LastResult property to zero.
+properties:
+ - name: LastResult
+ type: integer
+ default: 0
+ description: >
+ The result of the most recent calculation.
+signals:
+ - name: Cleared
+ description: >
+ Signal indicating the LastReset property has been set to zero by the
+ 'Clear' method.
+ properties:
+ - type: integer
+ description: >
+ Value of LastReset prior to Clear.
+
OpenPOWER on IntegriCloud