
                             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	  ej                  ej                  j                  ej                  j                  ej                  j                         G d d	ej                               Zy
)z'gcloud emulators spanner start command.    )absolute_import)division)unicode_literals)arg_parsers)base)spanner_utilc                   .    e Zd ZdZddiZed        Zd Zy)Startz_Start a local Cloud Spanner emulator.

  This command starts a local Cloud Spanner emulator.
  EXAMPLESz[          To start a local Cloud Spanner emulator, run:

            $ {command}
          c                     | j                  ddd d       | j                  ddt        j                  dd      d	       | j                  d
dt        j                         d       | j                  ddt        j                         dd       y )Nz--host-portFc                 D    t         j                  j                  | d      S )NT)ipv6_enabled)r   HostPortParse)args    &lib/surface/emulators/spanner/start.py<lambda>zStart.Args.<locals>.<lambda>0   s    --33Cd3K    a  The host:port to which the emulator should be bound. The default value is localhost:9010. Note that this port serves gRPC requests. To override the default port serving REST requests, use --rest-port. If using Docker to run the emulator, the host must be specified as an ipaddress.)requiredtypehelpz--rest-port   i  zyThe port at which REST requests are served. gcloud uses REST to communicate with the emulator. The default value is 9020.z--use-dockera  Use the Cloud Spanner emulator docker image even if the platform has a native binary available in the gcloud CLI. Currently we only provide a native binary for Linux. For other systems, you must install Docker for your platform before starting the emulator.z--enable-fault-injectionzvIf true, the emulator will randomly inject faults into transactions. This facilitates application abort-retry testing.)r   r   r   default)add_argumentr   
BoundedInt
ArgBoolean)parsers    r   Argsz
Start.Args+   s    
K	   ##Au-D	  E ##%I	  J "##%J  r   c                     |j                   st        j                  dd      |_         |j                  sd|_        t	        j
                  |       y )N	localhost9010i<#  )	host_portr   r   	rest_portr   r
   )selfargss     r   Runz	Start.RunL   s9    >>"++K@dn>>dntr   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r&    r   r   r
   r
      s2     -  @r   r
   N)r*   
__future__r   r   r   googlecloudsdk.callioper   r   $googlecloudsdk.command_lib.emulatorsr   ReleaseTracksReleaseTrackALPHABETAGACommandr
   r-   r   r   <module>r7      ss    . &  ' / ( = D%%++T->->-C-C%%((*6DLL 6*6r   