
                             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
KJr  \R"                   " S S\R$                  5      5       rg)z+`gcloud monitoring snoozes create` command.    )absolute_import)division)unicode_literals)snoozes)base)flags)util)log)
propertiesc                   8    \ rS rSrSrSSS.r\S 5       rS rSr	g	)
Create   zCreate a new snooze.a            Creates a new snooze. A snooze can be specified as a JSON/YAML value
          passed in as a file through the `--snooze-from-file` flag. A snooze
          can also be specified through command line flags. If a snooze is
          specified through `--snooze-from-file`, and additional flags are
          supplied, the flags will override the snooze's settings.

          For information about the JSON/YAML format of a snooze:
          https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.snoozes
       a            To create a snooze with command-line options, run:

            $ {command} --criteria-policies=LIST_OF_POLICIES
            --criteria-filter=FILTER
            --display-name=DISPLAY_NAME --start-time=START_TIME
            --end-time=END_TIME

          To create a snooze with a file, run:

            $ {command} --snooze-from-file=MY-FILE

          Sample contents of MY-FILE:

            criteria:
              policies:
              - projects/MY-PROJECT/alertPolicies/MY-POLICY
              filter: 'resource.labels.zone="us-central1-a" AND resource.labels.instance_id="1234567890"'
            interval:
              startTime: '2024-03-01T08:00:00Z'
              endTime: '2024-03-08T04:59:59.500Z'
            displayName: New Snooze
       )DESCRIPTIONEXAMPLESc                 ^    [         R                  " U S5        [         R                  " U 5        g Nsnooze)r   AddFileMessageFlagAddSnoozeSettingsFlags)parsers    (lib/surface/monitoring/snoozes/create.pyArgsCreate.ArgsF   s     	VX.	  (    c                 `   [         R                  " 5       n[        R                  " XR                  5      n[
        R                  " [        R                  R                  R                  R                  5       5      nUR                  XC5      n[        R                  " UR                  S5        U$ r   )r   SnoozeClientr	   CreateSnoozeFromArgsmessagesprojects_utilParseProjectr   VALUEScoreprojectGetr   r
   CreatedResourcename)selfargsclientr   project_refresults         r   Run
Create.RunK   s}    !!#F&&t__=F 	"":#4#4#9#9#A#A#E#E#GH  ]];/FX.Mr    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r,   __static_attributes__r.   r   r   r   r      s0    	"-H ) )	r   r   N)r3   
__future__r   r   r   !googlecloudsdk.api_lib.monitoringr   googlecloudsdk.callioper   %googlecloudsdk.command_lib.monitoringr   r	   #googlecloudsdk.command_lib.projectsr   googlecloudsdk.corer
   r   DefaultUniverseOnlyCreateCommandr   r.   r   r   <module>r?      sO    2 &  ' 5 ( 7 6 E # * 5T 5 5r   