Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest {CosmosDB-Preview} Incorporate stable changes for no-timestamp restore from #28034 and #28365 of the InAccount Restore of Deleted Database/Containers feature for SQL/Mongo/Table/Gremlin in az cosmosdb original: #7340 #7343

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
cc4122b
add new sdk
carjackson-msft Feb 7, 2024
5f1d5a7
update version
carjackson-msft Feb 8, 2024
b7ccf0a
update sdk
carjackson-msft Feb 14, 2024
c54e806
cli changes for PRPP
kushalwarke1 Feb 16, 2024
53b0ab3
variable name fix, added test case
kushalwarke1 Feb 19, 2024
374e7f7
Add mode in copy job
niteshvijay-ms Jan 16, 2024
f9e78fc
Add complete job API
niteshvijay-ms Feb 19, 2024
1a61375
Add test
niteshvijay-ms Feb 20, 2024
ca8f496
history.rst changes
kushalwarke1 Feb 21, 2024
c873cf5
Merge pull request #2 from carjackson-msft/users/kushalwarke1/prpp-au…
carjackson-msft Feb 21, 2024
32d29a6
Add history
niteshvijay-ms Feb 21, 2024
bd63d86
Merge branch 'main' into online-container-copy
niteshvijay1995 Feb 21, 2024
a1140ef
Merge pull request #3 from carjackson-msft/online-container-copy
niteshvijay1995 Feb 25, 2024
df53a19
Introduce disable_ttl parameter
minhokang242 Feb 14, 2024
931fdf7
Syntax error fixes
minhokang242 Feb 16, 2024
3182044
Update tests
minhokang242 Feb 16, 2024
c4761fe
Fix syntax error
minhokang242 Feb 22, 2024
7fe0549
Change test location to WestCentralUS where 0201 batch1 is completed,…
minhokang242 Feb 23, 2024
ebfcbed
Update history file
minhokang242 Feb 23, 2024
7d4dc54
Merge pull request #1 from carjackson-msft/users/minhokang/restore_wi…
carjackson-msft Feb 27, 2024
3f493c7
add missing changes from stable https://github.com/Azure/azure-cli/pu…
carjackson-msft Feb 28, 2024
e53c8c6
add stable changes https://github.com/Azure/azure-cli/pull/27175/files
carjackson-msft Feb 28, 2024
f779e16
https://github.com/Azure/azure-cli/pull/27322/files
carjackson-msft Feb 28, 2024
f42f44f
add missing stable changes from https://github.com/Azure/azure-cli/pu…
carjackson-msft Feb 28, 2024
a0f675b
Revert "https://github.com/Azure/azure-cli/pull/27322/files"
carjackson-msft Feb 29, 2024
be4709e
add missing stable changes for minimal tls version from https://githu…
carjackson-msft Feb 29, 2024
d4f4abe
nit
carjackson-msft Feb 29, 2024
9de20ee
Revert "nit"
carjackson-msft Feb 29, 2024
e8e6279
Revert "add missing stable changes for minimal tls version from https…
carjackson-msft Feb 29, 2024
cbf8bf0
fix style checl
carjackson-msft Mar 1, 2024
e5a86ec
Address multi character short flag issue
minhokang242 Mar 1, 2024
24a9ef5
Add missing parameters
minhokang242 Mar 1, 2024
ea6e462
Fix syntax issue
minhokang242 Mar 1, 2024
eccd1f1
Remove short flag
minhokang242 Mar 1, 2024
81ed5d1
Merge pull request #5 from carjackson-msft/users/minhokang/disable_tt…
carjackson-msft Mar 1, 2024
679d530
poc for test changes
AgarwalVivek Mar 2, 2024
7a72305
inital changes in custom.py
AgarwalVivek Mar 2, 2024
583371c
removing recordings
AgarwalVivek Mar 3, 2024
e50adf7
changes in params as well as test and recording for sql ntbr flow
AgarwalVivek Mar 3, 2024
97f1003
fixing imports
AgarwalVivek Mar 3, 2024
e24067c
fixing test
AgarwalVivek Mar 3, 2024
e6eeded
test changes
AgarwalVivek Mar 3, 2024
ea5c847
fixing recordings
AgarwalVivek Mar 4, 2024
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
7 changes: 7 additions & 0 deletions src/cosmosdb-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@

