Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/cosmosdb-preview/azext_cosmosdb_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2319,6 +2319,14 @@ def cli_cosmosdb_sql_container_throughput_update(client,
max_throughput=None,
throughput_buckets=None):
"""Update an Azure Cosmos DB SQL container throughput"""

# If throughput_buckets is None (not explicitly provided), preserve existing throughput buckets
if throughput_buckets is None:
logger.debug('reading SQL container throughput to preserve existing throughput buckets')
current_throughput = client.get_sql_container_throughput(resource_group_name, account_name, database_name, container_name)
if current_throughput.resource and current_throughput.resource.throughput_buckets is not None:
throughput_buckets = current_throughput.resource.throughput_buckets

throughput_update_resource = _get_throughput_settings_update_parameters(throughput=throughput,
max_throughput=max_throughput,
throughput_buckets=throughput_buckets)
Expand Down
Loading
Loading