OXIESEC PANEL
- Current Dir:
/
/
opt
/
gsutil
/
gslib
/
utils
/
__pycache__
Server IP: 2a02:4780:11:1594:0:ef5:22d7:a
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/11/2025 08:19:48 AM
rwxr-xr-x
📄
__init__.cpython-39.pyc
126 bytes
02/11/2025 08:19:48 AM
rw-r--r--
📄
acl_helper.cpython-39.pyc
9.38 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
arg_helper.cpython-39.pyc
1.01 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
boto_util.cpython-39.pyc
16.46 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
cat_helper.cpython-39.pyc
4.21 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
cloud_api_helper.cpython-39.pyc
3.29 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
constants.cpython-39.pyc
2.88 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
copy_helper.cpython-39.pyc
101.64 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
encryption_helper.cpython-39.pyc
5.84 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
execution_util.cpython-39.pyc
1.06 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
hashing_helper.cpython-39.pyc
15.71 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
iam_helper.cpython-39.pyc
8.61 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
ls_helper.cpython-39.pyc
12.4 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
metadata_util.cpython-39.pyc
3.1 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
parallelism_framework_util.cpython-39.pyc
11.79 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
posix_util.cpython-39.pyc
12.46 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
retention_util.cpython-39.pyc
8.77 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
retry_util.cpython-39.pyc
2.5 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
rsync_util.cpython-39.pyc
1.6 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
shim_util.cpython-39.pyc
19.8 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
signurl_helper.cpython-39.pyc
4.21 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
stet_util.cpython-39.pyc
3.35 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
system_util.cpython-39.pyc
7.9 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
temporary_file_util.cpython-39.pyc
915 bytes
02/11/2025 08:19:49 AM
rw-r--r--
📄
text_util.cpython-39.pyc
12.62 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
translation_helper.cpython-39.pyc
25.67 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
unit_util.cpython-39.pyc
7.01 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
update_util.cpython-39.pyc
3.39 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
user_agent_helper.cpython-39.pyc
1.49 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
version_check.cpython-39.pyc
1.39 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
wrapped_credentials.cpython-39.pyc
5.81 KB
02/11/2025 08:19:49 AM
rw-r--r--
Editing: cloud_api_helper.cpython-39.pyc
Close
a +(Wg� � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlZddlZddl m Z ddlmZ dd d �Z ddd�Zdd d�Zdd� ZdS )z/Helper functions for Cloud API implementations.� )�absolute_import)�print_function)�division)�unicode_literalsN)�ArgumentException)�AddQueryParamToUrlc C s |p| j S )a� Gets a gsutil Cloud API instance. Since Cloud API implementations are not guaranteed to be thread-safe, each thread needs its own instance. These instances are passed to each thread via the thread pool logic in command. Args: cls: Command class to be used for single-threaded case. thread_state: Per thread state from this thread containing a gsutil Cloud API instance. Returns: gsutil Cloud API instance. )� gsutil_api)�clsZthread_state� r �+/opt/gsutil/gslib/utils/cloud_api_helper.py�GetCloudApiInstance s r c C sJ | j }|rt|d|�}tjr0t|t�r0|�d�}d|| j|d�}t� |�S )a� Returns download serialization data. There are five entries: auto_transfer: JSON-specific field, always False. progress: How much of the download has already been completed. total_size: Total object size. url: Implementation-specific field used for saving a metadata get call. For JSON, this the download URL of the object. For XML, this is a pickled boto key. user_project: Project to be billed to, added as query param. Args: src_obj_metadata: Object to be downloaded. progress: See above. user_project: User project to add to query string. Returns: Serialization data for use with Cloud API GetObjectMedia. �userProject�ascii�False)� auto_transfer�progress� total_size�url) � mediaLinkr �six�PY3� isinstance�bytes�decode�size�json�dumps)�src_obj_metadatar �user_projectr �serialization_dictr r r �GetDownloadSerializationData1 s �r c C s: | r6t � }| D ]"}|dv rq|�t�dd|�� q|S dS )a Removes 'items/' from the input fields and converts it to a set. Args: list_fields: Iterable fields usable in ListBuckets/ListObjects calls. Returns: Set of fields usable in GetBucket/GetObjectMetadata calls (None implies all fields should be returned). )�kind� nextPageToken�prefixeszitems/� N)�set�add�re�sub)�list_fields� get_fields�fieldr r r �ListToGetFieldsZ s r, c C s, | st d��| jst d��| js(t d��dS )z�Ensures dst_obj_metadata supplies the needed fields for copy and insert. Args: dst_obj_metadata: Metadata to validate. Raises: ArgumentException if metadata is invalid. z3No object metadata supplied for destination object.zCObject metadata supplied for destination object had no object name.zCObject metadata supplied for destination object had no bucket name.N)r �name�bucket)�dst_obj_metadatar r r �ValidateDstObjectMetadatao s ���r0 )N)r N)N)�__doc__� __future__r r r r r r'