
                            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
dZej                   ej                  ej                  j                          G d dej"                                      Zej                   ej                  ej                  j&                         G d de                    Zy)zGCommand for advicing best zone and window time for future reservations.    )absolute_import)division)unicode_literals)base_classes)base)flags)utilzP
      Recommends the optimal time window and zone for Future Reservations.
    a  
      To request an advice for a future reservation of 8 a3-highgpu-8g VMs, run:

      $ {command}
        --region=fake-region
        --machine-type=a3-megagpu-8g
        --vm-count=8
        --duration-range=min=7d,max=14d
        --start-time-range=from=2025-02-20,to=2025-03-25
        --end-time-range=from=2025-02-20,to=2025-03-25

      To request advice for a future reservation of 512 v5e TPUs, run:

        $ {command}
          --region=fake-region
          --location-policy=fake-zone-1=DENY,fake-zone-2=ALLOW
          --tpu-version=V5E
          --chip-count=16
          --workload-type=BATCH
          --duration-range=min=30d,max=90d
          --start-time-range=from=2025-02-25,to=2025-06-25
          --end-time-range=from=2025-02-25,to=2025-06-25
    )DESCRIPTIONEXAMPLESc                   *    e Zd ZdZeZed        Zd Zy)CalendarModeDRecommends the optimal time window and zone for Future Reservations.c                 *   t        j                  |       t        j                  |       t        j                  |       t        j                  |       t        j
                  |       t        j                  |       t        j                  |       y)z9Adds arguments for the calendar-mode command to a parser.N)r   AddRegionFlagAddLocationPolicyFlagAddStartTimeRangeFlagAddEndTimeRangeFlagAddDurationRangeFlagAddAcceleratorPropertiesFlagsAddDeploymentTypeFlag)clsparsers     +lib/surface/compute/advice/calendar_mode.pyArgszCalendarMode.ArgsA   sf     
	'	'	f%	v&	''/	'    c                     t        j                  | j                               }|j                  }|j                  }t        j                  ||      }|j                  j                  }d}|j                  |||fg      S )zRuns the calendar-mode command.r   )
r   ComputeApiHolderReleaseTrackclientmessagesr	   #GetComputeAdviceCalendarModeRequestapitools_clientadviceMakeRequests)selfargsholderr   r    request_messageservicemethod_names           r   RunzCalendarMode.RunL   sv     **4+<+<+>?F]]FH >>tXNO $$++G K+ GHIIr   N)	__name__
__module____qualname____doc__DETAILED_HELPdetailed_helpclassmethodr   r+    r   r   r   r   :   s%     M-( (Jr   r   c                       e Zd ZdZeZy)CalendarModeAlphar   N)r,   r-   r.   r/   r0   r1   r3   r   r   r5   r5   \   s     M-r   r5   N)r/   
__future__r   r   r   googlecloudsdk.api_lib.computer   googlecloudsdk.callioper   )googlecloudsdk.command_lib.compute.advicer   r	   r0   DefaultUniverseOnlyReleaseTracksr   BETABaseCommandr   ALPHAr5   r3   r   r   <module>r?      s     N &  ' 7 ( ; :	< D%%**+J<++ J , J@ D%%++,    -  r   