Getting Started
Installation
pip install capo-elasticsearch-service
Usage
from capo_elasticsearch_service import AsyncElasticsearchServiceClient
async def main():
async with AsyncElasticsearchServiceClient() as elasticsearch_service:
# Example: call the accept_inbound_cross_cluster_search_connection operation
response = await elasticsearch_service.accept_inbound_cross_cluster_search_connection()
print(response["cross_cluster_search_connection"])
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_elasticsearch_service import AsyncElasticsearchServiceClient
async def main():
async with AsyncElasticsearchServiceClient() as elasticsearch_service:
# Example: paginate over describe_domain_auto_tunes
async for item in elasticsearch_service.iter_describe_domain_auto_tunes():
print(item)
Error Handling
The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.
from capo_elasticsearch_service import AsyncElasticsearchServiceClient
from capo_elasticsearch_service.error import DisabledOperationException
async def main():
async with AsyncElasticsearchServiceClient() as elasticsearch_service:
try:
await elasticsearch_service.accept_inbound_cross_cluster_search_connection()
except DisabledOperationException 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_elasticsearch_service import AsyncElasticsearchServiceClient
async def main():
async with AsyncElasticsearchServiceClient() as elasticsearch_service:
# Default: 3 attempts for every operation
response = await elasticsearch_service.accept_inbound_cross_cluster_search_connection()
# Override per operation
response = await elasticsearch_service.accept_inbound_cross_cluster_search_connection(config_overrides={"retry_max_attempts": 5})
# Disable retries for this call
response = await elasticsearch_service.accept_inbound_cross_cluster_search_connection(config_overrides={"retry_max_attempts": 1})
Release files for capo-elasticsearch-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_elasticsearch_service-0.1.0.tar.gz | 162.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| capo_elasticsearch_service-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 586.8 kB
Release files / capo_elasticsearch_service-0.1.0.tar.gz
| Download URL | capo_elasticsearch_service-0.1.0.tar.gz |
|---|---|
| Size | 162.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8c3733e80d33fb839ce733b77110bc24860d1b55fd428a68d91e84ac8bcff1b0
|
|
BLAKE2b-256 checksum How to use checksums |
604472cabec27ac57a4b2aa6ddcf255ed1b31c3d2ae2c6e7cbb63456a91fa1e8
|
| 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_elasticsearch_service-0.1.0-py3-none-any.whl
| Download URL | capo_elasticsearch_service-0.1.0-py3-none-any.whl |
|---|---|
| Size | 424.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b36d2086a0f69dc79fa4a7412708a1603f93c73204728db466ad47c617f8f659
|
|
BLAKE2b-256 checksum How to use checksums |
16dc5da9b6afe44fbb37ba0b127cce711b31c16f51a1412758605a10c35a2725
|
| 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}
|