Getting Started
Installation
pip install capo-greengrassv2
Usage
from capo_greengrassv2 import AsyncGreengrassV2Client
async def main():
async with AsyncGreengrassV2Client() as greengrass_v2:
# Example: call the associate_service_role_to_account operation
response = await greengrass_v2.associate_service_role_to_account()
print(response["associated_at"])
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_greengrassv2 import AsyncGreengrassV2Client
async def main():
async with AsyncGreengrassV2Client() as greengrass_v2:
# Example: paginate over list_client_devices_associated_with_core_device
async for item in greengrass_v2.iter_list_client_devices_associated_with_core_device():
print(item)
Error Handling
The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.
from capo_greengrassv2 import AsyncGreengrassV2Client
from capo_greengrassv2.error import InternalServerException
async def main():
async with AsyncGreengrassV2Client() as greengrass_v2:
try:
await greengrass_v2.associate_service_role_to_account()
except InternalServerException 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_greengrassv2 import AsyncGreengrassV2Client
async def main():
async with AsyncGreengrassV2Client() as greengrass_v2:
# Default: 3 attempts for every operation
response = await greengrass_v2.associate_service_role_to_account()
# Override per operation
response = await greengrass_v2.associate_service_role_to_account(config_overrides={"retry_max_attempts": 5})
# Disable retries for this call
response = await greengrass_v2.associate_service_role_to_account(config_overrides={"retry_max_attempts": 1})
Release files for capo-greengrassv2 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_greengrassv2-0.1.0.tar.gz | 116.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| capo_greengrassv2-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 381.6 kB
Release files / capo_greengrassv2-0.1.0.tar.gz
| Download URL | capo_greengrassv2-0.1.0.tar.gz |
|---|---|
| Size | 116.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b1da4f6979b5d83365f0f9a13325ddeb70a1b2e2decb57e49015df2d52507fd2
|
|
BLAKE2b-256 checksum How to use checksums |
6b70316b812f275512d4904573aa6712f7a7a147715829a9679c956332d5e7f7
|
| 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_greengrassv2-0.1.0-py3-none-any.whl
| Download URL | capo_greengrassv2-0.1.0-py3-none-any.whl |
|---|---|
| Size | 265.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
99be312cd886d34cc24a0f2cc202d8b1cd915e51b854a144af9614d6ebe0a05b
|
|
BLAKE2b-256 checksum How to use checksums |
035604e6f90b435e6eefea3111850d9883fbfd7196a662093e8dcebb626f0ac5
|
| 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}
|