davidban77 / gns3fy

Python library wrapper around GNS3 Server REST API
https://davidban77.github.io/gns3fy/
57 stars 28 forks source link

Http 404 http://XX:3080/v2/projects/{uid}/stats #60

Closed louis-6wind closed 4 years ago

louis-6wind commented 4 years ago

Hello,

I am having this issue. Is there any GN3 version requirements ? Mine is 2.1.21.

>>> gns3_server.projects_summary()
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/gns3fy/gns3fy.py", line 139, in http_call
    _response.raise_for_status()
  File "/usr/local/lib/python3.6/dist-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://labgns3:3080/v2/projects/ae7a2b6a-57d3-4ab7-b8fd-917286020735/stats
davidban77 commented 4 years ago

Hey @louis-oui ,

Yeah the problem is the GNS3 server version, the library was developed with the new API design of 2.2 and onwards.

Some functionality might not be available for your version 2.1.21. In this case it does not have the .../v2/proojects/<project_id>/stats API endpoint so the projects.summary() method will fail, see here.

I will add a note to make it clear on the README.

louis-6wind commented 4 years ago

Thank you for the response. I will upgrade my setup

davidban77 commented 4 years ago

No prob, will also take a look at the PR and merge with other upcoming changes on next release