Using Invoke-WebRequest, example to ticket:
$params = @{"username"="test@pve";
"password"="password";
}
Invoke-WebRequest -Uri "https://ip:8006/api2/json/access/ticket" -Method POST -Body $params | ConvertFrom-Json
This request to url (https://10.40.100.95:8006/api2/json/nodes/pve01/qemu) returns an error {"errors":{"vmid":"property is missing and it is not optional"},"data":null},
request for url (https://10.40.100.95:8006/api2/json/nodes), returned an array, what's wrong? in the documentation like...
I succeeded, I used a call with RestSharp
Thanks Hannes for your help )).
var client = new RestClient("https://10.40.100.95:8006/api2/json/nodes");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization"...
Not helped:
FormatException: The format of value 'PVEAPIToken=test@pve!ddf5959760540181d171d2e2a7adcba4=ad78e07e-a418-41a1-a201-3528154737f2' is invalid.
Not understand, how to write?:
user name:
test@pve
token name and password:
ddf5959760540181d171d2e2a7adcba4
tokenID:
test@pve!ddf5959760540181d171d2e2a7adcba4
Secret:
ad78e07e-a418-41a1-a201-3528154737f2
client.DefaultRequestHeaders.Add("Authorization"...
Help me figure it out, the token is there, the call does not accept the header.
using (var client = new HttpClient())
{
var url = "https://10.40.100.95:8006/api2/json/nodes";
client.DefaultRequestHeaders.Add("Authorization"...