Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
00b9235
{Docs} Remove stale reference in README to closed issue about extensi…
dkmiller Apr 27, 2020
ab16df0
Merge remote-tracking branch 'upstream/release'
azclibot Apr 28, 2020
03436bc
Merge remote-tracking branch 'upstream/release'
azclibot Apr 30, 2020
7d98b1f
Merge remote-tracking branch 'upstream/release'
azclibot May 19, 2020
06f6ec5
Merge remote-tracking branch 'upstream/release'
azclibot Jun 2, 2020
adab2d2
Merge remote-tracking branch 'upstream/release'
azclibot Jun 23, 2020
c7b9f98
Merge remote-tracking branch 'upstream/release'
azclibot Jul 14, 2020
18e8b8d
Merge remote-tracking branch 'upstream/release'
azclibot Jul 16, 2020
1eb5074
Merge remote-tracking branch 'upstream/release'
azclibot Aug 4, 2020
cc3a159
Merge remote-tracking branch 'upstream/release' into master
azclibot Aug 6, 2020
af8f98e
Merge remote-tracking branch 'upstream/release' into master
azclibot Aug 26, 2020
0f904b9
Merge remote-tracking branch 'upstream/release' into master
azclibot Aug 28, 2020
53ae210
intial commit for migration support for autoscale
Aug 21, 2020
f6040c8
tests and their recordings
Aug 22, 2020
2394d3e
nit
Aug 22, 2020
6726e82
revert wrong version change
Aug 24, 2020
a7e7f99
fixing linting issues
Aug 25, 2020
f58d7d2
fixing linting issues
Aug 25, 2020
ec876c7
Merged into a single cmdlet
Aug 28, 2020
2b8ece2
uncommenting tests
Aug 28, 2020
32b8991
Lint fix
Aug 28, 2020
71d0b58
Update src/azure-cli/azure/cli/command_modules/cosmosdb/commands.py
MehaKaushik Sep 5, 2020
41501d6
lint and style fixes
Sep 5, 2020
07cf1dc
more fixes to style
Sep 7, 2020
defb97f
addressing comments
Sep 10, 2020
2109770
adding examples
Sep 14, 2020
ab0977f
Merge dev
Sep 14, 2020
dbc04e4
updating help
Sep 14, 2020
23e0437
Revert "updating help"
Sep 14, 2020
bb02872
Revert "adding examples"
Sep 14, 2020
52bbea8
Merge branch 'dev2' into autoscale_migration
Sep 16, 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
49 changes: 45 additions & 4 deletions src/azure-cli/azure/cli/command_modules/cosmosdb/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
short-summary: Update the throughput of the Cassandra keyspace under an Azure Cosmos DB account.
"""

helps['cosmosdb cassandra keyspace throughput migrate'] = """
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we add some examples for new commands?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the examples manually, looks like the style and linter checks are failing after doing so. Is there a way to autogenerate these examples ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Juliehzl I have reverted the change where I was adding examples, I will take this up in my next PR. Can you please merge this PR today, so that it makes into the upcoming release cycle. There are customers who are looking forward to this change.

