
    k
                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ d	d
dZ ej                  ej                  j                          G d dej"                               Zee_        y)zDBare Metal Solution interactive serial console SSH keys add command.    )absolute_import)division)unicode_literals)	BmsClient)base)flags)filesz}
          Add a public SSH key to the project for accessing the interactive serial console in Bare Metal Solution."
        a  
          To add an SSH key called ``my-ssh-key'' in project ``my-project''
          with a public key ``ABC6695''

          $ {command} my-ssh-key --project=my-project --key=ABC6695

          To add an SSH key called ``my-ssh-key'' in project ``my-project''
          with a public key stored in /home/user/.ssh/id_rsa.pub

          $ {command} my-ssh-key --project=my-project --key-file=/home/user/.ssh/id_rsa.pub
    )DESCRIPTIONEXAMPLESc                   &    e Zd ZdZed        Zd Zy)AddzhAdd a public SSH key to the project for accessing the interactive serial console in Bare Metal Solution.c                     t        j                  | d       | j                  d      }|j                  dd       |j                  dd       y	)
z Register flags for this command.T)
positional)requiredz--keyz<The SSH public key to add for the interactive serial console)helpz
--key-filezYThe path to a file containing an SSH public key to add for the interactive serial consoleN)r   !AddSerialConsoleSshKeyArgToParseradd_mutually_exclusive_groupadd_argument)parserkey_args     .lib/surface/bms/serial_console_ssh_keys/add.pyArgszAdd.Args3   s^     
++FtD1141@GK  M +  -    c                     t               }|j                  r t        j                  |j                        }n|j                  }|j                  |j                  j                  j                         |      S )N)resource
public_key)	r   key_filer	   ReadFileContentskeyCreateSshKeyCONCEPTSserial_console_ssh_keyParse)selfargsclientr   s       r   RunzAdd.Run@   s^    [F}}))$--8j88j55;;=   r   N)__name__
__module____qualname____doc__staticmethodr   r'    r   r   r   r   /   s    p
- 
-r   r   N)r+   
__future__r   r   r   %googlecloudsdk.api_lib.bms.bms_clientr   googlecloudsdk.callioper   googlecloudsdk.command_lib.bmsr   googlecloudsdk.core.utilr	   DETAILED_HELPReleaseTracksReleaseTrackALPHACreateCommandr   detailed_helpr-   r   r   <module>r9      su    K &  ' ; ( 0 *
	
	( D%%++,$

  -6 " r   