equinixmetal-archive/packngo

Spot Market Request calls API with incorrect facility parameter

Closed this issue · 1 comments

Type SpotMarketRequestCreateRequest serializes the facilities field to JSON as "facility_ids":

https://github.com/packethost/packngo/blob/17aa566ace747f13d13debb41e86d401403dc663/spotmarketrequest.go#L21

However the Packet REST API expects a field called "facilities".

{ ..., "facilities": [ "string" ] }

I am invoking packngo via terraform-provider-packet. The effect I am seeing is that the API ignores the facility_ids parameter and instead creates a Spot request across all facilities that carry the machine type.

t0mk commented

@Shakahs thanks for spotting this. I fixed it in packngo and I created PR in the provider
https://github.com/terraform-providers/terraform-provider-packet/pull/139