summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0003-Chassis-Power-Control-are-implemented.patch
blob: 79d02ca9b051932e468305e3cb3fe371f2738bb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
From 35271230690c5d85dc7a6502031b38d93ddd683f Mon Sep 17 00:00:00 2001
From: Ed Tanous <ed.tanous@intel.com>
Date: Thu, 24 Jan 2019 09:29:01 -0800
Subject: [PATCH] Chassis Power Control are implemented.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Feature level:
Power on server is ready
Power off server is ready
Power cycle server is ready
Power reset server is ready

Framework level:
WebUI is enabled.
IPMI Commands is enabled.
Restful API is enabled.
Physical buttons (Power/Reset/ID) are enabled.
Chassis state manager is enabled.
Host state manager is enabled.

Enabled IPMI commands:
ipmitool -H <ip_addr>  -P <pass_word> -I lanplus chassis status
ipmitool -H <ip_addr>  -P <pass_word> -I lanplus chassis power status
ipmitool -H <ip_addr>  -P <pass_word> -I lanplus chassis power on
ipmitool -H <ip_addr>  -P <pass_word> -I lanplus chassis power off
ipmitool -H <ip_addr>  -P <pass_word> -I lanplus chassis power cycle
ipmitool -H <ip_addr>  -P <pass_word> -I lanplus chassis power reset

Enabled Restful APIs:
Login: curl --noproxy <ip_addr> -c cjar -b cjar -k -H "Content-Type: application/json" -X POST https://<ip_addr>/login -d "{\"data\": [ \"root\", \"0penBmc\" ] }“
Host State: curl --noproxy <ip_addr> -b cjar -k https://<ip_addr>/xyz/openbmc_project/state/host0
Chassis State: curl --noproxy <ip_addr> -b cjar -k https://<ip_addr>/xyz/openbmc_project/state/chassis0
Power state: curl --noproxy <ip_addr> -b cjar -k https://<ip_addr>/xyz/openbmc_project/Chassis/Control/Power0
Power on/off: curl --noproxy <ip_addr> -q1c cjar -b cjar -k -H "Content-Type: application/json" -d '{"data": "xyz.openbmc_project.State.Host.Transition.Off"}' -X PUT https://<ip_addr>/xyz/openbmc_project/state/host0/attr/RequestedHostTransition

Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
---
 .../Chassis/Control/Chassis.interface.yaml    | 94 +++++++++++++++++++
 .../Chassis/Control/Power.interface.yaml      | 85 ++++++++++++++---
 2 files changed, 166 insertions(+), 13 deletions(-)
 create mode 100644 xyz/openbmc_project/Chassis/Control/Chassis.interface.yaml

diff --git a/xyz/openbmc_project/Chassis/Control/Chassis.interface.yaml b/xyz/openbmc_project/Chassis/Control/Chassis.interface.yaml
new file mode 100644
index 0000000..c28492a
--- /dev/null
+++ b/xyz/openbmc_project/Chassis/Control/Chassis.interface.yaml
@@ -0,0 +1,94 @@
+description: >
+    chassis control service
+methods:
+    - name: powerOn
+      description: >
+        Power on system.
+      returns:
+        - name: state
+          type: int32
+          description: >
+            The result of command.
+      errors:
+       - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
+
+       - xyz.openbmc_project.Chassis.Common.Error.IOError
+
+    - name: powerOff
+      description: >
+        Power Off system.
+      returns:
+        - name: state
+          type: int32
+          description: >
+            The result of command.
+      errors:
+       - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
+
+       - xyz.openbmc_project.Chassis.Common.Error.IOError
+
+    - name: softPowerOff
+      description: >
+        Soft Power off system.
+      returns:
+        - name: state
+          type: int32
+          description: >
+            The result of command.
+      errors:
+       - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
+
+       - xyz.openbmc_project.Chassis.Common.Error.IOError
+
+    - name: reboot
+      description: >
+        reboot system.
+      returns:
+        - name: state
+          type: int32
+          description: >
+            The result of command.
+      errors:
+       - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
+
+       - xyz.openbmc_project.Chassis.Common.Error.IOError
+
+    - name: softReboot
+      description: >
+        Soft Reboot  system.
+      returns:
+        - name: state
+          type: int32
+          description: >
+            The result of command.
+      errors:
+       - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
+
+       - xyz.openbmc_project.Chassis.Common.Error.IOError
+
+    - name: quiesce
+      description: >
+        Quiesce system.
+      returns:
+        - name: state
+          type: int32
+          description: >
+            The result of command.
+      errors:
+       - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
+
+       - xyz.openbmc_project.Chassis.Common.Error.IOError
+
+    - name: getPowerState
+      description: >
+        Get system power state.
+      returns:
+        - name: state
+          type: int32
+          description: >
+            The result of command.
+      errors:
+       - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
+
+       - xyz.openbmc_project.Chassis.Common.Error.IOError
+
diff --git a/xyz/openbmc_project/Chassis/Control/Power.interface.yaml b/xyz/openbmc_project/Chassis/Control/Power.interface.yaml
index 082586f..e77598b 100644
--- a/xyz/openbmc_project/Chassis/Control/Power.interface.yaml
+++ b/xyz/openbmc_project/Chassis/Control/Power.interface.yaml
@@ -1,31 +1,90 @@
 description: >
-    Power control service
+    Chassis control service
 methods:
+    - name: setPowerState
+      description: >
+        set host power state.
+      parameters:
+        - name: state
+          type: int32
+          description: >
+            0 for force power off host
+            1 for power on host
+      returns:
+        - name: status
+          type: int32
+          description: >
+            The result of command.
+      errors:
+       - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
+
+       - xyz.openbmc_project.Chassis.Common.Error.IOError
+
+    - name: getPowerState
+      description: >
+        Get current host power status.
+      returns:
+        - name: status
+          type: int32
+          description: >
+            Current host status,
+            0 for host power off
+            1 for host power on
+      errors:
+       - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
+
+       - xyz.openbmc_project.Chassis.Common.Error.IOError
+
     - name: forcePowerOff
       description: >
         Force power off the host.
       returns:
         - name: status
-          type: boolean
+          type: int32
           description: >
             The result of power off command.
       errors:
        - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
+
        - xyz.openbmc_project.Chassis.Common.Error.IOError
 
 properties:
-    - name: PGood
-      type: boolean
-      default: false
+    - name: vrd_good
+      type: int32
+      default: 0
       description: >
-       PSU Power good property
-       It is a read-only property.
-    - name: State
+       ACPI status
+    - name: s4s5_state
       type: int32
       default: 0
       description: >
-       System power status
-       0: power is off
-       1: power is on
-       Setting its value to change the system state
-       Read its value to get the system state.
\ No newline at end of file
+       ACPI status
+    - name: pgood
+      type: int32
+      default: 0
+      description: >
+       pgood property
+    - name: state
+      type: int32
+      default: 0
+      description: >
+       state property
+    - name: pgood_timeout
+      type: int32
+      default: 0
+      description: >
+       pgoodtimeout property
+    - name: post_complete
+      type: boolean
+      default: false
+      description: >
+        The current BIOS POST state,
+        false means not completed or system reset,
+        true means BIOS POST completed.
+signals:
+    - name: PowerGood
+      description: >
+        Signal for powergood
+    - name: PowerLost
+      description: >
+        Signal for powerlost
-- 
2.17.1