Closed bybai closed 5 years ago
For https://github.ibm.com/xcat2/task_management/issues/143
Description: Add distros DB API delete, get, post
UT:
get distro list defined in store
curl -X GET "http://10.4.41.7:5000/api/v2/inventory/distros" -H "accept: application/json" [ { "meta": { "name": "rhels7.6-x86_64" }, "spec": { "majorversion": "7", "minorversion": "6", "arch": "x86_64", "basename": "rhels", "dirpaths": "/install/rhels7.6/x86_64", "type": "Linux" } } ]
get specified distro:
curl -X GET "http://10.4.41.7:5000/api/v2/inventory/distros/rhels7.6-x86_64" -H "accept: application/json" { "meta": { "name": "rhels7.6-x86_64" }, "spec": { "majorversion": "7", "minorversion": "6", "arch": "x86_64", "basename": "rhels", "dirpaths": "/install/rhels7.6/x86_64", "type": "Linux" } }
delete method:
]# lsdef -t osdistro rhels7.6 (osdistro) rhels7.6-x86_64 (osdistro) ]#curl -X DELETE "http://10.4.41.7:5000/api/v2/inventory/distros/rhels7.6" -H "accept: application/json" null ]# lsdef -t osdistro rhels7.6-x86_64 (osdistro)
after the input format is changed, the new POST method using valid data to UT:
/mnt/iso/suse/15/x86_64/SLE-15-Installer-DVD-x86_64-GM-DVD1.iso,/mnt/iso/suse/15/x86_64/SLE-15-Packages-x86_64-GM-DVD1.iso
curl -X POST "http://10.4.41.7:5000/api/v2/inventory/distros?Image%20paths=%2Fmnt%2Fiso%2Fsuse%2F15%2Fx86_64%2FSLE-15-Installer-DVD-x86_64-GM-DVD1.iso%2C%2Fmnt%2Fiso%2Fsuse%2F15%2Fx86_64%2FSLE-15-Packages-x86_64-GM-DVD1.iso" -H "accept: application/json"
http://10.4.41.7:5000/api/v2/inventory/distros?Image%20paths=%2Fmnt%2Fiso%2Fsuse%2F15%2Fx86_64%2FSLE-15-Installer-DVD-x86_64-GM-DVD1.iso%2C%2Fmnt%2Fiso%2Fsuse%2F15%2Fx86_64%2FSLE-15-Packages-x86_64-GM-DVD1.iso
empty input data for POST method:
curl -X POST "http://10.4.41.7:5000/api/v2/inventory/distros" -H "accept: application/json"
{ "message": "Image not found" }
invalid input data for POST method:
curl -X POST "http://10.4.41.7:5000/api/v2/inventory/distros?Image%20paths=ldkjflskkl" -H "accept: application/json"
{ "message": "The management server was unable to find/read /tmp/ldkjflskkl. Ensure that file exists on the server at the specified location." }
For https://github.ibm.com/xcat2/task_management/issues/143
Description: Add distros DB API delete, get, post
UT:
get distro list defined in store
get specified distro:
delete method:
after the input format is changed, the new POST method using valid data to UT:
empty input data for POST method:
invalid input data for POST method: