Add Sapm Account to Sapm Group
1 min
code examples curl request post \\ \ url {{url}}/aioc rest web/rest/sc/sapm/addsapmaccounttosapmgroup \\ \ header 'accept application/json'var myheaders = new headers(); myheaders append("accept", "application/json"); var requestoptions = { method 'post', headers myheaders, redirect 'follow' }; fetch("{{url}}/aioc rest web/rest/sc/sapm/addsapmaccounttosapmgroup", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "net/http" url = uri("{{url}}/aioc rest web/rest/sc/sapm/addsapmaccounttosapmgroup") http = net http new(url host, url port); request = net http post new(url) request\["accept"] = "application/json" response = http request(request) puts response read body import requests url = "{{url}}/aioc rest web/rest/sc/sapm/addsapmaccounttosapmgroup" payload = {} headers = { 'accept' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses { "dbid" 608679, "device" { "dbid" 602107, "id" "4b144118 2505 43a9 908a b6fab60f296f", "name" "10 20 40 184", "accessprotocol" "sshv2", "managementip" "10 20 40 184", "elementtype" { "dbid" 1256593, "elementtypeid" "linux", "elementtypename" "linux server", "vendor" null, "category" null, "elementtypeproperties" \[ { "dbid" 279310, "elementtypepropertyvalue" "hostname", "elementtypepropertykey" "discovery commands hostname", "elementtypepropertytype" null }, { "dbid" 279363, "elementtypepropertyvalue" "uname", "elementtypepropertykey" "discovery commands version command", "elementtypepropertytype" null }, { "dbid" 224107345, "elementtypepropertyvalue" "abort", "elementtypepropertykey" "enforcer terminal behaviour ctrl c", "elementtypepropertytype" null }, { "dbid" 328321729, "elementtypepropertyvalue" "^enter the date ", "elementtypepropertykey" "enforcer terminal behaviour exc last line patterns", "elementtypepropertytype" null }, { "dbid" 328317181, "elementtypepropertyvalue" "^are you sure ", "elementtypepropertykey" "enforcer terminal behaviour exc last line patterns", "elementtypepropertytype" null }, { "dbid" 328318769, "elementtypepropertyvalue" " (?i)password\[ |\>] ", "elementtypepropertykey" "enforcer terminal behaviour exc last line patterns", "elementtypepropertytype" null }, { "dbid" 224107346, "elementtypepropertyvalue" "do nothing", "elementtypepropertykey" "enforcer terminal behaviour ctrl z", "elementtypepropertytype" null }, { "dbid" 224107347, "elementtypepropertyvalue" " ?(\>|\\\\$|#|%)", "elementtypepropertykey" "enforcer terminal behaviour prompt pattern", "elementtypepropertytype" null }, { "dbid" 316330256, "elementtypepropertyvalue" " 1", "elementtypepropertykey" "shell terminal config fixed pty columns", "elementtypepropertytype" null }, { "dbid" 328315408, "elementtypepropertyvalue" "^quit ", "elementtypepropertykey" "enforcer terminal behaviour exc last line patterns", "elementtypepropertytype" null }, { "dbid" 355141703, "elementtypepropertyvalue" "^select choice ", "elementtypepropertykey" "enforcer terminal behaviour exc last line patterns", "elementtypepropertytype" null }, { "dbid" 279374, "elementtypepropertyvalue" "linux", "elementtypepropertykey" "discovery model match regex", "elementtypepropertytype" null } ] }, "discoverytime" 1548839906588, "properties" { "pseudodevice" "true" }, "devicegroups" \[ "4dd39f0b 2cb1 4089 8281 3912e7b904e0" ], "availability" null, "currentmaintenancewindow" null, "interfacename" null, "namemanagementip" "10 20 40 184 10 20 40 184", "regionname" null, "pseudodevice" true, "domaincontroller" null, "portnum" null, "discoverysource" null }, "config" { "configid" 9077, "name" "linux", "description" "linux", "strategy" "ssh", "properties" { "username parser" "( ?) ", "new\ user found action" "log", "user list command" "cat /etc/passwd", "check password validation" "true", "change password command template" "passwd\\\n${oldpassword}\\\n${newpassword}\\\n${newpassword}\\\nlogout" }, "exactmatch4search" false, "recordlimit4search" null }, "changeperiod" 7200, "username" "sapm2", "password" "5b5bycr3kodlejw0ui86bq==", "previouspassword" "igrfdomqfwhnvxtyotfvka==", "lastchangetime" 1548853978693, "nextchangetime" 1549285978693, "nextchangetimestart4search" null, "nextchangetimeend4search" null, "passwordseenstatus" "unseen", "validationstatus" "valid", "changestatus" null, "lastattemptstatus" true, "masteraccountid" null, "permissions" {}, "identicalsapmaccounts" \[], "recordlimit4search" null, "validationstatus4search" null, "checkpermission4search" true, "exactmatch4search" false, "acceptedsapmconfiglist" null, "masteraccountid4search" null, "searchonlymasteraccounts" false, "searchonlyownregion" false, "deviceip4search" null, "secondpartseenusername" null, "firstpartseenusername" null, "changeperiodformatted" "05d 00h 00m" }