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.3.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.3.0.tar.gz | 277.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| capo_wafv2-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 914.4 kB
Release files / capo_wafv2-0.3.0.tar.gz
| Download URL | capo_wafv2-0.3.0.tar.gz |
|---|---|
| Size | 277.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da8d83123894690533a81b695eae35d8ee4267588f337e3fd9a37bf907b36b4c
|
|
BLAKE2b-256 checksum How to use checksums |
bfb456853076096ea4461b3f8af56fae30092c4dc920c049968730265d8eff2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","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.3.0-py3-none-any.whl
| Download URL | capo_wafv2-0.3.0-py3-none-any.whl |
|---|---|
| Size | 637.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
736a83645f9ed41a90f648073ddebbbfc725ad2a4c03612989881a371015371b
|
|
BLAKE2b-256 checksum How to use checksums |
dfe03cfed5dde00b8d1883d226d4699ac76f622905107902a3294f366907b758
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","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}
|