Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2fe3ae4
updated sdk version
Jun 15, 2020
0d8a926
replaced ipRangeFilter by IpRules
Jun 15, 2020
e222acc
fixing IpRules
Jun 16, 2020
6224d47
Added autoscale related changes
Jun 16, 2020
063bfa4
tests for autoscale
Jun 16, 2020
3c52f90
Changes for ip_rules
Jun 17, 2020
939f147
init for updates in database account properties
Jun 16, 2020
9ea26bd
final changes and tests for enableFreeTier, serverVersion and enableA…
Jun 17, 2020
4bc3129
error message
Jun 17, 2020
8d48d6e
added analytical ttl in mongo collection
Jun 17, 2020
27bd4d7
fixes
Jun 17, 2020
e62c0b5
analytical_storage_ttl in cassandra table
Jun 17, 2020
0f46ce8
updated all tests
Jun 17, 2020
7a8cfab
[CosmosDB] Allow creating fixed collections (#13950)
MehaKaushik Jun 17, 2020
40beea1
Cherrypicking latest master CosmosDB
shurd Jun 17, 2020
d5be0d4
updated tests
Jun 18, 2020
abd4c7c
Merge upstream/dev
Jun 18, 2020
9516285
fixing lint issue
Jun 18, 2020
71adb50
fixing style check
Jun 19, 2020
5d1f99f
Addressed comments
Jun 26, 2020
39d2ab7
Removed preview tag from RuntimeResources
Jun 26, 2020
ee920e4
fixing cosmosdb in network
Jun 30, 2020
7852ac3
Fixing cosmosdb network tests
Jun 30, 2020
b20c3d7
missed private_endpint_connection yaml
Jun 30, 2020
202bf3a
Merge remote-tracking branch 'upstream/dev' into temp
Jul 2, 2020
665d105
missed private_endpint_connection yaml
Jun 30, 2020
2d07475
re-added network tests
Jul 2, 2020
db0cd1e
re-running tests
Jul 2, 2020
e3e04c1
fixture for CI
Jul 2, 2020
fe96d0a
changes to address github issue 14191
Jul 2, 2020
de2e4bf
nit
Jul 2, 2020
ec6def8
addressed PR comments
Jul 7, 2020
ec8e363
re-ran the network tests for cosmosdb
Jul 7, 2020
d11513c
lint fix
Jul 7, 2020
7c0cd0c
re-added network module tests
Jul 7, 2020
d185e0f
addressed comment
Jul 7, 2020
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
Prev Previous commit
Next Next commit
added analytical ttl in mongo collection
  • Loading branch information
Meha Kaushik committed Jun 17, 2020
commit 8d48d6ec4ff90773e4c51f281bd653e1396e995f
2 changes: 2 additions & 0 deletions src/azure-cli/azure/cli/command_modules/cosmosdb/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ def load_arguments(self, _):
c.argument('indexes', options_list=['--idx'], type=shell_safe_json_parse, completer=FilesCompleter(), help='Indexes, you can enter it as a string or as a file, e.g., --idx @indexes-file.json or ' + MONGODB_INDEXES_EXAMPLE)
c.argument('throughput', help='The throughput of MongoDB collection (RU/s). Default value is 400')
c.argument('max_throughput', help='The maximum throughput of MongoDB collection can scale to (RU/s). Provided when the container is autoscale enabled.')
c.argument('analytical_storage_ttl', help='Analytical TTL, when analytical storage is enabled.')

# Cassandra
with self.argument_context('cosmosdb cassandra keyspace') as c:
Expand All @@ -203,6 +204,7 @@ def load_arguments(self, _):
c.argument('schema', type=shell_safe_json_parse, completer=FilesCompleter(), help='Schema, you can enter it as a string or as a file, e.g., --schema @schema-file.json or ' + CASSANDRA_SCHEMA_EXAMPLE)
c.argument('throughput', help='The throughput of Cassandra table (RU/s). Default value is 400')
c.argument('max_throughput', help='The maximum throughput of Cassandra table can scale to (RU/s). Provided when the container is autoscale enabled.')
#c.argument('analytical_storage_ttl', help='Analytical TTL, when analytical storage is enabled.')

# Gremlin
with self.argument_context('cosmosdb gremlin database') as c:
Expand Down
14 changes: 10 additions & 4 deletions src/azure-cli/azure/cli/command_modules/cosmosdb/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ def cli_cosmosdb_mongodb_database_create(client,
mongodb_database_resource)


def _populate_mongodb_collection_definition(mongodb_collection_resource, shard_key_path, indexes):
def _populate_mongodb_collection_definition(mongodb_collection_resource, shard_key_path, indexes, analytical_storage_ttl):
if all(arg is None for arg in [shard_key_path, indexes]):
return False

Expand All @@ -651,6 +651,9 @@ def _populate_mongodb_collection_definition(mongodb_collection_resource, shard_k
if indexes is not None:
mongodb_collection_resource.indexes = indexes

if analytical_storage_ttl is not None:
mongodb_collection_resource.analytical_storage_ttl = analytical_storage_ttl

return True


Expand All @@ -662,11 +665,12 @@ def cli_cosmosdb_mongodb_collection_create(client,
shard_key_path,
indexes=None,
throughput=None,
max_throughput=None):
max_throughput=None,
analytical_storage_ttl=None):
"""Create an Azure Cosmos DB MongoDB collection"""
mongodb_collection_resource = MongoDBCollectionResource(id=collection_name)

_populate_mongodb_collection_definition(mongodb_collection_resource, shard_key_path, indexes)
_populate_mongodb_collection_definition(mongodb_collection_resource, shard_key_path, indexes, analytical_storage_ttl)

options = _get_options(throughput, max_throughput)

Expand All @@ -686,7 +690,8 @@ def cli_cosmosdb_mongodb_collection_update(client,
account_name,
database_name,
collection_name,
indexes=None):
indexes=None,
analytical_storage_ttl=None):

"""Updates an Azure Cosmos DB MongoDB collection """
logger.debug('reading MongoDB collection')
Expand All @@ -697,6 +702,7 @@ def cli_cosmosdb_mongodb_collection_update(client,
mongodb_collection_resource = MongoDBCollectionResource(id=collection_name)
mongodb_collection_resource.shard_key = mongodb_collection.resource.shard_key
mongodb_collection_resource.indexes = mongodb_collection.resource.indexes
mongodb_collection_resource.analytical_storage_ttl = mongodb_collection.resource.analytical_storage_ttl

if _populate_mongodb_collection_definition(mongodb_collection_resource, None, indexes):
logger.debug('replacing MongoDB collection')
Expand Down