summaryrefslogtreecommitdiffstats
path: root/common/recipes-rest/rest-api/files
diff options
context:
space:
mode:
authorTian Fang <tfang@fb.com>2015-12-14 22:08:40 -0800
committerTian Fang <tfang@fb.com>2015-12-15 09:49:21 -0800
commite65a7944211c70f6b5cfb6cedd73cc31105319de (patch)
tree067082251bc52bc6c09ca87feaa1352d0468a5ac /common/recipes-rest/rest-api/files
parent8a67fbdd0e251bb34d55992b0771edba1837d589 (diff)
downloadast2050-yocto-openbmc-e65a7944211c70f6b5cfb6cedd73cc31105319de.zip
ast2050-yocto-openbmc-e65a7944211c70f6b5cfb6cedd73cc31105319de.tar.gz
Sync to internal OpenBMC repo f926614
Diffstat (limited to 'common/recipes-rest/rest-api/files')
-rw-r--r--common/recipes-rest/rest-api/files/node_server.py7
-rw-r--r--common/recipes-rest/rest-api/files/pal.py8
2 files changed, 13 insertions, 2 deletions
diff --git a/common/recipes-rest/rest-api/files/node_server.py b/common/recipes-rest/rest-api/files/node_server.py
index 57a5c42..cf64f03 100644
--- a/common/recipes-rest/rest-api/files/node_server.py
+++ b/common/recipes-rest/rest-api/files/node_server.py
@@ -56,7 +56,7 @@ class serverNode(node):
else:
res = 'success'
- result = { "result": res }
+ result = { "result": res }
return result
@@ -64,6 +64,9 @@ def get_node_server(num):
actions = ["power-on",
"power-off",
"power-cycle",
- "graceful-shutdown"
+ "graceful-shutdown",
+ "12v-on",
+ "12v-off",
+ "12v-cycle"
]
return serverNode(num = num, actions = actions)
diff --git a/common/recipes-rest/rest-api/files/pal.py b/common/recipes-rest/rest-api/files/pal.py
index 8faef30..f0e076d 100644
--- a/common/recipes-rest/rest-api/files/pal.py
+++ b/common/recipes-rest/rest-api/files/pal.py
@@ -67,6 +67,14 @@ def pal_set_server_power(slot_id, command):
cmd.value = 2
elif command == 'graceful-shutdown':
cmd.value = 3
+ elif command == '12v-off':
+ cmd.value = 4
+ elif command == '12v-on':
+ cmd.value = 5
+ elif command == '12v-cycle':
+ cmd.value = 6
+ else:
+ return -1
ret = lpal_hndl.pal_set_server_power(slot_id, cmd)
if ret:
return -1
OpenPOWER on IntegriCloud