Hi,
I have a host that was created via API months ago without any interface. Now, programmatically I need to add an interface to ping it, I'm using hostinterface.create but it's not creating it.
Is this possible? or should I use another method/steps ? I'm tried to update the host to add the interface, but it didn;t work either. Details:
hostinterface.create:
================
host.update:
==========
Thanks
I have a host that was created via API months ago without any interface. Now, programmatically I need to add an interface to ping it, I'm using hostinterface.create but it's not creating it.
Is this possible? or should I use another method/steps ? I'm tried to update the host to add the interface, but it didn;t work either. Details:
hostinterface.create:
================
payload={
"jsonrpc": "2.0",
"method": "hostinterface.create",
"params": {
"host": "20070",
"main": "1",
"type": "1",
"useip": "1",
"ip": "8.8.8.8",
"dns": "",
"port": "10050"
},
"auth": "7a2c3sd343daw4ed43",
"id": 1
}
Response:
{"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params.","data":"Incorrect arguments passed to function."},"id":1}
"jsonrpc": "2.0",
"method": "hostinterface.create",
"params": {
"host": "20070",
"main": "1",
"type": "1",
"useip": "1",
"ip": "8.8.8.8",
"dns": "",
"port": "10050"
},
"auth": "7a2c3sd343daw4ed43",
"id": 1
}
Response:
{"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params.","data":"Incorrect arguments passed to function."},"id":1}
host.update:
==========
{
"jsonrpc": "2.0",
"method": "host.update",
"params": {
"host": "20070",
"interfaces": [
{
"type": "1",
"main": "1",
"useip": "1",
"ip": "8.8.8.8",
"dns": "aaa",
"port": "10050"
}
]
},
"auth": "7a2c3sd343daw4ed43",
"jsonrpc": "2.0",
"method": "host.update",
"params": {
"host": "20070",
"interfaces": [
{
"type": "1",
"main": "1",
"useip": "1",
"ip": "8.8.8.8",
"dns": "aaa",
"port": "10050"
}
]
},
"auth": "7a2c3sd343daw4ed43",
"id": 1
}
Response:
{"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params.","data":"Wrong fields for host "20070"."},"id":1}
}
Response:
{"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params.","data":"Wrong fields for host "20070"."},"id":1}
Thanks
Comment