Hi. I'm trying to create a snmp host using API. Looks like I'm missing params but don't know which ones.
My code:
{
"jsonrpc": "2.0",
"method": "host.create",
"params": {
"host": "Testing",
"interfaces": [
{
"type": 2,
"main": 1,
"useip": 1,
"ip": "192.168.3.1",
"dns": "",
"port": "161",
"bulk": 1,
}
],
"groups": [
{
"groupid": "21"
}
],
"templates": [
{
"templateid": "10233"
}
],
},
"auth": AUTHTOKEN,
"id": 1
}
The result:
{
"error": {
"code": -32602,
"data": "Incorrect arguments passed to function.",
"message": "Invalid params."
},
"id": 1,
"jsonrpc": "2.0"
}
My code:
{
"jsonrpc": "2.0",
"method": "host.create",
"params": {
"host": "Testing",
"interfaces": [
{
"type": 2,
"main": 1,
"useip": 1,
"ip": "192.168.3.1",
"dns": "",
"port": "161",
"bulk": 1,
}
],
"groups": [
{
"groupid": "21"
}
],
"templates": [
{
"templateid": "10233"
}
],
},
"auth": AUTHTOKEN,
"id": 1
}
The result:
{
"error": {
"code": -32602,
"data": "Incorrect arguments passed to function.",
"message": "Invalid params."
},
"id": 1,
"jsonrpc": "2.0"
}
Comment