HTTPS API for /generate not working properly for wireguard interface

I am on vyos VyOS 2025.11.04-0019-rolling using the https api. I have a simple python script to generate me a wireguard interface with its keys. when I run the code I get what looks like the correct response.

import os
import json
import urllib3
urllib3.disable_warnings()
from pyvyos import VyDevice
from dotenv import load_dotenv
load_dotenv()

hostname = os.getenv('VYDEVICE_HOSTNAME')
apikey = os.getenv('VYDEVICE_APIKEY')
port = os.getenv('VYDEVICE_PORT')
protocol = os.getenv('VYDEVICE_PROTOCOL')
verify_ssl = os.getenv('VYDEVICE_VERIFY_SSL')

verify = verify_ssl.lower() == "true" if verify_ssl else True

# Initialize VyDevice and store in app context
device = VyDevice(hostname=hostname, apikey=apikey, port=port, protocol=protocol, verify=verify)

data = device.generate(path=["pki", "wireguard", "key-pair", "install", "interface", "wg0"])

print(data.result)

Response:

1 value(s) installed. Use "compare" to see the pending changes, and "commit" to apply.
Corresponding public-key to use on peer system is: '+Nsm/cgOysi6za5TeRoEPRU5iPpitKVgTbuNX8h0Bmk='

But if I check to see if it was created properly I don’t see the new interface anywhere.

vyos@vyos# show interfaces 
 dummy dum0 {
     address 192.168.0.1/32
 }
 ethernet eth0 {
     address dhcp
     description WAN
     hw-id f8:b1:56:cb:9f:45
 }
 ethernet eth1 {
     address 10.50.50.1/24
     description LAN
     hw-id 60:e3:27:00:2d:62
     vif 5 {
         address 10.5.5.1/24
         description TEST5
     }
     vif 6 {
         address 10.6.6.1/23
         description TEST6
     }
     vif 7 {
         address 10.7.7.1/24
         description TEST7
     }
     vif 8 {
         address 10.8.8.1/24
         description TEST8
     }
 }
 loopback lo {
 }
[edit]
vyos@vyos#

Anyone have any idea what to look for to troubleshoot this? I appreciate the help.

The response is, unfortunately, misleading; moreover, the lack of error appears to be a regression: on a system from early August:
└──> curl -k -X POST -d '{"key": "baz", "op": "generate", "path": ["pki", "wireguard", "key-pair", "install", "interface", "wg0"]}' ``https://19
2.168.122.24/generate
{"success": true, "data": "Failed to install 1 value(s). Commands to manually install:\nset interfaces wireguard wg0 private-key '6PzlQhfpekOJ
Vvop7tKjzJinPJ0pOp2DDeZgmurL6F4='\nCorresponding public-key to use on peer system is: '147vCMgaCssmCDJHOV1M+gL+uEbXQ5ck64izKBZ0YT0='\n", "erro
r": null}%
└──> curl -k -X POST -d '{"key": "baz", "op": "show", "path": ["version"]}' ``https://192.168.122.24/show``
{"success": true, "data": "Version: VyOS 1.5-rolling-202508011523\nRelease train: current\nRelease flavor: generic\n\nBuilt by:
root@3f02241acba8\nBuilt on: Fri 01 Aug 2025 15:23 UTC\nBuild UUID: 3a1a4317-b423-4c1a-a489-be5bcb2a4daa\nBuild commit I
D: 2f2bfb56d28438\n\nArchitecture: x86_64\nBoot via: installed image\nSystem type: KVM guest\nSecure Boot: n/a (BIOS)\n
\nHardware vendor: QEMU\nHardware model: Standard PC (Q35 + ICH9, 2009)\nHardware S/N: \nHardware UUID: a151ec9a-bcf8-46a4-89a1-83b1
add60849\n\nCopyright: VyOS maintainers and contributors\n", "error": null}%

One will need to adopt the recommendations in the (correct) error message in the first response. Note: to generate the key-pair, one can use the simpler:
curl -k -X POST -d '{"key": "baz", "op": "generate", "path": ["pki", "wireguard", "key-pair"]}' ``https://192.168.122.24/generate

The regression itself will need to be addressed in a bug report.

Do I need to submit a bug report or?

If you are able it would be appreciated.

1 Like

I created an account on vyos.dev. Waiting to be approved so I can post a bug report.

1 Like