REST endpoints now return specific HTTP codes on failure (fix #4278)

This commit is contained in:
Alfredo Cardigliano 2020-08-20 11:45:17 +02:00
parent 745b3b52d3
commit ba2e44ddc6
37 changed files with 141 additions and 228 deletions

View file

@ -30,10 +30,10 @@ local rest_utils = {
internal_error = { http_code = 500, rc = -6, str = "INTERNAL_ERROR"},
bad_format = { http_code = 400, rc = -7, str = "BAD_FORMAT"},
bad_content = { http_code = 400, rc = -8, str = "BAD_CONTENT"},
resolution_failed = { http_code = 200, rc = -9, str = "NAME_RESOLUTION_FAILED"},
resolution_failed = { http_code = 400, rc = -9, str = "NAME_RESOLUTION_FAILED"},
snmp_device_already_added = { http_code = 409, rc = -10, str = "SNMP_DEVICE_ALREADY_ADDED"},
snmp_device_unreachable = { http_code = 200, rc = -11, str = "SNMP_DEVICE_UNREACHABLE"},
snmp_device_no_device_discovered = { http_code = 200, rc = -12, str = "NO_SNMP_DEVICE_DISCOVERED"},
snmp_device_unreachable = { http_code = 400, rc = -11, str = "SNMP_DEVICE_UNREACHABLE"},
snmp_device_no_device_discovered = { http_code = 400, rc = -12, str = "NO_SNMP_DEVICE_DISCOVERED"},
add_pool_failed = { http_code = 409, rc = -13, str = "ADD_POOL_FAILED"},
edit_pool_failed = { http_code = 409, rc = -14, str = "EDIT_POOL_FAILED"},
delete_pool_failed = { http_code = 409, rc = -15, str = "DELETE_POOL_FAILED"},