Skip to content

Timestream write

async_boto.clients.timestream_write

logger module-attribute

logger = getLogger(__name__)

T module-attribute

T = TypeVar('T', bound=BaseModel)

AsyncTimestreamWriteClient

AsyncTimestreamWriteClient(aws_session)

Bases: BaseClient

Source code in async_boto/clients/timestream_write.py
92
93
94
95
96
def __init__(self, aws_session: boto3.Session | AsyncAWSSession):
    super().__init__(aws_session=aws_session, service_name="timestream")
    self._url = (
        f"https://ingest.timestream.{self._aws_session.region_name}.amazonaws.com"
    )

describe_endpoints async

describe_endpoints()
Source code in async_boto/clients/timestream_write.py
114
115
116
117
118
119
120
121
122
123
async def describe_endpoints(self):
    headers = {
        "Content-Type": "application/x-amz-json-1.0",
        "X-Amz-Target": "Timestream_20181101.DescribeEndpoints",
        "x-amz-api-version": "2018-11-01",
    }
    resp = await self._post(url=self._url, headers=headers, json={})
    print(resp.json)
    resp.raise_for_status()
    return DescribeEndpointsResponse(**resp.json)

create_batch_load_task async

create_batch_load_task(request)
Source code in async_boto/clients/timestream_write.py
125
126
127
128
129
130
131
132
133
134
135
async def create_batch_load_task(
    self, request: CreateBatchLoadTaskRequest
) -> CreateBatchLoadTaskResponse:
    endpoint = await self.describe_endpoints()
    endpoint_to_use = random.choice(endpoint.Endpoints)
    return await self._make_request(
        "Timestream_20181101.CreateBatchLoadTask",
        request,
        CreateBatchLoadTaskResponse,
        url=f"https://{endpoint_to_use.Address}",
    )

create_database async

create_database(request)
Source code in async_boto/clients/timestream_write.py
137
138
139
140
141
142
143
144
145
146
147
async def create_database(
    self, request: CreateDatabaseRequest
) -> CreateDatabaseResponse:
    endpoint = await self.describe_endpoints()
    endpoint_to_use = random.choice(endpoint.Endpoints)
    return await self._make_request(
        "Timestream_20181101.CreateDatabase",
        request,
        CreateDatabaseResponse,
        url=f"https://{endpoint_to_use.Address}",
    )

create_table async

create_table(request)
Source code in async_boto/clients/timestream_write.py
149
150
151
152
153
154
155
156
157
async def create_table(self, request: CreateTableRequest) -> CreateTableResponse:
    endpoint = await self.describe_endpoints()
    endpoint_to_use = random.choice(endpoint.Endpoints)
    return await self._make_request(
        "Timestream_20181101.CreateTable",
        request,
        CreateTableResponse,
        url=f"https://{endpoint_to_use.Address}",
    )

delete_database async

delete_database(request)
Source code in async_boto/clients/timestream_write.py
159
160
161
162
163
164
165
166
167
168
169
async def delete_database(
    self, request: DeleteDatabaseRequest
) -> DeleteDatabaseResponse:
    endpoint = await self.describe_endpoints()
    endpoint_to_use = random.choice(endpoint.Endpoints)
    return await self._make_request(
        "Timestream_20181101.DeleteDatabase",
        request,
        DeleteDatabaseResponse,
        url=f"https://{endpoint_to_use.Address}",
    )

delete_table async

delete_table(request)
Source code in async_boto/clients/timestream_write.py
171
172
173
174
175
176
177
178
179
async def delete_table(self, request: DeleteTableRequest) -> DeleteTableResponse:
    endpoint = await self.describe_endpoints()
    endpoint_to_use = random.choice(endpoint.Endpoints)
    return await self._make_request(
        "Timestream_20181101.DeleteTable",
        request,
        DeleteTableResponse,
        url=f"https://{endpoint_to_use.Address}",
    )

describe_batch_load_task async

describe_batch_load_task(request)
Source code in async_boto/clients/timestream_write.py
181
182
183
184
185
186
187
188
189
190
191
async def describe_batch_load_task(
    self, request: DescribeBatchLoadTaskRequest
) -> DescribeBatchLoadTaskResponse:
    endpoint = await self.describe_endpoints()
    endpoint_to_use = random.choice(endpoint.Endpoints)
    return await self._make_request(
        "Timestream_20181101.DescribeBatchLoadTask",
        request,
        DescribeBatchLoadTaskResponse,
        url=f"https://{endpoint_to_use.Address}",
    )

describe_database async

describe_database(request)
Source code in async_boto/clients/timestream_write.py
193
194
195
196
197
198
199
200
201
202
203
async def describe_database(
    self, request: DescribeDatabaseRequest
) -> DescribeDatabaseResponse:
    endpoint = await self.describe_endpoints()
    endpoint_to_use = random.choice(endpoint.Endpoints)
    return await self._make_request(
        "Timestream_20181101.DescribeDatabase",
        request,
        DescribeDatabaseResponse,
        url=f"https://{endpoint_to_use.Address}",
    )

describe_table async

describe_table(request)
Source code in async_boto/clients/timestream_write.py
205
206
207
208
209
210
211
212
213
214
215
async def describe_table(
    self, request: DescribeTableRequest
) -> DescribeTableResponse:
    endpoint = await self.describe_endpoints()
    endpoint_to_use = random.choice(endpoint.Endpoints)
    return await self._make_request(
        "Timestream_20181101.DescribeTable",
        request,
        DescribeTableResponse,
        url=f"https://{endpoint_to_use.Address}",
    )

list_batch_load_tasks async

