Skip to content

Instantly share code, notes, and snippets.

@Miserlou
Created March 25, 2016 19:26
Show Gist options
  • Save Miserlou/aa2b400a0e21407b9c06 to your computer and use it in GitHub Desktop.
Save Miserlou/aa2b400a0e21407b9c06 to your computer and use it in GitHub Desktop.
API Gateway Selective Purger
import boto3
client = boto3.client('apigateway')
response = client.get_rest_apis(
limit=50
)
for api in response['items']:
input = raw_input("Delete " + api['name'] + " (" + api['description'] + ") [" + api['id'] + "]? " )
if input == 'y':
try:
response = client.delete_rest_api(
restApiId=api['id']
)
print "Deleted!"
except Exception as e:
continue
@KingGame0
Copy link

<style type="text/css"></style> KingGame -- Gold99 PGasia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment