
    >                         S r SSKJr  SSKJr  SSKJr  \R                  \R                  " \R                  R                  \R                  R                  5       " S S\R                  5      5       5       rg)zSurface for listing alerts.    )alerts)base)resource_argsc                   L   ^  \ rS rSrSrSrSSSS.r\U 4S j5       rS	 r	S
r
U =r$ )List   zList alerts.Fz          This command uses the monitoring/v3 API. The full documentation for this
          API can be found at: https://cloud.google.com/monitoring/api/zList alerts for a project.a        To list all open alerts:

        $ {command} --filter="state='OPEN'"

      To order alerts by when the alert was opened:

        $ {command} --sort-by=openTime

      To order alerts by when the alert was opened in reverse order:

        $ {command} --sort-by="~openTime"

      To list alerts for a specific policy:

        $ {command} --filter="policy.displayName='My Policy'"

      More information can be found at
      https://cloud.google.com/sdk/gcloud/reference/topic/filters)zAPI REFERENCEDESCRIPTIONEXAMPLESc                 6  > [         R                  " U SS5        [        [        [        ]  U 5        [
        R                  R                  U S5        U R                  R                  S5        U R                  R                  [         R                  " 5       5        g)z Register flags for this command.zlist alerts fromTi  yamlN)r   AddProjectResourceArgsuperr   Argsr   PAGE_SIZE_FLAG
SetDefaultdisplay_info	AddFormat
AddUriFuncGetAlertResourceUriFunc)parser	__class__s    %lib/surface/monitoring/alerts/list.pyr   	List.Args7   sp     ''0BDI 
$6"""640
!!&)
""=#H#H#JK    c                 4   UR                   R                  R                  5       n[        R                  " 5       nUR
                  (       a  SR                  UR
                  5      OSnUR                  UUR                  UUR                  S9nUR                  $ )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 list of alerts.
,N)a_filterorder_by	page_size)
CONCEPTSprojectParser   AlertsClientsort_byjoinr   filterr   )selfargsproject_refclientorder_by_stringresponses         r   RunList.RunC   sy     --''--/K  "F04chht||,$O {{ ..	  H ??r    )__name__
__module____qualname____firstlineno____doc__CLIENT_SIDE_FILTERSdetailed_helpstaticmethodr   r-   __static_attributes____classcell__)r   s   @r   r   r      sF     K 2E-4 	L 	L r   r   N)r4   !googlecloudsdk.api_lib.monitoringr   googlecloudsdk.callioper   %googlecloudsdk.command_lib.monitoringr   UniverseCompatibleReleaseTracksReleaseTrackALPHABETAListCommandr   r/   r   r   <module>rC      sk    " 4 ( ? D%%++T->->-C-CDA4 A E Ar   