
    <                         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S.r\R                  " \R                   R"                  5       " S S\R$                  5      5       rg)zCreate Command for Job.    )absolute_import)division)unicode_literals)jobs)base)
exceptions)flags)	resourcesz{description}z         To create a Job with the id `my-job` experiment `my-experiment`
        and fault-targets `target1 and target2`, run:

          $ {command} my-job --experiment=my-experiment --fault-targets="target1", "target2"
        )DESCRIPTIONEXAMPLESc                   B    \ rS rSrSr\r\S 5       r\S 5       r	S r
Srg)Create'   z%Create a Fault injection testing job.c                 0    [         R                  " U 5        g )N)r	   AddCreateJobFlags)parsers    *lib/surface/fault_injection/jobs/create.pyArgsCreate.Args-   s    	F#    c                    U R                   R                  R                  5       n[        R                  R                  U R
                  SUR                  UR                  S.S9nUR                  UR                  :w  a  [        R                  " SS5      eUR                  UR                  :w  a  [        R                  " SS5      eX4$ )zParse, validate and return the CA and KMS key version args from the CLI.

Args:
  args: The parsed arguments from the command-line.

Returns:
  Tuple containing the Resource objects for the KMS key version and CA,
  respectively.
z4faultinjectiontesting.projects.locations.experiments)
projectsIdlocationsId)
collectionparams
Experimentz9Experiment must be in the same project as the JOBversion.z:Experiment must be in the same location as the Jobversion.)
CONCEPTSjobParser
   REGISTRY
experimentr   r   r   InvalidArgumentException)argsjob_refexp_refs      r   ParseResourceArgsCreate.ParseResourceArgs1   s     mm%%'G  &&I!,,"..
 ' G W/////
  g111//
  r   c                    [         R                  " 5       nU R                  U5      u  p4UR                  5       nUR	                  5       (       d  [
        R                  " SS5      eUR	                  5       (       d  [
        R                  " SS5      eUR                  (       d  [
        R                  " SS5      eUR                  UR	                  5       UR                  5       UR                  UR                  UR                  5       S9$ )zRun the create command.r   zjob id must be non-empty.zexperiment must be non-empty.z fault targets must be non-empty.)job_idexperiment_idfault_targetsdry_runparent)r   
JobsClientr&   ParentNamer   r"   r+   r   RelativeNamer,   )selfr#   clientr$   r%   
parent_refs         r   Run
Create.RunW   s    __F --d3G!J<<>>//
,  <<>>//
0  //
3  ==||~**,((&&(   r    N)__name__
__module____qualname____firstlineno____doc___DETAILED_HELPdetailed_helpstaticmethodr   r&   r5   __static_attributes__r7   r   r   r   r   '   s6    - -$ $ # #Jr   r   N)r<   
__future__r   r   r   &googlecloudsdk.api_lib.fault_injectionr   googlecloudsdk.callioper   r   *googlecloudsdk.command_lib.fault_injectionr	   googlecloudsdk.corer
   r=   ReleaseTracksReleaseTrackALPHACreateCommandr   r7   r   r   <module>rJ      sn     &  ' 7 ( . < ) # D%%++,IT I -Ir   