Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If the command runs indefinitely, it will timeout and the connection will be closed with an error.   Current timeout interval is 20 seconds. To avoid timeout errors, add a parameter that would sufficiently limit the command execution time. For example, to limit the number of pings, add count parameter:

Code Block
languagetextpowershell
themeFadeToGrey
$ curl -k -u admin: -X POST https://router10.155.101.214/rest/ping \
  --data '{"address":"10.0155.0101.1111","count":4}"21"}' \
  -H "content-type: application/json"
{"detail":"Session closed","error":400,"message":"Bad Request"}

$ curl -k -u admin: -X POST https://10.155.101.214/rest/ping \
  --data '{"address":"10.155.101.1","count":"4"}' \
  -H "content-type: application/json"
[{"avg-rtt":"453us","host":"10.155.101.1","max-rtt":"453us","min-rtt":"453us","packet-loss":"0","received":"1","sent":"1","seq":"0","size":"56","time":"453us","ttl":"64"},
{"avg-rtt":"417us","host":"10.155.101.1","max-rtt":"453us","min-rtt":"382us","packet-loss":"0","received":"2","sent":"2","seq":"1","size":"56","time":"382us","ttl":"64"},
{"avg-rtt":"495us","host":"10.155.101.1","max-rtt":"650us","min-rtt":"382us","packet-loss":"0","received":"3","sent":"3","seq":"2","size":"56","time":"650us","ttl":"64"},
{"avg-rtt":"461us","host":"10.155.101.1","max-rtt":"650us","min-rtt":"359us","packet-loss":"0","received":"4","sent":"4","seq":"3","size":"56","time":"359us","ttl":"64"}]


Another example is a bandwidth test tool, which can be limited by providing run duration:

...