Hey,
ich versuche aktuell über die API meine SSH-Keys für eine virtuelle Maschine zu verändern. Wie in den API-Beschreibungen beschrieben sollte dies URL-Encoded werden.
Mein URL-Enkodierter String sieht wie folgt aus:
Ich enkodiere in Java wie folgt:
und dabei gibt es leider den folgenden Fehler:
ich versuche aktuell über die API meine SSH-Keys für eine virtuelle Maschine zu verändern. Wie in den API-Beschreibungen beschrieben sollte dies URL-Encoded werden.
Mein URL-Enkodierter String sieht wie folgt aus:
Code:
sshkeys=ssh-rsa+AAAAB3NzaC1yc2EAAAADAQABAAABAQDOHsJsOVOWp3cdkSLN8Nd5rY6YjNdc%2FaK%2B%2BwZ%2FMzol9OW0HrVwtWQe8aa0Wk546m0aLi1WRRDNSGhZbu3dlY3Gj8z9gonEo4IT8sEEq025%2B%2BsgzYe3GbgZZutwRcSQC7AOZY99d3bc5kHzAeHHAprHLPIXMHNWGlJl2U3ZNcxKDDneYJMCTtu5Z3HN0ZRJlPVsDAPn5jbruAsqXxNPCCP%2FAnbhkrzW4yPPrxSQFWjfIcKvYt3iByADLZbmqQCtgfhsEp0Q1MRkTzXgAMWBFS3sC2BPyXaXTwmTpYhXGxWAKHRKCiImmUp9z4FkkZB5ONdsq0gSM4FdIkuJwxXlQ%2FXJ+maxfritz%40Max-MBP.echo.box&ciuser=root
Ich enkodiere in Java wie folgt:
und dabei gibt es leider den folgenden Fehler:
Code:
java.io.IOException: Server returned HTTP response code: 400 for URL: https://192.168.178.131:8006/api2/json/nodes/pve/qemu/1203/config
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_192]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_192]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_192]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_192]
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1944) ~[na:1.8.0_192]
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1939) ~[na:1.8.0_192]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_192]
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1938) ~[na:1.8.0_192]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1508) ~[na:1.8.0_192]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492) ~[na:1.8.0_192]
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263) ~[na:1.8.0_192]
at it.corsinvest.proxmoxve.api.PveClientBase.executeAction(PveClientBase.java:355) [main/:na]
at it.corsinvest.proxmoxve.api.PveClientBase.create(PveClientBase.java:178) [main/:na]
at it.corsinvest.proxmoxve.api.PveClient$PVENodes$PVEItemNode$PVEQemu$PVEItemVmid$PVEConfig.setRest(PveClient.java:9391) [main/:na]
at de.vpsnow.restendpoint.service.impl.ProxmoxDeploymentService.lambda$createServer$0(ProxmoxDeploymentService.java:68) [main/:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_192]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_192]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_192]
Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: https://192.168.178.131:8006/api2/json/nodes/pve/qemu/1203/config
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894) ~[na:1.8.0_192]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492) ~[na:1.8.0_192]
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480) ~[na:1.8.0_192]
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:347) ~[na:1.8.0_192]
at it.corsinvest.proxmoxve.api.PveClientBase.executeAction(PveClientBase.java:352) [main/:na]
... 6 common frames omitted