
                         >   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	  \	R                  \	R                  " \	R                  R                  \	R                  R                  \	R                  R                  5       " S S	\	R                   5      5       5       rg
)z 'logging scopes create' command.    )absolute_import)division)unicode_literals)util)arg_parsers)basec                   4    \ rS rSrSr\S 5       rS rS rSr	g)Create   a  Create a log scope.

After creating a log scope, you can use it to view logs in 1 or more
resources.

## EXAMPLES

To create a log scope in a project, run:

  $ {command} my-scope --resource-names=projects/my-project

To create a log scope in a project with a description, run:

  $ {command} my-scope --resource-names=projects/my-project --description="my
  custom log scope"

To create a log scope that contains more than 1 resource, such as projects and
views, run:

  $ {command} my-scope
  --resource-names=projects/my-project,projects/my-project2,
  projects/my-project/locations/global/buckets/my-bucket/views/my-view1,
  projects/my-project/locations/global/buckets/my-bucket/views/my-view2,
c                     U R                  SSS9  U R                  SSS9  U R                  SSSS	[        R                  " 5       S
9  [        R                  " U SS	S9  g)z Register flags for this command.LOG_SCOPE_IDzID of the log scope to create.)helpz--descriptionz(A textual description for the log scope.z--resource-namesaK   Comma-separated list of resource names in this log scope. It could be one or more parent resources or one or more views.  A log scope can include a maximum of 50 projects and a maximum of 100 resources in total. For example, projects/[PROJECT_ID], projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`RESOURCE_NAMEST)r   metavarrequiredtypezlog scope to create)exclude_billing_accountN)add_argumentr   ArgListr   AddParentArgs)parsers    $lib/surface/logging/scopes/create.pyArgsCreate.Args8   s{     -MN
H   b !  "   	%t    c                    0 nUR                  S5      (       a  UR                  US'   UR                  S5      (       a  UR                  US'   [        R                  " 5       R
                  R                  [        R                  " 5       R                  [        R                  " 5       R                  " S0 UD6UR                  [        R                  " [        R                  " UR                  5      R                  5       SS5      S95      $ g )Ndescriptionresource_namesresourceNames	locationsglobal)logScope
logScopeIdparent )IsSpecifiedr   r   r   	GetClientprojects_locations_logScopesr
   GetMessages.LoggingProjectsLocationsLogScopesCreateRequestLogScoper   CreateResourceNameGetProjectResourceprojectRelativeName)selfargs
scope_datas      r   _RunCreate._RunP   s    J&&"&"2"2j())$($7$7j!^^::AA




K
K'')22@Z@**,,))$,,7DDF L 
 
 *r   c                 $    U R                  U5      $ )zThis 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.

Returns:
  The created log scope.
)r3   )r0   r1   s     r   Run
Create.Runc   s     99T?r   r%   N)
__name__
__module____qualname____firstlineno____doc__staticmethodr   r3   r6   __static_attributes__r%   r   r   r
   r
      s%    
2  .&
r   r
   N)r<   
__future__r   r   r   googlecloudsdk.api_lib.loggingr   googlecloudsdk.callioper   r   UniverseCompatibleReleaseTracksReleaseTrackALPHABETAGACreateCommandr
   r%   r   r   <module>rI      s    ' &  ' / / ( T..33T5F5F5I5IOT O Or   