HEX
Server: Apache/2.4.68 (Debian)
System: Linux as-cs-widget-demo-us-central1 6.1.0-44-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
User: root (0)
PHP: 8.2.32
Disabled: NONE
Upload Files
File: //lib/google-cloud-sdk/lib/surface/dataflow/jobs/__pycache__/drain.cpython-312.pyc
�

���	��,�dZddlmZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZdd	l
mZe
je
j j"e
j j$�e
j&Gd
�de
j(���Zy)
z6Implementation of gcloud dataflow jobs drain command.
�)�absolute_import)�division)�unicode_literals)�apis)�
exceptions)�base)�	job_utils)�logc�&�eZdZdZed��Zd�Zy)�Draina,Drains all jobs that match the command line arguments.

     Once Drain is triggered, the pipeline will stop accepting new inputs.
     The input watermark will be advanced to infinity. Elements already in the
     pipeline will continue to be processed. Drained jobs can safely be
     cancelled.
  c�2�tj|d��y)z Register flags for this command.�+)�nargsN)r	�ArgsForJobRefs)�parsers �"lib/surface/dataflow/jobs/drain.py�Argsz
Drain.Args)s�����V�3�/�c	��tj|�D]{}	tjj	|j
|j|j��tjjdj|j
���}y#tj$rb}tjjdj|j
|jj|j��Yd}~��d}~wwxYw)z�This is what gets called when the user runs this command.

    Args:
      args: all the arguments that were provided to this command invocation.
    )�
project_id�	region_idzStarted draining job [{0}]z�Failed to drain job [{0}]: {1} Ensure that you have permission to access the job and that the `--region` flag, {2}, matches the job's region.N)r	�ExtractJobRefsr�Jobsr�jobId�	projectId�locationr
�status�Print�formatr�
HttpException�payload�status_message)�self�args�job_ref�errors    r�Runz	Drain.Run.s����+�+�D�1��
��	�	����M�M��(�(��&�&�	�	(�	�
�
���5�<�<�W�]�]�K�L�
2���
%�
%�	
��
�
���%��f��
�
�u�}�}�;�;�W�=M�=M��	
�	
��	
�s�A8B�D
�(AD�D
N)�__name__�
__module__�__qualname__�__doc__�staticmethodrr'�rrrrs ����0��0�
rrN)r+�
__future__rrr�googlecloudsdk.api_lib.dataflowr�googlecloudsdk.api_lib.utilr�googlecloudsdk.callioper�#googlecloudsdk.command_lib.dataflowr	�googlecloudsdk.corer
�
ReleaseTracks�ReleaseTrack�BETA�GA�DefaultUniverseOnly�Commandrr-rr�<module>r:sy�� �'��'�0�2�(�9�#�����D�%�%�*�*�D�,=�,=�,@�,@�A����$
�D�L�L�$
��B�$
r