
    W
                         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\
R"                  5      rSSSS.\l        g)z)Command to set IAM policy for a resource.    )absolute_import)division)unicode_literals)base_classes)client)base)flags)iam_utilc                   .    \ rS rSrSr\S 5       rS rSrg)SetIamPolicy   @Set the IAM policy binding for a Compute Engine backend service.c                 n    [         R                  R                  U 5        [        R                  " U 5        g )N)r	   #GLOBAL_REGIONAL_BACKEND_SERVICE_ARGAddArgumentr
   AddArgForPolicyFile)parsers    6lib/surface/compute/backend_services/set_iam_policy.pyArgsSetIamPolicy.Args    s$    	--99&A  (    c                    [         R                  " U R                  5       5      n[        R                  R                  UUR                  [        R                  " UR                  5      S9n[        R                  " X2R                  S9nUR                  [        R                  " UR                  UR                  R                  R                   5      5      $ )N)scope_lister)compute_client)r   ComputeApiHolderReleaseTrackr	   r   ResolveAsResource	resourcescompute_flagsGetDefaultScopeListerr   BackendServicer   r
   ParsePolicyFilepolicy_filemessagesPolicy)selfargsholderbackend_service_refbackend_services        r   RunSetIamPolicy.Run%   s    **4+<+<+>?F11CC&<<V]]K 	D 	M  ++MM;O''  !1!1!'!7!7!>!>	@A Ar    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r+   __static_attributes__r-   r   r   r   r      s    H) )Ar   r   r   z_
    Sets the IAM policy for the given backend service as defined in a
    JSON or YAML file.  a      The following command will read an IAM policy defined in a JSON file
    'policy.json' and set it for the backend service `my-backend-service`:

      $ {command} my-backend-service policy.json --region=REGION

      $ {command} my-backend-service policy.json --global

    See https://cloud.google.com/iam/docs/managing-policies for details of the
    policy file format and contents.
    )briefDESCRIPTIONEXAMPLESN)r2   
__future__r   r   r   googlecloudsdk.api_lib.computer   /googlecloudsdk.api_lib.compute.backend_servicesr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer	   r   3googlecloudsdk.command_lib.compute.backend_servicesgooglecloudsdk.command_lib.iamr
   Commandr   detailed_helpr-   r   r   <module>rA      sQ    0 &  ' 7 B ( E E 3A4<< A2 	K	

	 r   