diff --git a/docs/index.md b/docs/index.md index 89f51cb8..0cc64cd5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -186,7 +186,8 @@ Proxmox `provider` block: - `endpoint` - (Required) The endpoint for the Proxmox Virtual Environment API (can also be sourced from `PROXMOX_VE_ENDPOINT`). Usually this is - `https://:8006/`. + `https://:8006/`. **Do not** include `/api2/json` at + the end. - `insecure` - (Optional) Whether to skip the TLS verification step (can also be sourced from `PROXMOX_VE_INSECURE`). If omitted, defaults to `false`. diff --git a/proxmox/api/client.go b/proxmox/api/client.go index 17e11e38..11227b5d 100644 --- a/proxmox/api/client.go +++ b/proxmox/api/client.go @@ -84,6 +84,9 @@ func NewConnection(endpoint string, insecure bool) (*Connection, error) { transport = logging.NewLoggingHTTPTransport(transport) } + // make sure the path does not contain "/api2/json" + u.Path = "" + return &Connection{ endpoint: strings.TrimRight(u.String(), "/"), httpClient: &http.Client{