CURRENT PATH:
/
opt
/
gsutil
/
gslib
/
commands
/
__pycache__
/
[ ⬅ KEMBALI ]
|
[ HOME ]
Upload File:
Upload Ke Sini
Dir Baru
File Baru
Editing:
compose.cpython-39.pyc
a +(Wg" � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddl mZ dd lm Z dd lmZ ddlmZ ddlmZ dd lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dZdZ de de Z!G dd� de�Z"dS )z;Implementation of compose command for Google Cloud Storage.� )�absolute_import)�print_function)�division)�unicode_literals)�config)�BucketListingObject)�Command)�CommandArgument)�ApiSelector)�CommandException)�ContainsWildcard)�StorageUrlFromString)�storage_v1_messages)�GetEncryptionKeyWrapper)�GcloudStorageFlag)�GcloudStorageMap)�PreconditionsFromHeaders� zb gsutil compose gs://bucket/source_obj1 [gs://bucket/source_obj2 ...] gs://bucket/composite_obj z <B>SYNOPSIS</B> aH <B>DESCRIPTION</B> The compose command creates a new object whose content is the concatenation of a given sequence of source objects under the same bucket. gsutil uses the content type of the first source object to determine the destination object's content type and does not modify or delete the source objects as part of the compose command. For more information, see the `composite objects topic <https://cloud.google.com/storage/docs/composite-objects>`_. There is a limit (currently %d) to the number of components that can be composed in a single operation. c @ s� e Zd ZdZejddgeded ddddej ej gej e�� gd�Z ejddgdd ei d �Zeg d�i d�Zd d� Zdd� ZdS )�ComposeCommandz)Implementation of gsutil compose command.�compose�concat� � F)�command_name_aliases�usage_synopsis�min_args�max_args�supported_sub_args�file_url_ok�provider_url_ok�urls_start_arg�gs_api_support�gs_default_api�argparse_arguments�command_helpz>Concatenate a sequence of objects into a new composite object.)� help_name�help_name_aliases� help_type�help_one_line_summary� help_text�subcommand_help_text)�storage�objectsr )�gcloud_command�flag_mapc C s |j dkrtdt|� ��d S )N�gsz7"compose" called on URL with unsupported provider (%s).)�schemer �str)�self�url� r4 �%/opt/gsutil/gslib/commands/compose.py� CheckProvider_ s �zComposeCommand.CheckProviderc C s� | j d }| j dd� | _ t|�}| �|� |�� r@td| ��tj|j|jd�}g }d}| j D ]�}t |�r|| � |��� }ntt|��g}|D ]v}|j } | �| � | j|jkr�td��|s�| }tjj| jd�} | �� r�t| j�| _|�| � t|�tkr�tdt ��q�q`|�std��| jj|j|j|jd d gd�}|j|_|j|_t| j�pPi �}| j�d|t|�� | jj||||jtt �d � dS )z,Command entry point for the compose command.���NzQA version-specific URL (%s) cannot be the destination for gsutil compose - abort.)�name�bucketz,GCS does not support inter-bucket composing.)r8 z>"compose" called with too many component objects. Limit is %d.z/"compose" requires at least 1 component object.�contentEncoding�contentType)�provider�fieldsz)Composing %s from %d component object(s).)� preconditionsr<