diff --git a/gns3server/handlers/virtualbox_handler.py b/gns3server/handlers/virtualbox_handler.py index b164a727..69ddba1a 100644 --- a/gns3server/handlers/virtualbox_handler.py +++ b/gns3server/handlers/virtualbox_handler.py @@ -227,7 +227,7 @@ class VirtualBoxHandler: response.set_status(204) @Route.post( - r"/virtualbox/{uuid}/ports/{adapter_id:\d+}/nio", + r"/virtualbox/{uuid}/adapters/{adapter_id:\d+}/nio", parameters={ "uuid": "Instance UUID", "adapter_id": "Adapter where the nio should be added" @@ -251,7 +251,7 @@ class VirtualBoxHandler: @classmethod @Route.delete( - r"/virtualbox/{uuid}/ports/{adapter_id:\d+}/nio", + r"/virtualbox/{uuid}/adapters/{adapter_id:\d+}/nio", parameters={ "uuid": "Instance UUID", "adapter_id": "Adapter from where the nio should be removed" diff --git a/tests/api/test_virtualbox.py b/tests/api/test_virtualbox.py index 9f90aea4..51c17495 100644 --- a/tests/api/test_virtualbox.py +++ b/tests/api/test_virtualbox.py @@ -88,24 +88,24 @@ def test_vbox_reload(server, vm): def test_vbox_nio_create_udp(server, vm): - response = server.post("/virtualbox/{}/ports/0/nio".format(vm["uuid"]), {"type": "nio_udp", + response = server.post("/virtualbox/{}/adapters/0/nio".format(vm["uuid"]), {"type": "nio_udp", "lport": 4242, "rport": 4343, "rhost": "127.0.0.1"}, example=True) assert response.status == 201 - assert response.route == "/virtualbox/{uuid}/ports/{adapter_id:\d+}/nio" + assert response.route == "/virtualbox/{uuid}/adapters/{adapter_id:\d+}/nio" assert response.json["type"] == "nio_udp" def test_vbox_delete_nio(server, vm): - server.post("/virtualbox/{}/ports/0/nio".format(vm["uuid"]), {"type": "nio_udp", + server.post("/virtualbox/{}/adapters/0/nio".format(vm["uuid"]), {"type": "nio_udp", "lport": 4242, "rport": 4343, "rhost": "127.0.0.1"}) - response = server.delete("/virtualbox/{}/ports/0/nio".format(vm["uuid"]), example=True) + response = server.delete("/virtualbox/{}/adapters/0/nio".format(vm["uuid"]), example=True) assert response.status == 204 - assert response.route == "/virtualbox/{uuid}/ports/{adapter_id:\d+}/nio" + assert response.route == "/virtualbox/{uuid}/adapters/{adapter_id:\d+}/nio" def test_vpcs_update(server, vm, free_console_port):