
    f                         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  ej                  ej                  j                          G d	 d
ej"                               Zddde_        y)zACreate VM maintenance resource policy maintenance-window command.    )absolute_import)division)unicode_literals)base_classes)base)flags)utilc                   &    e Zd ZdZed        Zd Zy)$CreateVmMaintenanceMaintenanceWindowzCreate a Compute Engine VM Maintenance Resource Policy.

  *{command} creates a Compute Engine VM Maintenance Resource Policy
  that, contains a window in which maintenance should start.
  c                     t        j                         j                  |        t        j                  |        t        j                  | dddd       | j
                  j                  d        y )NwindowzTStart time of a four-hour window in which maintenance should start in daily cadence.zMaintenance activity windowT)flag_suffixstart_time_helpcadence_helphas_restricted_start_times)r   MakeResourcePolicyArgAddArgumentAddCommonArgsAddCycleFrequencyArgsdisplay_infoAddCacheUpdater)parsers    Qlib/surface/compute/resource_policies/create/vm_maintenance/maintenance_window.pyArgsz)CreateVmMaintenanceMaintenanceWindow.Args$   s]    	!--f5		F2#') ''-    c                    t        j                  | j                               }|j                  }t	        j
                         j                  ||j                  t        j                  |j                              }|j                  j                  }t        j                  |||      }|j                  ||j                  |j                        }|j                  j                   j"                  }|j%                  |d|fg      d   S )N)scope_lister)resourcePolicyprojectregionInsertr   )r   ComputeApiHolderReleaseTrackclientr   r   ResolveAsResource	resourcescompute_flagsGetDefaultScopeListermessagesr	   "MakeVmMaintenanceMaintenanceWindow$ComputeResourcePoliciesInsertRequestr   r    apitools_clientresourcePoliciesMakeRequests)	selfargsholderr$   
policy_refr)   resource_policycreate_requestservices	            r   Runz(CreateVmMaintenanceMaintenanceWindow.Run1   s    **4+<+<+>?F]]F,,.@@"88G A IJ
 }}%%H==j>BHNOBB&""   C "N
 mm++<<G(N CDEaHHr   N)__name__
__module____qualname____doc__staticmethodr   r6    r   r   r   r      s!     
. 
.Ir   r   ztCreate a Compute Engine VM Maintenance Resource Policy that
contains time window in which maintenance should start.
z  The following command creates a Compute Engine VM Maintenance Resource
  Policy with a daily maintenance activity window that starts at 04:00Z.

    $ {command} my-resource-policy --region=REGION --start-time=04:00 --daily-window
)DESCRIPTIONEXAMPLESN)r:   
__future__r   r   r   googlecloudsdk.api_lib.computer   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   r'   4googlecloudsdk.command_lib.compute.resource_policiesr	   ReleaseTracksr#   ALPHACreateCommandr   detailed_helpr<   r   r   <module>rH      sv    H &  ' 7 ( E F E D%%++,&I4+=+= &I -&IV
6 $ 2r   