Save Masking Policy
1 min
code examples curl request post \\ \ url {{url}}/aioc rest web/rest/sc/sqlproxy/savemaskingpolicy \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ header 'x xsrf token {{csrftoken}}' \\ \ data '"\[\r\n {\r\n \\"name\\" \\"new policy\\",\r\n \\"description\\" \\"new masking policy\\",\r\n \\"devicedbid\\" 390457,\r\n \\"active\\" true,\r\n \\"rowlimit\\" \\"\\",\r\n \\"schema\\" \\" \\",\r\n \\"table\\" \\" \\",\r\n \\"column\\" \\" \\",\r\n \\"methoddbid\\" 261965\r\n }\r\n]\r\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("\[\r\n {\r\n \\"name\\" \\"new policy\\",\r\n \\"description\\" \\"new masking policy\\",\r\n \\"devicedbid\\" 390457,\r\n \\"active\\" true,\r\n \\"rowlimit\\" \\"\\",\r\n \\"schema\\" \\" \\",\r\n \\"table\\" \\" \\",\r\n \\"column\\" \\" \\",\r\n \\"methoddbid\\" 261965\r\n }\r\n]\r\n"); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("{{url}}/aioc rest web/rest/sc/sqlproxy/savemaskingpolicy", 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/sc/sqlproxy/savemaskingpolicy") 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("\[\r\n {\r\n \\"name\\" \\"new policy\\",\r\n \\"description\\" \\"new masking policy\\",\r\n \\"devicedbid\\" 390457,\r\n \\"active\\" true,\r\n \\"rowlimit\\" \\"\\",\r\n \\"schema\\" \\" \\",\r\n \\"table\\" \\" \\",\r\n \\"column\\" \\" \\",\r\n \\"methoddbid\\" 261965\r\n }\r\n]\r\n") response = http request(request) puts response read body import requests import json url = "{{url}}/aioc rest web/rest/sc/sqlproxy/savemaskingpolicy" payload = json dumps("\[\r\n {\r\n \\"name\\" \\"new policy\\",\r\n \\"description\\" \\"new masking policy\\",\r\n \\"devicedbid\\" 390457,\r\n \\"active\\" true,\r\n \\"rowlimit\\" \\"\\",\r\n \\"schema\\" \\" \\",\r\n \\"table\\" \\" \\",\r\n \\"column\\" \\" \\",\r\n \\"methoddbid\\" 261965\r\n }\r\n]\r\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 \[ { "dbid" 393329, "usercreate" { "id" "abbccd16 b31f 4449 8cc4 131d08cdebca", "eid" "irem", "personelid" null, "name" "iremgul", "passwordalgorithm" null, "password" null, "secondpassword" null, "email" "iremgul durmus\@krontech com", "surname" "durmus", "internal" true, "properties" { "ubathreshold" "50" }, "groups" \[ "default group sysyem users", "0482ee83 aec0 4c89 bd42 6d31f4ae8ad5", "default group sysyem admins" ], "managergroups" \[ "0482ee83 aec0 4c89 bd42 6d31f4ae8ad5" ], "lastlogin" 1695906253787, "lastloginip" "10 0 8 206", "grouppropertykey4search" null, "grouppropertyvalue4search" null, "recordlimit4search" null, "checkpermission4search" false, "passworddirty" false, "secondpasswordchange" false, "passwordautogenerated" false, "filterfunctionname" null, "filtermembershipuserid" null, "filtermanagerid" null, "filtereidlist" null, "filteridlist" null, "filtermanagerofuserid" null, "passwordsalt" null, "creationtime" 1695642004340, "delegations" \[], "firstresult" null, "maxresult" null, "locked" false, "unlockonpasswordchanged" false, "unlocktime" null, "tempuserstarttime" null, "tempuser" false, "externaldirectorysource" null, "userpropertykey4search" null, "userpropertyvalue4search" null, "phonenumber" null, "adlinemanager" null, "forcechangepasswordonnextlogin" false, "lockreason" null, "tempuserendtime" null }, "userupdate" null, "creationdate" null, "lastupdate" null, "name" "new policy", "description" "new masking policy", "date" 1695906781102, "tablename" " ", "maskbase" null, "columnname" " ", "maskingmethod" { "dbid" 261965, "usercreate" null, "userupdate" null, "creationdate" null, "lastupdate" null, "name" "mssql email", "description" null, "methodpattern" "stuff(${column},1,7,'masked ')", "date" null, "columntype" "varchar", "hidecolumn" false, "databasetype" null, "firstresult" null, "maxresult" null }, "device" { "dbid" 390457, "id" "f340b899 a8df 4dde b37d 241e2f487ee1", "name" "mssql 19", "accessprotocol" "mssql", "managementip" "10 20 42 96", "elementtype" { "dbid" 444, "elementtypeid" "mssql", "elementtypename" "mssql", "vendor" null, "category" null, "elementtypeproperties" \[], "tags" \[ "infrastructure" ] }, "discoverytime" 1695900168322, "properties" { "db password" null, "portnum" "1433", "discoverysource" "rest", "pseudodevice" "true", "db name" "master", "db username" "sa", "sql proxy bind port" "2002" }, "devicegroups" \[], "availability" null, "currentmaintenancewindow" null, "interfacename" null, "namemanagementip" "mssql 19 10 20 42 96", "regionname" null, "filterrecordlimit" null, "filtersearchphrase" null, "filtergroupid" null, "filterrolegroupids" null, "filteronlyunassigneddevices" null, "firstresult" null, "maxresult" null, "filtercheckpermission" false, "filteruserid" null, "filteronlyapprovalrequired" false, "checktagsforsearchphrase" false, "connectornodeipaddress" null, "devicegroupnames" null, "filteridlist" null, "filtergroupidlist" null, "filterbygrouptree" false, "pseudodevice" true, "domaincontroller" null, "dbpassword" null, "dbusername" "sa", "dbservicename" "master", "dbconnectionnumber" null, "discoverysource" "rest", "connectorsitename" null, "connectorportnum" null }, "schema" " ", "rowlimit" null, "enabled" true, "alltable" null, "columntype" "varchar", "type" null, "key" null } ]