KRON PAM API Collection v3.7.0
Device Management
Save Device Group Ip Pattern
1 min
code examples curl location globoff '{{url}}/aioc rest web/rest/discovery/savedevicegroupippattern' \\ \ header 'accept application/json, text/plain, / ' \\ \ header 'content type application/json' \\ \ header 'host localhost' \\ \ header 'user agent mozilla/5 0 (x11; ubuntu; linux x86 64; rv 64 0) gecko/20100101 firefox/64 0' \\ \ header 'accept language en us,en;q=0 5' \\ \ header 'accept encoding gzip, deflate' \\ \ header 'referer http //localhost' \\ \ header 'connection keep alive' \\ \ header 'pragma no cache' \\ \ header 'cache control no cache' \\ \ header 'x xsrf token {{csrftoken}}' \\ \ data '"{\n \\"dbid\\" 118263,\n \\"devicegroupid\\" \\"d8a5810e f17e 43f4 8036 86a10c5e2ba0\\",\n \\"interfacename\\" null,\n \\"action\\" \\"allow\\",\n \\"ippattern\\" \\"^10\\\\\\\\ 20\\\\\\\\ 40\\\\\\\\ (1(\[0 9]\[0 8])|2(\[0 4]\[0 8]|5\[0 5]))$\\"\n }"'var myheaders = new headers(); myheaders append("accept", " application/json, text/plain, / "); myheaders append("content type", "application/json"); myheaders append("host", " localhost"); myheaders append("user agent", " mozilla/5 0 (x11; ubuntu; linux x86 64; rv 64 0) gecko/20100101 firefox/64 0"); myheaders append("accept language", " en us,en;q=0 5"); myheaders append("accept encoding", " gzip, deflate"); myheaders append("referer", " http //localhost"); myheaders append("connection", " keep alive"); myheaders append("pragma", " no cache"); myheaders append("cache control", " no cache"); myheaders append("x xsrf token", "{{csrftoken}}"); var raw = json stringify("{\n \\"dbid\\" 118263,\n \\"devicegroupid\\" \\"d8a5810e f17e 43f4 8036 86a10c5e2ba0\\",\n \\"interfacename\\" null,\n \\"action\\" \\"allow\\",\n \\"ippattern\\" \\"^10\\\\\\\\ 20\\\\\\\\ 40\\\\\\\\ (1(\[0 9]\[0 8])|2(\[0 4]\[0 8]|5\[0 5]))$\\"\n }"); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("{{url}}/aioc rest web/rest/discovery/savedevicegroupippattern", 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/savedevicegroupippattern") http = net http new(url host, url port); request = net http post new(url) request\["accept"] = " application/json, text/plain, / " request\["content type"] = "application/json" request\["host"] = " localhost" request\["user agent"] = " mozilla/5 0 (x11; ubuntu; linux x86 64; rv 64 0) gecko/20100101 firefox/64 0" request\["accept language"] = " en us,en;q=0 5" request\["accept encoding"] = " gzip, deflate" request\["referer"] = " http //localhost" request\["connection"] = " keep alive" request\["pragma"] = " no cache" request\["cache control"] = " no cache" request\["x xsrf token"] = "{{csrftoken}}" request body = json dump("{\n \\"dbid\\" 118263,\n \\"devicegroupid\\" \\"d8a5810e f17e 43f4 8036 86a10c5e2ba0\\",\n \\"interfacename\\" null,\n \\"action\\" \\"allow\\",\n \\"ippattern\\" \\"^10\\\\\\\\ 20\\\\\\\\ 40\\\\\\\\ (1(\[0 9]\[0 8])|2(\[0 4]\[0 8]|5\[0 5]))$\\"\n }") response = http request(request) puts response read body import requests import json url = "{{url}}/aioc rest web/rest/discovery/savedevicegroupippattern" payload = json dumps("{\n \\"dbid\\" 118263,\n \\"devicegroupid\\" \\"d8a5810e f17e 43f4 8036 86a10c5e2ba0\\",\n \\"interfacename\\" null,\n \\"action\\" \\"allow\\",\n \\"ippattern\\" \\"^10\\\\\\\\ 20\\\\\\\\ 40\\\\\\\\ (1(\[0 9]\[0 8])|2(\[0 4]\[0 8]|5\[0 5]))$\\"\n }") headers = { 'accept' ' application/json, text/plain, / ', 'content type' 'application/json', 'host' ' localhost', 'user agent' ' mozilla/5 0 (x11; ubuntu; linux x86 64; rv 64 0) gecko/20100101 firefox/64 0', 'accept language' ' en us,en;q=0 5', 'accept encoding' ' gzip, deflate', 'referer' ' http //localhost', 'connection' ' keep alive', 'pragma' ' no cache', 'cache control' ' no cache', 'x xsrf token' '{{csrftoken}}' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses { "dbid" 140532, "devicegroupid" "d8a5810e f17e 43f4 8036 86a10c5e2ba0", "interfacename" null, "action" "allow", "ippattern" "^10\\\\ 20\\\\ 40\\\\ (1(\[0 9]\[0 8])|2(\[0 4]\[0 8]|5\[0 5]))$" }