
    3!                        S r SSKJr  SSKJr  SSKJ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&                  R2                  5       " S S\5      5       rg)z%bigtable app profiles create command.    )absolute_import)division)unicode_literalsN)	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 Nz	to createapp profileF)requiredcreater
   AddAppProfileResourceArgArgAdderAddDescriptionAddAppProfileRoutingAddIsolationAddForceparsers    +lib/surface/bigtable/app_profiles/create.pyArgsCreateAppProfile.ArgsC   H    &&v{;6"		6					(	    c                    [         R                  " UUR                  UR                  UR                  UR
                  UR                  UR                  UR                  UR                  UR                  UR                  S9$ az  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   Createroute_tor'   	route_anyr)   r*   r+   r,   r-   r.   r/   selfapp_profile_refargss      r   _CreateAppProfile"CreateAppProfile._CreateAppProfileN   j      $$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Parser8   r   CreatedResourceNamer   r   FormatErrorMessages)r5   r7   r6   resultes        r   RunCreateAppProfile.Runl   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    r8   rE   __static_attributes__rG   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                    [         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   r4   s      r   r8   &CreateAppProfileBeta._CreateAppProfile   r:   r#   rG   N)rH   rI   rJ   rK   rL   rM   rN   rO   rP   r    r8   rQ   rG   r#   r   rS   rS      s:    * (// # ->  r#   rS   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                  5       R                  S5        g r   r   r   s    r   r    CreateAppProfileAlpha.Args   r"   r#   c                    [         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   r4   s      r   r8   'CreateAppProfileAlpha._CreateAppProfile   r:   r#   rG   N)	rH   rI   rJ   rK   rL   rP   r    r8   rQ   rG   r#   r   rZ   rZ      s    * r#   rZ   )rL   
__future__r   r   r   rM   apitools.base.py.exceptionsr   googlecloudsdk.api_lib.bigtabler   r   googlecloudsdk.callioper	   #googlecloudsdk.command_lib.bigtabler
   googlecloudsdk.corer   DefaultUniverseOnlyReleaseTracksReleaseTrackGACreateCommandr   BETArS   ALPHArZ   rG   r#   r   <module>rm      s    , &  '  1 8 0 ( 9 # D%%(()at)) a * aH D%%**+I+ I ,IX D%%++,*0 * -*r#   