Update Server Miscellaneous Configuration
curl --request PUT \
--url https://use.hoop.dev/api/serverconfig/misc \
--header 'Content-Type: application/json' \
--data '
{
"grpc_server_url": "grpc://127.0.0.1:8010",
"http_proxy_server_config": {
"listen_address": "http://0.0.0.0:18888"
},
"postgres_server_config": {
"listen_address": "0.0.0.0:15432"
},
"rdp_server_config": {
"listen_address": "0.0.0.0:3389"
},
"ssh_server_config": {
"hosts_key": "base64-pem-encoded-hosts-key",
"listen_address": "0.0.0.0:12222",
"trusted_cas": [
"ssh-ed25519 AAAA..."
],
"user_mapping": {
"cert_attr": "principal",
"user_attr": "email"
}
}
}
'import requests
url = "https://use.hoop.dev/api/serverconfig/misc"
payload = {
"grpc_server_url": "grpc://127.0.0.1:8010",
"http_proxy_server_config": { "listen_address": "http://0.0.0.0:18888" },
"postgres_server_config": { "listen_address": "0.0.0.0:15432" },
"rdp_server_config": { "listen_address": "0.0.0.0:3389" },
"ssh_server_config": {
"hosts_key": "base64-pem-encoded-hosts-key",
"listen_address": "0.0.0.0:12222",
"trusted_cas": ["ssh-ed25519 AAAA..."],
"user_mapping": {
"cert_attr": "principal",
"user_attr": "email"
}
}
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
grpc_server_url: 'grpc://127.0.0.1:8010',
http_proxy_server_config: {listen_address: 'http://0.0.0.0:18888'},
postgres_server_config: {listen_address: '0.0.0.0:15432'},
rdp_server_config: {listen_address: '0.0.0.0:3389'},
ssh_server_config: {
hosts_key: 'base64-pem-encoded-hosts-key',
listen_address: '0.0.0.0:12222',
trusted_cas: ['ssh-ed25519 AAAA...'],
user_mapping: {cert_attr: 'principal', user_attr: 'email'}
}
})
};
fetch('https://use.hoop.dev/api/serverconfig/misc', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://use.hoop.dev/api/serverconfig/misc",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'grpc_server_url' => 'grpc://127.0.0.1:8010',
'http_proxy_server_config' => [
'listen_address' => 'http://0.0.0.0:18888'
],
'postgres_server_config' => [
'listen_address' => '0.0.0.0:15432'
],
'rdp_server_config' => [
'listen_address' => '0.0.0.0:3389'
],
'ssh_server_config' => [
'hosts_key' => 'base64-pem-encoded-hosts-key',
'listen_address' => '0.0.0.0:12222',
'trusted_cas' => [
'ssh-ed25519 AAAA...'
],
'user_mapping' => [
'cert_attr' => 'principal',
'user_attr' => 'email'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://use.hoop.dev/api/serverconfig/misc"
payload := strings.NewReader("{\n \"grpc_server_url\": \"grpc://127.0.0.1:8010\",\n \"http_proxy_server_config\": {\n \"listen_address\": \"http://0.0.0.0:18888\"\n },\n \"postgres_server_config\": {\n \"listen_address\": \"0.0.0.0:15432\"\n },\n \"rdp_server_config\": {\n \"listen_address\": \"0.0.0.0:3389\"\n },\n \"ssh_server_config\": {\n \"hosts_key\": \"base64-pem-encoded-hosts-key\",\n \"listen_address\": \"0.0.0.0:12222\",\n \"trusted_cas\": [\n \"ssh-ed25519 AAAA...\"\n ],\n \"user_mapping\": {\n \"cert_attr\": \"principal\",\n \"user_attr\": \"email\"\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://use.hoop.dev/api/serverconfig/misc")
.header("Content-Type", "application/json")
.body("{\n \"grpc_server_url\": \"grpc://127.0.0.1:8010\",\n \"http_proxy_server_config\": {\n \"listen_address\": \"http://0.0.0.0:18888\"\n },\n \"postgres_server_config\": {\n \"listen_address\": \"0.0.0.0:15432\"\n },\n \"rdp_server_config\": {\n \"listen_address\": \"0.0.0.0:3389\"\n },\n \"ssh_server_config\": {\n \"hosts_key\": \"base64-pem-encoded-hosts-key\",\n \"listen_address\": \"0.0.0.0:12222\",\n \"trusted_cas\": [\n \"ssh-ed25519 AAAA...\"\n ],\n \"user_mapping\": {\n \"cert_attr\": \"principal\",\n \"user_attr\": \"email\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/serverconfig/misc")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"grpc_server_url\": \"grpc://127.0.0.1:8010\",\n \"http_proxy_server_config\": {\n \"listen_address\": \"http://0.0.0.0:18888\"\n },\n \"postgres_server_config\": {\n \"listen_address\": \"0.0.0.0:15432\"\n },\n \"rdp_server_config\": {\n \"listen_address\": \"0.0.0.0:3389\"\n },\n \"ssh_server_config\": {\n \"hosts_key\": \"base64-pem-encoded-hosts-key\",\n \"listen_address\": \"0.0.0.0:12222\",\n \"trusted_cas\": [\n \"ssh-ed25519 AAAA...\"\n ],\n \"user_mapping\": {\n \"cert_attr\": \"principal\",\n \"user_attr\": \"email\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"grpc_server_url": "grpc://127.0.0.1:8010",
"http_proxy_server_config": {
"listen_address": "http://0.0.0.0:18888"
},
"postgres_server_config": {
"listen_address": "0.0.0.0:15432"
},
"rdp_server_config": {
"listen_address": "0.0.0.0:3389"
},
"ssh_server_config": {
"hosts_key": "base64-pem-encoded-hosts-key",
"listen_address": "0.0.0.0:12222",
"trusted_cas": [
"ssh-ed25519 AAAA..."
],
"user_mapping": {
"cert_attr": "principal",
"user_attr": "email"
}
}
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Server Management
Update Server Miscellaneous Configuration
Update server miscellaneous configuration
PUT
/
serverconfig
/
misc
Update Server Miscellaneous Configuration
curl --request PUT \
--url https://use.hoop.dev/api/serverconfig/misc \
--header 'Content-Type: application/json' \
--data '
{
"grpc_server_url": "grpc://127.0.0.1:8010",
"http_proxy_server_config": {
"listen_address": "http://0.0.0.0:18888"
},
"postgres_server_config": {
"listen_address": "0.0.0.0:15432"
},
"rdp_server_config": {
"listen_address": "0.0.0.0:3389"
},
"ssh_server_config": {
"hosts_key": "base64-pem-encoded-hosts-key",
"listen_address": "0.0.0.0:12222",
"trusted_cas": [
"ssh-ed25519 AAAA..."
],
"user_mapping": {
"cert_attr": "principal",
"user_attr": "email"
}
}
}
'import requests
url = "https://use.hoop.dev/api/serverconfig/misc"
payload = {
"grpc_server_url": "grpc://127.0.0.1:8010",
"http_proxy_server_config": { "listen_address": "http://0.0.0.0:18888" },
"postgres_server_config": { "listen_address": "0.0.0.0:15432" },
"rdp_server_config": { "listen_address": "0.0.0.0:3389" },
"ssh_server_config": {
"hosts_key": "base64-pem-encoded-hosts-key",
"listen_address": "0.0.0.0:12222",
"trusted_cas": ["ssh-ed25519 AAAA..."],
"user_mapping": {
"cert_attr": "principal",
"user_attr": "email"
}
}
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
grpc_server_url: 'grpc://127.0.0.1:8010',
http_proxy_server_config: {listen_address: 'http://0.0.0.0:18888'},
postgres_server_config: {listen_address: '0.0.0.0:15432'},
rdp_server_config: {listen_address: '0.0.0.0:3389'},
ssh_server_config: {
hosts_key: 'base64-pem-encoded-hosts-key',
listen_address: '0.0.0.0:12222',
trusted_cas: ['ssh-ed25519 AAAA...'],
user_mapping: {cert_attr: 'principal', user_attr: 'email'}
}
})
};
fetch('https://use.hoop.dev/api/serverconfig/misc', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://use.hoop.dev/api/serverconfig/misc",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'grpc_server_url' => 'grpc://127.0.0.1:8010',
'http_proxy_server_config' => [
'listen_address' => 'http://0.0.0.0:18888'
],
'postgres_server_config' => [
'listen_address' => '0.0.0.0:15432'
],
'rdp_server_config' => [
'listen_address' => '0.0.0.0:3389'
],
'ssh_server_config' => [
'hosts_key' => 'base64-pem-encoded-hosts-key',
'listen_address' => '0.0.0.0:12222',
'trusted_cas' => [
'ssh-ed25519 AAAA...'
],
'user_mapping' => [
'cert_attr' => 'principal',
'user_attr' => 'email'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://use.hoop.dev/api/serverconfig/misc"
payload := strings.NewReader("{\n \"grpc_server_url\": \"grpc://127.0.0.1:8010\",\n \"http_proxy_server_config\": {\n \"listen_address\": \"http://0.0.0.0:18888\"\n },\n \"postgres_server_config\": {\n \"listen_address\": \"0.0.0.0:15432\"\n },\n \"rdp_server_config\": {\n \"listen_address\": \"0.0.0.0:3389\"\n },\n \"ssh_server_config\": {\n \"hosts_key\": \"base64-pem-encoded-hosts-key\",\n \"listen_address\": \"0.0.0.0:12222\",\n \"trusted_cas\": [\n \"ssh-ed25519 AAAA...\"\n ],\n \"user_mapping\": {\n \"cert_attr\": \"principal\",\n \"user_attr\": \"email\"\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://use.hoop.dev/api/serverconfig/misc")
.header("Content-Type", "application/json")
.body("{\n \"grpc_server_url\": \"grpc://127.0.0.1:8010\",\n \"http_proxy_server_config\": {\n \"listen_address\": \"http://0.0.0.0:18888\"\n },\n \"postgres_server_config\": {\n \"listen_address\": \"0.0.0.0:15432\"\n },\n \"rdp_server_config\": {\n \"listen_address\": \"0.0.0.0:3389\"\n },\n \"ssh_server_config\": {\n \"hosts_key\": \"base64-pem-encoded-hosts-key\",\n \"listen_address\": \"0.0.0.0:12222\",\n \"trusted_cas\": [\n \"ssh-ed25519 AAAA...\"\n ],\n \"user_mapping\": {\n \"cert_attr\": \"principal\",\n \"user_attr\": \"email\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/serverconfig/misc")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"grpc_server_url\": \"grpc://127.0.0.1:8010\",\n \"http_proxy_server_config\": {\n \"listen_address\": \"http://0.0.0.0:18888\"\n },\n \"postgres_server_config\": {\n \"listen_address\": \"0.0.0.0:15432\"\n },\n \"rdp_server_config\": {\n \"listen_address\": \"0.0.0.0:3389\"\n },\n \"ssh_server_config\": {\n \"hosts_key\": \"base64-pem-encoded-hosts-key\",\n \"listen_address\": \"0.0.0.0:12222\",\n \"trusted_cas\": [\n \"ssh-ed25519 AAAA...\"\n ],\n \"user_mapping\": {\n \"cert_attr\": \"principal\",\n \"user_attr\": \"email\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"grpc_server_url": "grpc://127.0.0.1:8010",
"http_proxy_server_config": {
"listen_address": "http://0.0.0.0:18888"
},
"postgres_server_config": {
"listen_address": "0.0.0.0:15432"
},
"rdp_server_config": {
"listen_address": "0.0.0.0:3389"
},
"ssh_server_config": {
"hosts_key": "base64-pem-encoded-hosts-key",
"listen_address": "0.0.0.0:12222",
"trusted_cas": [
"ssh-ed25519 AAAA..."
],
"user_mapping": {
"cert_attr": "principal",
"user_attr": "email"
}
}
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Body
application/json
The request body resource
Response
OK
Was this page helpful?