
                            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KJr  SSKJ
r  SS	KJr  S
rSr " S S\5      r\R(                  " \R*                  R,                  5       " S S\\R.                  5      5       r\R(                  " \R*                  R2                  5       " S S\\R.                  5      5       rg)z?Command to create connection profiles for a database migration.    )absolute_import)division)unicode_literals)resource_args)base)flags)create_helper)
console_ioACreate a Database Migration Service connection profile for MySQL.a      To create a connection profile for MySQL:

        $ {{command}} my-profile --region=us-central1 --password=123456
        --username=my-user --host=1.2.3.4 --port=3306

    If the source is a Cloud SQL database, run:

        $ {{command}} my-profile --region=us-central1 --password=123456
        --username=my-user --host=1.2.3.4 --port=3306
        --{instance}=my-instance --provider=CLOUDSQL
    c                   .    \ rS rSrSr\S 5       rS rSrg)_MySQL,   r   c                    [         R                  " U S5        [        R                  " U 5        [        R                  " U 5        [        R
                  " U SS9  [        R                  " U 5        [        R                  " U 5        g)zArgs is called by calliope to gather arguments for this command.

Args:
  parser: An argparse parser that you can use to add arguments that go on
    the command line after this command. Positional arguments are allowed.
z	to createF)require_passwordN)	r   AddConnectionProfileResourceArgcp_flagsAddNoAsyncFlagAddDisplayNameFlagAddDatabaseParamsFlagsAddProviderFlagr   AddLabelsCreateFlagsparsers    Blib/surface/database_migration/connection_profiles/create/mysql.pyArgs_MySQL.Args/   s\     11&+FF#'##FUCV$	v&    c                 L   UR                   R                  R                  5       nUR                  5       R	                  5       nUR
                  (       a  [        R                  " S5      Ul        [        R                  " 5       nUR                  U R                  5       UX!S5      $ )a  Create a Database Migration Service connection profile.

Args:
  args: argparse.Namespace, The arguments that this command was invoked
    with.

Returns:
  A dict object representing the operations resource describing the create
  operation if the create was successful.
zPlease Enter Password: MYSQL)CONCEPTSconnection_profileParseParentRelativeNameprompt_for_passwordr
   PromptPasswordpasswordr	   CreateHelpercreateReleaseTrack)selfargsconnection_profile_ref
parent_refhelpers        r   Run
_MySQL.Run?   s     "]]==CCE'..0==?J //0IJdm'')F==**,j/w@ @r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r0   __static_attributes__r2   r   r   r   r   ,   s    I' '@r   r   c                   L    \ rS rSrSr\\R                  SS9S.r\	S 5       r
Srg)	
MySQLAlphaU   r   instancer=   DESCRIPTIONEXAMPLESc                     [         R                  U 5        [        R                  " U [        R
                  R                  5        [        R                  " U 5        g N)r   r   r   AddSslConfigGroupr   r*   ALPHAAddInstanceFlagr   s    r   r   MySQLAlpha.Args^   s8    
KKvt'8'8'>'>?V$r   r2   Nr3   r4   r5   r6   r7   r@   rA   formatdetailed_helpr8   r   r9   r2   r   r   r;   r;   U   s3    I !//:/6-
 % %r   r;   c                   L    \ rS rSrSr\\R                  SS9S.r\	S 5       r
Srg)	MySQLGAe   r   zcloudsql-instancer>   r?   c                     [         R                  U 5        [        R                  " U [        R
                  R                  5        [        R                  " U 5        [        R                  " U 5        g rC   )	r   r   r   rD   r   r*   GAAddCloudSQLInstanceFlagAddRoleFlagr   s    r   r   MySQLGA.Argsn   sF    
KKvt'8'8';';<$$V, r   r2   NrH   r2   r   r   rL   rL   e   s4    I !//+>/?-
 ! !r   rL   N)r7   
__future__r   r   r   )googlecloudsdk.api_lib.database_migrationr   googlecloudsdk.callioper   -googlecloudsdk.command_lib.database_migrationr   Agooglecloudsdk.command_lib.database_migration.connection_profilesr	   r   googlecloudsdk.core.consoler
   r@   rA   objectr   ReleaseTracksr*   rE   Commandr;   rO   rL   r2   r   r   <module>r\      s    F &  ' C ( ? [ _ 2&@V &@R D%%++,% % -% D%%(()!fdll ! *!r   