os_router module doubt

Hi there,

I am working with openstack modules (os_network, os_router, os_subnet, …)

The point is that I am trying to remove a router, a subnet and a network with this modules but I am getting an error when trying to do it, specifically “subnet still has ports”.

From Openstack CLI, steps to to this is: detach subnet from the router, remove subnet, remove network and, finally, remove router.

My question is: how can I detach the subnet from the router in order to be able to remove? Thank you