]# curl -X DELETE "http://10.4.41.7:5000/api/v2/inventory/osimages/rh" -H "accept: application/json"
{
"message": "Could not find an object named 'rh' of type 'osimage'."
}
]# curl -X GET "http://10.4.41.7:5000/api/v2/inventory/osimages/rhels7.6-x86_64" -H "accept: application/json"
{
"message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again. You have requested this URI [/api/v2/inventory/osimages/rhels7.6-x86_64] but did you mean /api/v2/inventory/osimages/<string:name> or /api/v2/inventory/osimages or /api/v2/inventory/routes/<string:name> ?"
}
Implement Osimage restful APIs for: https://github.ibm.com/xcat2/task_management/issues/142
Changes summaries:
validate_resource_input_data
ininvmanager.py
.inventory/osimages
POST/GETinventory/osimages/{name}
GET/PUT/DELETE/PATCHUT results:
inventory/osimages/{name}
DELETE OKinventory/osimages/{name}
DELETE Not Foundinventory/osimages/{name}
GET OKinventory/osimages/{name}
GET failedinventory/osimages/{name}
PUT created OK.]#curl -X PUT "http://10.4.41.7:5000/api/v2/inventory/osimages/rhels7.6-test" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"meta\": { \"name\": \"rhels7.6-test\" }, \"spec\": { \"basic_attributes\": { \"osdistro\": \"rhels7.6-x86_64\", \"osname\": \"Linux\", \"distribution\": \"rhels7.6\", \"arch\": \"ppc64\" }, \"role\": \"service\", \"imagetype\": \"linux\", \"provision_mode\": \"netboot\" }}"
]# lsdef -t osimage rhels7.6-test Object name: rhels7.6-test environvar=OBJNAME=rhels7.6-x86_64-install-compute imagetype=linux osarch=ppc64 osdistroname=rhels7.6-x86_64 osname=Linux osvers=rhels7.6 profile=service provmethod=netboot
curl -X PUT "http://10.4.41.7:5000/api/v2/inventory/osimages/rhels7.6-x86_64-install-compute" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"meta\": { \"name\": \"rhels7.6-\" }, \"spec\": { \"basic_attributes\": { \"osdistro\": \"rhels7.6-x86_64\", \"osname\": \"Linux\", \"distribution\": \"rhels7.6\", \"arch\": \"ppc64\" }, \"role\": \"service\", \"imagetype\": \"linux\", \"provision_mode\": \"netboot\" }}"
{ "message": "meta name rhels7.6- is not the same with resource name rhels7.6-x86_64-install-compute." }
curl -X PATCH "http://10.4.41.7:5000/api/v2/inventory/osimages/rhels7.6-test" -H "accept: application/json" -H "Content-Type: application/json" -d "{}" { "message": "Input data should not be None." }
curl -X PATCH "http://10.4.41.7:5000/api/v2/inventory/osimages/rhels7.6-test" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"modify\": { \"osdistro\": \"rhels7.6-x86_64\", \"osname\": \"Linux\", \"osarch\": \"ppc\" }}"