packethost / packet-python

A Python client for the Equinix Metal API
http://metal.equinix.com/
GNU Lesser General Public License v3.0
40 stars 50 forks source link

Metro endpoint is 404 #122

Closed jpablo-eqx closed 3 years ago

jpablo-eqx commented 3 years ago

Getting when using list_metro function.

import packet
manager = packet.Manager(auth_token="TOKEN")
manager.list_metros()

Output

Traceback (most recent call last):
  File "/Users/HOME/projects/equinix-metal/packet-python/metro.py", line 5, in <module>
    manager.list_metros()
  File "/Users/HOME/.local/share/virtualenvs/packet-python-0HIUktmS/lib/python3.9/site-packages/packet/Manager.py", line 46, in list_metros
    data = self.call_api("metros", params=params)
  File "/Users/HOME/.local/share/virtualenvs/packet-python-0HIUktmS/lib/python3.9/site-packages/packet/Manager.py", line 32, in call_api
    return super(Manager, self).call_api(method, type, params)
  File "/Users/HOME/.local/share/virtualenvs/packet-python-0HIUktmS/lib/python3.9/site-packages/packet/baseapi.py", line 116, in call_api
    raise ResponseError(resp, data)
packet.baseapi.ResponseError: Error 404: Not found

Curl'ing the actual endpoint returns HTTP 404:

curl -I -H 'X-Auth-Token: TOKEN' https://api.packet.net/metros
HTTP/2 404
displague commented 3 years ago

The endpoint is wrong. https://github.com/packethost/packngo/blob/master/metros.go#L3