func (m *MmeApiHandler) DeleteModel(cont *gin.Context) {
id := cont.Param("modelRegistrationId")
logging.INFO("Deleting model... id = ", id)
- rowsAffected, err := m.iDB.Delete(id)
+ _, err := m.iDB.Delete(id)
if err != nil {
cont.JSON(http.StatusInternalServerError, gin.H{
"error": err.Error(),
})
return
}
- message := "modelInfo deleted"
- if rowsAffected == 0 {
- message = fmt.Sprintf("id = %s already doesn't exist in database", id)
- }
- cont.JSON(http.StatusOK, gin.H{"message": message})
+
+ cont.JSON(http.StatusNoContent, nil)
}
GET http://{{host}}/models?model-name=TestModel1&model-version=v1.0
Content-Type: application/json
-### updated model
-PUT http://{{host}}/model-registrations/79a20274-35a6-4f97-a669-8b42b73f087f
+### Get Model info by ID
+GET http://{{host}}/model-registrations/a43d1a80-e1c5-4d87-b90f-729736bdd89f
+Content-Type: application/json
+
+### Updated Model info by ID
+PUT http://{{host}}/model-registrations/a43d1a80-e1c5-4d87-b90f-729736bdd89f
Content-Type: application/json
{
- "id": "79a20274-35a6-4f97-a669-8b42b73f087f",
+ "id": "a43d1a80-e1c5-4d87-b90f-729736bdd89f",
"modelId": {
"modelName": "TestModel1",
"modelVersion": "v1.0",
"modelLocation": ""
}
-### delete modelinfo
-DELETE http://{{host}}/modelInfo/12345
\ No newline at end of file
+### delete model info by ID
+DELETE http://{{host}}/model-registrations/a43d1a80-e1c5-4d87-b90f-729736bdd89f