[ZBX-7278] API host.massremove templateids_clear generates SQL error Created: 2013 Nov 05 Updated: 2017 May 30 Resolved: 2013 Nov 06 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | API (A) |
Affects Version/s: | 2.0.8 |
Fix Version/s: | None |
Type: | Incident report | Priority: | Minor |
Reporter: | Gregory Ruiz-Ade | Assignee: | Ivo Kurzemnieks |
Resolution: | Duplicate | Votes: | 0 |
Labels: | api | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Oracle Enterprise Linux 6.4, Zabbix RPMs from Zabbix repository |
Issue Links: |
|
Description |
Attempting to do a template "unlink and clear" via the API fails. Performing the operation manually (via the Web UI) works as expected. Request: { }, Response: { "code": -32500, "message": "Application error.", "data": "SQL statement execution has failed \"DELETE FROM hosts_templates WHERE templateid=Array AND hostid='10141'\"" } |
Comments |
Comment by Ivo Kurzemnieks [ 2013 Nov 06 ] |
The given API request is incorrect. There is no need for another array 'templateid'. See documentation for 2.0 and 2.2. { "hostids": [ "10122" ], "templateids_clear": [ "10056" ] } or string: { "hostids": [ "10122" ], "templateids_clear": "10056" } Nowever API requires additional validation for such cases, but this will be fixed under ZBX-3783. |