Add Vault Account to Vault Group
1 min
POST
{{url}}/aioc-rest-web/rest/sc/sapm/addSapmAccountToSapmGroup
Path Parameters
- urlstringDefaulturl
Header Parameters
- Content-TypestringDefaultapplication/json
- CookiestringDefault{{netrightCookie}}
- X-XSRF-TOKENstringDefault{{csrftoken}}
Body Parameters
- bodyobjectDefault{ "sapmDbId":85613, "sapmGroupDbId":85220 }
Responses
200
curl
curl --request POST \
--url {{url}}/aioc-rest-web/rest/sc/sapm/addSapmAccountToSapmGroup \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--cookie {{netrightCookie}} \
--header 'x-xsrf-token: {{csrftoken}}' \
--data '"{\t\n\t\"sapmDbId\":85613,\n\t\"sapmGroupDbId\":85220\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\"sapmDbId\":85613,\n\t\"sapmGroupDbId\":85220\n}");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
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));ruby
require "uri"
require "json"
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"
request["content-type"] = "application/json"
request["cookie"] = "{{netrightCookie}} "
request["x-xsrf-token"] = "{{csrftoken}}"
request.body = JSON.dump("{\t\n\t\"sapmDbId\":85613,\n\t\"sapmGroupDbId\":85220\n}")
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "{{url}}/aioc-rest-web/rest/sc/sapm/addSapmAccountToSapmGroup"
payload = json.dumps("{\t\n\t\"sapmDbId\":85613,\n\t\"sapmGroupDbId\":85220\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
{
"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"
}