Ad Widget

Collapse

API hostinterface.create on already created host returning error:-32602

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • verde
    Member
    • Jul 2021
    • 39

    #1

    API hostinterface.create on already created host returning error:-32602

    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:
    ================
    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}



    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",
    "id": 1
    }

    Response:
    {"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params.","data":"Wrong fields for host "20070"."},"id":1}




    Thanks
    Last edited by verde; 01-01-2024, 19:37.
  • verde
    Member
    • Jul 2021
    • 39

    #2
    Any insights?

    Comment

    Working...