
    oe                     r   S 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
S-S
 jrS.S jrS/S jrS rS0S jrS(S jrS)S jrS*S jrS+S jrS,S jrS-S jrS1S jrS2S jrS rS rS r  S3S jr S2S jrS2S jrS4S jrS2S jrS4S jr S4S  jr!S! r"S2S" jr#S2S# jr$S2S$ jr%S2S% jr&S2S& jr'g')5z>Shared resource flags for Database Migration Service commands.    )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   2   s    		2	2	==r   c                 ,    [         R                  " U SS9$ )Nz&The CMEK keyring id of the {resource}.r   r
   r   s    r   CmekKeyringAttributeConfigr   7   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"   C   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+   H   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    GetConnectionProfileResourceSpecr.   Q   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   GetMigrationJobResourceSpecr1   [   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    GetPrivateConnectionResourceSpecr6   f   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:   q   s,    			"!8mL77	
9 9r   c           
      p    [         R                  " SU S[        U S9[        5       [         R                  SS9$ )Nz5datamigration.projects.locations.conversionWorkspacesr3   r   F)r$   r4   conversionWorkspacesIdr%   r&   r'   )r   r(   r   r"   r)   r*   s    r   "GetConversionWorkspaceResourceSpecr=   y   s;    			=!?')::#
% %r   c                 x    [         R                  " SU S[        5       [        5       [	        5       [        5       SS9$ )N/cloudkms.projects.locations.keyRings.cryptoKeysr3   Fr$   r4   cryptoKeysId
keyRingsIdr%   r&   r'   r   r(   r   r   r"   r   r*   s    r   GetCmekKeyResourceSpecrD      s9    			7!)++-')+-#	
 	r   c                 ~    [         R                  " SU S[        S5      [        S5      [	        5       [        S5      SS9$ )Nr?   r3   kms-keyzkms-keyringzkms-projectFr@   rC   r*   s    r   GetKMSKeyResourceSpecrG      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ForResourcer.   formatAddToParserparserverb
positionalr   s       r   AddConnectionProfileResourceArgrV      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'.
rI   rK   TrL   z--source-idz8Database Migration Service source connection profile ID.r     rM   flag_name_overridesz--source-id.region--regioncommand_level_fallthroughsN)r   ResourcePresentationSpecr.   rP   r   rN   rQ   rS   rT   resource_specss      r   (AddCloudSqlConnectionProfileResourceArgsra      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'.
rI   rK   TrL   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    rX   rZ   z--kms-key.regionr[   r\   N)r   r^   r.   rP   rG   r   rN   rQ   r_   s      r   'AddAlloyDBConnectionProfileResourceArgsrd      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    rX   rc   N)r   rN   rO   rD   rQ   )rS   s    r   AddCmekResourceArgsrg      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.
rI   rJ   Tmutex--static-ip-connectivity
store_trueuse static ip connectivityactionhelp--forward-ssh-hostnameHostname for the SSH tunnel.rp   rM   --forward-ssh-usernameUsername for the SSH tunnel.--forward-ssh-port3Port for the SSH tunnel, default value is 22.         rp   defaultrM   rj   --forward-ssh-password"          SSH password.
          rp   --forward-ssh-private-keySSH private key..rK   rL   --private-connection&Resource ID of the private connection.r    rX   rZ   group--private-connection.regionr[   r\   N)
	add_groupadd_argumentr   r^   r.   rP   r6   r   rN   rQ   )	rS   rT   rU   rM   r   connectivity_parserforward_ssh_parserpassword_groupr`   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.
rI   rJ   Tri   rk   rl   rm   rn   rK   rL   r   r   r    rX   r   --psc-service-attachment&Resource ID of the service attachment.)rZ   hiddenr   r[   )r   --psc-service-attachment.regionr\   N)r   r   AddForwardSshConnectivityGroupr   r^   r.   rP   r6   r:   r   rN   rQ   rS   rT   rU   r   r   r`   s         r   (AddSqlServerConnectionProfileResourceArgr   ?  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.
rI   rJ   Tri   rk   rl   rm   rn   r   rK   rL   r   r   r    rX   r   r   r   )rZ   r   r   r[   )r   r   r\   N)r   r   r   r   r^   r.   rP   r:   r6   r   rN   rQ   r   s         r   )AddPostgresqlConnectionProfileResourceArgr   t  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   rq   rr   Trs   rt   ru   rv   rw   rx   ry   r{   r|   r}   r~   r   r   N)r   r   )rS   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 {}.TrL   N)r   r^   r1   rP   r   rN   rQ   rS   rT   rU   r   r`   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   TrL   --sourceFID of the source connection profile, representing the source database.r    rX   rY   --destinationPID of the destination connection profile, representing the destination database.r[   )--source.region--destination.regionr\   N)r   r^   r1   rP   r.   r   rN   rQ   rS   rT   rM   r`   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   TrL   r   r   r    rX   rY   r   r   --conversion-workspacezBName of the conversion workspaces to be used for the migration jobrc   z--original-migration-namezLName of the original migration job to be used for the failback migration job)rZ   r   rf   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   r^   r1   rP   r.   r=   rD   r   rN   rQ   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$   networkr9   )r   r(   r)   )r   s    r   GetVpcResourceSpecr   X  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 {}.TrL   Nr   r^   r6   rP   r   rN   rQ   r   s        r   AddPrivateConnectionResourceArgr   j  ]     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 {}.TrL   N)r   rN   rO   r=   rP   rQ   rR   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)rj   rM   r   rL   z--source-connection-profilezThe connection profile {} from.r    rX   r    --destination-connection-profiler[   )z"--source-connection-profile.region'--destination-connection-profile.regionr\   N)	r   r   r^   r=   rP   r.   r   rN   rQ   )rS   rT   rU   r   rI   r`   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   TrL   r   zThe connection profile {} to.r    rX   )rZ   rM   r   r[   r\   N)r   r^   r=   rP   r.   r   rN   rQ   r   s        r   &AddConversionWorkspaceApplyResourceArgr     s     !D#D 11

,
.
(
/
/
5	 11
,
*
,
)
0
0
6'n. 
3j\"	 
V	r   N)rI   )r   )r   )service_attachment)r   )zcmek-key)zcmek-keyring)zcmek-project)r    )rF   )T)TT)F)(__doc__ googlecloudsdk.calliope.conceptsr   (googlecloudsdk.command_lib.util.conceptsr   r   r   r   r   r   r   r   r   r   r"   r+   r.   r1   r6   r:   r=   rD   rG   rV   ra   rd   rg   r   r   r   r   r   r   r   r   r   r   r   r   r   r!   r   r   <module>r      s    E 6 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   