xcat2 / xcat-inventory

An inventory tool for xcat cluster
8 stars 16 forks source link

add node remote power API #210

Closed bybai closed 5 years ago

bybai commented 5 years ago

For https://github.ibm.com/xcat2/task_management/issues/272

Des:

PATH METHOD Description Parameters
/system/nodes/{node}/power POST remote control, action will be given in payload  

UT:

[root@byrh07 postscripts]# curl -X POST "http://10.4.41.7:5000/api/v2/system/nodes/byrh08/power" -H  "accept: application/json" -H  "Content-Type: application/json" -d "{  \"action\": \"on\"}"
{
    "powerstate": "on"
}

[root@byrh07 postscripts]# curl -X POST "http://10.4.41.7:5000/api/v2/system/nodes/byrh08/power" -H  "accept: application/json" -H  "Content-Type: application/json" -d "{  \"action\": \"off\"}"
{
    "powerstate": "off"
}

[root@byrh07 postscripts]# curl -X POST "http://10.4.41.7:5000/api/v2/system/nodes/byrh08/power" -H  "accept: application/json" -H  "Content-Type: application/json" -d "{  \"action\": \"state\"}"
{
    "powerstate": "off"
}