
    e                        S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	  S+S jr
S,S	 jrS-S
 jrS.S jrS/S jrS0S jrS1S jrS2S jrS rS3S jrS+S jrS,S jrS-S jrS.S jrS/S jrS0S jrS4S jrS5S jrS rS rS r  S6S jr S5S jr S5S jr!S7S  jr"S5S! jr#S7S" jr$S7S# jr%S$ r&S5S% jr'S5S& jr(S5S' jr)S5S( jr*S5S) jr+g*)8z>Shared resource flags for Database Migration Service commands.    )absolute_import)division)unicode_literals)concepts)concept_parsers)presentation_specsc                 ,    [         R                  " U SS9$ )Nz)The connection profile of the {resource}.name	help_textr    ResourceParameterAttributeConfigr   s    >lib/googlecloudsdk/api_lib/database_migration/resource_args.py ConnectionProfileAttributeConfigr          		2	2F
H H    c                 ,    [         R                  " U SS9$ )Nz$The migration job of the {resource}.r
   r   r   s    r   MigrationJobAttributeConfigr      s    		2	2A
C Cr   c                 ,    [         R                  " U SS9$ )Nz)The private connection of the {resource}.r
   r   r   s    r    PrivateConnectionAttributeConfigr   $   r   r   c                 ,    [         R                  " U SS9$ )Nz)The service attachment of the {resource}.r
   r   r   s    r    ServiceAttachmentAttributeConfigr   )   s    		2	2F
 r   c                 ,    [         R                  " U SS9$ )Nz+The conversion workspace of the {resource}.r
   r   r   s    r   "ConversionWorkspaceAttributeConfigr   /   s    		2	2H
 r   c                 *    [         R                  " U S9$ )Nr   r   r   s    r   CmekKeyAttributeConfigr   5   s    		2	2	==r   c                 ,    [         R                  " U SS9$ )Nz&The CMEK keyring id of the {resource}.r
   r   r   s    r   CmekKeyringAttributeConfigr   :   s    		2	2C
 r   c                 ,    [         R                  " U SS9$ )Nz(The Cloud project id for the {resource}.r
   r   r   s    r   CmekProjectAttributeConfigr!   @   s    		2	2E
 r   c                  ,    [         R                  " SSS9$ )Nregionz$The Cloud region for the {resource}.r
   r    r   r   RegionAttributeConfigr%   F   s    		2	2E
G Gr   c                 ^    [         R                  " SU [        5       [         R                  SS9$ )Nz datamigration.projects.locationsF)resource_namelocationsId
projectsIddisable_auto_completers)r   ResourceSpecr%    DEFAULT_PROJECT_ATTRIBUTE_CONFIGr'   s    r   GetRegionResourceSpecr.   K   s-    			(!')::#
% %r   c           	      n    [         R                  " SU [        U S9[        5       [         R                  SS9$ )Nz3datamigration.projects.locations.connectionProfilesr   F)r'   connectionProfilesIdr(   r)   r*   )r   r+   r   r%   r,   r-   s    r    GetConnectionProfileResourceSpecr1   T   s5    			;!;O')::#
% %r   c           	      n    [         R                  " SU [        U S9[        5       [         R                  SS9$ )Nz.datamigration.projects.locations.migrationJobsr   F)r'   migrationJobsIdr(   r)   r*   )r   r+   r   r%   r,   r-   s    r   GetMigrationJobResourceSpecr4   ^   s5    			6!1}E')::#
 r   c           
      p    [         R                  " SU S[        U S9[        5       [         R                  SS9$ )Nz3datamigration.projects.locations.privateConnectionsv1r   F)r'   api_versionprivateConnectionsIdr(   r)   r*   )r   r+   r   r%   r,   r-   s    r    GetPrivateConnectionResourceSpecr9   i   s8    			;!;O')::#
% %r   c                 Z    [         R                  " SU [        U S9[         R                  S9$ )Nzcompute.serviceAttachmentsr   )r'   serviceAttachmentproject)r   r+   r   r,   r-   s    r    GetServiceAttachmentResourceSpecr=   t   s,    			"!8mL77	
9 9r   c           
      p    [         R                  " SU S[        U S9[        5       [         R                  SS9$ )Nz5datamigration.projects.locations.conversionWorkspacesr6   r   F)r'   r7   conversionWorkspacesIdr(   r)   r*   )r   r+   r   r%   r,   r-   s    r   "GetConversionWorkspaceResourceSpecr@   |   s;    			=!?')::#
% %r   c                 x    [         R                  " SU S[        5       [        5       [	        5       [        5       SS9$ )N/cloudkms.projects.locations.keyRings.cryptoKeysr6   Fr'   r7   cryptoKeysId
keyRingsIdr(   r)   r*   r   r+   r   r   r%   r!   r-   s    r   GetCmekKeyResourceSpecrG      s9    			7!)++-')+-#	
 	r   c                 ~    [         R                  " SU S[        S5      [        S5      [	        5       [        S5      SS9$ )NrB   r6   kms-keyzkms-keyringzkms-projectFrC   rF   r-   s    r   GetKMSKeyResourceSpecrJ      s?    			7!))4+M:')+M:#	
 	r   c                     U(       a  SnOSn[         R                  R                  U[        5       SR	                  U5      SS9R                  U 5        g)a  Add a resource argument for a database migration connection profile.

Args:
  parser: the parser for the command.
  verb: str, the verb to describe the resource, such as 'to update'.
  positional: bool, if True, means that the resource is a positional rather
    than a flag.
connection_profile--connection-profileThe connection profile {}.TrequiredN)r   ConceptParserForResourcer1   formatAddToParserparserverb
positionalr   s       r   AddConnectionProfileResourceArgrY      sP     D!D++
&("))$/	 ,  ![(r   c           	          [         R                  " S[        5       SR                  U5      SS9[         R                  " S[        5       SSSS0S	9/n[        R
                  " US
S/0S9R                  U 5        g)zAdd resource arguments for a database migration CloudSQL connection profile.

Args:
  parser: the parser for the command.
  verb: str, the verb to describe the resource, such as 'to update'.
rL   rN   TrO   z--source-idz8Database Migration Service source connection profile ID.r#    rP   flag_name_overridesz--source-id.region--regioncommand_level_fallthroughsN)r   ResourcePresentationSpecr1   rS   r   rQ   rT   rV   rW   resource_specss      r   (AddCloudSqlConnectionProfileResourceArgsrd      s     11

*
,
&
-
-d
3	
 11

*
,
D'n.. 
"	 
V	r   c                     [         R                  " S[        5       SR                  U5      SS9[         R                  " S[	        5       SSS0S	9/n[
        R                  " US
S/0S9R                  U 5        g)zAdd resource arguments for a database migration AlloyDB connection profile.

Args:
  parser: the parser for the command.
  verb: str, the verb to describe the resource, such as 'to update'.
rL   rN   TrO   z	--kms-keyzName of the CMEK (customer-managed encryption key) used for this AlloyDB cluster. For example, projects/myProject/locations/us-central1/keyRings/myKeyRing/cryptoKeys/myKey.r#   r[   r]   z--kms-key.regionr^   r_   N)r   ra   r1   rS   rJ   r   rQ   rT   rb   s      r   'AddAlloyDBConnectionProfileResourceArgsrg      s     11

*
,
&
-
-d
3	 11


!_  (n	.$ "4zl!C Kr   c                 v    [         R                  R                  S[        5       SSS0S9R	                  U 5        g)zdAdd a resource argument for a connection profile cmek.

Args:
  parser: the parser for the command.

--cmek-keyzName of the CMEK (customer-managed encryption key) used for the connection profile. For example, projects/myProject/locations/us-central1/keyRings/myKeyRing/cryptoKeys/myKey.r#   r[   rf   N)r   rQ   rR   rG   rT   )rV   s    r   AddCmekResourceArgsrj      sA     ++W $R. ,  Kr   c           	      0   U(       a  SnOSnU R                  SS9nUR                  SSSS9  UR                  5       nUR                  S	S
US9  UR                  SSUS9  UR                  SSSS9  UR                  USS9nUR                  SSS9  UR                  SSS9  [        R                  " U[	        5       SR                  U5      SS9[        R                  " S[        5       SSS0US9/n[        R                  " USS /0S!9R                  U 5        g")#aE  Add a resource argument for a database migration oracle cp.

Args:
  parser: the parser for the command.
  verb: str, the verb to describe the resource, such as 'to update'.
  positional: bool, if True, means that the resource is a positional rather
    than a flag.
  required: bool, if True, means that a flag is required.
rL   rM   Tmutex--static-ip-connectivity
store_trueuse static ip connectivityactionhelp--forward-ssh-hostnameHostname for the SSH tunnel.rs   rP   --forward-ssh-usernameUsername for the SSH tunnel.--forward-ssh-port3Port for the SSH tunnel, default value is 22.         rs   defaultrP   rm   --forward-ssh-password"          SSH password.
          rs   --forward-ssh-private-keySSH private key..rN   rO   --private-connection&Resource ID of the private connection.r#   r[   r]   group--private-connection.regionr^   r_   N)
	add_groupadd_argumentr   ra   r1   rS   r9   r   rQ   rT   )	rV   rW   rX   rP   r   connectivity_parserforward_ssh_parserpassword_grouprc   s	            r   %AddOracleConnectionProfileResourceArgr      s{    D!D((t(4"" + # -
 +446!!- "  !!- "  !!
	 " 
 &///N. &   !(;  = 11

*
,
&
-
-d
3	
 11
 
*
,
2'n#%. 
'*"	 
V	r   c                    U(       a  SnOSnU R                  SS9nUR                  SSSS9  [        U5        [        R                  " U[        5       S	R                  U5      SS
9[        R                  " S[        5       SSS0US9[        R                  " S[        5       SSS0SUS9/n[        R                  " US/S/S.S9R                  U 5        g)a  Add a resource argument for a database migration sqlserver cp.

Args:
  parser: the parser for the command.
  verb: str, the verb to describe the resource, such as 'to update'.
  positional: bool, if True, means that the resource is a positional rather
    than a flag.
rL   rM   Trl   rn   ro   rp   rq   rN   rO   r   r   r#   r[   r   --psc-service-attachment&Resource ID of the service attachment.)r]   hiddenr   r^   )r   --psc-service-attachment.regionr_   N)r   r   AddForwardSshConnectivityGroupr   ra   r1   rS   r9   r=   r   rQ   rT   rV   rW   rX   r   r   rc   s         r   (AddSqlServerConnectionProfileResourceArgr   B  s     D!D((t(4"" + # -
 !!45 11

*
,
&
-
-d
3	
 11
 
*
,
2'n#% 11
$
*
,
2'n#.* *4.8\"	
 
V	r   c                    U(       a  SnOSnU R                  SS9nUR                  SSSS9  [        USS	9  [        R                  " U[        5       S
R                  U5      SS9[        R                  " S[        5       SSS0US9[        R                  " S[        5       SSS0USS9/n[        R                  " US/S/S.S9R                  U 5        g)a  Add a resource argument for a database migration postgresql cp.

Args:
  parser: the parser for the command.
  verb: str, the verb to describe the resource, such as 'to update'.
  positional: bool, if True, means that the resource is a positional rather
    than a flag.
rL   rM   Trl   rn   ro   rp   rq   r   rN   rO   r   r   r#   r[   r   r   r   )r]   r   r   r^   )r   r   r_   N)r   r   r   r   ra   r1   rS   r=   r9   r   rQ   rT   r   s         r   )AddPostgresqlConnectionProfileResourceArgr   w  s     D!D((t(4"" + #  !!4TB 11

*
,
&
-
-d
3	 11
$
*
,
2'n# 11
 
*
,
2'n#.. .8\*4" Kr   c                     U R                  US9nUR                  SSSS9  UR                  SSSS9  UR                  SS	S
S9  UR                  SSS9nUR                  SSS9  UR                  SSS9  g)zAdds a group for forward ssh connectivity.

Args:
  parser: the parser for the command.
  hidden: whether the group is hidden.
r   rt   ru   Trv   rw   rx   ry   rz   r{   r|   r~   r   r   r   r   r   N)r   r   )rV   r   r   r   s       r   r   r     s     ''v'6!!- "  !!- "  !!
	 " 
 &//T/J. &   !(;  =r   c                     U(       a  SnOSn[         R                  " U[        5       SR                  U5      SS9/n[        R
                  " U5      R                  U 5        g)a+  Add resource arguments for actions on an mj except create/update.

Args:
  parser: argparse.ArgumentParser, the parser for the command.
  verb: str, the verb to describe the resource, such as 'to promote'.
  positional: bool, if True, means that the resource is a positional rather
    than a flag.
migration_jobz--migration-jobThe migration job {}.TrO   N)r   ra   r4   rS   r   rQ   rT   rV   rW   rX   r   rc   s        r   AddOnlyMigrationJobResourceArgsr     s_     DD 11

%
'
!
(
(
.	. Kr   c           
      8   [         R                  " S[        5       SR                  U5      SS9[         R                  " S[	        5       SUSS0S	9[         R                  " S
[	        5       SUSS0S	9/n[
        R                  " US/S/S.S9R                  U 5        g)a  Add resource arguments for creating/updating a database migration job.

Args:
  parser: argparse.ArgumentParser, the parser for the command.
  verb: str, the verb to describe the resource, such as 'to update'.
  required: boolean, whether source/dest resource args are required.
r   r   TrO   --sourceFID of the source connection profile, representing the source database.r#   r[   r\   --destinationPID of the destination connection profile, representing the destination database.r^   )--source.region--destination.regionr_   N)r   ra   r4   rS   r1   r   rQ   rT   rV   rW   rP   rc   s       r   AddMigrationJobResourceArgsr     s     11

%
'
!
(
(
.	 11

*
, 'n	 11

*
,& 'n	#.8 (\#-," Kr   c                    [         R                  " S[        5       SR                  U5      SS9[         R                  " S[	        5       SUSS0S	9[         R                  " S
[	        5       SUSS0S	9[         R                  " S[        5       SSS0S9[         R                  " S[        5       SSS0SS9[         R                  " S[        5       SSS0S9/n[        R                  " US/S/S/S/S/S.S9R                  U 5        g)a  Add resource arguments for creating/updating a heterogeneous database mj.

Args:
  parser: argparse.ArgumentParser, the parser for the command.
  verb: str, the verb to describe the resource, such as 'to update'.
  required: boolean, whether source/dest resource args are required.
r   r   TrO   r   r   r#   r[   r\   r   r   --conversion-workspacezBName of the conversion workspaces to be used for the migration jobrf   z--original-migration-namezLName of the original migration job to be used for the failback migration job)r]   r   ri   zMName of the CMEK (customer-managed encryption key) used for the migration jobr^   )r   r   z--conversion-workspace.regionz --original-migration-name.regionz--cmek-key.regionr_   N)
r   ra   r4   rS   r1   r@   rG   r   rQ   rT   r   s       r   (AddHeterogeneousMigrationJobResourceArgsr     s8    11

%
'
!
(
(
.	 11

*
, 'n	 11

*
,& 'n	 11
"
,
.
N'n	 11
%
%
''n 11

 
"#  (nS2.f (\#-,,6</9l *|"	 Kr   c                  \    S n [         R                  " SSU " 5       [         R                  S9$ )z:Constructs and returns the Resource specification for VPC.c                  ,    [         R                  " SSS9$ )Nvpcz@fully qualified name of the VPC database migration will peer to.r
   r   r$   r   r   VpcAttributeConfig.GetVpcResourceSpec.<locals>.VpcAttributeConfig^  s    44N r   zcompute.networksr   )r'   networkr<   )r   r+   r,   )r   s    r   GetVpcResourceSpecr   [  s1     
		 "77	
9 9r   c                     U(       a  SnOSn[         R                  " U[        5       SR                  U5      SS9/n[        R
                  " U5      R                  U 5        ga  Add a resource argument for a database migration private connection.

Args:
  parser: the parser for the command.
  verb: str, the verb to describe the resource, such as 'to update'.
  positional: bool, if True, means that the resource is a positional rather
    than a flag.
private_connectionr   zThe private connection {}.TrO   Nr   ra   r9   rS   r   rQ   rT   r   s        r   AddPrivateConnectionResourceArgr   m  ]     D!D 11

*
,
&
-
-d
3	. /;;FCr   c                     U(       a  SnOSn[         R                  " U[        5       SR                  U5      SS9/n[        R
                  " U5      R                  U 5        gr   r   r   s        r   %AddPrivateConnectionDeleteResourceArgr     r   r   c                     U(       a  SnOSn[         R                  R                  U[        5       SR	                  U5      SS9R                  U 5        g)a  Add a resource argument for a database migration conversion workspace.

Args:
  parser: the parser for the command.
  verb: str, the verb to describe the resource, such as 'to update'.
  positional: bool, if True, means that the resource is a positional rather
    than a flag.
conversion_workspacer   The conversion workspace {}.TrO   N)r   rQ   rR   r@   rS   rT   rU   s       r   !AddConversionWorkspaceResourceArgr     sP     !D#D++
(*$++D1	 , 
 Kr   c           
         U(       a  SnOSnU R                  SSS9n[        R                  " U[        5       SR	                  U5      SS9[        R                  " S[        5       SR	                  U5      S	S
0US9[        R                  " S[        5       SR	                  U5      S	S
0US9/n[        R                  " US/S/S.S9R                  U 5        g)a
  Add a resource argument for seeding a database migration cw.

Args:
  parser: the parser for the command.
  verb: str, the verb to describe the resource, such as 'to seed'.
  positional: bool, if True, means that the resource is a positional rather
    than a flag.
r   r   T)rm   rP   r   rO   z--source-connection-profilezThe connection profile {} from.r#   r[   r    --destination-connection-profiler^   )z"--source-connection-profile.region'--destination-connection-profile.regionr_   N)	r   r   ra   r@   rS   r1   r   rQ   rT   )rV   rW   rX   r   rL   rc   s         r   %AddConversionWorkspaceSeedResourceArgr     s     !D#D''dT'B 11

,
.
(
/
/
5	 11
'
*
,
+
2
24
8'n" 11
,
*
,
+
2
24
8'n"., 1;6@\"	
 
V	r   c           	      (   U(       a  SnOSn[         R                  " U[        5       SR                  U5      SS9[         R                  " S[	        5       SR                  U5      SS	0SS
9/n[
        R                  " USS/0S9R                  U 5        g)a  Add a resource argument for applying a database migration cw.

Args:
  parser: the parser for the command.
  verb: str, the verb to describe the resource, such as 'to apply'.
  positional: bool, if True, means that the resource is a positional rather
    than a flag.
r   r   r   TrO   r   zThe connection profile {} to.r#   r[   )r]   rP   r   r^   r_   N)r   ra   r@   rS   r1   r   rQ   rT   r   s        r   &AddConversionWorkspaceApplyResourceArgr     s     !D#D 11

,
.
(
/
/
5	 11
,
*
,
)
0
0
6'n. 
3j\"	 
V	r   N)rL   )r   )r   )service_attachment)r   )zcmek-key)zcmek-keyring)zcmek-project)r#   )rI   )T)TT)F),__doc__
__future__r   r   r    googlecloudsdk.calliope.conceptsr   (googlecloudsdk.command_lib.util.conceptsr   r   r   r   r   r   r   r   r   r!   r%   r.   r1   r4   r9   r=   r@   rG   rJ   rY   rd   rg   rj   r   r   r   r   r   r   r   r   r   r   r   r   r   r$   r   r   <module>r      s    E &  ' 5 D GH
C
H
>
G
%%%9	%

)(6>$ 6:37?H 9=2j4n=<6*ZDN9$D2D2*+\!r   