capo-keyspacesstreams 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- capo_keyspacesstreams/__init__.py +74 -0
- capo_keyspacesstreams/_async.py +25 -0
- capo_keyspacesstreams/_auth/_identity.py +16 -0
- capo_keyspacesstreams/_auth/_providers.py +886 -0
- capo_keyspacesstreams/_auth/_signers.py +88 -0
- capo_keyspacesstreams/_auth/_sigv4.py +434 -0
- capo_keyspacesstreams/_auth/_zapros_handler.py +80 -0
- capo_keyspacesstreams/_iter.py +113 -0
- capo_keyspacesstreams/_operations/keyspaces_streams/get_records.py +171 -0
- capo_keyspacesstreams/_operations/keyspaces_streams/get_shard_iterator.py +170 -0
- capo_keyspacesstreams/_operations/keyspaces_streams/get_stream.py +174 -0
- capo_keyspacesstreams/_operations/keyspaces_streams/list_streams.py +170 -0
- capo_keyspacesstreams/_pagination.py +21 -0
- capo_keyspacesstreams/_protocol/__init__.py +1 -0
- capo_keyspacesstreams/_protocol/errors.py +93 -0
- capo_keyspacesstreams/_protocol/eventstream.py +238 -0
- capo_keyspacesstreams/_protocol/serialize.py +47 -0
- capo_keyspacesstreams/_protocol/xml.py +33 -0
- capo_keyspacesstreams/_rule_engine/__init__.py +0 -0
- capo_keyspacesstreams/_rule_engine/_aws_partition.py +160 -0
- capo_keyspacesstreams/_rule_engine/_endpoint_rule_set.py +65 -0
- capo_keyspacesstreams/_rule_engine/_endpoint_runtime.py +389 -0
- capo_keyspacesstreams/_services/_aws_config.py +156 -0
- capo_keyspacesstreams/_services/_pipeline.py +196 -0
- capo_keyspacesstreams/_services/async_keyspaces_streams.py +442 -0
- capo_keyspacesstreams/_services/keyspaces_streams.py +438 -0
- capo_keyspacesstreams/errors/__init__.py +32 -0
- capo_keyspacesstreams/errors/_base.py +94 -0
- capo_keyspacesstreams/errors/access_denied_exception.py +47 -0
- capo_keyspacesstreams/errors/internal_server_exception.py +47 -0
- capo_keyspacesstreams/errors/resource_not_found_exception.py +47 -0
- capo_keyspacesstreams/errors/throttling_exception.py +47 -0
- capo_keyspacesstreams/errors/validation_exception.py +72 -0
- capo_keyspacesstreams/py.typed +0 -0
- capo_keyspacesstreams/types/_prelude/blob.py +12 -0
- capo_keyspacesstreams/types/_prelude/timestamp.py +17 -0
- capo_keyspacesstreams/types/date.py +20 -0
- capo_keyspacesstreams/types/get_records_input.py +37 -0
- capo_keyspacesstreams/types/get_records_output.py +70 -0
- capo_keyspacesstreams/types/get_shard_iterator_input.py +70 -0
- capo_keyspacesstreams/types/get_shard_iterator_output.py +30 -0
- capo_keyspacesstreams/types/get_stream_input.py +63 -0
- capo_keyspacesstreams/types/get_stream_output.py +144 -0
- capo_keyspacesstreams/types/iterator_description.py +42 -0
- capo_keyspacesstreams/types/iterator_position.py +17 -0
- capo_keyspacesstreams/types/keyspace_name.py +5 -0
- capo_keyspacesstreams/types/keyspaces_cell.py +63 -0
- capo_keyspacesstreams/types/keyspaces_cell_list.py +35 -0
- capo_keyspacesstreams/types/keyspaces_cell_map.py +39 -0
- capo_keyspacesstreams/types/keyspaces_cell_map_definition.py +83 -0
- capo_keyspacesstreams/types/keyspaces_cell_value.py +333 -0
- capo_keyspacesstreams/types/keyspaces_cells.py +35 -0
- capo_keyspacesstreams/types/keyspaces_keys_map.py +39 -0
- capo_keyspacesstreams/types/keyspaces_metadata.py +29 -0
- capo_keyspacesstreams/types/keyspaces_row.py +83 -0
- capo_keyspacesstreams/types/keyspaces_udt_map.py +35 -0
- capo_keyspacesstreams/types/list_streams_input.py +50 -0
- capo_keyspacesstreams/types/list_streams_output.py +47 -0
- capo_keyspacesstreams/types/origin_type.py +18 -0
- capo_keyspacesstreams/types/record.py +146 -0
- capo_keyspacesstreams/types/record_list.py +29 -0
- capo_keyspacesstreams/types/sequence_number.py +5 -0
- capo_keyspacesstreams/types/sequence_number_range.py +38 -0
- capo_keyspacesstreams/types/shard.py +70 -0
- capo_keyspacesstreams/types/shard_description_list.py +29 -0
- capo_keyspacesstreams/types/shard_filter.py +47 -0
- capo_keyspacesstreams/types/shard_filter_type.py +14 -0
- capo_keyspacesstreams/types/shard_id.py +5 -0
- capo_keyspacesstreams/types/shard_id_list.py +17 -0
- capo_keyspacesstreams/types/shard_id_token.py +5 -0
- capo_keyspacesstreams/types/shard_iterator.py +5 -0
- capo_keyspacesstreams/types/shard_iterator_type.py +19 -0
- capo_keyspacesstreams/types/stream.py +54 -0
- capo_keyspacesstreams/types/stream_arn.py +5 -0
- capo_keyspacesstreams/types/stream_arn_token.py +5 -0
- capo_keyspacesstreams/types/stream_list.py +29 -0
- capo_keyspacesstreams/types/stream_status.py +19 -0
- capo_keyspacesstreams/types/stream_view_type.py +19 -0
- capo_keyspacesstreams/types/table_name.py +5 -0
- capo_keyspacesstreams/types/validation_exception_type.py +19 -0
- capo_keyspacesstreams-0.1.0.dist-info/METADATA +101 -0
- capo_keyspacesstreams-0.1.0.dist-info/RECORD +85 -0
- capo_keyspacesstreams-0.1.0.dist-info/WHEEL +5 -0
- capo_keyspacesstreams-0.1.0.dist-info/licenses/LICENSE +21 -0
- capo_keyspacesstreams-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.keyspacesstreams#KeyspacesStreams``."""
|
|
2
|
+
|
|
3
|
+
import warnings
|
|
4
|
+
from collections.abc import AsyncIterator
|
|
5
|
+
from typing import TYPE_CHECKING, Any, Iterable, Optional
|
|
6
|
+
|
|
7
|
+
from typing_extensions import Self, TypedDict
|
|
8
|
+
from zapros import AsyncBaseHandler, AsyncClient
|
|
9
|
+
|
|
10
|
+
import capo_keyspacesstreams._auth._signers
|
|
11
|
+
import capo_keyspacesstreams._auth._sigv4
|
|
12
|
+
from capo_keyspacesstreams._auth._identity import Credentials
|
|
13
|
+
from capo_keyspacesstreams._auth._providers import (
|
|
14
|
+
CredentialsProvider,
|
|
15
|
+
IdentityProvider,
|
|
16
|
+
StaticAwsCredentialsProvider,
|
|
17
|
+
default_aws_credentials_chain,
|
|
18
|
+
)
|
|
19
|
+
from capo_keyspacesstreams._auth._zapros_handler import AuthMiddleware
|
|
20
|
+
from capo_keyspacesstreams._pagination import resolve_path as _resolve_path
|
|
21
|
+
from capo_keyspacesstreams._services._aws_config import aaws_config
|
|
22
|
+
from capo_keyspacesstreams._services._pipeline import (
|
|
23
|
+
AsyncInterceptor,
|
|
24
|
+
AsyncOperationOptions,
|
|
25
|
+
AsyncOperationRequest,
|
|
26
|
+
AsyncOperationResponse,
|
|
27
|
+
aexecute_pipeline,
|
|
28
|
+
aretry,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
if TYPE_CHECKING:
|
|
32
|
+
import capo_keyspacesstreams.types.get_records_input
|
|
33
|
+
import capo_keyspacesstreams.types.get_records_output
|
|
34
|
+
import capo_keyspacesstreams.types.get_shard_iterator_input
|
|
35
|
+
import capo_keyspacesstreams.types.get_shard_iterator_output
|
|
36
|
+
import capo_keyspacesstreams.types.get_stream_input
|
|
37
|
+
import capo_keyspacesstreams.types.get_stream_output
|
|
38
|
+
import capo_keyspacesstreams.types.keyspace_name
|
|
39
|
+
import capo_keyspacesstreams.types.list_streams_input
|
|
40
|
+
import capo_keyspacesstreams.types.list_streams_output
|
|
41
|
+
import capo_keyspacesstreams.types.sequence_number
|
|
42
|
+
import capo_keyspacesstreams.types.shard
|
|
43
|
+
import capo_keyspacesstreams.types.shard_filter
|
|
44
|
+
import capo_keyspacesstreams.types.shard_id
|
|
45
|
+
import capo_keyspacesstreams.types.shard_id_token
|
|
46
|
+
import capo_keyspacesstreams.types.shard_iterator
|
|
47
|
+
import capo_keyspacesstreams.types.shard_iterator_type
|
|
48
|
+
import capo_keyspacesstreams.types.stream
|
|
49
|
+
import capo_keyspacesstreams.types.stream_arn
|
|
50
|
+
import capo_keyspacesstreams.types.stream_arn_token
|
|
51
|
+
import capo_keyspacesstreams.types.table_name
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class AsyncKeyspacesStreamsClientConfig(TypedDict, total=False, closed=True):
|
|
55
|
+
operation_interceptors: Iterable[AsyncInterceptor[Any, Any]]
|
|
56
|
+
retry_max_attempts: int | None
|
|
57
|
+
use_fips: bool | None
|
|
58
|
+
endpoint: str | None
|
|
59
|
+
region: str | None
|
|
60
|
+
credentials_provider: IdentityProvider[Credentials] | None
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class AsyncKeyspacesStreamsClient:
|
|
64
|
+
"""A client for the ``KeyspacesStreams`` service.
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
http_handler: HTTP handler for sending requests. If not provided, creates a default handler.
|
|
68
|
+
operation_interceptors: Interceptors that wrap every operation call. If not provided, defaults to an empty list.
|
|
69
|
+
retry_max_attempts: Maximum number of times to retry a failed operation. Defaults to 3.
|
|
70
|
+
use_fips: The value of the ``AWS::UseFIPS`` endpoint parameter.
|
|
71
|
+
endpoint: The value of the ``SDK::Endpoint`` endpoint parameter.
|
|
72
|
+
region: The value of the ``AWS::Region`` endpoint parameter.
|
|
73
|
+
credentials: AWS credentials for request signing.
|
|
74
|
+
credentials_provider: Provider that resolves AWS credentials. Takes precedence over ``credentials``.
|
|
75
|
+
"""
|
|
76
|
+
|
|
77
|
+
def __init__(
|
|
78
|
+
self,
|
|
79
|
+
http_handler: AsyncBaseHandler | None = None,
|
|
80
|
+
operation_interceptors: Iterable[AsyncInterceptor[Any, Any]] | None = None,
|
|
81
|
+
retry_max_attempts: int | None = None,
|
|
82
|
+
use_fips: bool | None = None,
|
|
83
|
+
endpoint: str | None = None,
|
|
84
|
+
region: str | None = None,
|
|
85
|
+
credentials: Credentials | None = None,
|
|
86
|
+
credentials_provider: CredentialsProvider | None = None,
|
|
87
|
+
):
|
|
88
|
+
self._client = AsyncClient(http_handler).wrap_with_middleware(
|
|
89
|
+
lambda next: AuthMiddleware(next)
|
|
90
|
+
)
|
|
91
|
+
if credentials is not None and credentials_provider is not None:
|
|
92
|
+
warnings.warn(
|
|
93
|
+
"Both credentials and credentials_provider given; provider takes precedence"
|
|
94
|
+
)
|
|
95
|
+
resolved_credentials_provider: IdentityProvider[Credentials] | None = (
|
|
96
|
+
credentials_provider
|
|
97
|
+
)
|
|
98
|
+
if resolved_credentials_provider is None and credentials is not None:
|
|
99
|
+
resolved_credentials_provider = StaticAwsCredentialsProvider(credentials)
|
|
100
|
+
if resolved_credentials_provider is None and credentials is None:
|
|
101
|
+
resolved_credentials_provider = default_aws_credentials_chain(
|
|
102
|
+
AsyncClient(http_handler)
|
|
103
|
+
)
|
|
104
|
+
self._config = AsyncKeyspacesStreamsClientConfig(
|
|
105
|
+
{
|
|
106
|
+
"operation_interceptors": operation_interceptors or [],
|
|
107
|
+
"retry_max_attempts": retry_max_attempts,
|
|
108
|
+
"use_fips": use_fips,
|
|
109
|
+
"endpoint": endpoint,
|
|
110
|
+
"region": region,
|
|
111
|
+
"credentials_provider": resolved_credentials_provider,
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
def operation_options(
|
|
116
|
+
self, config_overrides: Optional[AsyncKeyspacesStreamsClientConfig] = None
|
|
117
|
+
) -> tuple[Iterable[AsyncInterceptor[Any, Any]], AsyncOperationOptions]:
|
|
118
|
+
overrides: AsyncKeyspacesStreamsClientConfig = config_overrides or {}
|
|
119
|
+
interceptors_: list[AsyncInterceptor[Any, Any]] = [
|
|
120
|
+
*overrides.get(
|
|
121
|
+
"operation_interceptors", self._config.get("operation_interceptors", [])
|
|
122
|
+
),
|
|
123
|
+
aaws_config(),
|
|
124
|
+
aretry(),
|
|
125
|
+
]
|
|
126
|
+
options_: AsyncOperationOptions = AsyncOperationOptions(
|
|
127
|
+
client=self._client,
|
|
128
|
+
retry_max_attempts=overrides.get(
|
|
129
|
+
"retry_max_attempts", self._config.get("retry_max_attempts")
|
|
130
|
+
),
|
|
131
|
+
use_fips=overrides.get("use_fips", self._config.get("use_fips")),
|
|
132
|
+
endpoint=overrides.get("endpoint", self._config.get("endpoint")),
|
|
133
|
+
region=overrides.get("region", self._config.get("region")),
|
|
134
|
+
credentials_provider=overrides.get(
|
|
135
|
+
"credentials_provider", self._config.get("credentials_provider")
|
|
136
|
+
),
|
|
137
|
+
)
|
|
138
|
+
return interceptors_, options_
|
|
139
|
+
|
|
140
|
+
async def get_records(
|
|
141
|
+
self,
|
|
142
|
+
shard_iterator: "capo_keyspacesstreams.types.shard_iterator.ShardIterator",
|
|
143
|
+
*,
|
|
144
|
+
config_overrides: Optional[AsyncKeyspacesStreamsClientConfig] = None,
|
|
145
|
+
max_results: Optional[int] = None,
|
|
146
|
+
) -> "capo_keyspacesstreams.types.get_records_output.GetRecordsOutput":
|
|
147
|
+
"""<p>Retrieves data records from a specified shard in an Amazon Keyspaces data stream. This operation returns a collection of data records from the shard, including the primary key columns and information about modifications made to the captured table data. Each record represents a single data modification in the Amazon Keyspaces table and includes metadata about when the change occurred.</p>
|
|
148
|
+
|
|
149
|
+
Args:
|
|
150
|
+
shard_iterator: <p> The unique identifier of the shard iterator. A shard iterator specifies the position in the shard from which you want to start reading data records sequentially. You obtain this value by calling the <code>GetShardIterator </code> operation. Each shard iterator is valid for 15 minutes after creation. </p>
|
|
151
|
+
max_results: <p> The maximum number of records to return in a single <code>GetRecords</code> request. The default value is 100. You can specify a limit between 1 and 1000, but the actual number returned might be less than the specified maximum if the size of the data for the returned records exceeds the internal size limit. </p>
|
|
152
|
+
|
|
153
|
+
Raises:
|
|
154
|
+
capo_keyspacesstreams.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this operation. </p> <p>This exception occurs when your IAM user or role lacks the required permissions to access the Amazon Keyspaces resource or perform the requested action. Check your IAM policies and ensure they grant the necessary permissions.</p>
|
|
155
|
+
capo_keyspacesstreams.errors.internal_server_exception.InternalServerException: <p>The Amazon Keyspaces service encountered an unexpected error while processing the request. </p> <p>This internal server error is not related to your request parameters. Retry your request after a brief delay. If the issue persists, contact Amazon Web Services Support with details of your request to help identify and resolve the problem.</p>
|
|
156
|
+
capo_keyspacesstreams.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource doesn't exist or could not be found. </p> <p>This exception occurs when you attempt to access a keyspace, table, stream, or other Amazon Keyspaces resource that doesn't exist or that has been deleted. Verify that the resource identifier is correct and that the resource exists in your account.</p>
|
|
157
|
+
capo_keyspacesstreams.errors.throttling_exception.ThrottlingException: <p>The request rate is too high and exceeds the service's throughput limits. </p> <p>This exception occurs when you send too many requests in a short period of time. Implement exponential backoff in your retry strategy to handle this exception. Reducing your request frequency or distributing requests more evenly can help avoid throughput exceptions.</p> <p>This exception can also occur when more than two processes are reading from the same stream shard at the same time. Ensure that only one process reads from a stream shard at the same time. </p>
|
|
158
|
+
capo_keyspacesstreams.errors.validation_exception.ValidationException: <p>The request validation failed because one or more input parameters failed validation. </p> <p>This exception occurs when there are syntax errors in the request, field constraints are violated, or required parameters are missing. To help you fix the issue, the exception message provides details about which parameter failed and why.</p>
|
|
159
|
+
capo_keyspacesstreams.errors.UnknownServiceError: The service returned an error code this client does not model.
|
|
160
|
+
"""
|
|
161
|
+
|
|
162
|
+
async def _handler(
|
|
163
|
+
req: "AsyncOperationRequest[capo_keyspacesstreams.types.get_records_input.GetRecordsInput]",
|
|
164
|
+
) -> AsyncOperationResponse[
|
|
165
|
+
"capo_keyspacesstreams.types.get_records_output.GetRecordsOutput"
|
|
166
|
+
]:
|
|
167
|
+
import capo_keyspacesstreams._operations.keyspaces_streams.get_records
|
|
168
|
+
|
|
169
|
+
(
|
|
170
|
+
output,
|
|
171
|
+
http_response,
|
|
172
|
+
) = await capo_keyspacesstreams._operations.keyspaces_streams.get_records.async_get_records(
|
|
173
|
+
req.options, req.input
|
|
174
|
+
)
|
|
175
|
+
return AsyncOperationResponse(output=output, response=http_response)
|
|
176
|
+
|
|
177
|
+
interceptors_, options_ = self.operation_options(config_overrides)
|
|
178
|
+
input_: capo_keyspacesstreams.types.get_records_input.GetRecordsInput = {
|
|
179
|
+
"shard_iterator": shard_iterator
|
|
180
|
+
}
|
|
181
|
+
if max_results is not None:
|
|
182
|
+
input_["max_results"] = max_results
|
|
183
|
+
|
|
184
|
+
response = await aexecute_pipeline(
|
|
185
|
+
AsyncOperationRequest(input=input_, options=options_),
|
|
186
|
+
handler=_handler,
|
|
187
|
+
interceptors=list(interceptors_),
|
|
188
|
+
)
|
|
189
|
+
await response.response.aclose()
|
|
190
|
+
return response.output
|
|
191
|
+
|
|
192
|
+
async def get_shard_iterator(
|
|
193
|
+
self,
|
|
194
|
+
stream_arn: "capo_keyspacesstreams.types.stream_arn.StreamArn",
|
|
195
|
+
shard_id: "capo_keyspacesstreams.types.shard_id.ShardId",
|
|
196
|
+
shard_iterator_type: "capo_keyspacesstreams.types.shard_iterator_type.ShardIteratorType",
|
|
197
|
+
*,
|
|
198
|
+
config_overrides: Optional[AsyncKeyspacesStreamsClientConfig] = None,
|
|
199
|
+
sequence_number: Optional[
|
|
200
|
+
"capo_keyspacesstreams.types.sequence_number.SequenceNumber"
|
|
201
|
+
] = None,
|
|
202
|
+
) -> "capo_keyspacesstreams.types.get_shard_iterator_output.GetShardIteratorOutput":
|
|
203
|
+
"""<p>Returns a shard iterator that serves as a bookmark for reading data from a specific position in an Amazon Keyspaces data stream's shard. The shard iterator specifies the shard position from which to start reading data records sequentially. You can specify whether to begin reading at the latest record, the oldest record, or at a particular sequence number within the shard.</p>
|
|
204
|
+
|
|
205
|
+
Args:
|
|
206
|
+
stream_arn: <p> The Amazon Resource Name (ARN) of the stream for which to get the shard iterator. The ARN uniquely identifies the stream within Amazon Keyspaces. </p>
|
|
207
|
+
shard_id: <p> The identifier of the shard within the stream. The shard ID uniquely identifies a subset of the stream's data records that you want to access. </p>
|
|
208
|
+
shard_iterator_type: <p> Determines how the shard iterator is positioned. Must be one of the following: </p> <ul> <li> <p> <code>TRIM_HORIZON</code> - Start reading at the last untrimmed record in the shard, which is the oldest data record in the shard.</p> </li> <li> <p> <code>AT_SEQUENCE_NUMBER</code> - Start reading exactly from the specified sequence number.</p> </li> <li> <p> <code>AFTER_SEQUENCE_NUMBER</code> - Start reading right after the specified sequence number. </p> </li> <li> <p> <code>LATEST</code> - Start reading just after the most recent record in the shard, so that you always read the most recent data. </p> </li> </ul>
|
|
209
|
+
sequence_number: <p> The sequence number of the data record in the shard from which to start reading. Required if <code>ShardIteratorType</code> is <code>AT_SEQUENCE_NUMBER</code> or <code>AFTER_SEQUENCE_NUMBER</code>. This parameter is ignored for other iterator types. </p>
|
|
210
|
+
|
|
211
|
+
Raises:
|
|
212
|
+
capo_keyspacesstreams.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this operation. </p> <p>This exception occurs when your IAM user or role lacks the required permissions to access the Amazon Keyspaces resource or perform the requested action. Check your IAM policies and ensure they grant the necessary permissions.</p>
|
|
213
|
+
capo_keyspacesstreams.errors.internal_server_exception.InternalServerException: <p>The Amazon Keyspaces service encountered an unexpected error while processing the request. </p> <p>This internal server error is not related to your request parameters. Retry your request after a brief delay. If the issue persists, contact Amazon Web Services Support with details of your request to help identify and resolve the problem.</p>
|
|
214
|
+
capo_keyspacesstreams.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource doesn't exist or could not be found. </p> <p>This exception occurs when you attempt to access a keyspace, table, stream, or other Amazon Keyspaces resource that doesn't exist or that has been deleted. Verify that the resource identifier is correct and that the resource exists in your account.</p>
|
|
215
|
+
capo_keyspacesstreams.errors.throttling_exception.ThrottlingException: <p>The request rate is too high and exceeds the service's throughput limits. </p> <p>This exception occurs when you send too many requests in a short period of time. Implement exponential backoff in your retry strategy to handle this exception. Reducing your request frequency or distributing requests more evenly can help avoid throughput exceptions.</p> <p>This exception can also occur when more than two processes are reading from the same stream shard at the same time. Ensure that only one process reads from a stream shard at the same time. </p>
|
|
216
|
+
capo_keyspacesstreams.errors.validation_exception.ValidationException: <p>The request validation failed because one or more input parameters failed validation. </p> <p>This exception occurs when there are syntax errors in the request, field constraints are violated, or required parameters are missing. To help you fix the issue, the exception message provides details about which parameter failed and why.</p>
|
|
217
|
+
capo_keyspacesstreams.errors.UnknownServiceError: The service returned an error code this client does not model.
|
|
218
|
+
"""
|
|
219
|
+
|
|
220
|
+
async def _handler(
|
|
221
|
+
req: "AsyncOperationRequest[capo_keyspacesstreams.types.get_shard_iterator_input.GetShardIteratorInput]",
|
|
222
|
+
) -> AsyncOperationResponse[
|
|
223
|
+
"capo_keyspacesstreams.types.get_shard_iterator_output.GetShardIteratorOutput"
|
|
224
|
+
]:
|
|
225
|
+
import capo_keyspacesstreams._operations.keyspaces_streams.get_shard_iterator
|
|
226
|
+
|
|
227
|
+
(
|
|
228
|
+
output,
|
|
229
|
+
http_response,
|
|
230
|
+
) = await capo_keyspacesstreams._operations.keyspaces_streams.get_shard_iterator.async_get_shard_iterator(
|
|
231
|
+
req.options, req.input
|
|
232
|
+
)
|
|
233
|
+
return AsyncOperationResponse(output=output, response=http_response)
|
|
234
|
+
|
|
235
|
+
interceptors_, options_ = self.operation_options(config_overrides)
|
|
236
|
+
input_: capo_keyspacesstreams.types.get_shard_iterator_input.GetShardIteratorInput = {
|
|
237
|
+
"stream_arn": stream_arn,
|
|
238
|
+
"shard_id": shard_id,
|
|
239
|
+
"shard_iterator_type": shard_iterator_type,
|
|
240
|
+
}
|
|
241
|
+
if sequence_number is not None:
|
|
242
|
+
input_["sequence_number"] = sequence_number
|
|
243
|
+
|
|
244
|
+
response = await aexecute_pipeline(
|
|
245
|
+
AsyncOperationRequest(input=input_, options=options_),
|
|
246
|
+
handler=_handler,
|
|
247
|
+
interceptors=list(interceptors_),
|
|
248
|
+
)
|
|
249
|
+
await response.response.aclose()
|
|
250
|
+
return response.output
|
|
251
|
+
|
|
252
|
+
async def get_stream(
|
|
253
|
+
self,
|
|
254
|
+
stream_arn: "capo_keyspacesstreams.types.stream_arn.StreamArn",
|
|
255
|
+
*,
|
|
256
|
+
config_overrides: Optional[AsyncKeyspacesStreamsClientConfig] = None,
|
|
257
|
+
max_results: Optional[int] = None,
|
|
258
|
+
shard_filter: Optional[
|
|
259
|
+
"capo_keyspacesstreams.types.shard_filter.ShardFilter"
|
|
260
|
+
] = None,
|
|
261
|
+
next_token: Optional[
|
|
262
|
+
"capo_keyspacesstreams.types.shard_id_token.ShardIdToken"
|
|
263
|
+
] = None,
|
|
264
|
+
) -> "capo_keyspacesstreams.types.get_stream_output.GetStreamOutput":
|
|
265
|
+
"""<p>Returns detailed information about a specific data capture stream for an Amazon Keyspaces table. The information includes the stream's Amazon Resource Name (ARN), creation time, current status, retention period, shard composition, and associated table details. This operation helps you monitor and manage the configuration of your Amazon Keyspaces data streams.</p>
|
|
266
|
+
|
|
267
|
+
Args:
|
|
268
|
+
stream_arn: <p> The Amazon Resource Name (ARN) of the stream for which detailed information is requested. This uniquely identifies the specific stream you want to get information about. </p>
|
|
269
|
+
max_results: <p> The maximum number of shard objects to return in a single <code>GetStream</code> request. The default value is 100. The minimum value is 1 and the maximum value is 100. </p>
|
|
270
|
+
shard_filter: <p> Optional filter criteria to apply when retrieving shards. You can filter shards based on their parent <code>shardID</code> to get a list of children shards to narrow down the results returned by the <code>GetStream</code> operation. </p>
|
|
271
|
+
next_token: <p> An optional pagination token provided by a previous <code>GetStream</code> operation. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxResults</code>. </p>
|
|
272
|
+
|
|
273
|
+
Raises:
|
|
274
|
+
capo_keyspacesstreams.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this operation. </p> <p>This exception occurs when your IAM user or role lacks the required permissions to access the Amazon Keyspaces resource or perform the requested action. Check your IAM policies and ensure they grant the necessary permissions.</p>
|
|
275
|
+
capo_keyspacesstreams.errors.internal_server_exception.InternalServerException: <p>The Amazon Keyspaces service encountered an unexpected error while processing the request. </p> <p>This internal server error is not related to your request parameters. Retry your request after a brief delay. If the issue persists, contact Amazon Web Services Support with details of your request to help identify and resolve the problem.</p>
|
|
276
|
+
capo_keyspacesstreams.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource doesn't exist or could not be found. </p> <p>This exception occurs when you attempt to access a keyspace, table, stream, or other Amazon Keyspaces resource that doesn't exist or that has been deleted. Verify that the resource identifier is correct and that the resource exists in your account.</p>
|
|
277
|
+
capo_keyspacesstreams.errors.throttling_exception.ThrottlingException: <p>The request rate is too high and exceeds the service's throughput limits. </p> <p>This exception occurs when you send too many requests in a short period of time. Implement exponential backoff in your retry strategy to handle this exception. Reducing your request frequency or distributing requests more evenly can help avoid throughput exceptions.</p> <p>This exception can also occur when more than two processes are reading from the same stream shard at the same time. Ensure that only one process reads from a stream shard at the same time. </p>
|
|
278
|
+
capo_keyspacesstreams.errors.validation_exception.ValidationException: <p>The request validation failed because one or more input parameters failed validation. </p> <p>This exception occurs when there are syntax errors in the request, field constraints are violated, or required parameters are missing. To help you fix the issue, the exception message provides details about which parameter failed and why.</p>
|
|
279
|
+
capo_keyspacesstreams.errors.UnknownServiceError: The service returned an error code this client does not model.
|
|
280
|
+
"""
|
|
281
|
+
|
|
282
|
+
async def _handler(
|
|
283
|
+
req: "AsyncOperationRequest[capo_keyspacesstreams.types.get_stream_input.GetStreamInput]",
|
|
284
|
+
) -> AsyncOperationResponse[
|
|
285
|
+
"capo_keyspacesstreams.types.get_stream_output.GetStreamOutput"
|
|
286
|
+
]:
|
|
287
|
+
import capo_keyspacesstreams._operations.keyspaces_streams.get_stream
|
|
288
|
+
|
|
289
|
+
(
|
|
290
|
+
output,
|
|
291
|
+
http_response,
|
|
292
|
+
) = await capo_keyspacesstreams._operations.keyspaces_streams.get_stream.async_get_stream(
|
|
293
|
+
req.options, req.input
|
|
294
|
+
)
|
|
295
|
+
return AsyncOperationResponse(output=output, response=http_response)
|
|
296
|
+
|
|
297
|
+
interceptors_, options_ = self.operation_options(config_overrides)
|
|
298
|
+
input_: capo_keyspacesstreams.types.get_stream_input.GetStreamInput = {
|
|
299
|
+
"stream_arn": stream_arn
|
|
300
|
+
}
|
|
301
|
+
if max_results is not None:
|
|
302
|
+
input_["max_results"] = max_results
|
|
303
|
+
if shard_filter is not None:
|
|
304
|
+
input_["shard_filter"] = shard_filter
|
|
305
|
+
if next_token is not None:
|
|
306
|
+
input_["next_token"] = next_token
|
|
307
|
+
|
|
308
|
+
response = await aexecute_pipeline(
|
|
309
|
+
AsyncOperationRequest(input=input_, options=options_),
|
|
310
|
+
handler=_handler,
|
|
311
|
+
interceptors=list(interceptors_),
|
|
312
|
+
)
|
|
313
|
+
await response.response.aclose()
|
|
314
|
+
return response.output
|
|
315
|
+
|
|
316
|
+
async def iter_get_stream(
|
|
317
|
+
self,
|
|
318
|
+
stream_arn: "capo_keyspacesstreams.types.stream_arn.StreamArn",
|
|
319
|
+
*,
|
|
320
|
+
config_overrides: Optional[AsyncKeyspacesStreamsClientConfig] = None,
|
|
321
|
+
max_results: Optional[int] = None,
|
|
322
|
+
shard_filter: Optional[
|
|
323
|
+
"capo_keyspacesstreams.types.shard_filter.ShardFilter"
|
|
324
|
+
] = None,
|
|
325
|
+
next_token: Optional[
|
|
326
|
+
"capo_keyspacesstreams.types.shard_id_token.ShardIdToken"
|
|
327
|
+
] = None,
|
|
328
|
+
) -> "AsyncIterator[capo_keyspacesstreams.types.shard.Shard]":
|
|
329
|
+
_token = next_token
|
|
330
|
+
while True:
|
|
331
|
+
_response = await self.get_stream(
|
|
332
|
+
stream_arn,
|
|
333
|
+
config_overrides=config_overrides,
|
|
334
|
+
max_results=max_results,
|
|
335
|
+
shard_filter=shard_filter,
|
|
336
|
+
next_token=_token,
|
|
337
|
+
)
|
|
338
|
+
_page = _resolve_path(_response, ("shards",))
|
|
339
|
+
for _item in _page or []:
|
|
340
|
+
yield _item
|
|
341
|
+
_token = _resolve_path(_response, ("next_token",))
|
|
342
|
+
if not _token:
|
|
343
|
+
break
|
|
344
|
+
|
|
345
|
+
async def list_streams(
|
|
346
|
+
self,
|
|
347
|
+
*,
|
|
348
|
+
config_overrides: Optional[AsyncKeyspacesStreamsClientConfig] = None,
|
|
349
|
+
keyspace_name: Optional[
|
|
350
|
+
"capo_keyspacesstreams.types.keyspace_name.KeyspaceName"
|
|
351
|
+
] = None,
|
|
352
|
+
table_name: Optional["capo_keyspacesstreams.types.table_name.TableName"] = None,
|
|
353
|
+
max_results: Optional[int] = None,
|
|
354
|
+
next_token: Optional[
|
|
355
|
+
"capo_keyspacesstreams.types.stream_arn_token.StreamArnToken"
|
|
356
|
+
] = None,
|
|
357
|
+
) -> "capo_keyspacesstreams.types.list_streams_output.ListStreamsOutput":
|
|
358
|
+
"""<p>Returns a list of all data capture streams associated with your Amazon Keyspaces account or for a specific keyspace or table. The response includes information such as stream ARNs, table associations, creation timestamps, and current status. This operation helps you discover and manage all active data streams in your Amazon Keyspaces environment.</p>
|
|
359
|
+
|
|
360
|
+
Args:
|
|
361
|
+
keyspace_name: <p> The name of the keyspace for which to list streams. If specified, only streams associated with tables in this keyspace are returned. If omitted, streams from all keyspaces are included in the results. </p>
|
|
362
|
+
table_name: <p> The name of the table for which to list streams. Must be used together with <code>keyspaceName</code>. If specified, only streams associated with this specific table are returned. </p>
|
|
363
|
+
max_results: <p> The maximum number of streams to return in a single <code>ListStreams</code> request. The default value is 100. The minimum value is 1 and the maximum value is 100. </p>
|
|
364
|
+
next_token: <p> An optional pagination token provided by a previous <code>ListStreams</code> operation. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>maxResults</code>. </p>
|
|
365
|
+
|
|
366
|
+
Raises:
|
|
367
|
+
capo_keyspacesstreams.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this operation. </p> <p>This exception occurs when your IAM user or role lacks the required permissions to access the Amazon Keyspaces resource or perform the requested action. Check your IAM policies and ensure they grant the necessary permissions.</p>
|
|
368
|
+
capo_keyspacesstreams.errors.internal_server_exception.InternalServerException: <p>The Amazon Keyspaces service encountered an unexpected error while processing the request. </p> <p>This internal server error is not related to your request parameters. Retry your request after a brief delay. If the issue persists, contact Amazon Web Services Support with details of your request to help identify and resolve the problem.</p>
|
|
369
|
+
capo_keyspacesstreams.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource doesn't exist or could not be found. </p> <p>This exception occurs when you attempt to access a keyspace, table, stream, or other Amazon Keyspaces resource that doesn't exist or that has been deleted. Verify that the resource identifier is correct and that the resource exists in your account.</p>
|
|
370
|
+
capo_keyspacesstreams.errors.throttling_exception.ThrottlingException: <p>The request rate is too high and exceeds the service's throughput limits. </p> <p>This exception occurs when you send too many requests in a short period of time. Implement exponential backoff in your retry strategy to handle this exception. Reducing your request frequency or distributing requests more evenly can help avoid throughput exceptions.</p> <p>This exception can also occur when more than two processes are reading from the same stream shard at the same time. Ensure that only one process reads from a stream shard at the same time. </p>
|
|
371
|
+
capo_keyspacesstreams.errors.validation_exception.ValidationException: <p>The request validation failed because one or more input parameters failed validation. </p> <p>This exception occurs when there are syntax errors in the request, field constraints are violated, or required parameters are missing. To help you fix the issue, the exception message provides details about which parameter failed and why.</p>
|
|
372
|
+
capo_keyspacesstreams.errors.UnknownServiceError: The service returned an error code this client does not model.
|
|
373
|
+
"""
|
|
374
|
+
|
|
375
|
+
async def _handler(
|
|
376
|
+
req: "AsyncOperationRequest[capo_keyspacesstreams.types.list_streams_input.ListStreamsInput]",
|
|
377
|
+
) -> AsyncOperationResponse[
|
|
378
|
+
"capo_keyspacesstreams.types.list_streams_output.ListStreamsOutput"
|
|
379
|
+
]:
|
|
380
|
+
import capo_keyspacesstreams._operations.keyspaces_streams.list_streams
|
|
381
|
+
|
|
382
|
+
(
|
|
383
|
+
output,
|
|
384
|
+
http_response,
|
|
385
|
+
) = await capo_keyspacesstreams._operations.keyspaces_streams.list_streams.async_list_streams(
|
|
386
|
+
req.options, req.input
|
|
387
|
+
)
|
|
388
|
+
return AsyncOperationResponse(output=output, response=http_response)
|
|
389
|
+
|
|
390
|
+
interceptors_, options_ = self.operation_options(config_overrides)
|
|
391
|
+
input_: capo_keyspacesstreams.types.list_streams_input.ListStreamsInput = {}
|
|
392
|
+
if keyspace_name is not None:
|
|
393
|
+
input_["keyspace_name"] = keyspace_name
|
|
394
|
+
if table_name is not None:
|
|
395
|
+
input_["table_name"] = table_name
|
|
396
|
+
if max_results is not None:
|
|
397
|
+
input_["max_results"] = max_results
|
|
398
|
+
if next_token is not None:
|
|
399
|
+
input_["next_token"] = next_token
|
|
400
|
+
|
|
401
|
+
response = await aexecute_pipeline(
|
|
402
|
+
AsyncOperationRequest(input=input_, options=options_),
|
|
403
|
+
handler=_handler,
|
|
404
|
+
interceptors=list(interceptors_),
|
|
405
|
+
)
|
|
406
|
+
await response.response.aclose()
|
|
407
|
+
return response.output
|
|
408
|
+
|
|
409
|
+
async def iter_list_streams(
|
|
410
|
+
self,
|
|
411
|
+
*,
|
|
412
|
+
config_overrides: Optional[AsyncKeyspacesStreamsClientConfig] = None,
|
|
413
|
+
keyspace_name: Optional[
|
|
414
|
+
"capo_keyspacesstreams.types.keyspace_name.KeyspaceName"
|
|
415
|
+
] = None,
|
|
416
|
+
table_name: Optional["capo_keyspacesstreams.types.table_name.TableName"] = None,
|
|
417
|
+
max_results: Optional[int] = None,
|
|
418
|
+
next_token: Optional[
|
|
419
|
+
"capo_keyspacesstreams.types.stream_arn_token.StreamArnToken"
|
|
420
|
+
] = None,
|
|
421
|
+
) -> "AsyncIterator[capo_keyspacesstreams.types.stream.Stream]":
|
|
422
|
+
_token = next_token
|
|
423
|
+
while True:
|
|
424
|
+
_response = await self.list_streams(
|
|
425
|
+
config_overrides=config_overrides,
|
|
426
|
+
keyspace_name=keyspace_name,
|
|
427
|
+
table_name=table_name,
|
|
428
|
+
max_results=max_results,
|
|
429
|
+
next_token=_token,
|
|
430
|
+
)
|
|
431
|
+
_page = _resolve_path(_response, ("streams",))
|
|
432
|
+
for _item in _page or []:
|
|
433
|
+
yield _item
|
|
434
|
+
_token = _resolve_path(_response, ("next_token",))
|
|
435
|
+
if not _token:
|
|
436
|
+
break
|
|
437
|
+
|
|
438
|
+
async def __aenter__(self) -> Self:
|
|
439
|
+
return self
|
|
440
|
+
|
|
441
|
+
async def __aexit__(self, exc_type: Any, exc: Any, tb: Any):
|
|
442
|
+
await self._client.aclose()
|