@@ -1506,7 +1506,7 @@ def _get_connection_info_pg(self, service_name: str) -> PGConnectionInfo:
15061506 @arg .project
15071507 @arg .service_name
15081508 @arg ("-r" , "--route" , choices = ("dynamic" , "privatelink" , "public" ))
1509- @arg ("--usage" , choices = ("primary" , "replica" ))
1509+ @arg ("--usage" , choices = ("primary" , "replica" , "disaster_recovery" ))
15101510 @arg ("-p" , "--privatelink-connection-id" )
15111511 @arg ("--replica" , action = "store_true" )
15121512 @arg ("-u" , "--username" , default = "avnadmin" )
@@ -1521,7 +1521,7 @@ def service__connection_info__psql(self) -> None:
15211521 @arg .project
15221522 @arg .service_name
15231523 @arg ("-r" , "--route" , choices = ("dynamic" , "privatelink" , "public" ))
1524- @arg ("--usage" , choices = ("primary" , "replica" ))
1524+ @arg ("--usage" , choices = ("primary" , "replica" , "disaster_recovery" ))
15251525 @arg ("-p" , "--privatelink-connection-id" )
15261526 @arg ("--replica" , action = "store_true" )
15271527 @arg ("-u" , "--username" , default = "avnadmin" )
@@ -1535,7 +1535,7 @@ def service__connection_info__pg__uri(self) -> None:
15351535 @arg .project
15361536 @arg .service_name
15371537 @arg ("-r" , "--route" , choices = ("dynamic" , "privatelink" , "public" ))
1538- @arg ("--usage" , choices = ("primary" , "replica" ))
1538+ @arg ("--usage" , choices = ("primary" , "replica" , "disaster_recovery" ))
15391539 @arg ("-p" , "--privatelink-connection-id" )
15401540 @arg ("--replica" , action = "store_true" )
15411541 @arg ("-u" , "--username" , default = "avnadmin" )
@@ -4022,6 +4022,10 @@ def _get_plan(self) -> str:
40224022 "--read-replica-for" ,
40234023 help = "Creates a read replica for given source service. Only applicable for certain service types" ,
40244024 )
4025+ @arg (
4026+ "--disaster-recovery-copy-for" ,
4027+ help = "Cretes a disaster recovery copy for given source service. Only applicable for certain service types" ,
4028+ )
40254029 @arg (
40264030 "--enable-termination-protection" ,
40274031 action = "store_true" ,
@@ -4062,6 +4066,13 @@ def service__create(self) -> None:
40624066 "source_service" : self .args .read_replica_for ,
40634067 }
40644068 )
4069+ elif self .args .disaster_recovery_copy_for :
4070+ service_integrations .append (
4071+ {
4072+ "integration_type" : "disaster_recovery" ,
4073+ "source_service" : self .args .disaster_recovery_copy_for ,
4074+ }
4075+ )
40654076 elif self .args .recovery_target_time and self .args .service_to_fork_from :
40664077 user_config ["service_to_fork_from" ] = self .args .service_to_fork_from
40674078 user_config ["recovery_target_time" ] = self .args .recovery_target_time
@@ -4290,6 +4301,11 @@ def _get_maintenance(self) -> Mapping[str, str] | None:
42904301 action = "store_true" ,
42914302 help = "Do not put the service into a project VPC even if the project has one in the selected cloud" ,
42924303 )
4304+ @arg (
4305+ "--disaster-recovery-role" ,
4306+ help = "Set disaster recovery role" ,
4307+ choices = ["active" , "passive" , "failed" ],
4308+ )
42934309 @arg .force
42944310 def service__update (self ) -> None :
42954311 """Update service settings"""
@@ -4345,6 +4361,7 @@ def service__update(self) -> None:
43454361 termination_protection = termination_protection ,
43464362 project_vpc_id = project_vpc_id ,
43474363 schema_registry_authorization = schema_registry_authorization ,
4364+ disaster_recovery_role = self .args .disaster_recovery_role ,
43484365 )
43494366 except client .Error as ex :
43504367 try :
0 commit comments