From 5980a38730347ef01dfc29c1b3445e0d6e18826e Mon Sep 17 00:00:00 2001 From: Patrick Decat Date: Wed, 28 Sep 2022 16:16:11 +0200 Subject: [PATCH] Revert "Fix HostsDeleteByIds request due to documentation (#11)" This reverts commit 6f429ab92d328040e8af8ccec632c69706046c6d. --- host.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/host.go b/host.go index 95e4757..37916eb 100644 --- a/host.go +++ b/host.go @@ -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 {