Patrick Williams | 696fa72 | 2016-10-09 15:25:22 -0500 | [diff] [blame] | 1 | description: > |
Gunnar Mills | a4b4a0b | 2018-04-08 14:30:38 -0500 | [diff] [blame] | 2 | An example interface originally described as part of the announcement |
Patrick Williams | 696fa72 | 2016-10-09 15:25:22 -0500 | [diff] [blame] | 3 | of new sd-bus interfaces at: |
| 4 | http://0pointer.net/blog/the-new-sd-bus-api-of-systemd.html |
| 5 | methods: |
| 6 | - name: Multiply |
| 7 | description: > |
| 8 | Multiplies two integers 'x' and 'y' and returns the result. |
| 9 | parameters: |
| 10 | - name: x |
Patrick Williams | d0cd966 | 2016-11-14 21:55:07 -0600 | [diff] [blame] | 11 | type: int64 |
Patrick Williams | 696fa72 | 2016-10-09 15:25:22 -0500 | [diff] [blame] | 12 | description: > |
| 13 | The first integer to multiply. |
| 14 | - name: y |
Patrick Williams | d0cd966 | 2016-11-14 21:55:07 -0600 | [diff] [blame] | 15 | type: int64 |
Patrick Williams | 696fa72 | 2016-10-09 15:25:22 -0500 | [diff] [blame] | 16 | description: > |
| 17 | The second integer to multiply. |
| 18 | default: 1 |
| 19 | returns: |
| 20 | - name: z |
Patrick Williams | d0cd966 | 2016-11-14 21:55:07 -0600 | [diff] [blame] | 21 | type: int64 |
Patrick Williams | 696fa72 | 2016-10-09 15:25:22 -0500 | [diff] [blame] | 22 | description: > |
| 23 | The result of (x*y). |
| 24 | - name: Divide |
| 25 | description: > |
| 26 | Divides two integers 'x' and 'y' and returns the result. |
| 27 | parameters: |
| 28 | - name: x |
Patrick Williams | d0cd966 | 2016-11-14 21:55:07 -0600 | [diff] [blame] | 29 | type: int64 |
Patrick Williams | 696fa72 | 2016-10-09 15:25:22 -0500 | [diff] [blame] | 30 | description: > |
| 31 | The first integer to divide. |
| 32 | - name: y |
Patrick Williams | d0cd966 | 2016-11-14 21:55:07 -0600 | [diff] [blame] | 33 | type: int64 |
Patrick Williams | 696fa72 | 2016-10-09 15:25:22 -0500 | [diff] [blame] | 34 | description: > |
| 35 | The second integer to divide. |
| 36 | default: 1 |
| 37 | returns: |
| 38 | - name: z |
Patrick Williams | d0cd966 | 2016-11-14 21:55:07 -0600 | [diff] [blame] | 39 | type: int64 |
Patrick Williams | 696fa72 | 2016-10-09 15:25:22 -0500 | [diff] [blame] | 40 | description: > |
| 41 | The result of (x/y). |
| 42 | errors: |
Patrick Williams | 4a5c3b3 | 2016-11-15 14:26:25 -0600 | [diff] [blame] | 43 | - self.Error.DivisionByZero |
Patrick Williams | 696fa72 | 2016-10-09 15:25:22 -0500 | [diff] [blame] | 44 | - name: Clear |
| 45 | description: > |
| 46 | Reset the LastResult property to zero. |
| 47 | properties: |
| 48 | - name: LastResult |
Patrick Williams | d0cd966 | 2016-11-14 21:55:07 -0600 | [diff] [blame] | 49 | type: int64 |
Patrick Williams | 696fa72 | 2016-10-09 15:25:22 -0500 | [diff] [blame] | 50 | default: 0 |
| 51 | description: > |
| 52 | The result of the most recent calculation. |
Patrick Williams | 8c00fed | 2016-11-15 11:07:39 -0600 | [diff] [blame] | 53 | - name: Status |
| 54 | type: enum[self.State] |
| 55 | default: Success |
Adriana Kobylak | 69425eb | 2018-08-17 13:55:19 -0500 | [diff] [blame] | 56 | flags: |
| 57 | - const |
Patrick Williams | 8c00fed | 2016-11-15 11:07:39 -0600 | [diff] [blame] | 58 | description: > |
| 59 | The current state of the Calculator. |
Adriana Kobylak | 75a2e25 | 2018-06-06 10:49:24 -0500 | [diff] [blame] | 60 | - name: Owner |
| 61 | type: string |
| 62 | description: > |
| 63 | The name of the owner of the Calculator. |
| 64 | errors: |
| 65 | - self.Error.PermissionDenied |
Patrick Williams | 696fa72 | 2016-10-09 15:25:22 -0500 | [diff] [blame] | 66 | signals: |
| 67 | - name: Cleared |
| 68 | description: > |
| 69 | Signal indicating the LastReset property has been set to zero by the |
| 70 | 'Clear' method. |
| 71 | properties: |
Patrick Williams | d0cd966 | 2016-11-14 21:55:07 -0600 | [diff] [blame] | 72 | - type: int64 |
Patrick Williams | 696fa72 | 2016-10-09 15:25:22 -0500 | [diff] [blame] | 73 | description: > |
| 74 | Value of LastReset prior to Clear. |
Patrick Williams | 8c00fed | 2016-11-15 11:07:39 -0600 | [diff] [blame] | 75 | enumerations: |
| 76 | - name: State |
| 77 | description: > |
| 78 | Identifies if the service has encountered an error or not. |
| 79 | values: |
| 80 | - name: Success |
| 81 | description: > |
| 82 | No error has been encountered. |
| 83 | - name: Error |
| 84 | description: > |
| 85 | The service has encountered an error. |