@@ -133,13 +133,15 @@ async def read(
133
133
* ,
134
134
session_token : Optional [str ] = None ,
135
135
initial_headers : Optional [Dict [str , str ]] = None ,
136
+ throughput_bucket : Optional [int ] = None ,
136
137
** kwargs : Any
137
138
) -> Dict [str , Any ]:
138
139
"""Read the database properties.
139
140
140
141
:keyword str session_token: Token for use with Session consistency.
141
142
:keyword dict[str, str] initial_headers: Initial headers to be sent as part of the request.
142
143
:keyword response_hook: A callable invoked with the response metadata.
144
+ :keyword int throughput_bucket: The desired throughput bucket for the client
143
145
:paramtype response_hook: Callable[[Dict[str, str], Dict[str, Any]], None]
144
146
:raises ~azure.cosmos.exceptions.CosmosHttpResponseError: If the given database couldn't be retrieved.
145
147
:returns: A dict representing the database properties
@@ -150,6 +152,8 @@ async def read(
150
152
kwargs ['session_token' ] = session_token
151
153
if initial_headers is not None :
152
154
kwargs ['initial_headers' ] = initial_headers
155
+ if throughput_bucket is not None :
156
+ kwargs ["throughput_bucket" ] = throughput_bucket
153
157
request_options = _build_options (kwargs )
154
158
155
159
self ._properties = await self .client_connection .ReadDatabase (
@@ -178,6 +182,7 @@ async def create_container(
178
182
vector_embedding_policy : Optional [Dict [str , Any ]] = None ,
179
183
change_feed_policy : Optional [Dict [str , Any ]] = None ,
180
184
full_text_policy : Optional [Dict [str , Any ]] = None ,
185
+ throughput_bucket : Optional [int ] = None ,
181
186
** kwargs : Any
182
187
) -> ContainerProxy :
183
188
"""Create a new container with the given ID (name).
@@ -216,6 +221,7 @@ async def create_container(
216
221
:keyword Dict[str, Any] full_text_policy: **provisional** The full text policy for the container.
217
222
Used to denote the default language to be used for all full text indexes, or to individually
218
223
assign a language to each full text index path.
224
+ :keyword int throughput_bucket: The desired throughput bucket for the client
219
225
:raises ~azure.cosmos.exceptions.CosmosHttpResponseError: The container creation failed.
220
226
:returns: A `ContainerProxy` instance representing the new container.
221
227
:rtype: ~azure.cosmos.aio.ContainerProxy
@@ -273,6 +279,8 @@ async def create_container(
273
279
kwargs ['etag' ] = etag
274
280
if match_condition is not None :
275
281
kwargs ['match_condition' ] = match_condition
282
+ if throughput_bucket is not None :
283
+ kwargs ['throughput_bucket' ] = throughput_bucket
276
284
request_options = _build_options (kwargs )
277
285
_set_throughput_options (offer = offer_throughput , request_options = request_options )
278
286
@@ -301,6 +309,7 @@ async def create_container_if_not_exists(
301
309
vector_embedding_policy : Optional [Dict [str , Any ]] = None ,
302
310
change_feed_policy : Optional [Dict [str , Any ]] = None ,
303
311
full_text_policy : Optional [Dict [str , Any ]] = None ,
312
+ throughput_bucket : Optional [int ] = None ,
304
313
** kwargs : Any
305
314
) -> ContainerProxy :
306
315
"""Create a container if it does not exist already.
@@ -341,6 +350,7 @@ async def create_container_if_not_exists(
341
350
:keyword Dict[str, Any] full_text_policy: **provisional** The full text policy for the container.
342
351
Used to denote the default language to be used for all full text indexes, or to individually
343
352
assign a language to each full text index path.
353
+ :keyword int throughput_bucket: The desired throughput bucket for the client
344
354
:raises ~azure.cosmos.exceptions.CosmosHttpResponseError: The container creation failed.
345
355
:returns: A `ContainerProxy` instance representing the new container.
346
356
:rtype: ~azure.cosmos.aio.ContainerProxy
@@ -371,6 +381,7 @@ async def create_container_if_not_exists(
371
381
vector_embedding_policy = vector_embedding_policy ,
372
382
change_feed_policy = change_feed_policy ,
373
383
full_text_policy = full_text_policy ,
384
+ throughput_bucket = throughput_bucket ,
374
385
** kwargs
375
386
)
376
387
@@ -409,6 +420,7 @@ def list_containers(
409
420
max_item_count : Optional [int ] = None ,
410
421
initial_headers : Optional [Dict [str , str ]] = None ,
411
422
response_hook : Optional [Callable [[Mapping [str , Any ], AsyncItemPaged [Dict [str , Any ]]], None ]] = None ,
423
+ throughput_bucket : Optional [int ] = None ,
412
424
** kwargs
413
425
) -> AsyncItemPaged [Dict [str , Any ]]:
414
426
"""List the containers in the database.
@@ -417,6 +429,7 @@ def list_containers(
417
429
:keyword str session_token: Token for use with Session consistency.
418
430
:keyword dict[str, str] initial_headers: Initial headers to be sent as part of the request.
419
431
:keyword response_hook: A callable invoked with the response metadata.
432
+ :keyword int throughput_bucket: The desired throughput bucket for the client
420
433
:paramtype response_hook: Callable[[Mapping[str, Any], AsyncItemPaged[Dict[str, Any]]], None]
421
434
:returns: An AsyncItemPaged of container properties (dicts).
422
435
:rtype: AsyncItemPaged[Dict[str, Any]]
@@ -435,6 +448,8 @@ def list_containers(
435
448
kwargs ['session_token' ] = session_token
436
449
if initial_headers is not None :
437
450
kwargs ['initial_headers' ] = initial_headers
451
+ if throughput_bucket is not None :
452
+ kwargs ["throughput_bucket" ] = throughput_bucket
438
453
feed_options = _build_options (kwargs )
439
454
if max_item_count is not None :
440
455
feed_options ["maxItemCount" ] = max_item_count
@@ -456,6 +471,7 @@ def query_containers(
456
471
max_item_count : Optional [int ] = None ,
457
472
initial_headers : Optional [Dict [str , str ]] = None ,
458
473
response_hook : Optional [Callable [[Mapping [str , Any ], AsyncItemPaged [Dict [str , Any ]]], None ]] = None ,
474
+ throughput_bucket : Optional [int ] = None ,
459
475
** kwargs : Any
460
476
) -> AsyncItemPaged [Dict [str , Any ]]:
461
477
"""List the properties for containers in the current database.
@@ -468,6 +484,7 @@ def query_containers(
468
484
:keyword str session_token: Token for use with Session consistency.
469
485
:keyword dict[str, str] initial_headers: Initial headers to be sent as part of the request.
470
486
:keyword response_hook: A callable invoked with the response metadata.
487
+ :keyword int throughput_bucket: The desired throughput bucket for the client
471
488
:paramtype response_hook: Callable[[Mapping[str, Any], AsyncItemPaged[Dict[str, Any]]], None]
472
489
:returns: An AsyncItemPaged of container properties (dicts).
473
490
:rtype: AsyncItemPaged[Dict[str, Any]]
@@ -476,6 +493,8 @@ def query_containers(
476
493
kwargs ['session_token' ] = session_token
477
494
if initial_headers is not None :
478
495
kwargs ['initial_headers' ] = initial_headers
496
+ if throughput_bucket is not None :
497
+ kwargs ["throughput_bucket" ] = throughput_bucket
479
498
feed_options = _build_options (kwargs )
480
499
if max_item_count is not None :
481
500
feed_options ["maxItemCount" ] = max_item_count
@@ -506,6 +525,7 @@ async def replace_container(
506
525
analytical_storage_ttl : Optional [int ] = None ,
507
526
computed_properties : Optional [List [Dict [str , str ]]] = None ,
508
527
full_text_policy : Optional [Dict [str , Any ]] = None ,
528
+ throughput_bucket : Optional [int ] = None ,
509
529
** kwargs : Any
510
530
) -> ContainerProxy :
511
531
"""Reset the properties of the container.
@@ -539,6 +559,7 @@ async def replace_container(
539
559
:keyword Dict[str, Any] full_text_policy: **provisional** The full text policy for the container.
540
560
Used to denote the default language to be used for all full text indexes, or to individually
541
561
assign a language to each full text index path.
562
+ :keyword int throughput_bucket: The desired throughput bucket for the client
542
563
:returns: A `ContainerProxy` instance representing the container after replace completed.
543
564
:raises ~azure.cosmos.exceptions.CosmosHttpResponseError: Raised if the container couldn't be replaced.
544
565
This includes if the container with given id does not exist.
@@ -562,6 +583,8 @@ async def replace_container(
562
583
kwargs ['etag' ] = etag
563
584
if match_condition is not None :
564
585
kwargs ['match_condition' ] = match_condition
586
+ if throughput_bucket is not None :
587
+ kwargs ['throughput_bucket' ] = throughput_bucket
565
588
request_options = _build_options (kwargs )
566
589
567
590
container_id = self ._get_container_id (container )
@@ -597,6 +620,7 @@ async def delete_container(
597
620
initial_headers : Optional [Dict [str , str ]] = None ,
598
621
etag : Optional [str ] = None ,
599
622
match_condition : Optional [MatchConditions ] = None ,
623
+ throughput_bucket : Optional [int ] = None ,
600
624
** kwargs : Any
601
625
) -> None :
602
626
"""Delete a container.
@@ -612,6 +636,7 @@ async def delete_container(
612
636
:keyword match_condition: The match condition to use upon the etag.
613
637
:paramtype match_condition: ~azure.core.MatchConditions
614
638
:keyword response_hook: A callable invoked with the response metadata.
639
+ :keyword int throughput_bucket: The desired throughput bucket for the client
615
640
:paramtype response_hook: Callable[[Dict[str, str], None], None]
616
641
:raises ~azure.cosmos.exceptions.CosmosHttpResponseError: If the container couldn't be deleted.
617
642
:rtype: None
@@ -624,6 +649,8 @@ async def delete_container(
624
649
kwargs ['etag' ] = etag
625
650
if match_condition is not None :
626
651
kwargs ['match_condition' ] = match_condition
652
+ if throughput_bucket is not None :
653
+ kwargs ['throughput_bucket' ] = throughput_bucket
627
654
request_options = _build_options (kwargs )
628
655
629
656
collection_link = self ._get_container_link (container )
0 commit comments