Last active
December 31, 2018 05:54
-
-
Save amitness/c02e97f96ab4b1d03627e62be3253bb7 to your computer and use it in GitHub Desktop.
List all AWS Services and their associated methods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import boto3 | |
def get_available_methods(service): | |
client = boto3.client(service) | |
all_attributes = dir(client) | |
available_methods = [attribute for attribute in all_attributes if callable(getattr(client, attribute))] | |
available_methods = [i for i in available_methods if not i.startswith('_')] | |
return available_methods | |
with open('aws_services.csv', 'w') as file: | |
writer = csv.writer(file) | |
writer.writerow(['ranking', 'method', 'service']) | |
counter = 0 | |
sess = boto3.Session() | |
services = sess.get_available_services() | |
for service in services: | |
methods = get_available_methods(service) | |
for method in methods: | |
print("{}, {}, {}".format(counter, method, service)) | |
writer.writerow([counter, method, service]) | |
counter += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment