Domain per HTTP REST Api hinzufügen

May 10, 2019
17
0
21
39
Hallo zusammen,

ich spiele grade mit der API ein wenig rum und wollte per HTTP (nicht per shell) eine Domäne hinzufügen.
Wenn ich es wiefolgt mache:
Code:
curl -XPUT -H "CSRFPreventionToken":"5CDCFFC6:O9I2m7OuGUWszt4g6ZY3vFGQ6OM" -k -b "PMGAuthCookie=PMG:root@pam:5CDCFFC6::phb4piyhrJ/md7+s3XKPBzhxs48TOMvnaQ8GwGg2iLxV1PMZTn1WRHfiHiM/y280pfZ7G51OHa34cziQdF4xqxdM5bN/fzIINTmeOVIQ9JHzvk/yJOZu6HgfwOhghRxPjTWhldN+/0OQ0WFLQBmuroNDkxzl6MtTBPWaRLaQje5WEV4/cYGxAwZBbXNj2RbmiwHkspvsD+L6ZgID0bkThPXy6cgZtmQ9/KtwuiL5vHziN0usxoCV9iy3zi1YjadS6yphER6JHIyxfHdoK9KIUVIgCEzjjHlv4gJ53vn7/qKnwdX/xPFXN4R/p0f1uNZsZajKoRexZZjrmAhBw9D02A==" https://10.10.11.45:8006/api2/json/config/domains/test.de
erhalte ich folgende Meldung:
Code:
{"data":null,"errors":{"comment":"property is missing and it is not optional"}}
Wie füge ich denn einen zweiten Parameter "comment" zu meiner Anfrage hinzu?
Oder ist das hier an der Stelle nicht möglich? Ich habe schon mit Hilfe der Browser F12 Entwicklertools versucht den Aufruf mitzusniffen, allerdings ohne nennenswerten Erfolg. Für Hinweise wäre ich sehr dankbar.

Viele Grüße
Jürgen
 
Ok, Thread kann geschlossen werden, hab meinen Denkfehler gefunden.
Fürs Protokoll:
Code:
curl -XPOST -H $token -k -b "PMGAuthCookie"=$tick -d "domain"=test.de https://10.10.11.45:8006/api2/json/config/domains
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!