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.4.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.4.0.tar.gz | 276.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| capo_wafv2-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 913.5 kB
Release files / capo_wafv2-0.4.0.tar.gz
| Download URL | capo_wafv2-0.4.0.tar.gz |
|---|---|
| Size | 276.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
67fb9d4d6639b9d855778ea76c477066a07a1f4ea198fa248854f8e6766170b5
|
|
BLAKE2b-256 checksum How to use checksums |
f60c167ca1e82f06529e86c3dca70f393fa2dc92efa5959ba4bf657c79140596
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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.4.0-py3-none-any.whl
| Download URL | capo_wafv2-0.4.0-py3-none-any.whl |
|---|---|
| Size | 636.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
438667e232031b817ec8e815fd9daab3c09dd6dcd3079263fd40194c32487aa2
|
|
BLAKE2b-256 checksum How to use checksums |
ff5529fdb28827d24b54641f492965871a38be4aae3f90f73b9724757332dd12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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}
|