AWS boto3 源代码

AWS boto3 source code

我们如何查看 AWS boto 库代码。并非所有代码都出现在 python 包中。

例如,如果我想了解 Waiter class 的 wait_until_running() 方法是如何实现的,即它是否实现了序列化时尚和其他代码的特点。虽然文档说的是这样的: "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.",描述并不完全有用。

我们如何才能看到boto3方法正在使用的代码逻辑?? 我在 github 和 python boto-3 包中都找不到。 虽然我已经了解到这样的模型 classes 是从 JSON 描述文件(waiters-2.json??)自动生成的,但我仍然找不到查看实现的方法

任何指导我的建议都有帮助

boto3 使用 botocore 作为核心功能的依赖。两者的源代码都可以在 github.com:

上找到

wait_until_running 不是代码中的函数。它告诉 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 使用许多测试来检查其功能,我的经验是,这是了解功能的好地方。

...希望这对您有所帮助。