Release History
===============
0.27.0
* Add support for Per-Region Per-Partition Autoscale. '--enable-per-region-per-partition-autoscale' parameter can be used during account create/update.
* Add support for Restore with Time-To-Live Disabled. '--disable-ttl' parameter can be used during restore.
* Add support for online mode in container copy job.

++++++
0.26.0
* Add '--enable-priority-based-execution' and '--default-priority-level' parameter for create/update database account.
* Add support for cross account container copy
* Add Non-CMK to CMK support
* Removed preview tag from CMK related properties

++++++
0.25.0
* Add support for performing database merge for Sql and MongoDB database account.

Expand Down
9 changes: 9 additions & 0 deletions src/cosmosdb-preview/azext_cosmosdb_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,15 @@
az cosmosdb copy cancel -g "rg1" --account-name "acc1" --job-name "j1"
"""

helps['cosmosdb copy complete'] = """
type: command
short-summary: "Completes an online container copy job."
examples:
- name: Complete job j1
text: |-
az cosmosdb copy complete -g "rg1" --account-name "acc1" --job-name "j1"
"""

helps['cosmosdb sql container merge'] = """
type: command
short-summary: "Merges the partitions of a sql container."
Expand Down
31 changes: 19 additions & 12 deletions src/cosmosdb-preview/azext_cosmosdb_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ def load_arguments(self, _):
c.argument('databases_to_restore', nargs='+', action=CreateDatabaseRestoreResource, is_preview=True, arg_group='Restore')
c.argument('gremlin_databases_to_restore', nargs='+', action=CreateGremlinDatabaseRestoreResource, is_preview=True, arg_group='Restore')
c.argument('tables_to_restore', nargs='+', action=CreateTableRestoreResource, is_preview=True, arg_group='Restore')
c.argument('enable_partition_merge', arg_type=get_three_state_flag(), help="Flag to enable partition merge on the account.")

for scope in ['cosmosdb create', 'cosmosdb update']:
with self.argument_context(scope) as c:
Expand All @@ -324,7 +325,7 @@ def load_arguments(self, _):
c.argument('virtual_network_rules', nargs='+', validator=validate_virtual_network_rules, help='ACL\'s for virtual network')
c.argument('enable_multiple_write_locations', arg_type=get_three_state_flag(), help="Enable Multiple Write Locations")
c.argument('disable_key_based_metadata_write_access', arg_type=get_three_state_flag(), help="Disable write operations on metadata resources (databases, containers, throughput) via account keys")
c.argument('enable_public_network', options_list=['--enable-public-network', '-e'], arg_type=get_three_state_flag(), help="Enable or disable public network access to server.")
c.argument('public_network_access', options_list=['--public-network-access', '-p'], arg_type=get_enum_type(['ENABLED', 'DISABLED', 'SECUREDBYPERIMETER']), help="Sets public network access in server to either Enabled, Disabled, or SecuredByPerimeter.")
c.argument('enable_analytical_storage', arg_type=get_three_state_flag(), help="Flag to enable log storage on the account.")
c.argument('network_acl_bypass', arg_type=get_enum_type(NetworkAclBypass), options_list=['--network-acl-bypass'], help="Flag to enable or disable Network Acl Bypass.")
c.argument('network_acl_bypass_resource_ids', nargs='+', options_list=['--network-acl-bypass-resource-ids', '-i'], help="List of Resource Ids to allow Network Acl Bypass.")
Expand All @@ -340,22 +341,25 @@ def load_arguments(self, _):
c.argument('enable_burst_capacity', arg_type=get_three_state_flag(), help="Flag to enable burst capacity on the account.", is_preview=True)
c.argument('enable_priority_based_execution', options_list=['--enable-priority-based-execution', '--enable-pbe'], arg_type=get_three_state_flag(), help="Flag to enable priority based execution on the account.", is_preview=True)
c.argument('default_priority_level', arg_type=get_enum_type(DefaultPriorityLevel), help="Default Priority Level of Request if not specified.", is_preview=True)
c.argument('enable_per_region_per_partition_autoscale', arg_type=get_three_state_flag(), help="Enable or disable PerRegionPerPartitionAutoscale.", is_preview=True)
c.argument('enable_partition_merge', arg_type=get_three_state_flag(), help="Flag to enable partition merge on the account.")

