From ffbc987a298f8b370fb98fbfd220f5ebda01c7f2 Mon Sep 17 00:00:00 2001 From: Rodrigo Souza Date: Tue, 19 Jan 2021 19:31:16 -0800 Subject: [PATCH 1/7] Update README.md --- sdk/cosmos/azure-cosmos/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/cosmos/azure-cosmos/README.md b/sdk/cosmos/azure-cosmos/README.md index ab0dccb1c3a9..f07a5eb32342 100644 --- a/sdk/cosmos/azure-cosmos/README.md +++ b/sdk/cosmos/azure-cosmos/README.md @@ -101,6 +101,7 @@ As of August 2020 the features below are **not supported**. * Provision Autoscale DBs or containers * Cross-partition ORDER BY for mixed types * Get the connection string +* Get the minimum RU/s of a container. For more information, click [here](https://docs.microsoft.com/azure/cosmos-db/concepts-limits#minimum-throughput-limits) or use [Azure CLI](https://docs.microsoft.com/azure/cosmos-db/scripts/cli/sql/throughput#sample-script) examples for Cosmos DB. ## Bulk processing limitation workaround From 092edd113adeaa6aab47163f419803851622d429 Mon Sep 17 00:00:00 2001 From: Rodrigo Souza Date: Tue, 19 Jan 2021 19:42:17 -0800 Subject: [PATCH 2/7] Update README.md --- sdk/cosmos/azure-cosmos/README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/sdk/cosmos/azure-cosmos/README.md b/sdk/cosmos/azure-cosmos/README.md index f07a5eb32342..13b2aa6ca872 100644 --- a/sdk/cosmos/azure-cosmos/README.md +++ b/sdk/cosmos/azure-cosmos/README.md @@ -334,6 +334,33 @@ properties = database.read() print(json.dumps(properties)) ``` +### Get database and container throughputs + +Get and display the throughput values of a database and of a container with dedicated throughput: + +```Python +from azure.cosmos import CosmosClient +import os +import json + +url = os.environ['ACCOUNT_URI'] +key = os.environ['ACCOUNT_KEY'] +client = CosmosClient(url, credential=key) + +# Database +database_name = 'testDatabase' +database = client.get_database_client(database_name) +db_offer = database.read_offer() +print('Found Offer \'{0}\' for Database \'{1}\' and its throughput is \'{2}\''.format(db_offer.properties['id'], database.id, db_offer.properties['content']['offerThroughput'])) + +# Container with dedicated throughput only. Will return error "offer not find" for containers without dedicated throughput +container_name = 'testContainer' +container = database.get_container_client(container_name) +container_offer = database.read_offer() +print('Found Offer \'{0}\' for Container \'{1}\' and its throughput is \'{2}\''.format(container_offer.properties['id'], container.id, container_offer.properties['content']['offerThroughput'])) +``` + + ### Modify container properties Certain properties of an existing container can be modified. This example sets the default time to live (TTL) for items in the container to 10 seconds: From 2259fad4eb4b8f4ce8f37b3c180dfd2ee1bba6e7 Mon Sep 17 00:00:00 2001 From: Rodrigo Souza Date: Tue, 19 Jan 2021 19:44:33 -0800 Subject: [PATCH 3/7] Update README.md --- sdk/cosmos/azure-cosmos/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/cosmos/azure-cosmos/README.md b/sdk/cosmos/azure-cosmos/README.md index 13b2aa6ca872..fe503d2504f6 100644 --- a/sdk/cosmos/azure-cosmos/README.md +++ b/sdk/cosmos/azure-cosmos/README.md @@ -136,6 +136,7 @@ The following sections provide several code snippets covering some of the most c * [Delete data](#delete-data "Delete data") * [Query the database](#query-the-database "Query the database") * [Get database properties](#get-database-properties "Get database properties") +* [Get database and container throughputs](#Get-database-and-container-throughputs "Get database and container throughputs") * [Modify container properties](#modify-container-properties "Modify container properties") ### Create a database From 9b0479d0277380bb3a5a9f9abf9268f0a4ec237b Mon Sep 17 00:00:00 2001 From: Rodrigo Souza Date: Wed, 20 Jan 2021 07:29:20 -0800 Subject: [PATCH 4/7] Update README.md --- sdk/cosmos/azure-cosmos/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/cosmos/azure-cosmos/README.md b/sdk/cosmos/azure-cosmos/README.md index fe503d2504f6..3d6e52ad89eb 100644 --- a/sdk/cosmos/azure-cosmos/README.md +++ b/sdk/cosmos/azure-cosmos/README.md @@ -358,7 +358,7 @@ print('Found Offer \'{0}\' for Database \'{1}\' and its throughput is \'{2}\''.f container_name = 'testContainer' container = database.get_container_client(container_name) container_offer = database.read_offer() -print('Found Offer \'{0}\' for Container \'{1}\' and its throughput is \'{2}\''.format(container_offer.properties['id'], container.id, container_offer.properties['content']['offerThroughput'])) +print('Found Offer \'{0}\' for Container \'{1}\' and its throughput is \'{2}\''.format(container_offer.properties['id'], container.id, container_offer.properties['content']['offerThroughput'])) ``` From 39d1fb52561289fe88d8b7290e25230cb18e1ae3 Mon Sep 17 00:00:00 2001 From: Rodrigo Souza Date: Wed, 20 Jan 2021 11:18:47 -0800 Subject: [PATCH 5/7] Update README.md --- sdk/cosmos/azure-cosmos/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/cosmos/azure-cosmos/README.md b/sdk/cosmos/azure-cosmos/README.md index 3d6e52ad89eb..de263fb27da4 100644 --- a/sdk/cosmos/azure-cosmos/README.md +++ b/sdk/cosmos/azure-cosmos/README.md @@ -136,7 +136,7 @@ The following sections provide several code snippets covering some of the most c * [Delete data](#delete-data "Delete data") * [Query the database](#query-the-database "Query the database") * [Get database properties](#get-database-properties "Get database properties") -* [Get database and container throughputs](#Get-database-and-container-throughputs "Get database and container throughputs") +* [Get database and container throughputs](#get-database-and-container-throughputs "Get database and container throughputs") * [Modify container properties](#modify-container-properties "Modify container properties") ### Create a database From 054c5219f84b0c8a58abb3b9055bd0a13a60b9f8 Mon Sep 17 00:00:00 2001 From: Rodrigo Souza Date: Wed, 20 Jan 2021 12:21:21 -0800 Subject: [PATCH 6/7] Update sdk/cosmos/azure-cosmos/README.md Co-authored-by: Zachary Foster --- sdk/cosmos/azure-cosmos/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/cosmos/azure-cosmos/README.md b/sdk/cosmos/azure-cosmos/README.md index de263fb27da4..67fa9b982fd4 100644 --- a/sdk/cosmos/azure-cosmos/README.md +++ b/sdk/cosmos/azure-cosmos/README.md @@ -354,7 +354,7 @@ database = client.get_database_client(database_name) db_offer = database.read_offer() print('Found Offer \'{0}\' for Database \'{1}\' and its throughput is \'{2}\''.format(db_offer.properties['id'], database.id, db_offer.properties['content']['offerThroughput'])) -# Container with dedicated throughput only. Will return error "offer not find" for containers without dedicated throughput +# Container with dedicated throughput only. Will return error "offer not found" for containers without dedicated throughput container_name = 'testContainer' container = database.get_container_client(container_name) container_offer = database.read_offer() From bba74d03fe5e36132078b696e19b7c09f9742186 Mon Sep 17 00:00:00 2001 From: Rodrigo Souza Date: Tue, 2 Feb 2021 11:08:13 -0800 Subject: [PATCH 7/7] Update README.md --- sdk/cosmos/azure-cosmos/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/cosmos/azure-cosmos/README.md b/sdk/cosmos/azure-cosmos/README.md index 67fa9b982fd4..079210e4e797 100644 --- a/sdk/cosmos/azure-cosmos/README.md +++ b/sdk/cosmos/azure-cosmos/README.md @@ -87,6 +87,7 @@ As of August 2020 the features below are **not supported**. * Group By queries (in roadmap for 2021) * Language Native async i/o (in roadmap for 2021) +* Queries with COUNT from a DISTINCT subquery: SELECT COUNT (1) FROM (SELECT DISTINCT C.ID FROM C) * Bulk/Transactional batch processing * Direct TCP Mode access * Continuation token for cross partitions queries