
    
                         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 dd
lmZ  G d dej"                        Zy)z*`gcloud monitoring uptime create` command.    )absolute_import)division)unicode_literals)uptime)base)flags)util)log)
propertiesc                   0    e Zd ZdZdddZed        Zd Zy)Createz/Create a new uptime check or synthetic monitor.aS            Create a new uptime check or synthetic monitor.

          Flags only apply to uptime checks unless noted that they apply to
          synthetic monitors.

          For information about the JSON/YAML format of an uptime check:
          https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.uptimeCheckConfigs
       a            To create an uptime check against a URL, run:

            $ {command} DISPLAY_NAME --resource-type=uptime-url
            --resource-labels=host=google.com,project_id=PROJECT_ID

          To create a synthetic monitor, run:

            $ {command} SYNTHETIC_MONITOR_NAME
            --synthetic-target=projects/PROJECT_ID/locations/REGION/functions/FUNCTION_NAME
       )DESCRIPTIONEXAMPLESc                 ^    t        j                  | dd       t        j                  |        y )Nz!uptime check or synthetic monitorT)
positional)r   AddDisplayNameFlagAddUptimeSettingsFlags)parsers    'lib/surface/monitoring/uptime/create.pyArgszCreate.Args8   s(    	3 
  (    c                 \   t        j                         }t        j                  ||j                        }t        j                  t        j                  j                  j                  j                               }|j                  ||      }t        j                  |j                  d       |S )Nr   )r   UptimeClientr	   CreateUptimeFromArgsmessagesprojects_utilParseProjectr   VALUEScoreprojectGetr   r
   CreatedResourcename)selfargsclientuptime_checkproject_refresults         r   Runz
Create.Run?   s      "F,,T6??CL,,&&**,K ]];5FX.Mr   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r*    r   r   r   r      s/    7
-. ) )r   r   N)r.   
__future__r   r   r   !googlecloudsdk.api_lib.monitoringr   googlecloudsdk.callioper   %googlecloudsdk.command_lib.monitoringr   r	   #googlecloudsdk.command_lib.projectsr   googlecloudsdk.corer
   r   CreateCommandr   r1   r   r   <module>r9      s:    1 &  ' 4 ( 7 6 E # *)T )r   