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.
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.