List Policy Groups by Names
1 min
code examples curl request post \\ \ url {{url}}/aioc rest web/rest/policy/getmultiplepolicygroupsbynames \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ header 'x xsrf token {{csrftoken}}' \\ \ data '"\[\\"pg linux\\",\\"pg second\\"]"'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("\[\\"pg linux\\",\\"pg second\\"]"); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("{{url}}/aioc rest web/rest/policy/getmultiplepolicygroupsbynames", 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/policy/getmultiplepolicygroupsbynames") 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("\[\\"pg linux\\",\\"pg second\\"]") response = http request(request) puts response read body import requests import json url = "{{url}}/aioc rest web/rest/policy/getmultiplepolicygroupsbynames" payload = json dumps("\[\\"pg linux\\",\\"pg second\\"]") 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" 376256, "name" "pg linux", "description" null, "policies" \[ { "dbid" 376251, "usercreate" "admin", "userupdate" null, "creationdate" 1581605373075, "lastupdate" null, "key" " ", "description" null, "userbehaviorrate" null, "type" "white", "devicetypes" \[ "linux" ], "taskname" null, "xmlcontent" null } ], "policykeys" \[ { "dbid" 376251, "usercreate" "admin", "userupdate" null, "creationdate" 1581605373075, "lastupdate" null, "key" " ", "description" null, "userbehaviorrate" null, "type" "white", "devicetypes" \[ "linux" ], "taskname" null, "xmlcontent" null } ], "httppolicies" \[], "maskingpolicies" \[], "timerestrictions" \[], "realms" \[ 376291 ], "sendemail" false, "sendsnmp" false, "action" "generate error", "confirmationtext" null, "operationmode" "operation", "usercreate" "admin", "userupdate" null, "creationdate" 1581605384541, "lastupdate" null }, { "dbid" 377585, "name" "pg second", "description" null, "policies" \[ { "dbid" 377572, "usercreate" "admin", "userupdate" null, "creationdate" 1581608151289, "lastupdate" null, "key" "date", "description" null, "userbehaviorrate" null, "type" "black", "devicetypes" \[ "linux" ], "taskname" null, "xmlcontent" null }, { "dbid" 376251, "usercreate" "admin", "userupdate" null, "creationdate" 1581605373075, "lastupdate" null, "key" " ", "description" null, "userbehaviorrate" null, "type" "white", "devicetypes" \[ "linux" ], "taskname" null, "xmlcontent" null } ], "policykeys" \[ { "dbid" 377572, "usercreate" "admin", "userupdate" null, "creationdate" 1581608151289, "lastupdate" null, "key" "date", "description" null, "userbehaviorrate" null, "type" "black", "devicetypes" \[ "linux" ], "taskname" null, "xmlcontent" null }, { "dbid" 376251, "usercreate" "admin", "userupdate" null, "creationdate" 1581605373075, "lastupdate" null, "key" " ", "description" null, "userbehaviorrate" null, "type" "white", "devicetypes" \[ "linux" ], "taskname" null, "xmlcontent" null } ], "httppolicies" \[], "maskingpolicies" \[], "timerestrictions" \[], "realms" \[ 377590 ], "sendemail" false, "sendsnmp" false, "action" "approval via email", "confirmationtext" null, "operationmode" "operation", "usercreate" "admin", "userupdate" null, "creationdate" 1581608173274, "lastupdate" null } ]