Add SAPM Account
1 min
POST
{{url}}/aioc-rest-web/rest/sc/sapm/addSapmAccount
Path Parameters
- urlstringDefaulturl
Header Parameters
- Content-TypestringDefaultapplication/json
- CookiestringDefault{{netrightCookie}}
- X-XSRF-TOKENstringDefault{{csrftoken}}
Body Parameters
- bodyobjectDefault{ "secretName":"sapm-dynamic-type", "privateType":"YES", "secretType":"DYNAMIC", "sapmUserName":"root", "password":"root", "sapmGroupDbId":85220, "sapmConfigId":82796, "passwordChangePeriod":"25", "deviceId":"8cc08d2f-36f8-44fa-9c17-47ae77d1a70d" }
Responses
200
200
200
200
200
200
200
curl
curl --request POST \
--url {{url}}/aioc-rest-web/rest/sc/sapm/addSapmAccount \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--cookie {{netrightCookie}} \
--header 'x-xsrf-token: {{csrftoken}}' \
--data '"{\t\n\t\"secretName\":\"sapm-dynamic-type\",\n\t\"privateType\":\"YES\",\n\t\"secretType\":\"DYNAMIC\",\n\t\"sapmUserName\":\"root\",\n\t\"password\":\"root\",\n\t\"sapmGroupDbId\":85220,\n\t\"sapmConfigId\":82796,\n\t\"passwordChangePeriod\":\"25\",\n\t\"deviceId\":\"8cc08d2f-36f8-44fa-9c17-47ae77d1a70d\"\n}"'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
myHeaders.append("cookie", "{{netrightCookie}} ");
myHeaders.append("x-xsrf-token", "{{csrftoken}}");
var raw = JSON.stringify("{\t\n\t\"secretName\":\"sapm-dynamic-type\",\n\t\"privateType\":\"YES\",\n\t\"secretType\":\"DYNAMIC\",\n\t\"sapmUserName\":\"root\",\n\t\"password\":\"root\",\n\t\"sapmGroupDbId\":85220,\n\t\"sapmConfigId\":82796,\n\t\"passwordChangePeriod\":\"25\",\n\t\"deviceId\":\"8cc08d2f-36f8-44fa-9c17-47ae77d1a70d\"\n}");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("{{url}}/aioc-rest-web/rest/sc/sapm/addSapmAccount", 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/sapm/addSapmAccount")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request["cookie"] = "{{netrightCookie}} "
request["x-xsrf-token"] = "{{csrftoken}}"
request.body = JSON.dump("{\t\n\t\"secretName\":\"sapm-dynamic-type\",\n\t\"privateType\":\"YES\",\n\t\"secretType\":\"DYNAMIC\",\n\t\"sapmUserName\":\"root\",\n\t\"password\":\"root\",\n\t\"sapmGroupDbId\":85220,\n\t\"sapmConfigId\":82796,\n\t\"passwordChangePeriod\":\"25\",\n\t\"deviceId\":\"8cc08d2f-36f8-44fa-9c17-47ae77d1a70d\"\n}")
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "{{url}}/aioc-rest-web/rest/sc/sapm/addSapmAccount"
payload = json.dumps("{\t\n\t\"secretName\":\"sapm-dynamic-type\",\n\t\"privateType\":\"YES\",\n\t\"secretType\":\"DYNAMIC\",\n\t\"sapmUserName\":\"root\",\n\t\"password\":\"root\",\n\t\"sapmGroupDbId\":85220,\n\t\"sapmConfigId\":82796,\n\t\"passwordChangePeriod\":\"25\",\n\t\"deviceId\":\"8cc08d2f-36f8-44fa-9c17-47ae77d1a70d\"\n}")
headers = {
'accept': 'application/json',
'content-type': 'application/json',
'cookie': '{{netrightCookie}} ',
'x-xsrf-token': '{{csrftoken}}'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// Add Sapm Account(Dynamic Account)
200
// Add Sapm Account (static strategy - other)
200
// Add Sapm Account (Static Strategy, SSL )
200
{
"dbId": 00000,
"device": {
"dbId":0000,
"id": "4b144118-2505-43a9-6fab60f296f",
"name": "10.20.40.00",
"accessProtocol": "SSHv2",
"managementIp": "10.20.40.00",
"elementType": {
"dbId": 00000,
"elementTypeId": "linux",
"elementTypeName": "Linux Server",
"vendor": null,
"category": null,
"elementTypeProperties": [
{
"dbId": 00000,
"elementTypePropertyValue": "hostname",
"elementTypePropertyKey": "discovery.commands.hostname",
"elementTypePropertyType": null
},
{
"dbId": 00000,
"elementTypePropertyValue": "uname",
"elementTypePropertyKey": "discovery.commands.version.command",
"elementTypePropertyType": null
},
{
"dbId": -00000,
"elementTypePropertyValue": "abort",
"elementTypePropertyKey": "enforcer.terminal.behaviour.ctrl_c",
"elementTypePropertyType": null
},
{
"dbId": -00000,
"elementTypePropertyValue": "^Enter the date.*",
"elementTypePropertyKey": "enforcer.terminal.behaviour.exc_last_line_patterns",
"elementTypePropertyType": null
},
{
"dbId": -00000,
"elementTypePropertyValue": "^Are you sure.*",
"elementTypePropertyKey": "enforcer.terminal.behaviour.exc_last_line_patterns",
"elementTypePropertyType": null
},
{
"dbId": -00000,
"elementTypePropertyValue": ".*(?i)password[:|>].*",
"elementTypePropertyKey": "enforcer.terminal.behaviour.exc_last_line_patterns",
"elementTypePropertyType": null
},
{
"dbId": -00000,
"elementTypePropertyValue": "do_nothing",
"elementTypePropertyKey": "enforcer.terminal.behaviour.ctrl_z",
"elementTypePropertyType": null
},
{
"dbId": -00000,
"elementTypePropertyValue": ".*?(>|\\$|#|%)",
"elementTypePropertyKey": "enforcer.terminal.behaviour.prompt_pattern",
"elementTypePropertyType": null
},
{
"dbId": -00000,
"elementTypePropertyValue": "-1",
"elementTypePropertyKey": "shell.terminal.config.fixed_pty_columns",
"elementTypePropertyType": null
},
{
"dbId": -00000,
"elementTypePropertyValue": "^Quit.*",
"elementTypePropertyKey": "enforcer.terminal.behaviour.exc_last_line_patterns",
"elementTypePropertyType": null
},
{
"dbId": -00000,
"elementTypePropertyValue": "^Select choice.*",
"elementTypePropertyKey": "enforcer.terminal.behaviour.exc_last_line_patterns",
"elementTypePropertyType": null
},
{
"dbId": 00000,
"elementTypePropertyValue": "Linux",
"elementTypePropertyKey": "discovery.model.match.regex",
"elementTypePropertyType": null
}
]
},
"discoveryTime": 00000,
"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": -00000,
"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": 00000,
"username": "sapm2",
"password": "5B5bycR3kOdleJw0UI86BQ==",
"previousPassword": "IGrfdOMqFwhnVxTYOTFVKA==",
"lastChangeTime": 00000,
"nextChangeTime": 00000,
"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"
}200
{
"dbId": 61293,
"device": null,
"secretName": "sapm-staticstrategy-usercred",
"config": {
"configId": -2000003,
"name": "Static User Credentials",
"description": "Static User Credentials",
"strategy": "STATIC",
"staticSecretType": "USER_CREDENTIAL",
"properties": {
"static.secret.type": "USER_CREDENTIAL"
},
"exactMatch4Search": false,
"recordLimit4Search": null
},
"changePeriod": 36000,
"username": "user-1",
"description": null,
"password": "QeLRh2OVGzo45m7aS3dpDfC0Qbqd2kA2bOcCdsYfkKnRCfrzEBLyg8zjzPzLHuNVrVwNi5LDjrvk9YtynUXUpA==",
"previousPassword": null,
"lastChangeTime": 1599046840499,
"nextChangeTime": 1599133240499,
"nextChangeTimeStart4Search": null,
"nextChangeTimeEnd4Search": null,
"passwordSeenStatus": "UNSEEN",
"validationStatus": null,
"changeStatus": null,
"lastAttemptStatus": null,
"masterAccountId": null,
"permissions": {},
"newPermission": {},
"permissionToDelete": {},
"groupManagerToDelete": null,
"identicalSapmAccounts": [],
"recordLimit4Search": null,
"validationStatus4Search": null,
"checkPermission4Search": true,
"acceptedSapmConfigList": null,
"searchOnlyMasterAccounts": false,
"searchOnlyOwnRegion": false,
"deviceIp4Search": null,
"secondPartSeenUsername": null,
"firstPartSeenUsername": null,
"errorMessage": null,
"successful": true,
"parentSapmGroup": {
"dbId": 9257,
"id": "9bcb8c02-ec4b-4ad4-8825-c071c9eac8d1",
"name": "test group",
"description": null,
"parentSapmGroupId": null,
"permissions": {},
"newPermission": {},
"permissionToDelete": {},
"children": [],
"userCreate": "admin",
"parent": null,
"userPermissionLevel": 3,
"managers": [],
"newGroupManager": null,
"groupManagerToDelete": null,
"approvalStatus": null,
"fullPath": null,
"approvalRequired": false,
"manager": false,
"newApprovalRequired": false,
"auditor": false
},
"parentSapmName4Search": null,
"secretType": "STATIC",
"userCreate": "admin",
"managers": [],
"newGroupManager": null,
"userPermissionLevel": -2147483648,
"privateType": "YES",
"approvalStatus": null,
"parentSapmGroupDbId": 9257,
"groupFullPath": "/test group",
"approvedBy": null,
"approvedDate": null,
"getFullPermissionUser": false,
"skipFillPermission": false,
"sqlSearchSapmParent": [],
"firstResult": null,
"maxResult": null,
"exactMatch4Search": false,
"masterAccountId4Search": null,
"changePeriodFormatted": "25d 00h 00m",
"accountWithDynamicStrategy": false,
"approvalRequired": false,
"manager": false
}200
// Add Sapm Account(Static Type, Dynamic Stategy)
200
// Add Sapm Account -(Static Strategy SSH key)