vyos-1x icon indicating copy to clipboard operation
vyos-1x copied to clipboard

T6695: Machine-readable operational mode support for traceroute

Open natali-rs1985 opened this issue 4 months ago • 7 comments

Change Summary

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Code style update (formatting, renaming)
  • [ ] Refactoring (no functional changes)
  • [ ] Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • [ ] Other (please describe):

Related Task(s)

  • https://vyos.dev/T6695

Related PR(s)

Component(s) name

Proposed changes

Added new endpoint for http API /traceroute

How to test

vyos@vyos:~$ curl -k --location --request POST 'https://localhost/traceroute' --form data='{"op": "traceroute", "host": "192.0.1.1"}' --form key='foo'
{"success": true, "data": "{'report': {'mtr': {'src': 'vyos', 'dst': '192.0.1.1', 'tos': 0, 'tests': 1, 'psize': '64', 'bitpattern': '0x00'}, 'hubs': [{'count': 1, 'host': '192.168.122.1', 'Loss%': 0.0, 'Snt': 1, 'Last': 1.669, 'Avg': 1.669, 'Best': 1.669, 'Wrst': 1.669, 'StDev': 0.0}, {'count': 2, 'host': '192.168.179.2', 'Loss%': 0.0, 'Snt': 1, 'Last': 1.854, 'Avg': 1.854, 'Best': 1.854, 'Wrst': 1.854, 'StDev': 0.0}, {'count': 3, 'host': '???', 'Loss%': 100.0, 'Snt': 1, 'Last': 0.0, 'Avg': 0.0, 'Best': 0.0, 'Wrst': 0.0, 'StDev': 0.0}]}}\n", "error": null}

Smoketest result

Checklist:

  • [x] I have read the CONTRIBUTING document
  • [x] I have linked this PR to one or more Phabricator Task(s)
  • [ ] I have run the components SMOKETESTS if applicable
  • [x] My commit headlines contain a valid Task id
  • [ ] My change requires a change to the documentation
  • [ ] I have updated the documentation accordingly

natali-rs1985 avatar Oct 11 '24 10:10 natali-rs1985