KRON PAM API Collection v3.7.0
Device Management
Update Device Realms
1 min
code examples curl location globoff '{{url}}/aioc rest web/rest/discovery/updatedevicerealms' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ header 'x xsrf token {{csrftoken}}' \\ \ data '"\[ {\n\t \\"dbid\\" 139033, \n \\"name\\" \\"test devicerealm\\",\n \\"description\\" \\"test devicerealm\\",\n \\"devicegroups\\" \[\n {\n \\"dbid\\" 83057,\n \\"id\\" \\"787b7f7c 2d28 4009 892b e059b3510b15\\"\n },\n {\n \t \\"dbid\\" 118207,\n \\"id\\" \\"478e7007 4f52 4c6d a9bf 14252848ccfc\\"\n }\n ],\n \\"usergroups\\" \[\n {\\"id\\" \\"57888613 58bd 4008 af8a 729dc53edbed\\",\n \\"eid\\" \\"sshug1\\"}\n ]\n }\n]\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\t \\"dbid\\" 139033, \n \\"name\\" \\"test devicerealm\\",\n \\"description\\" \\"test devicerealm\\",\n \\"devicegroups\\" \[\n {\n \\"dbid\\" 83057,\n \\"id\\" \\"787b7f7c 2d28 4009 892b e059b3510b15\\"\n },\n {\n \t \\"dbid\\" 118207,\n \\"id\\" \\"478e7007 4f52 4c6d a9bf 14252848ccfc\\"\n }\n ],\n \\"usergroups\\" \[\n {\\"id\\" \\"57888613 58bd 4008 af8a 729dc53edbed\\",\n \\"eid\\" \\"sshug1\\"}\n ]\n }\n]\n"); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("{{url}}/aioc rest web/rest/discovery/updatedevicerealms", 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/updatedevicerealms") 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\t \\"dbid\\" 139033, \n \\"name\\" \\"test devicerealm\\",\n \\"description\\" \\"test devicerealm\\",\n \\"devicegroups\\" \[\n {\n \\"dbid\\" 83057,\n \\"id\\" \\"787b7f7c 2d28 4009 892b e059b3510b15\\"\n },\n {\n \t \\"dbid\\" 118207,\n \\"id\\" \\"478e7007 4f52 4c6d a9bf 14252848ccfc\\"\n }\n ],\n \\"usergroups\\" \[\n {\\"id\\" \\"57888613 58bd 4008 af8a 729dc53edbed\\",\n \\"eid\\" \\"sshug1\\"}\n ]\n }\n]\n") response = http request(request) puts response read body import requests import json url = "{{url}}/aioc rest web/rest/discovery/updatedevicerealms" payload = json dumps("\[ {\n\t \\"dbid\\" 139033, \n \\"name\\" \\"test devicerealm\\",\n \\"description\\" \\"test devicerealm\\",\n \\"devicegroups\\" \[\n {\n \\"dbid\\" 83057,\n \\"id\\" \\"787b7f7c 2d28 4009 892b e059b3510b15\\"\n },\n {\n \t \\"dbid\\" 118207,\n \\"id\\" \\"478e7007 4f52 4c6d a9bf 14252848ccfc\\"\n }\n ],\n \\"usergroups\\" \[\n {\\"id\\" \\"57888613 58bd 4008 af8a 729dc53edbed\\",\n \\"eid\\" \\"sshug1\\"}\n ]\n }\n]\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 { "test devicerealm" "success" }