Skip to content

InstanceUtilsV1API cannot create an IP address #849

Open
@rico132

Description

@rico132

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

Metadata

Metadata

Labels

bugSomething isn't workinginstanceInstance issues, bugs and feature requestspriority:highestBugs filled by customers, security issues

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions