
    !
                        d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ dd	lmZ dd
lmZ  ej                  ej                   j"                  ej                   j$                         G d dej&                               Zy)z&Apply an Anthos configuration package.    )absolute_import)division)unicode_literals)base)anthoscli_backend)flags)common_args)log)
propertiesc                   .    e Zd ZdZddiZed        Zd Zy)Applyz6Apply configuration changes for Anthos infrastructure.EXAMPLESz
      To apply Anthos package to a Google Kubernetes Engine cluster in
      project `my-project`:

          $ {command} my-config --project=my-project
      c                     t        j                  d      j                  |        t        j                  d      j                  |        y )NzDirectory of package to apply.)help_overridezProject ID.)help_text_to_overwrite)r   GetLocalDirFlagAddToParserr	   ProjectArgument)parsers    lib/surface/anthos/apply.pyArgsz
Apply.Args*   s8    	688CF8K,..9k&.A    c           
          t        j                         }t        j                  j                  j
                  j                         }t        j                  t        j                  j                  j                  j                         d      }t        j                  j                  dj                  |j                  |              |d|j                  ||j                  t        j                  ddi      |      }| j!                  |      S )Napply)account	operationz1Starting apply of package [{}] using project [{}]GCLOUD_AUTH_PLUGINtrue)
extra_vars)command	apply_dirprojectshow_exec_errorenvstdin)r   AnthosCliWrapperr   VALUEScorer"   GetGetAuthTokenr   r
   statusPrintformat	LOCAL_DIRr#   GetEnvArgsForCommand _DefaultOperationResponseHandler)selfargscommand_executorapply_project	auth_credresponses         r   Runz	Apply.Run1   s    (99;%%**22668M!..!!&&..224IIJJ $$*F4>>=$IK*...(5040D0D$5$J$J0Df/M%O&/1H 00::r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r7    r   r   r   r      s1    >  
- B B;r   r   N)r;   
__future__r   r   r   googlecloudsdk.callioper   !googlecloudsdk.command_lib.anthosr   r   $googlecloudsdk.command_lib.util.argsr	   googlecloudsdk.corer
   r   ReleaseTracksReleaseTrackALPHABETABinaryBackedCommandr   r>   r   r   <module>rI      sp    - &  ' ) ? 3 < # * D%%++T->->-C-CD!;D$$ !; E!;r   