Page MenuHomeVyOS Platform

Generate wiregurad keys via HTTP-API fails
Closed, ResolvedPublicBUG

Description

Generate wiregurad keys via HTTP-API fails
The request was from our documentation https://docs.vyos.io/en/latest/automation/vyos-api.html#generate

set service https api keys id key-01 key 'foo'
set service https api socket

Try to generate wireguard key pair

vyos@r4# curl -k --location --request POST 'https://127.0.0.1/generate' \
>   --form data='{"op": "generate", "path": ["wireguard", "default-keypair"]}' \
>   --form key='foo'
{"success": false, "error": "\n  Invalid command: generate wireguard [default-keypair]\n\n", "data": null}[edit]
vyos@r4#

It seems we don't have this path anymore

vyos@r4# run generate wireguard 
Possible completions:
  client-config         Generate Client config QR code

Details

Difficulty level
Unknown (require assessment)
Version
VyOS 1.5-rolling-202311130023
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Related Objects

Event Timeline

I wonder if we should use permanent API call queries that don't depend on the path.

This path was changed as part of the task T3642.
The new path is generate pki wireguard key-pair, we can easily translate the old path to the new in these cases, but do we need backward compatibility here?
Looks like this path was marked as deprecated more than two years ago(Sept 21) and dropped a little bit more than one year ago(Dec 22).
Perhaps it is enough to simply update the documentation?

fix doc PR https://github.com/vyos/vyos-documentation/pull/1270

HollyGurza changed the task status from Open to In progress.Mar 20 2024, 7:30 AM
HollyGurza claimed this task.
HollyGurza changed the task status from In progress to Open.Mar 20 2024, 9:05 AM