Hi,
When you attempt to add a tag using host.update as an API, the following error occurs.
Error:
{'error': {'data': 'Invalid parameter "/tags/1": an array is expected.', 'message': 'Invalid params.', 'code': -32602}, 'jsonrpc': '2.0', 'id': '0'}
Requested Parameter
{"params": {"hostid": "10272", "tags": {"value": "test", "tag": "role"}}, "jsonrpc": "2.0", "id": "0", "method": "host.update", "auth": "eb9149e5b05b7fbf41bb753c76698d55"}
zabbixUrl="http://192.168.0.42/zabbix/api_jsonrpc.php"
data = {
"jsonrpc": "2.0",
"method": "host.update",
"params": {
"hostid":hostId,
#"inventory_mode":0,
#"inventory":{
# "location":"Latvia, Riga"
#} # This code is no problem.
"tags": {
"tag": tagName,
"value": tagValue
}
},
"auth": token,
"id":"0"
}
zabbix version : 4.4
Please help me
When you attempt to add a tag using host.update as an API, the following error occurs.
Error:
{'error': {'data': 'Invalid parameter "/tags/1": an array is expected.', 'message': 'Invalid params.', 'code': -32602}, 'jsonrpc': '2.0', 'id': '0'}
Requested Parameter
{"params": {"hostid": "10272", "tags": {"value": "test", "tag": "role"}}, "jsonrpc": "2.0", "id": "0", "method": "host.update", "auth": "eb9149e5b05b7fbf41bb753c76698d55"}
zabbixUrl="http://192.168.0.42/zabbix/api_jsonrpc.php"
data = {
"jsonrpc": "2.0",
"method": "host.update",
"params": {
"hostid":hostId,
#"inventory_mode":0,
#"inventory":{
# "location":"Latvia, Riga"
#} # This code is no problem.
"tags": {
"tag": tagName,
"value": tagValue
}
},
"auth": token,
"id":"0"
}
zabbix version : 4.4
Please help me
Comment