with self.argument_context('cosmosdb update') as c:
c.argument('key_uri', help="The URI of the key vault", is_preview=True)

with self.argument_context('cosmosdb restore') as c:
c.argument('target_database_account_name', options_list=['--target-database-account-name', '-n'], help='Name of the new target Cosmos DB database account after the restore')
c.argument('account_name', completer=None, options_list=['--account-name', '-a'], help='Name of the source Cosmos DB database account for the restore', id_part=None)
c.argument('restore_timestamp', options_list=['--restore-timestamp', '-t'], action=UtcDatetimeAction, help="The timestamp to which the account has to be restored to.")
c.argument('restore_timestamp', options_list=['--restore-timestamp', '-t'], action=UtcDatetimeAction, help="The timestamp to which the account has to be restored to.", required=True)
c.argument('location', arg_type=get_location_type(self.cli_ctx), help="This is the write region of the restored account. This is also the location of the source account where its backups are located if source_backup_location is not provided.")
c.argument('databases_to_restore', nargs='+', action=CreateDatabaseRestoreResource)
c.argument('gremlin_databases_to_restore', nargs='+', action=CreateGremlinDatabaseRestoreResource, is_preview=True)
c.argument('tables_to_restore', nargs='+', action=CreateTableRestoreResource, is_preview=True)
c.argument('assign_identity', nargs='*', help="Assign system or user assigned identities separated by spaces. Use '[system]' to refer system assigned identity.")
c.argument('default_identity', help="The primary identity to access key vault in CMK related features. e.g. 'FirstPartyIdentity', 'SystemAssignedIdentity' and more.")
c.argument('enable_public_network', options_list=['--enable-public-network', '-e'], arg_type=get_three_state_flag(), help="Enable or disable public network access to server.", is_preview=True)
c.argument('public_network_access', options_list=['--public-network-access', '-p'], arg_type=get_enum_type(['ENABLED', 'DISABLED']), help="Sets public network access in server to either Enabled or Disabled.")
c.argument('source_backup_location', help="This is the location of the source account where backups are located. Provide this value if the source and target are in different locations.", is_preview=True)
c.argument('disable_ttl', options_list=['--disable-ttl'], arg_type=get_three_state_flag(), help="Enable or disable restoring with ttl disabled.", is_preview=True)

# Restorable Database Accounts
with self.argument_context('cosmosdb restorable-database-account show') as c:
Expand Down Expand Up @@ -464,21 +468,24 @@ def load_arguments(self, _):
c.argument('dest_nosql', nargs='+', arg_group='Azure Cosmos DB API for NoSQL container copy', action=AddSqlContainerAction, help='Destination NoSql container details')
c.argument('host_copy_on_src', arg_type=get_three_state_flag(), help=argparse.SUPPRESS)
c.argument('worker_count', type=int, help=argparse.SUPPRESS)
c.argument('mode', help='Copy Mode (Online / Offline)')

for scope in [
'cosmosdb copy list',
'cosmosdb copy show',
'cosmosdb copy pause',
'cosmosdb copy resume',
'cosmosdb copy cancel']:
'cosmosdb copy cancel',
'cosmosdb copy complete']:
with self.argument_context(scope) as c:
c.argument('account_name', options_list=["--account-name", "-a"], id_part=None, required=True, help='Azure Cosmos DB account name where the job is created. Use --dest-account value from create job command.')

for scope in [
'cosmosdb copy show',
'cosmosdb copy pause',
'cosmosdb copy resume',
'cosmosdb copy cancel']:
'cosmosdb copy cancel',
'cosmosdb copy complete']:
with self.argument_context(scope) as c:
c.argument('job_name', options_list=['--job-name', '-n'], help='Name of the container copy job.', required=True)

Expand Down Expand Up @@ -563,43 +570,43 @@ def load_arguments(self, _):
with self.argument_context('cosmosdb sql database restore') as c:
c.argument('account_name', account_name_type, id_part=None, required=True)
c.argument('database_name', options_list=['--name', '-n'], help="Database name", required=True)
c.argument('restore_timestamp', options_list=['--restore-timestamp', '-t'], action=UtcDatetimeAction, help="The timestamp to which the database needs to be restored to.", required=True)
c.argument('restore_timestamp', options_list=['--restore-timestamp', '-t'], action=UtcDatetimeAction, help="The timestamp to which the database needs to be restored to.", required=False)

