Save Masking Policy
1 min
POST
{{url}}/aioc-rest-web/rest/sc/sqlproxy/saveMaskingPolicy
Path Parameters
- urlstringDefaulturl
Header Parameters
- Content-TypestringDefaultapplication/json
- X-XSRF-TOKENstringDefault{{csrftoken}}
Body Parameters
- bodyobjectDefault[ { "name": "new policy", "description": "new masking policy", "deviceDbId": 390457, "active": true, "rowLimit": "", "schema": "*", "table": "*", "column": "*", "methodDbId": -261965 } ]
Responses
200
curl
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"'javascript
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));ruby
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
python
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)
200
[
{
"dbId": 393329,
"userCreate": {
"id": "abbccd16-b31f-4449-8cc4-131d08cdebca",
"eid": "irem",
"personelId": null,
"name": "iremgul",
"passwordAlgorithm": null,
"password": null,
"secondPassword": null,
"email": "[email protected]",
"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
}
]