Skip to content

Commit 536507d

Browse files
committed
remove stop_replication
1 parent f25a321 commit 536507d

File tree

4 files changed

+2
-33
lines changed

4 files changed

+2
-33
lines changed

src/azure-cli/azure/cli/command_modules/rdbms/_helptext_pg.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -837,14 +837,6 @@
837837
text: az postgres flexible-server replica list -g testGroup -n testserver
838838
"""
839839

840-
helps['postgres flexible-server replica stop-replication'] = """
841-
type: command
842-
short-summary: Stop replication to a read replica and make it a read/write server.
843-
examples:
844-
- name: Stop replication to 'testreplicaserver' and make it a read/write server.
845-
text: az postgres flexible-server replica stop-replication -g testGroup -n testreplicaserver
846-
"""
847-
848840
helps['postgres flexible-server replica promote'] = """
849841
type: command
850842
short-summary: Stop replication of a read replica and promote it to an independent server or as a primary server.

src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_commands.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ def load_flexibleserver_command_table(self, _):
236236
custom_command_type=flexible_servers_custom_postgres,
237237
client_factory=cf_postgres_flexible_servers) as g:
238238
g.custom_command('create', 'flexible_replica_create', supports_no_wait=True)
239-
g.custom_command('stop-replication', 'flexible_replica_stop', confirmation=True, deprecate_info=g.deprecate(redirect='postgres flexible-server replica promote', hide=True))
240239
g.custom_command('promote', 'flexible_replica_promote', confirmation=True)
241240

242241
with self.command_group('postgres flexible-server identity', postgres_flexible_servers_sdk,

src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -739,28 +739,6 @@ def flexible_server_revivedropped(cmd, client, resource_group_name, server_name,
739739
return sdk_no_wait(no_wait, client.begin_create, resource_group_name, server_name, parameters)
740740

741741

742-
def flexible_replica_stop(client, resource_group_name, server_name):
743-
validate_resource_group(resource_group_name)
744-
745-
try:
746-
server_object = client.get(resource_group_name, server_name)
747-
except Exception as e:
748-
raise ResourceNotFoundError(e)
749-
750-
if server_object.replica.role is not None and "replica" not in server_object.replica.role.lower():
751-
raise CLIError('Server {} is not a replica server.'.format(server_name))
752-
753-
params = postgresql_flexibleservers.models.ServerForUpdate(
754-
replica=postgresql_flexibleservers.models.Replica(
755-
role='None',
756-
promote_mode='standalone',
757-
promote_option='planned'
758-
)
759-
)
760-
761-
return client.begin_update(resource_group_name, server_name, params)
762-
763-
764742
def flexible_replica_promote(client, resource_group_name, server_name, promote_mode='standalone', promote_option='planned'):
765743
validate_resource_group(resource_group_name)
766744

src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,8 +1362,8 @@ def _test_flexible_server_replica_mgmt(self, database_engine, resource_group, vn
13621362
.format(database_engine, resource_group, master_server),
13631363
checks=[JMESPathCheck('length(@)', 1)])
13641364

1365-
# test replica stop-replication
1366-
self.cmd('{} flexible-server replica stop-replication -g {} --name {} --yes'
1365+
# test replica promote
1366+
self.cmd('{} flexible-server replica promote -g {} --name {} --yes'
13671367
.format(database_engine, resource_group, replicas[0]),
13681368
checks=[
13691369
JMESPathCheck('name', replicas[0]),

0 commit comments

Comments
 (0)