
    V                        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SK
Jr  SSKJr  SSKJr  Sr SS jr\	R*                  " \	R,                  R.                  5       " S S\	R0                  5      5       r\	R*                  " \	R,                  R4                  \	R,                  R6                  5       " S S\5      5       rg)z"ai-platform models create command.    )absolute_import)division)unicode_literals)models)arg_parsers)base)	constants)endpoint_util)flags)models_util)labels_util)loga  Google Cloud region of the regional endpoint to use for this command.

If you specify this flag, do not specify `--regions`.

If you specify `--region=global`, the model will be deployed to 'us-central1'
by default using the global endpoint. Please use `--regions` only if you want
to change the region where the model will be deployed against the global
endpoint.

If both flags are unspecified and you don't set ``ai_platform/region'', you will
be prompted for region of the regional endpoint.

Learn more about regional endpoints and see a list of available regions:
 https://cloud.google.com/ai-platform/prediction/docs/regional-endpoints
c                    [         R                  " 5       R                  U 5        [         R                  " S5      R                  U 5        U R	                  5       nUR                  S[        R                  [        S9  UR                  SS[        R                  " SS9SS	9  U R                  S
SSS9  U(       a  U R                  SSSS9  [        R                  " U 5        g)z:Get arguments for the `ai-platform models create` command.modelz--region)choiceshelpz	--regionsREGION   )
min_lengthzThe Google Cloud region where the model will be deployed (currently only a
single region is supported) against the global endpoint.

If you specify this flag, do not specify `--region`.

Defaults to 'us-central1' while using the global endpoint.
)metavartyper   z--enable-logging
store_truezIf set, enables StackDriver Logging for online prediction. These logs are like standard server access logs, containing information such as timestamps and latency for each request.)actionr   z--enable-console-loggingzIf set, enables StackDriver Logging of stderr and stdout streams for online prediction. These logs are more verbose than the standard access logs and can be helpful for debugging.N)r   GetModelNameAddToParserGetDescriptionFlagadd_mutually_exclusive_groupadd_argumentr	   SUPPORTED_REGIONS_WITH_GLOBAL_REGION_FLAG_HELPTEXTr   ArgListr   AddCreateLabelsFlags)parsersupport_console_loggingregion_groups      (lib/surface/ai_platform/models/create.py_AddCreateArgsr'   1   s     ""6*7#//7446,55   " !,	   	>  ? 
"F  G ""6*    c                   8    \ rS rSrSr\S 5       rSS jrS rSr	g)	CreateW   Create a new AI Platform model.c                     [        U 5        g Nr'   r#   s    r&   ArgsCreate.Args[   s
    6r(   c                    [         R                  " U5      u  p4[        R                  " US9   [        R
                  " 5       n[         R                  " XQ5      nU=(       a    UR                  n[         R                  " UUR                  UUR                  UUUR                  S9n[        R                  " UR                  SS9  S S S 5        g ! , (       d  f       g = f)N)region)enable_loggingenable_console_logginglabelsdescriptionzai platform model)kind)r   GetModelRegionr
   MlEndpointOverridesr   ModelsClientParseCreateLabelsr6   r*   r   r5   r8   r   CreatedResourcename)	selfargsr$   r4   model_regionsmodels_clientr7   r6   r   s	            r&   _RunCreate._Run_   s    '66t<F		*	*&	9))+m,,]Af
!
Ad&A&A   

**
,,!7&&(e 
%**+>? 
:	9	9s   BC
Cc                 &    U R                  U5        g r.   rD   r@   rA   s     r&   Run
Create.Runp   s    IIdOr(    NF)
__name__
__module____qualname____firstlineno____doc__staticmethodr1   rD   rI   __static_attributes__rK   r(   r&   r*   r*   W   s"    ' @"r(   r*   c                   .    \ rS rSrSr\S 5       rS rSrg)
CreateBetat   r,   c                     [        U SS9  g NT)r$   r/   r0   s    r&   r1   CreateBeta.Argsx   s    648r(   c                 $    U R                  USS9  g rX   rG   rH   s     r&   rI   CreateBeta.Run|   s    IIdDI1r(   rK   N)	rM   rN   rO   rP   rQ   rR   r1   rI   rS   rK   r(   r&   rU   rU   t   s    '9 92r(   rU   NrL   )rQ   
__future__r   r   r    googlecloudsdk.api_lib.ml_enginer   googlecloudsdk.callioper   r   $googlecloudsdk.command_lib.ml_enginer	   r
   r   r   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   r    r'   ReleaseTracksReleaseTrackGACreateCommandr*   BETAALPHArU   rK   r(   r&   <module>rh      s    ) &  ' 3 / ( : > 6 < < # & ,1#+L D%%(()T  *8 D%%**D,=,=,C,CD2 2 E2r(   