Getting Started
Installation
pip install capo-wafv2
Usage
from capo_wafv2 import AsyncWAFV2Client
async def main():
async with AsyncWAFV2Client() as wafv2:
# Example: call the associate_web_acl operation
response = await wafv2.associate_web_acl()
print(response)
Error Handling
The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.
from capo_wafv2 import AsyncWAFV2Client
from capo_wafv2.error import WAFFeatureNotIncludedInPricingPlanException
async def main():
async with AsyncWAFV2Client() as wafv2:
try:
await wafv2.associate_web_acl()
except WAFFeatureNotIncludedInPricingPlanException 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_wafv2 import AsyncWAFV2Client
async def main():
async with AsyncWAFV2Client() as wafv2:
# Default: 3 attempts for every operation
response = await wafv2.associate_web_acl()
# Override per operation
response = await wafv2.associate_web_acl(config_overrides={"retry_max_attempts": 5})
# Disable retries for this call
response = await wafv2.associate_web_acl(config_overrides={"retry_max_attempts": 1})
Metadata
Release files for capo-wafv2 0.5.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_wafv2-0.5.0.tar.gz | 276.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| capo_wafv2-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 914.8 kB
Release files / capo_wafv2-0.5.0.tar.gz
| Download URL | capo_wafv2-0.5.0.tar.gz |
|---|---|
| Size | 276.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5cff4866de8ea530dc8380b799ad33d255f5219a942d75279734ccece1da7a46
|
|
BLAKE2b-256 checksum How to use checksums |
9293780b49d0390c1c63df0761b745e0a0024db153e5025e77101450f1400f75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","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_wafv2-0.5.0-py3-none-any.whl
| Download URL | capo_wafv2-0.5.0-py3-none-any.whl |
|---|---|
| Size | 638.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cd58dc5db31e76d8849c11a53a50d4a0744395cd603ae7485f23be679adca7ca
|
|
BLAKE2b-256 checksum How to use checksums |
6f98709849023a9a5053c1cce4931ea6a6f2c9fd73b3ac9258f930a2db64ba10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","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}
|