list_batch_load_tasks(request)
Source code in async_boto/clients/timestream_write.py
217
218
219
220
221
222
223
224
225
226
227
async def list_batch_load_tasks(
    self, request: ListBatchLoadTasksRequest
) -> ListBatchLoadTasksResponse:
    endpoint = await self.describe_endpoints()
    endpoint_to_use = random.choice(endpoint.Endpoints)
    return await self._make_request(
        "Timestream_20181101.ListBatchLoadTasks",
        request,
        ListBatchLoadTasksResponse,
        url=f"https://{endpoint_to_use.Address}",
    )

list_databases async

list_databases(request)
Source code in async_boto/clients/timestream_write.py
229
230
231
232
233
234
235
236
237
238
239
async def list_databases(
    self, request: ListDatabasesRequest
) -> ListDatabasesResponse:
    endpoint = await self.describe_endpoints()
    endpoint_to_use = random.choice(endpoint.Endpoints)
    return await self._make_request(
        "Timestream_20181101.ListDatabases",
        request,
        ListDatabasesResponse,
        url=f"https://{endpoint_to_use.Address}",
    )

list_tables async

list_tables(request)
Source code in async_boto/clients/timestream_write.py
241
242
243
244
245
246
247
248
249
async def list_tables(self, request: ListTablesRequest) -> ListTablesResponse:
    endpoint = await self.describe_endpoints()
    endpoint_to_use = random.choice(endpoint.Endpoints)
    return await self._make_request(
        "Timestream_20181101.ListTables",
        request,
        ListTablesResponse,
        url=f"https://{endpoint_to_use.Address}",
    )

list_tags_for_resource async

list_tags_for_resource(request)
Source code in async_boto/clients/timestream_write.py
251
252
253
254
255
256
257
258
259
260
261
async def list_tags_for_resource(
    self, request: ListTagsForResourceRequest
) -> ListTagsForResourceResponse:
    endpoint = await self.describe_endpoints()
    endpoint_to_use = random.choice(endpoint.Endpoints)
    return await self._make_request(
        "Timestream_20181101.ListTagsForResource",
        request,
        ListTagsForResourceResponse,
        url=f"https://{endpoint_to_use.Address}",
    )

resume_batch_load_task async

resume_batch_load_task(request)
Source code in async_boto/clients/timestream_write.py
263
264
265
266
267
268
269
270
271
272
273
async def resume_batch_load_task(
    self, request: ResumeBatchLoadTaskRequest
) -> ResumeBatchLoadTaskResponse:
    endpoint = await self.describe_endpoints()
    endpoint_to_use = random.choice(endpoint.Endpoints)
    return await self._make_request(
        "Timestream_20181101.ResumeBatchLoadTask",
        request,
        ResumeBatchLoadTaskResponse,
        url=f"https://{endpoint_to_use.Address}",
    )

tag_resource async

tag_resource(request)
Source code in async_boto/clients/timestream_write.py
275
276
277
278
279
280
281
282
283
async def tag_resource(self, request: TagResourceRequest) -> TagResourceResponse:
    endpoint = await self.describe_endpoints()
    endpoint_to_use = random.choice(endpoint.Endpoints)
    return await self._make_request(
        "Timestream_20181101.TagResource",
        request,
        TagResourceResponse,
        url=f"https://{endpoint_to_use.Address}",
    )

untag_resource async

untag_resource(request)
Source code in async_boto/clients/timestream_write.py
285
286
287
288
289
290
291
292
293
294
295
async def untag_resource(
    self, request: UntagResourceRequest
) -> UntagResourceResponse:
    endpoint = await self.describe_endpoints()
    endpoint_to_use = random.choice(endpoint.Endpoints)
    return await self._make_request(
        "Timestream_20181101.UntagResource",
        request,
        UntagResourceResponse,
        url=f"https://{endpoint_to_use.Address}",
    )

update_database async

update_database(request)
Source code in async_boto/clients/timestream_write.py
297
298
299
300
301
302
303
304
305
306
307
async def update_database(
    self, request: UpdateDatabaseRequest
) -> UpdateDatabaseResponse:
    endpoint = await self.describe_endpoints()
    endpoint_to_use = random.choice(endpoint.Endpoints)
    return await self._make_request(
        "Timestream_20181101.UpdateDatabase",
        request,
        UpdateDatabaseResponse,
        url=f"https://{endpoint_to_use.Address}",
    )

update_table async

update_table(request)
Source code in async_boto/clients/timestream_write.py
309
310
311
312
313
314
315
316
317
async def update_table(self, request: UpdateTableRequest) -> UpdateTableResponse:
    endpoint = await self.describe_endpoints()
    endpoint_to_use = random.choice(endpoint.Endpoints)
    return await self._make_request(
        "Timestream_20181101.UpdateTable",
        request,
        UpdateTableResponse,
        url=f"https://{endpoint_to_use.Address}",
    )

write_records async

write_records(request)
Source code in async_boto/clients/timestream_write.py
319
320
321
322
323
324
325
326
327
async def write_records(self, request: WriteRecordsRequest) -> WriteRecordsResponse:
    endpoint = await self.describe_endpoints()
    endpoint_to_use = random.choice(endpoint.Endpoints)
    return await self._make_request(
        "Timestream_20181101.WriteRecords",
        request,
        WriteRecordsResponse,
        url=f"https://{endpoint_to_use.Address}",
    )

paginate async

paginate(method_name, request)
Source code in async_boto/core/base_client.py
255
256
257
258
259
260
261
262
263
async def paginate(self, method_name, request: BaseModel):
    if method_name not in self._paginators:
        raise ValueError(
            f"Method {method_name} is not paginatable. "
            f"Available methods: {list(self._paginators.keys())}"
        )
    paginator = paginate(self, request=request, **self._paginators[method_name])
    async for page in paginator:
        yield page