mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-19 04:47:54 +00:00
Change ports to adapters in VirtualBox API entry points.
This commit is contained in:
parent
22369ade49
commit
8a00d30e23
@ -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"
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user