type: command
short-summary: Migrate the throughput of the Cassandra keyspace between autoscale and manually provisioned.
"""

helps['cosmosdb cassandra table'] = """
type: group
short-summary: Manage Azure Cosmos DB Cassandra tables.
Expand Down Expand Up @@ -122,6 +127,11 @@
crafted: true
"""

helps['cosmosdb cassandra table throughput migrate'] = """
type: command
short-summary: Migrate the throughput of the Cassandra table between autoscale and manually provisioned.
"""

helps['cosmosdb cassandra table update'] = """
type: command
short-summary: Update an Cassandra table under an Azure Cosmos DB Cassandra keyspace.
Expand Down Expand Up @@ -279,6 +289,11 @@
short-summary: Update the throughput of the Gremlin database under an Azure Cosmos DB account.
"""

helps['cosmosdb gremlin database throughput migrate'] = """
type: command
short-summary: Migrate the throughput of the Gremlin database between autoscale and manually provisioned.
"""

helps['cosmosdb gremlin graph'] = """
type: group
short-summary: Manage Azure Cosmos DB Gremlin graphs.
Expand Down Expand Up @@ -323,6 +338,11 @@
short-summary: Update the throughput of the Gremlin graph under an Azure Cosmos DB Gremlin database.
"""

helps['cosmosdb gremlin graph throughput migrate'] = """
type: command
short-summary: Migrate the throughput of the Gremlin Graph between autoscale and manually provisioned.
"""

helps['cosmosdb gremlin graph update'] = """
type: command
short-summary: Update an Gremlin graph under an Azure Cosmos DB Gremlin database.
Expand Down Expand Up @@ -423,6 +443,11 @@
short-summary: Update the throughput of the MongoDB collection under an Azure Cosmos DB MongoDB database.
"""

helps['cosmosdb mongodb collection throughput migrate'] = """
type: command
short-summary: Migrate the throughput of the MongoDB collection between autoscale and manually provisioned.
"""

helps['cosmosdb mongodb collection update'] = """
type: command
short-summary: Update an MongoDB collection under an Azure Cosmos DB MongoDB database.
Expand Down Expand Up @@ -481,12 +506,16 @@
crafted: true
"""

helps['cosmosdb mongodb database throughput migrate'] = """
type: command
short-summary: Migrate the throughput of the MongoDB database between autoscale and manually provisioned.
"""

helps['cosmosdb network-rule'] = """
type: group
short-summary: Manage Azure Comsos DB network rules.
"""


helps['cosmosdb private-endpoint-connection'] = """
type: group
short-summary: Manage Azure Comsos DB private endpoint connections.
Expand All @@ -500,7 +529,6 @@
text: az cosmosdb private-endpoint-connection approve --account-name MyAccount --name MyPrivateEndpoint --resource-group MyResourceGroup --description "Approved"
"""


helps['cosmosdb private-endpoint-connection delete'] = """
type: command
short-summary: Delete the specified private endpoint connection associated with Azure Comsos DB.
Expand All @@ -518,7 +546,6 @@
text: az cosmosdb private-endpoint-connection reject --account-name MyAccount --name MyPrivateEndpoint --resource-group MyResourceGroup --description "Rejected"
"""


helps['cosmosdb private-endpoint-connection show'] = """
type: command
short-summary: Show details of a private endpoint connection associated with Azure Comsos DB.
Expand All @@ -540,7 +567,6 @@
text: cosmosdb private-link-resource list --account-name MyAccount --resource-group MyResourceGroup
"""


helps['cosmosdb regenerate-key'] = """
type: command
short-summary: Regenerate an access key for a Azure Cosmos DB database account.
Expand Down Expand Up @@ -700,6 +726,11 @@
short-summary: Update the throughput of the SQL container under an Azure Cosmos DB SQL database.
"""

helps['cosmosdb sql container throughput migrate'] = """
type: command
short-summary: Migrate the throughput of the SQL container between autoscale and manually provisioned.
"""

helps['cosmosdb sql container update'] = """
type: command
short-summary: Update an SQL container under an Azure Cosmos DB SQL database.
Expand Down Expand Up @@ -749,6 +780,11 @@
short-summary: Update the throughput of the SQL database under an Azure Cosmos DB account.
"""

helps['cosmosdb sql database throughput migrate'] = """
type: command
short-summary: Migrate the throughput of the SQL database between autoscale and manually provisioned.
"""

helps['cosmosdb table'] = """
type: group
short-summary: Manage Table resources of Azure Cosmos DB account.
Expand Down Expand Up @@ -789,6 +825,11 @@
short-summary: Update the throughput of the Table under an Azure Cosmos DB account.
"""

helps['cosmosdb table throughput migrate'] = """
type: command
short-summary: Migrate the throughput of the Table between autoscale and manually provisioned.
"""

helps['cosmosdb update'] = """
type: command
short-summary: Update an Azure Cosmos DB database account.
Expand Down
17 changes: 16 additions & 1 deletion src/azure-cli/azure/cli/command_modules/cosmosdb/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

# pylint: disable=too-many-statements
# pylint: disable=line-too-long
from enum import Enum
from argcomplete.completers import FilesCompleter

