KRON PAM API Collection v3.7.0
Device Management
Save New Device Group Subnet
1 min
code examples curl location globoff '{{url}}/aioc rest web/rest/discovery/savedevicegroupsubnet' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ header 'x xsrf token {{csrftoken}}' \\ \ data '"{\n \\"dbid\\" 462524,\n \\"devicegroupid\\" \\"636dca2e b185 4296 a66e 03b4a35dace2\\",\n \n \\"subnetip\\" \\"10 30 40 1\\",\n \\"mask\\" null,\n \\"cidr\\" 32,\n \\"firstip\\" 169748725,\n \\"lastip\\" 169748725,\n \\"interfacename\\" null\n\t\n}"'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); myheaders append("x xsrf token", "{{csrftoken}}"); var raw = json stringify("{\n \\"dbid\\" 462524,\n \\"devicegroupid\\" \\"636dca2e b185 4296 a66e 03b4a35dace2\\",\n \n \\"subnetip\\" \\"10 30 40 1\\",\n \\"mask\\" null,\n \\"cidr\\" 32,\n \\"firstip\\" 169748725,\n \\"lastip\\" 169748725,\n \\"interfacename\\" null\n\t\n}"); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("{{url}}/aioc rest web/rest/discovery/savedevicegroupsubnet", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("{{url}}/aioc rest web/rest/discovery/savedevicegroupsubnet") http = net http new(url host, url port); request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request\["x xsrf token"] = "{{csrftoken}}" request body = json dump("{\n \\"dbid\\" 462524,\n \\"devicegroupid\\" \\"636dca2e b185 4296 a66e 03b4a35dace2\\",\n \n \\"subnetip\\" \\"10 30 40 1\\",\n \\"mask\\" null,\n \\"cidr\\" 32,\n \\"firstip\\" 169748725,\n \\"lastip\\" 169748725,\n \\"interfacename\\" null\n\t\n}") response = http request(request) puts response read body import requests import json url = "{{url}}/aioc rest web/rest/discovery/savedevicegroupsubnet" payload = json dumps("{\n \\"dbid\\" 462524,\n \\"devicegroupid\\" \\"636dca2e b185 4296 a66e 03b4a35dace2\\",\n \n \\"subnetip\\" \\"10 30 40 1\\",\n \\"mask\\" null,\n \\"cidr\\" 32,\n \\"firstip\\" 169748725,\n \\"lastip\\" 169748725,\n \\"interfacename\\" null\n\t\n}") headers = { 'accept' 'application/json', 'content type' 'application/json', 'x xsrf token' '{{csrftoken}}' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses { "dbid" 3483567, "devicegroupid" "7dad2aa5 414a 4b20 86c0 346876ea88b5", "subnetip" "10 30 40 1", "mask" null, "cidr" 32, "firstip" 169748481, "lastip" 169748481, "interfacename" "null" }