boto3 icon indicating copy to clipboard operation
boto3 copied to clipboard

EC2.RouteTable.delete_route() is missing

Open kislyuk opened this issue 11 years ago • 4 comments

for vpc in ec2.vpcs.all():
    for route_table in vpc.route_tables.all():
        print(route_table)
        print(route_table.meta.client.create_route)
        print(route_table.create_route)
        print(route_table.meta.client.delete_route)
        print(route_table.delete_route)
<bound method EC2.create_route of <botocore.client.EC2 object at 0x7f7a723afdd8>>
<bound method ec2.RouteTable.create_route of ec2.RouteTable(id='rtb-513cb835')>
<bound method EC2.delete_route of <botocore.client.EC2 object at 0x7f7a723afdd8>>
Traceback (most recent call last):
  File "./scripts/foo", line 193, in <module>
    print(route_table.delete_route)
AttributeError: 'ec2.RouteTable' object has no attribute 'delete_route'

kislyuk avatar Sep 28 '15 21:09 kislyuk

Thanks for your suggestion. We will look into this.

rayluo avatar Sep 30 '15 08:09 rayluo

@kislyuk Agreed there should be some parity. I think route_table.delete_route is a reasonable interface. Feel free to submit a PR to our resource model for EC2 to add this. We can add it as well. If you have any other questions feel free to ask.

kyleknap avatar Oct 16 '15 20:10 kyleknap

I'm running into the same issue.

---> 29                 x = ec2_client.delete_route(RouteTableId=route_table.id,DestinationCidrBlock=route['DestinationCidrBlock'])
     30                 print x
     31 
AttributeError: 'ec2.ServiceResource' object has no attribute 'delete_route'

mandeepbal avatar Dec 17 '15 03:12 mandeepbal

ditto - quite annoying as I have to shell call the CLI to delete routes :(

cloudreach-jw avatar Feb 01 '16 17:02 cloudreach-jw