from azure.cli.core.commands.parameters import (
Expand Down Expand Up @@ -37,6 +38,11 @@
"""


class ThroughputTypes(str, Enum):
autoscale = "autoscale"
manual = "manual"


def load_arguments(self, _):
from knack.arguments import CLIArgumentType
from azure.mgmt.cosmosdb.models import KeyKind, DefaultConsistencyLevel, DatabaseAccountKind, TriggerType, TriggerOperation, ServerVersion
Expand Down Expand Up @@ -107,6 +113,7 @@ def load_arguments(self, _):
database_name_type = CLIArgumentType(options_list=['--database-name', '-d'], help='Database name.')
container_name_type = CLIArgumentType(options_list=['--container-name', '-c'], help='Container name.')
max_throughput_type = CLIArgumentType(options_list=['--max-throughput'], help='The maximum throughput resource can scale to (RU/s). Provided when the resource is autoscale enabled. The minimum value can be 4000 (RU/s)')
throughput_type = CLIArgumentType(options_list=['--throughput-type', '-t'], arg_type=get_enum_type(ThroughputTypes), help='The type of throughput to migrate to.')

with self.argument_context('cosmosdb private-endpoint-connection') as c:
c.argument('private_endpoint_connection_name', options_list=['--name', '-n'], required=False,
Expand Down Expand Up @@ -282,7 +289,7 @@ def load_arguments(self, _):
with self.argument_context('cosmosdb gremlin graph throughput') as c:
c.argument('account_name', account_name_type, id_part=None)
c.argument('database_name', database_name_type)
c.argument('graph_name', options_list=['--name', '-n'], help="Grapth name")
c.argument('graph_name', options_list=['--name', '-n'], help="Graph name")
c.argument('throughput', type=int, help='The throughput Gremlin graph (RU/s).')
c.argument('max_throughput', max_throughput_type)

Expand All @@ -291,3 +298,11 @@ def load_arguments(self, _):
c.argument('table_name', options_list=['--name', '-n'], help="Table name")
c.argument('throughput', type=int, help='The throughput of Table (RU/s).')
c.argument('max_throughput', max_throughput_type)

for scope in ['sql database throughput migrate', 'sql container throughput migrate',
'gremlin database throughput migrate', 'gremlin graph throughput migrate',
'cassandra table throughput migrate', 'cassandra keyspace throughput migrate',
'mongodb collection throughput migrate', 'mongodb database throughput migrate',
'table throughput migrate']:
with self.argument_context('cosmosdb {}'.format(scope)) as c:
c.argument('throughput_type', throughput_type)
Original file line number Diff line number Diff line change
Expand Up @@ -203,39 +203,48 @@ def load_command_table(self, _):
# Offer throughput
with self.command_group('cosmosdb sql database throughput', cosmosdb_sql_sdk, client_factory=cf_sql_resources) as g:
g.show_command('show', 'get_sql_database_throughput')
g.custom_command('migrate', 'cli_cosmosdb_sql_database_throughput_migrate')
g.custom_command('update', 'cli_cosmosdb_sql_database_throughput_update')

with self.command_group('cosmosdb sql container throughput', cosmosdb_sql_sdk, client_factory=cf_sql_resources) as g:
g.show_command('show', 'get_sql_container_throughput')
g.custom_command('update', 'cli_cosmosdb_sql_container_throughput_update')
g.custom_command('migrate', 'cli_cosmosdb_sql_container_throughput_migrate')

with self.command_group('cosmosdb mongodb database throughput', cosmosdb_mongo_sdk, client_factory=cf_mongo_db_resources) as g:
g.show_command('show', 'get_mongo_db_database_throughput')
g.custom_command('update', 'cli_cosmosdb_mongodb_database_throughput_update')
g.custom_command('migrate', 'cli_cosmosdb_mongodb_database_throughput_migrate')

with self.command_group('cosmosdb mongodb collection throughput', cosmosdb_mongo_sdk, client_factory=cf_mongo_db_resources) as g:
g.show_command('show', 'get_mongo_db_collection_throughput')
g.custom_command('update', 'cli_cosmosdb_mongodb_collection_throughput_update')
g.custom_command('migrate', 'cli_cosmosdb_mongodb_collection_throughput_migrate')

with self.command_group('cosmosdb cassandra keyspace throughput', cosmosdb_cassandra_sdk, client_factory=cf_cassandra_resources) as g:
g.show_command('show', 'get_cassandra_keyspace_throughput')
g.custom_command('update', 'cli_cosmosdb_cassandra_keyspace_throughput_update')
g.custom_command('migrate', 'cli_cosmosdb_cassandra_keyspace_throughput_migrate')

with self.command_group('cosmosdb cassandra table throughput', cosmosdb_cassandra_sdk, client_factory=cf_cassandra_resources) as g:
g.show_command('show', 'get_cassandra_table_throughput')
g.custom_command('update', 'cli_cosmosdb_cassandra_table_throughput_update')
g.custom_command('migrate', 'cli_cosmosdb_cassandra_table_throughput_migrate')

with self.command_group('cosmosdb gremlin database throughput', cosmosdb_gremlin_sdk, client_factory=cf_gremlin_resources) as g:
g.show_command('show', 'get_gremlin_database_throughput')
g.custom_command('update', 'cli_cosmosdb_gremlin_database_throughput_update')
g.custom_command('migrate', 'cli_cosmosdb_gremlin_database_throughput_migrate')

with self.command_group('cosmosdb gremlin graph throughput', cosmosdb_gremlin_sdk, client_factory=cf_gremlin_resources) as g:
g.show_command('show', 'get_gremlin_graph_throughput')
g.custom_command('update', 'cli_cosmosdb_gremlin_graph_throughput_update')
g.custom_command('migrate', 'cli_cosmosdb_gremlin_graph_throughput_migrate')

with self.command_group('cosmosdb table throughput', cosmosdb_table_sdk, client_factory=cf_table_resources) as g:
g.show_command('show', 'get_table_throughput')
g.custom_command('update', 'cli_cosmosdb_table_throughput_update')
g.custom_command('migrate', 'cli_cosmosdb_table_throughput_migrate')

# virtual network rules
with self.command_group('cosmosdb network-rule', None, client_factory=cf_db_accounts) as g:
Expand Down
Loading