# SQL collection restore
with self.argument_context('cosmosdb sql container restore') as c:
c.argument('account_name', account_name_type, id_part=None, required=True)
c.argument('database_name', database_name_type, required=True)
c.argument('container_name', options_list=['--name', '-n'], help="Container name", required=True)
c.argument('restore_timestamp', options_list=['--restore-timestamp', '-t'], action=UtcDatetimeAction, help="The timestamp to which the container needs to be restored to.", required=True)
c.argument('restore_timestamp', options_list=['--restore-timestamp', '-t'], action=UtcDatetimeAction, help="The timestamp to which the container needs to be restored to.", required=False)

# MongoDB database restore
with self.argument_context('cosmosdb mongodb database restore') as c:
c.argument('account_name', account_name_type, id_part=None, required=True)
c.argument('database_name', options_list=['--name', '-n'], help="Database name", required=True)
c.argument('restore_timestamp', options_list=['--restore-timestamp', '-t'], action=UtcDatetimeAction, help="The timestamp to which the database needs to be restored to.", required=True)
c.argument('restore_timestamp', options_list=['--restore-timestamp', '-t'], action=UtcDatetimeAction, help="The timestamp to which the database needs to be restored to.", required=False)

# MongoDB collection restore
with self.argument_context('cosmosdb mongodb collection restore') as c:
c.argument('account_name', account_name_type, id_part=None, required=True)
c.argument('database_name', database_name_type, required=True)
c.argument('collection_name', options_list=['--name', '-n'], help="Collection name", required=True)
c.argument('restore_timestamp', options_list=['--restore-timestamp', '-t'], action=UtcDatetimeAction, help="The timestamp to which the collection needs to be restored to.", required=True)
c.argument('restore_timestamp', options_list=['--restore-timestamp', '-t'], action=UtcDatetimeAction, help="The timestamp to which the collection needs to be restored to.", required=False)

# Gremlin database restore
with self.argument_context('cosmosdb gremlin database restore') as c:
c.argument('account_name', account_name_type, id_part=None, required=True)
c.argument('database_name', options_list=['--name', '-n'], help="Name of the CosmosDB Gremlin database name", required=True)
c.argument('restore_timestamp', options_list=['--restore-timestamp', '-t'], action=UtcDatetimeAction, help="The timestamp to which the database needs to be restored to.", required=True)
c.argument('restore_timestamp', options_list=['--restore-timestamp', '-t'], action=UtcDatetimeAction, help="The timestamp to which the database needs to be restored to.", required=False)

# Gremlin Graph restore
with self.argument_context('cosmosdb gremlin graph restore') as c:
c.argument('account_name', account_name_type, id_part=None, required=True)
c.argument('database_name', database_name_type, required=True, help='Name of the CosmosDB Gremlin database name')
c.argument('graph_name', options_list=['--name', '-n'], help="Name of the CosmosDB Gremlin graph name", required=True)
c.argument('restore_timestamp', options_list=['--restore-timestamp', '-t'], action=UtcDatetimeAction, help="The timestamp to which the graph needs to be restored to.", required=True)
c.argument('restore_timestamp', options_list=['--restore-timestamp', '-t'], action=UtcDatetimeAction, help="The timestamp to which the graph needs to be restored to.", required=False)

# Table restore
with self.argument_context('cosmosdb table restore') as c:
c.argument('account_name', account_name_type, id_part=None, required=True)
c.argument('table_name', options_list=['--table-name', '-n'], required=True, help='Name of the CosmosDB Table name')
c.argument('restore_timestamp', options_list=['--restore-timestamp', '-t'], action=UtcDatetimeAction, help="The timestamp to which the Table needs to be restored to.", required=True)
c.argument('restore_timestamp', options_list=['--restore-timestamp', '-t'], action=UtcDatetimeAction, help="The timestamp to which the Table needs to be restored to.", required=False)
1 change: 1 addition & 0 deletions src/cosmosdb-preview/azext_cosmosdb_preview/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ def load_command_table(self, _):
g.command('pause', 'pause')
g.command('resume', 'resume')
g.command('cancel', 'cancel')
g.command('complete', 'complete')

# Merge partitions for Sql containers
cosmosdb_sql_sdk = CliCommandType(
Expand Down
Loading
Loading