Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS boto3 source code

How can we get a look at the AWS boto library code. Not all the code is present in the python package.

For example if I wanted to understand how the wait_until_running() method of Waiter class is implemented i.e. if it is implemented serialized fashion and other features of the code. Although the documentation says something like : "This method calls EC2.Waiter.instance_stopped.wait() which polls. EC2.Client.describe_instances() every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.", the description is not fully helpful.

How can we see the logic of the code boto3 methods are using?? I couldn't find in github nor in the python boto-3 packages. Although I have learnt that such model classes are autogenerated from JSON description files (waiters-2.json??), I still couldn't find a way to see the implementation

Any advise guiding me helps

like image 833
Mikki Avatar asked Mar 12 '23 23:03

Mikki


1 Answers

boto3 uses botocore as a dependency for the core functionality. The sourcecode can be found for both on github.com:

  • https://github.com/boto/boto3/
  • https://github.com/boto/botocore/

wait_until_running is not a function in the code. Its tells the Waiter to wait until the state running is set. All possible EC2 states and much more is defined at the resources-1.json. Working with these json files is part of the loaders.py.

Boto uses many tests to check its functionality and my experience is, that this is a good place to understand the functionality.

  • using the waiters-2.json
  • work with waiters

... hope this helps.

like image 197
andpei Avatar answered Mar 21 '23 03:03

andpei