Skip to content

Commit

Permalink
Merge pull request #13 from claranet/revert-11-master
Browse files Browse the repository at this point in the history
Revert "Fix HostsDeleteByIds request due to documentation (#11)"

This reverts commit 6f429ab.
  • Loading branch information
pdecat committed Oct 3, 2022
2 parents afeebbf + 5980a38 commit 1651899
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion host.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,12 @@ func (api *API) HostsDelete(hosts Hosts) (err error) {
// HostsDeleteByIds Wrapper for host.delete
// https://www.zabbix.com/documentation/3.2/manual/api/reference/host/delete
func (api *API) HostsDeleteByIds(ids []string) (err error) {
response, err := api.CallWithError("host.delete", ids)
hostIds := make([]map[string]string, len(ids))
for i, id := range ids {
hostIds[i] = map[string]string{"hostid": id}
}

response, err := api.CallWithError("host.delete", hostIds)
if err != nil {
// Zabbix 2.4 uses new syntax only
if e, ok := err.(*Error); ok && e.Code == -32500 {
Expand Down

0 comments on commit 1651899

Please sign in to comment.