
    !                        S r SSK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  \R                  \R                  " \R                  R                   5       " S	 S
\R"                  5      5       5       r\R                  " \R                  R&                  5       " S S\5      5       r\R                  " \R                  R*                  5       " S S\5      5       rg)z%bigtable app profiles create command.    N)	HttpError)app_profiles)util)base)	arguments)logc                   \    \ rS rSrSrS\R                  " S5      0r\S 5       r	S r
S rSrg	)
CreateAppProfile   "Create a new Bigtable app profile.EXAMPLESa            To create an app profile with a multi-cluster routing policy, run:

            $ {command} my-app-profile-id --instance=my-instance-id --route-any

          To create an app profile with a single-cluster routing policy which
          routes all requests to `my-cluster-id`, run:

            $ {command} my-single-cluster-app-profile --instance=my-instance-id --route-to=my-cluster-id

          To create an app profile with a friendly description, run:

            $ {command} my-app-profile-id --instance=my-instance-id --route-any --description="Routes requests for my use case"

          To create an app profile with a request priority of PRIORITY_MEDIUM,
          run:

            $ {command} my-app-profile-id --instance=my-instance-id --route-any --priority=PRIORITY_MEDIUM

          To create an app profile with row-affinity routing enabled, run:

            $ {command} my-app-profile-id --instance=my-instance-id --route-any --row-affinity

          To create an app profile with Data Boost enabled which bills usage to the host project, run:

            $ {command} my-app-profile-id --instance=my-instance-id --data-boost --data-boost-compute-billing-owner=HOST_PAYS

          c                     [         R                  " U S5        [         R                  " U 5      R                  SSS9R	                  5       R                  5       R                  S5        g N	to createapp profileFrequiredcreater   AddAppProfileResourceArgArgAdderAddDescriptionAddAppProfileRoutingAddIsolationAddForceparsers    +lib/surface/bigtable/app_profiles/create.pyArgsCreateAppProfile.Args@   H    &&v{;6"		6					(	    c                 2   [         R                  " U5        [        R                  " UUR                  UR
                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  S9$ z  Creates an AppProfile with the given arguments.

Args:
  app_profile_ref: A resource reference of the new app profile.
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Raises:
  ConflictingArgumentsException,
  OneOfArgumentsRequiredException:
    See app_profiles.Create(...)

Returns:
  Created app profile resource object.
)
clusterdescriptionmulti_clusterrestrict_totransactional_writesrow_affinitypriority
data_boost data_boost_compute_billing_ownerforcer   ValidateStandardIsolationArgsr   Createroute_tor'   	route_anyr)   r*   r+   r,   r-   r.   r/   selfapp_profile_refargss      r   _CreateAppProfile"CreateAppProfile._CreateAppProfileK   x      ++D1$$nn$$!66&&??)-)N)Njj r"   c                    UR                   R                  R                  5       n U R                  X!5      n[        R
                  " UR                  5       SS9  U$ ! [         a   n[        R                  " U5         SnAgSnAff = f)a/  This is what gets called when the user runs this command.

Args:
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Raises:
  ConflictingArgumentsException,
  OneOfArgumentsRequiredException:
    See _CreateAppProfile(...)

Returns:
  Created resource.
r   )kindN)
CONCEPTSapp_profileParser9   r   CreatedResourceNamer   r   FormatErrorMessages)r6   r8   r7   resultes        r   RunCreateAppProfile.Runj   st     mm//557O%%o<f 
/..0}Em	  "
q!!"s   A 
B&BB N)__name__
__module____qualname____firstlineno____doc__textwrapdedentdetailed_helpstaticmethodr   r9   rF   __static_attributes__rH   r"   r   r
   r
      sA     + (// # ->  >r"   r
   c                   V    \ rS rSrSrS\R                  " S5      0r\S 5       r	S r
Srg)	CreateAppProfileBeta   r   r   a            To create an app profile with a multi-cluster routing policy, run:

            $ {command} my-app-profile-id --instance=my-instance-id --route-any

          To create an app profile with a single-cluster routing policy which
          routes all requests to `my-cluster-id`, run:

            $ {command} my-single-cluster-app-profile --instance=my-instance-id --route-to=my-cluster-id

          To create an app profile with a friendly description, run:

            $ {command} my-app-profile-id --instance=my-instance-id --route-any --description="Routes requests for my use case"

          To create an app profile with a request priority of PRIORITY_MEDIUM,
          run:

            $ {command} my-app-profile-id --instance=my-instance-id --route-any --priority=PRIORITY_MEDIUM

          To create an app profile with Data Boost enabled which bills usage to the host project, run:

            $ {command} my-app-profile-id --instance=my-instance-id --data-boost --data-boost-compute-billing-owner=HOST_PAYS

          To create an app profile with row-affinity routing enabled, run:

            $ {command} my-app-profile-id --instance=my-instance-id --route-any --row-affinity

          c                     [         R                  " U S5        [         R                  " U 5      R                  SSS9R	                  5       R                  5       R                  S5        g r   r   r   s    r   r   CreateAppProfileBeta.Args   r!   r"   c                 2   [         R                  " U5        [        R                  " UUR                  UR
                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  S9$ r$   r0   r5   s      r   r9   &CreateAppProfileBeta._CreateAppProfile   r;   r"   rH   N)rI   rJ   rK   rL   rM   rN   rO   rP   rQ   r   r9   rR   rH   r"   r   rT   rT      s:    * (// # ->  r"   rT   c                   .    \ rS rSrSr\S 5       rS rSrg)CreateAppProfileAlpha   r   c                     [         R                  " U S5        [         R                  " U 5      R                  SSS9R	                  5       R                  SS9R                  S5        g )Nr   r   Fr   Tallow_memory_layerr   r   r   s    r   r   CreateAppProfileAlpha.Args   sM    &&v{;6"		6					.	(	r"   c                 F   [         R                  " USS9  [        R                  " UUR                  UR
                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  S9$ )r%   Tr^   )r&   r'   r(   r)   r*   r+   r,   use_memory_layerr-   r.   r/   )r   r1   r   r2   r3   r'   r4   r)   r*   r+   r,   rb   r-   r.   r/   r5   s      r   r9   'CreateAppProfileAlpha._CreateAppProfile   s      ++DTJ$$nn$$!66&&..??)-)N)Njj r"   rH   N)	rI   rJ   rK   rL   rM   rQ   r   r9   rR   rH   r"   r   r[   r[      s    * r"   r[   )rM   rN   apitools.base.py.exceptionsr   googlecloudsdk.api_lib.bigtabler   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.bigtabler   googlecloudsdk.corer   DefaultUniverseOnlyReleaseTracksReleaseTrackGACreateCommandr
   BETArT   ALPHAr[   rH   r"   r   <module>rp      s    ,  1 8 0 ( 9 # D%%(()bt)) b * bJ D%%**+J+ J ,JZ D%%++,,0 , -,r"   