scaleway-sdk-python icon indicating copy to clipboard operation
scaleway-sdk-python copied to clipboard

InstanceUtilsV1API cannot create an IP address

Open rico132 opened this issue 11 months ago • 1 comments

Hello there,

When I try to create an IP address like this:

client = Client.from_env()
api = InstanceUtilsV1API(client)
api.create_ip(type_=IpType.ROUTED_IPV6)

I get an error:

 result = api.create_ip(type_=IpType.ROUTED_IPV6)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.12/site-packages/scaleway/instance/v1/api.py", line 3571, in create_ip
    return unmarshal_CreateIpResponse(res.json())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.12/site-packages/scaleway/instance/v1/marshalling.py", line 1021, in unmarshal_CreateIpResponse
    args["ip"] = unmarshal_Ip(field)
                 ^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.12/site-packages/scaleway/instance/v1/marshalling.py", line 1008, in unmarshal_Ip
    return Ip(**args)
           ^^^^^^^^^^
TypeError: Ip.__init__() missing 1 required positional argument: 'address'

So I added a print statement in scaleway/instance/v1/api.py create_ip() and the response looks something like this(I removed the UUIDs and the prefix):

{'ip': {'id': 'UUID', 'address': None, 'prefix': 'PREFIX', 'reverse': None, 'server': None, 'organization': 'UUID', 'project': 'UUID', 'zone': 'fr-par-1', 'type': 'routed_ipv6', 'state': 'detached', 'tags': [], 'ipam_id': 'UUID'}}

I think the address should not be None

rico132 avatar Feb 05 '25 12:02 rico132

Hello,

The issue has been raised to the product team. We apologize for the inconvenience and the delay.

Thank you for reporting this and for your patience.

Laure

Laure-di avatar Mar 18 '25 15:03 Laure-di