KRON PAM API Collection v3.7.0
Device Management
Save New Devices
1 min
code examples curl location globoff '{{url}}/aioc rest web/rest/discovery/savedevices' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ header 'x xsrf token {{csrftoken}}' \\ \ data '"\[\n {\n \\"managementip\\" \\"155 17 17 17\\",\n \\"accessprotocol\\" \\"rdp\\",\n \\"elementtype\\" {\n \\"elementtypeid\\" \\"windows\\"\n },\n \\"devicegroups\\" \[\n \\"8851fead 2b5e 4769 b847 fc8a898999a0\\"\n ],\n \\"pseudodevice\\" true\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 {\n \\"managementip\\" \\"155 17 17 17\\",\n \\"accessprotocol\\" \\"rdp\\",\n \\"elementtype\\" {\n \\"elementtypeid\\" \\"windows\\"\n },\n \\"devicegroups\\" \[\n \\"8851fead 2b5e 4769 b847 fc8a898999a0\\"\n ],\n \\"pseudodevice\\" true\n }\n]"); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("{{url}}/aioc rest web/rest/discovery/savedevices", 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/savedevices") 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 {\n \\"managementip\\" \\"155 17 17 17\\",\n \\"accessprotocol\\" \\"rdp\\",\n \\"elementtype\\" {\n \\"elementtypeid\\" \\"windows\\"\n },\n \\"devicegroups\\" \[\n \\"8851fead 2b5e 4769 b847 fc8a898999a0\\"\n ],\n \\"pseudodevice\\" true\n }\n]") response = http request(request) puts response read body import requests import json url = "{{url}}/aioc rest web/rest/discovery/savedevices" payload = json dumps("\[\n {\n \\"managementip\\" \\"155 17 17 17\\",\n \\"accessprotocol\\" \\"rdp\\",\n \\"elementtype\\" {\n \\"elementtypeid\\" \\"windows\\"\n },\n \\"devicegroups\\" \[\n \\"8851fead 2b5e 4769 b847 fc8a898999a0\\"\n ],\n \\"pseudodevice\\" true\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 { "18 18 18 18" "success", "19 19 19 19" "success", "17 17 17 17" "success" }{ "111 111 11 11" "success", "12 12 12 12" "success", "123 123 123 123" "success" }