OXIESEC PANEL
- Current Dir:
/
/
opt
/
gsutil
/
gslib
/
commands
/
__pycache__
Server IP: 2a02:4780:11:1594:0:ef5:22d7:a
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/11/2025 08:19:49 AM
rwxr-xr-x
📄
__init__.cpython-39.pyc
323 bytes
02/11/2025 08:19:49 AM
rw-r--r--
📄
acl.cpython-39.pyc
18.76 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
autoclass.cpython-39.pyc
6.01 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
bucketpolicyonly.cpython-39.pyc
6.75 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
cat.cpython-39.pyc
4.17 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
compose.cpython-39.pyc
4.57 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
config.cpython-39.pyc
40.97 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
cors.cpython-39.pyc
6.56 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
cp.cpython-39.pyc
42.21 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
defacl.cpython-39.pyc
11.25 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
defstorageclass.cpython-39.pyc
5.78 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
du.cpython-39.pyc
8.47 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
hash.cpython-39.pyc
7.87 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
help.cpython-39.pyc
6.41 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
hmac.cpython-39.pyc
12.39 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
iam.cpython-39.pyc
24.6 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
kms.cpython-39.pyc
14.88 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
label.cpython-39.pyc
10.46 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
lifecycle.cpython-39.pyc
6.37 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
logging.cpython-39.pyc
9.04 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
ls.cpython-39.pyc
18.81 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
mb.cpython-39.pyc
12.23 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
mv.cpython-39.pyc
5.06 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
notification.cpython-39.pyc
25.47 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
pap.cpython-39.pyc
6.53 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
perfdiag.cpython-39.pyc
62.18 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
rb.cpython-39.pyc
3.78 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
requesterpays.cpython-39.pyc
5.53 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
retention.cpython-39.pyc
20.02 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
rewrite.cpython-39.pyc
16.12 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
rm.cpython-39.pyc
10.86 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
rpo.cpython-39.pyc
5.96 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
rsync.cpython-39.pyc
53.86 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
setmeta.cpython-39.pyc
11.25 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
signurl.cpython-39.pyc
20.99 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
stat.cpython-39.pyc
5.04 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
test.cpython-39.pyc
17.73 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
ubla.cpython-39.pyc
6.96 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
update.cpython-39.pyc
12.26 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
version.cpython-39.pyc
5.25 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
versioning.cpython-39.pyc
5.51 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
web.cpython-39.pyc
7.63 KB
02/11/2025 08:19:49 AM
rw-r--r--
Editing: requesterpays.cpython-39.pyc
Close
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 dZdZee�d� ZdZ dZ!de e! Z"eee"�Z#eee!�Z$eee �Z%de�&� d d Z'G dd� de �Z(dS )zBImplementation of requesterpays configuration command for buckets.� )�absolute_import)�print_function)�division)�unicode_literals)�metrics)�Command)�CommandArgument)�ApiSelector)�CommandException)�NO_URLS_MATCHED_TARGET)�CreateHelpText)�storage_v1_messages)�NO_MAX)�GcloudStorageMap)� shim_utilz; gsutil requesterpays set (on|off) gs://<bucket_name>... z2 gsutil requesterpays get gs://<bucket_name>... � z� <B>SET</B> The "set" sub-command requires an additional sub-command, either "on" or "off", which, respectively, will enable or disable Requester Pays for the specified bucket. z� <B>GET</B> The "get" sub-command gets the Requester Pays configuration for a bucket and displays whether or not it is enabled. a% The `Requester Pays <https://cloud.google.com/storage/docs/requester-pays>`_ feature enables you to configure a Google Cloud Storage bucket so that the requester pays all costs related to accessing the bucket and its objects. The gsutil requesterpays command has two sub-commands: z)--format=value[separator=": "](name.sub("z", "gs://"),z,requester_pays.yesno("Enabled", "Disabled"))c @ s� e Zd ZdZejdededdddej gej e dddgd �e �� ge �� gd �d�Zej dg dd eeed�d�Zeedddegi dd�eeg d�i d�eg d�i d�d�i d�d�i d�Zdd� Zdd� Zdd� Zdd � Zd!S )"�RequesterPaysCommandz/Implementation of gsutil requesterpays command.Z requesterpays� � F�mode�on�off)�choices)�set�get) �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_helpz8Enable or disable requester pays for one or more buckets)r r )� help_name�help_name_aliases� help_type�help_one_line_summary� help_text�subcommand_help_text�storage�buckets�listT)�gcloud_command�flag_map�supports_output_translation)r, r- �updatez--requester-pays)r/ r0 )r, r- r2 z--no-requester-pays�r r c C s, | j s| �� | j d �� dkr$dS dS d S )Nr r r � )�args�$RaiseWrongNumberOfArgumentsException�lower)�self� r9 �+/opt/gsutil/gslib/commands/requesterpays.py�_CalculateUrlsStartArg� s z+RequesterPaysCommand._CalculateUrlsStartArgc C s� | j d �� }|dvr$td| j ��| j dd� }|s>| �� d}|D ]�}| j|dgd�}|D ]p}|j}d }tjtj� � d �}|dkr�| j �d|� d |j_ n| j �d |� d|j_ | jj|j||jdgd� q^qF|s�ttt|� ��dS )z.Gets requesterpays configuration for a bucket.r r3 z,Argument to "%s set" must be either <on|off>r4 NF�id�� bucket_fieldsT)�billingr z!Enabling requester pays for %s...z"Disabling requester pays for %s...)�provider�fields)r5 r7 r �command_namer6 �GetBucketUrlIterFromArg�storage_url�apitools_messages�Bucket�BillingValue�logger�infor? � requesterPays� gsutil_api�PatchBucket�bucket_name�schemer r. ) r8 �requesterpays_arg�url_args�some_matched�url_str�bucket_iter�blr�url�bucket_metadatar9 r9 r: �_SetRequesterPays� s: �� � z&RequesterPaysCommand._SetRequesterPaysc C s� | j }d}|D ]^}| j|dgd�}|D ]D}d}|jjrV|jjjrVtd|j�d� � q&td|j�d� � q&q|s�tt t |� ��dS ) z9Gets requesterpays configuration for one or more buckets.Fr? r= Tz%s: Enabled�/z%s: DisabledN)r5 rC �root_objectr? rJ �print� url_string�rstripr r r. )r8 rP rQ rR rS rT r9 r9 r: �_GetRequesterPays� s �z&RequesterPaysCommand._GetRequesterPaysc C s� | j �d�}|dkr*| j}tj|gd� nL|dkr`| j}| j d �� }|dv rvtj||gd� ntd|| j| jf ��|� dS )z2Command entry point for the requesterpays command.r r )�subcommandsr r3 zAInvalid subcommand "%s" for the %s command. See "gsutil help %s".) r5 �popr] r �LogCommandParamsrW r7 r rB )r8 �action_subcommand�funcrO r9 r9 r: � RunCommand� s$ ���zRequesterPaysCommand.RunCommandN)�__name__� __module__�__qualname__�__doc__r �CreateCommandSpec� _SYNOPSISr r �JSONr �%MakeZeroOrMoreCloudBucketURLsArgument�command_spec�HelpSpec�_DETAILED_HELP_TEXT�_get_help_text�_set_help_text� help_specr �_GCLOUD_FORMAT_STRING�gcloud_storage_mapr; rW r] rc r9 r9 r9 r: r M sn ������ �������"�&!r N))rg � __future__r r r r �gslibr � gslib.commandr �gslib.command_argumentr �gslib.cs_api_mapr �gslib.exceptionr r �gslib.help_providerr �"gslib.third_party.storage_apitoolsr rE �gslib.utils.constantsr �gslib.utils.shim_utilr Zgslib.utilsr � _SET_SYNOPSIS� _GET_SYNOPSIS�lstripri �_SET_DESCRIPTION�_GET_DESCRIPTION�_DESCRIPTIONrn ro rp �get_format_flag_caretrr r r9 r9 r9 r: �<module> sH �� ���