Closed displague closed 3 years ago
@displague looks like a good temporary solution. I should have seen that the omitempty
will not work as expected iwth the nil there.
Would be good to know what exactly the API expects there for the removal. It should be possible to observe from web UI console (with debugging tools) if you have a connection for testing available.
We may not need to remove the VLAN explicitly. When I can test this I will try taking that approach too.
I suspect this... Fixes #183
Error: PUT https://api.equinix.com/metal/v1/virtual-circuits/31e13e9e-57e8-4720-a9b2-a715106a9a8c: 422 Update params can't be blank
https://github.com/packethost/packngo/blob/86fc114a1bf21d9f0ad2f16ddbbecd769b79ee4a/virtualcircuits.go#L40 The
omitempty
here will prevent thenil
VirtualNetworkID
from being sent to the API. By using an empty string, the API will receive something, however it is not clear to me if the API will accept""
to declare the intention to disconnect the VLAN, or if we will need to change packngo to permitnull
to be sent. In this case, we could use an option that may be undefined/omitted or literal null or string: