Getting Started
Installation
pip install capo-resiliencehubv2
Usage
from capo_resiliencehubv2 import Asyncresiliencehubv2Client
async def main():
async with Asyncresiliencehubv2Client() as resiliencehubv2:
# Example: call the create_assertion operation
response = await resiliencehubv2.create_assertion()
print(response["assertion"])
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_resiliencehubv2 import Asyncresiliencehubv2Client
async def main():
async with Asyncresiliencehubv2Client() as resiliencehubv2:
# Example: paginate over list_assertions
async for item in resiliencehubv2.iter_list_assertions():
print(item)
Error Handling
The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.
from capo_resiliencehubv2 import Asyncresiliencehubv2Client
from capo_resiliencehubv2.error import AccessDeniedException
async def main():
async with Asyncresiliencehubv2Client() as resiliencehubv2:
try:
await resiliencehubv2.create_assertion()
except AccessDeniedException 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_resiliencehubv2 import Asyncresiliencehubv2Client
async def main():
async with Asyncresiliencehubv2Client() as resiliencehubv2:
# Default: 3 attempts for every operation
response = await resiliencehubv2.create_assertion()
# Override per operation
response = await resiliencehubv2.create_assertion(config_overrides={"retry_max_attempts": 5})
# Disable retries for this call
response = await resiliencehubv2.create_assertion(config_overrides={"retry_max_attempts": 1})
Release files for capo-resiliencehubv2 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_resiliencehubv2-0.1.0.tar.gz | 132.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| capo_resiliencehubv2-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 502.2 kB
Release files / capo_resiliencehubv2-0.1.0.tar.gz
| Download URL | capo_resiliencehubv2-0.1.0.tar.gz |
|---|---|
| Size | 132.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9fdcbc1b34d8e90565ad6e88e37c6ce55640ddea0fd7d87f95fb3fd094e01df1
|
|
BLAKE2b-256 checksum How to use checksums |
f16c1c6973a3f7a60f1c3e97ad1dee25a3244fe7a627c8071909a547e31e995a
|
| 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_resiliencehubv2-0.1.0-py3-none-any.whl
| Download URL | capo_resiliencehubv2-0.1.0-py3-none-any.whl |
|---|---|
| Size | 369.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a0e784e0b5833ed5c7a8df49a8534c68d30440f685a49bc7fedcb40046a8c537
|
|
BLAKE2b-256 checksum How to use checksums |
9bddd07f2b0cc357968f91071ee587483e1c9efed8e2620764b9f9b7f797e341
|
| 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}
|