Device.create: overrides ip_addresses#91
Conversation
|
Thanks for this PR, @karmab! Could you please explain this PR and the reasoning behind it in the description. At first glance, it appears that this PR adds the ability to define the |
| hardware_reservation_id="", | ||
| storage={}, | ||
| customdata={}, | ||
| ip_addresses=[ |
There was a problem hiding this comment.
I'm not sure about the defaults that are being provided in this PR. I see evidence that the default IP address allocation for a device includes:
- IPv4 Public
- IPv6 Public
- IPv4 False
Could the defaulting behavior introduced here be avoided if =None was default? Unless I am missing something, If a user wants to request 'no IP addresses', they could then supply create_device(..., ip_addresses=[]).
If this results in ip_addresses: null being sent to the API, and the API treats this the same as [], then avoid adding ip_addresses to params when it is None.
There was a problem hiding this comment.
ip_addresses=[] should be sent as an empty array to the API, to which the API will report that at least a management IP address must be included. I can imagine the API removing this limitation in the future.
ip_address=None should be omitted in API requests, this is how you request the default IP Addresses which are generally, but not necessarily (depending on OS and plan) the following:
{"address_family": 4, "public": False},
{"address_family": 4, "public": True},
{"address_family": 6, "public": False}
displague
left a comment
There was a problem hiding this comment.
I'm pretty sure we will want to change how the default ip_addresses are handled, per this comment
|
Closing this for #136 The ip_addressesin metal-python's create_device should handle this case. |
No description provided.