packngo icon indicating copy to clipboard operation
packngo copied to clipboard

Base URL alternative should be configurable via the environment

Open displague opened this issue 3 years ago • 1 comments

Alternate base URLs, such as the legacy https://api.packet.net, may be useful during testing. PACKNGO_API_BASE_URL could be used to configure such a change.

No other mechanism currently exists. If packngo supported this feature, downstream tools may need to be adapted to inherit this value, alternatively, these tools could offer their own way to provide the base URL.

displague avatar Feb 22 '22 16:02 displague

This could also be used with tools like Prism https://github.com/stoplightio/prism#validation-proxy. When applied against the Terraform E2E tests, for example, this could be used to identify if the TF implementation and packngo (or metal-go) are true to the API spec (and that the API is true to the API spec).

displague avatar Feb 22 '23 01:02 displague