mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Move to version 3 of the REST API.
Rename packet capture endpoints.
This commit is contained in:
1 parent
eeaf10b418
commit
359f9a7384
34 files changed
+120
-118
No files matched your search
@@ -497,7 +497,7 @@ class Compute:
|
||||
host = "[{}]".format(host)
|
||||
elif host == "0.0.0.0":
|
||||
host = "127.0.0.1"
|
||||
return "{}://{}:{}/v2/compute{}".format(self._protocol, host, self._port, path)
|
||||
return "{}://{}:{}/v3/compute{}".format(self._protocol, host, self._port, path)
|
||||
|
||||
def get_url(self, path):
|
||||
""" Returns URL for specific path at Compute"""
|
||||
|
||||
@@ -310,7 +310,7 @@ class VirtualBoxGNS3VM(BaseGNS3VM):
|
||||
remaining_try = 300
|
||||
while remaining_try > 0:
|
||||
try:
|
||||
async with HTTPClient.get(f"http://127.0.0.1:{api_port}/v2/compute/network/interfaces") as resp:
|
||||
async with HTTPClient.get(f"http://127.0.0.1:{api_port}/v3/compute/network/interfaces") as resp:
|
||||
if resp.status < 300:
|
||||
try:
|
||||
json_data = await resp.json()
|
||||
|
||||
@@ -345,11 +345,12 @@ class Link:
|
||||
node_id = self.capture_node["node"].id
|
||||
adapter_number = self.capture_node["adapter_number"]
|
||||
port_number = self.capture_node["port_number"]
|
||||
url = "/projects/{project_id}/{node_type}/nodes/{node_id}/adapters/{adapter_number}/ports/{port_number}/pcap".format(project_id=self.project.id,
|
||||
node_type=node_type,
|
||||
node_id=node_id,
|
||||
adapter_number=adapter_number,
|
||||
port_number=port_number)
|
||||
url = "/projects/{project_id}/{node_type}/nodes/{node_id}/adapters/{adapter_number}/" \
|
||||
"ports/{port_number}/capture/stream".format(project_id=self.project.id,
|
||||
node_type=node_type,
|
||||
node_id=node_id,
|
||||
adapter_number=adapter_number,
|
||||
port_number=port_number)
|
||||
|
||||
return compute._getUrl(url)
|
||||
|
||||
|
||||
Reference in new issue
Block a user