Getting Started
Installation
pip install capo-imagebuilder
Usage
from capo_imagebuilder import AsyncimagebuilderClient
async def main():
async with AsyncimagebuilderClient() as imagebuilder:
# Example: call the cancel_image_creation operation
response = await imagebuilder.cancel_image_creation()
print(response["request_id"])
Pagination
Some operations in this SDK support pagination. If the operation supports pagination it will have an iter_ prefixed method that returns an async iterator.
from capo_imagebuilder import AsyncimagebuilderClient
async def main():
async with AsyncimagebuilderClient() as imagebuilder:
# Example: paginate over list_component_build_versions
async for item in imagebuilder.iter_list_component_build_versions():
print(item)
Error Handling
The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.
from capo_imagebuilder import AsyncimagebuilderClient
from capo_imagebuilder.error import CallRateLimitExceededException
async def main():
async with AsyncimagebuilderClient() as imagebuilder:
try:
await imagebuilder.cancel_image_creation()
except CallRateLimitExceededException as e:
print(f"Error: {e}")
print(e.data) # additional error data
Retrying
The SDK retries failed operations automatically. Retry behaviour follows the Smithy specification: errors are retried based on their is_retryable and is_throttling_error attributes. Throttling errors use a longer base delay. Network-level failures (connection errors and timeouts) are also retried. Non-retryable errors, such as client errors without the @retryable trait, are raised immediately without further attempts.
The number of attempts defaults to 3 and can be changed at the client level via retry_max_attempts, or per call via config_overrides.
from capo_imagebuilder import AsyncimagebuilderClient
async def main():
async with AsyncimagebuilderClient() as imagebuilder:
# Default: 3 attempts for every operation
response = await imagebuilder.cancel_image_creation()
# Override per operation
response = await imagebuilder.cancel_image_creation(config_overrides={"retry_max_attempts": 5})
# Disable retries for this call
response = await imagebuilder.cancel_image_creation(config_overrides={"retry_max_attempts": 1})
Release files for capo-imagebuilder 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| capo_imagebuilder-0.1.0.tar.gz | 229.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| capo_imagebuilder-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 844.8 kB
Release files / capo_imagebuilder-0.1.0.tar.gz
| Download URL | capo_imagebuilder-0.1.0.tar.gz |
|---|---|
| Size | 229.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
009c45b5478a4c700aca3f071acffbaeba7f5dea0a96a58437227ee48a7746f9
|
|
BLAKE2b-256 checksum How to use checksums |
7c90bf8d3dd1606947726dd1c52672437539af6c29146b7b486fd76180799055
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / capo_imagebuilder-0.1.0-py3-none-any.whl
| Download URL | capo_imagebuilder-0.1.0-py3-none-any.whl |
|---|---|
| Size | 615.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4f32b51e11d8305f57c772b0c16bca505ce096756ca885065cfb433cd7a3c3f1
|
|
BLAKE2b-256 checksum How to use checksums |
8fd72b952139a8ea2b51ec2bcc03a890c7f153f057b76bbf167adfa9105f32b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|