Patrick Williams | 696fa72 | 2016-10-09 15:25:22 -0500 | [diff] [blame] | 1 | description: > |
Patrick Williams | f7944dc | 2022-12-05 15:59:17 -0600 | [diff] [blame] | 2 | An example interface originally described as part of the announcement of new |
| 3 | sd-bus interfaces at: |
Patrick Williams | 9f11c97 | 2022-03-14 14:39:30 -0500 | [diff] [blame] | 4 | http://0pointer.net/blog/the-new-sd-bus-api-of-systemd.html |
Patrick Williams | 696fa72 | 2016-10-09 15:25:22 -0500 | [diff] [blame] | 5 | methods: |
Patrick Williams | 9f11c97 | 2022-03-14 14:39:30 -0500 | [diff] [blame] | 6 | - name: Multiply |
| 7 | description: > |
| 8 | Multiplies two integers 'x' and 'y' and returns the result. |
| 9 | parameters: |
| 10 | - name: x |
| 11 | type: int64 |
| 12 | description: > |
| 13 | The first integer to multiply. |
| 14 | - name: y |
| 15 | type: int64 |
| 16 | description: > |
| 17 | The second integer to multiply. |
| 18 | default: 1 |
| 19 | returns: |
| 20 | - name: z |
| 21 | type: int64 |
| 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 |
| 29 | type: int64 |
| 30 | description: > |
| 31 | The first integer to divide. |
| 32 | - name: y |
| 33 | type: int64 |
| 34 | description: > |
| 35 | The second integer to divide. |
| 36 | default: 1 |
| 37 | returns: |
| 38 | - name: z |
| 39 | type: int64 |
| 40 | description: > |
| 41 | The result of (x/y). |
| 42 | errors: |
| 43 | - self.Error.DivisionByZero |
| 44 | - name: Clear |
| 45 | flags: |
| 46 | - unprivileged |
| 47 | - no_reply |
| 48 | description: > |
| 49 | Reset the LastResult property to zero. |
Patrick Williams | 696fa72 | 2016-10-09 15:25:22 -0500 | [diff] [blame] | 50 | properties: |
Patrick Williams | 9f11c97 | 2022-03-14 14:39:30 -0500 | [diff] [blame] | 51 | - name: LastResult |
| 52 | type: int64 |
| 53 | default: 0 |
| 54 | description: > |
| 55 | The result of the most recent calculation. |
| 56 | - name: Status |
| 57 | type: enum[self.State] |
| 58 | default: Success |
| 59 | flags: |
| 60 | - const |
| 61 | description: > |
| 62 | The current state of the Calculator. |
| 63 | - name: Owner |
| 64 | type: string |
| 65 | description: > |
| 66 | The name of the owner of the Calculator. |
| 67 | errors: |
| 68 | - self.Error.PermissionDenied |
Patrick Williams | 696fa72 | 2016-10-09 15:25:22 -0500 | [diff] [blame] | 69 | signals: |
Patrick Williams | 9f11c97 | 2022-03-14 14:39:30 -0500 | [diff] [blame] | 70 | - name: Cleared |
| 71 | description: > |
| 72 | Signal indicating the LastReset property has been set to zero by the |
| 73 | 'Clear' method. |
| 74 | properties: |
| 75 | - type: int64 |
| 76 | description: > |
| 77 | Value of LastReset prior to Clear. |
Patrick Williams | 8c00fed | 2016-11-15 11:07:39 -0600 | [diff] [blame] | 78 | enumerations: |
Patrick Williams | 9f11c97 | 2022-03-14 14:39:30 -0500 | [diff] [blame] | 79 | - name: State |
| 80 | description: > |
| 81 | Identifies if the service has encountered an error or not. |
| 82 | values: |
| 83 | - name: Success |
| 84 | description: > |
| 85 | No error has been encountered. |
| 86 | - name: Error |
| 87 | description: > |
| 88 | The service has encountered an error. |
Patrick Williams | b4bae8f | 2023-09-01 10:13:19 -0500 | [diff] [blame^] | 89 | |
| 90 | paths: |
| 91 | - instance: /net/poettering/calculator |
| 92 | description: Expected path of the instance. |
| 93 | |
| 94 | service_names: |
| 95 | - default: net.poettering.Calculator |
| 96 | description: Expected service name for the instance. |