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] az cosmosdb restore: Support enabling/disabling public network access #27175

Merged
merged 7 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ def load_arguments(self, _):
c.argument('tables_to_restore', nargs='+', action=CreateTableRestoreResource)
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('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.")

# Mongo role definition
with self.argument_context('cosmosdb mongodb role definition') as c:
Expand Down
6 changes: 4 additions & 2 deletions src/azure-cli/azure/cli/command_modules/cosmosdb/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1778,7 +1778,8 @@ def cli_cosmosdb_restore(cmd,
default_identity=None,
databases_to_restore=None,
gremlin_databases_to_restore=None,
tables_to_restore=None):
tables_to_restore=None,
public_network_access=None):
from azure.cli.command_modules.cosmosdb._client_factory import cf_restorable_database_accounts
restorable_database_accounts_client = cf_restorable_database_accounts(cmd.cli_ctx, [])
restorable_database_accounts = restorable_database_accounts_client.list()
Expand Down Expand Up @@ -1883,7 +1884,8 @@ def cli_cosmosdb_restore(cmd,
databases_to_restore=databases_to_restore,
gremlin_databases_to_restore=gremlin_databases_to_restore,
tables_to_restore=tables_to_restore,
arm_location=target_restorable_account.location)
arm_location=target_restorable_account.location,
public_network_access=public_network_access)


def _convert_to_utc_timestamp(timestamp_string):
Expand Down
Loading