Learn How We Can Help You Keep Teleworkers Protected During the COVID-19 Crisis

Security

Reply
Highlighted

WAPI Creating Hosts using the next available ip

Authority
Posts: 15
2149     0

have tried examples of similar efforts, but with no result.

To test using curl ..

curl -k3 -u "loginSmiley Tongueassword" -X POST -H "Content-Type: application/json" -d '{"name":"testhost.zone.here","ipv4addrs":[{"ipv4addr":"func:nextavailableip:10.0.1.128/25"}]}' https://192.168.1.1/wapi/v1.2.1/record:host

Mainly complains

{ "Error": "AdmConProtoError: JSON Decoding: No JSON object
  "code": "Client.Ibap.Proto.JSONDecoding",
  "text": "JSON Decoding: No JSON object could be decoded"
}

have tried without using the 'sub' structure for ipv4addrs, but same result.

Highlighted

Fix/Workaround

Authority
Posts: 15
2149     0

Maybe it's the version of cURL or being on windows.  Found POST requests work by putting the XML/JSON within a file and using the -d @filename to read in the data.

Showing results for 
Search instead for 
Do you mean 

Recommended for You