Getting Started
Installation
pip install capo-cost-and-usage-report-service
Usage
from capo_cost_and_usage_report_service import AsyncCostandUsageReportServiceClient
async def main():
async with AsyncCostandUsageReportServiceClient() as costand_usage_report_service:
# Example: call the delete_report_definition operation
response = await costand_usage_report_service.delete_report_definition()
print(response["response_message"])
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_cost_and_usage_report_service import AsyncCostandUsageReportServiceClient
async def main():
async with AsyncCostandUsageReportServiceClient() as costand_usage_report_service:
# Example: paginate over describe_report_definitions
async for item in costand_usage_report_service.iter_describe_report_definitions():
print(item)
Error Handling
The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.
from capo_cost_and_usage_report_service import AsyncCostandUsageReportServiceClient
from capo_cost_and_usage_report_service.error import InternalErrorException
async def main():
async with AsyncCostandUsageReportServiceClient() as costand_usage_report_service:
try:
await costand_usage_report_service.delete_report_definition()
except InternalErrorException 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_cost_and_usage_report_service import AsyncCostandUsageReportServiceClient
async def main():
async with AsyncCostandUsageReportServiceClient() as costand_usage_report_service:
# Default: 3 attempts for every operation
response = await costand_usage_report_service.delete_report_definition()
# Override per operation
response = await costand_usage_report_service.delete_report_definition(config_overrides={"retry_max_attempts": 5})
# Disable retries for this call
response = await costand_usage_report_service.delete_report_definition(config_overrides={"retry_max_attempts": 1})
Release files for capo-cost-and-usage-report-service 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_cost_and_usage_report_service-0.1.0.tar.gz | 54.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| capo_cost_and_usage_report_service-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 147.0 kB
Release files / capo_cost_and_usage_report_service-0.1.0.tar.gz
| Download URL | capo_cost_and_usage_report_service-0.1.0.tar.gz |
|---|---|
| Size | 54.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1424a0beb95f10cc13594df36fd69c4ba5ee28c61aa87a40f360c267b43b1e27
|
|
BLAKE2b-256 checksum How to use checksums |
b62962ea883f1c8d505cd1d62720463f7c13b9f3169013383bb066da4b6f8818
|
| 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_cost_and_usage_report_service-0.1.0-py3-none-any.whl
| Download URL | capo_cost_and_usage_report_service-0.1.0-py3-none-any.whl |
|---|---|
| Size | 92.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7c076c717edf15284b2abce4df2d21c6cc9181aaa204986b794484ff4ec4b97d
|
|
BLAKE2b-256 checksum How to use checksums |
4a2354675ac4880533a75cf8bc85bfec81c6d0c92a14036a5b822e6189d3e044
|
| 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}
|