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

[CosmosDB] Add support for Continuous 7 Days backup mode #4841

Merged
merged 32 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5237f10
Add generated SDK
vinhms Apr 27, 2022
3250f89
fix import
vinhms Apr 30, 2022
3bfe7bc
fix import again
vinhms May 2, 2022
36c8ccd
add continuous 7 tests and recordings
vinhms May 3, 2022
8ee0c1c
fix oldest restorable time
vinhms May 3, 2022
4fe2943
add oldest restorable test
vinhms May 3, 2022
724e926
fix lint and style
vinhms May 4, 2022
181c63a
add all recordings
vinhms May 4, 2022
2f51ba7
fix lint
vinhms May 10, 2022
b9f94f7
fix import
vinhms Apr 30, 2022
843966d
fix import again
vinhms May 2, 2022
fe6c6cb
add continuous 7 tests and recordings
vinhms May 3, 2022
8a3721c
fix oldest restorable time
vinhms May 3, 2022
3c0c461
add oldest restorable test
vinhms May 3, 2022
29a094d
fix lint and style
vinhms May 4, 2022
b0b7470
fix lint
vinhms May 10, 2022
3c441a5
merge latest
vinhms May 17, 2022
734aa84
Merge branch 'Azure:main' into main
vinhms May 17, 2022
ac9e2ec
revert changes in vendored_sdks folder
vinhms May 17, 2022
8f43e6e
Merge branch 'main' of https://github.com/vinhms/azure-cli-extensions
vinhms May 17, 2022
4cf020b
added merge commands for sql and mongo
amar-sagare May 17, 2022
0964a53
rerun all tests
vinhms May 17, 2022
06c49d9
Merge branch 'main' of https://github.com/vinhms/azure-cli-extensions
vinhms May 17, 2022
92895da
fix some stylings
vinhms May 17, 2022
02e0b57
az cli tests for merge
amar-sagare May 17, 2022
e2c3f73
Merge branch 'main' of https://github.com/vinhms/azure-cli-extensions…
amar-sagare May 17, 2022
12110a7
pylint fixes
amar-sagare May 17, 2022
a72e2ce
pylint fixes
amar-sagare May 18, 2022
fa8f9e9
more pylint fixes
amar-sagare May 18, 2022
d3674df
adding back simulation switch
amar-sagare May 18, 2022
7c15d76
linter checks
amar-sagare May 18, 2022
ec26843
revert is-simulation switch
amar-sagare May 18, 2022
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
adding back simulation switch
  • Loading branch information
amar-sagare committed May 18, 2022
commit d3674dff08febc19cd9bb5316dabbdaef35d68d0
4 changes: 3 additions & 1 deletion src/cosmosdb-preview/azext_cosmosdb_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,11 @@ def load_arguments(self, _):
c.argument('account_name', account_name_type, id_part=None, required=True, help='Name of the CosmosDB database account')
c.argument('database_name', database_name_type, required=True, help='Name of the CosmosDB database name')
c.argument('container_name', options_list=['--name', '-n'], required=True, help='Name of the CosmosDB collection')
c.argument('is-simulation', options_list=['--is_simulation', '-s'], arg_type=get_three_state_flag(), help="This flag is set by default, merge will always be a simulation unless this flag is set to false.")

# mongodb collection partition merge
with self.argument_context('cosmosdb mongodb collection merge') as c:
c.argument('account_name', account_name_type, id_part=None, required=True, help='Name of the CosmosDB database account')
c.argument('database_name', database_name_type, required=True, help='Name of the mongoDB database')
c.argument('container_name', options_list=['--name', '-n'], required=True, help='Name of the mongoDB collection')
c.argument('container_name', options_list=['--name', '-n'], required=True, help='Name of the mongoDB collection')
c.argument('is-simulation', options_list=['--is_simulation', '-s'], arg_type=get_three_state_flag(), help="This flag is set by default, merge will always be a simulation unless this flag is set to false.")
14 changes: 8 additions & 6 deletions src/cosmosdb-preview/azext_cosmosdb_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,16 +1154,17 @@ def cli_begin_list_sql_container_partition_merge(client,
resource_group_name,
account_name,
database_name,
container_name):
container_name,
is_simulation=True):

try:
client.get_sql_container(resource_group_name, account_name, database_name, container_name)
except Exception as ex:
if ex.error.code == "NotFound":
raise CLIError("(NotFound) Container with name '{container_name}' in database '{database_name}' could not be found.")
raise CLIError("(NotFound) Container with name '{}' in database '{}' could not be found.".format(container_name, database_name))
raise CLIError("{}".format(str(ex)))

mergeParameters = MergeParameters(is_dry_run=False)
mergeParameters = MergeParameters(is_dry_run=is_simulation)

async_partition_merge_result = client.begin_list_sql_container_partition_merge(resource_group_name=resource_group_name,
account_name=account_name,
Expand All @@ -1178,16 +1179,17 @@ def cli_begin_list_mongo_db_collection_partition_merge(client,
resource_group_name,
account_name,
database_name,
container_name):
container_name,
is_simulation=True):

try:
client.get_mongo_db_collection(resource_group_name, account_name, database_name, container_name)
except Exception as ex:
if ex.error.code == "NotFound":
raise CLIError("(NotFound) collection with name '{container_name}' in mongodb '{database_name}' could not be found.")
raise CLIError("(NotFound) collection with name '{}' in mongodb '{}' could not be found.".format(container_name, database_name))
raise CLIError("{}".format(str(ex)))

mergeParameters = MergeParameters(is_dry_run=False)
mergeParameters = MergeParameters(is_dry_run=is_simulation)

async_partition_merge_result = client.begin_list_mongo_db_collection_partition_merge(resource_group_name=resource_group_name,
account_name=account_name,
Expand Down