Generate New SSH Key Pair
1 min
POST
{{url}}/aioc-rest-web/rest/sc/ssh/generateNewSshKeyPair
Path Parameters
- urlstringDefaulturl
Header Parameters
- Content-TypestringDefaultapplication/json
- X-XSRF-TOKENstringDefault{{csrftoken}}
Responses
200
curl
curl --request POST \
--url {{url}}/aioc-rest-web/rest/sc/ssh/generateNewSshKeyPair \
--header 'accept: application/json' \
--header 'x-xsrf-token: {{csrftoken}}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
myHeaders.append("x-xsrf-token", "{{csrftoken}}");
var requestOptions = {
method: 'POST',
headers: myHeaders,
redirect: 'follow'
};
fetch("{{url}}/aioc-rest-web/rest/sc/ssh/generateNewSshKeyPair", 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/ssh/generateNewSshKeyPair")
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}}"
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "{{url}}/aioc-rest-web/rest/sc/ssh/generateNewSshKeyPair"
payload = {}
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": 0,
"userId": "a177be61-8850-4f03-be1c-3ce275f02c1f",
"publicKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCB1EkBNtKvdF6pgrMFybt7L+leCsdrAu+keJXESuZZXgzCJRmfvpbH/yxpGojePrdeXyDtSNesVPK/4+kd09cHPa9ojrs6oW8JKgaZihYSb/9s5OiTQWTWVv9iXmGq0Kqa5AzNgd8/IQtnjhrrR/E85NRmBtf0yIKi1UO+0WZcl0CKaAwVwWqce+f0a0Do23COzgUU1bveVg1H9FLtzAq5yvgno7YdKZLVT8s9D6XH3P5sWN8/cC0tf7ajqw30YrtrzOjbu4GqxXIeYLHCN1COT4HoiInJ1OZ2dyP3TNrQXzfiZlSQEnHWv/dXazDsiF0NebLa7cboLxanHXyxWo0r testuser",
"privateKey": "{{vault:rsa-private-key}}\n",
"creationTime": 1548419222811,
"expirationTime": null
}