CURRENT PATH:
/
opt
/
gsutil
/
gslib
/
commands
/
__pycache__
/
[ ⬅ KEMBALI ]
|
[ HOME ]
Upload File:
Upload Ke Sini
Dir Baru
File Baru
Editing:
ubla.cpython-39.pyc
a +(Wg4( � @ sV d Z ddlmZ ddlmZ ddlZddlZddlmZ ddlm Z ddl mZ ddlm Z dd lmZ dd lmZ ddlmZ ddlmZ dd lmZ ddlmZ ddlmZ ddlmZ dZdZee� d� Z!dZ"dZ#de# e" Z$ee!e$�Z%eee"�Z&eee#�Z'ej(j)Z)e)j*Z+de�,� d d d d e�,� d d d Z-G dd � d e �Z.dS )!z+This module provides the command to gsutil.� )�absolute_import)�print_functionN)�metrics)�Command)�CommandArgument)�ApiSelector)�CommandException)�NO_URLS_MATCHED_TARGET)�CreateHelpText)�storage_v1_messages)�NO_MAX)�GcloudStorageMap)� InsistOnOrOff)� shim_utilz2 gsutil ubla set (on|off) gs://<bucket_name>... z! gsutil ubla get bucket_url... � a~ <B>SET</B> The ``ubla set`` command enables or disables uniform bucket-level access for Google Cloud Storage buckets. <B>SET EXAMPLES</B> Configure your buckets to use uniform bucket-level access: gsutil ubla set on gs://redbucket gs://bluebucket Configure your buckets to NOT use uniform bucket-level access: gsutil ubla set off gs://redbucket gs://bluebucket a <B>GET</B> The ``ubla get`` command shows whether uniform bucket-level access is enabled for the specified Cloud Storage bucket(s). <B>GET EXAMPLES</B> Check if your buckets are using uniform bucket-level access: gsutil ubla get gs://redbucket gs://bluebucket z� The ``ubla`` command is used to retrieve or configure the `uniform bucket-level access <https://cloud.google.com/storage/docs/bucket-policy-only>`_ setting of Cloud Storage bucket(s). This command has two sub-commands, ``get`` and ``set``. z--format=multi[terminator="z2"](name:format="value(format('Uniform bucket-levelz! access setting for gs://{}:'))",zD iamConfiguration.uniformBucketLevelAccess.enabled.yesno(no="False")z:format="value[terminator='z'](format(' Enabled: {}'))",zC iamConfiguration.uniformBucketLevelAccess.lockedTime.sub("T", " ")z,:format="value(format(' LockedTime: {}'))")c @ s� e Zd ZdZejddgededdddej gej e �d�ge dd d gd�e �� gd�d �Z ejddgddeeed�d�Zeedddedgi d�eeg d�i d�eg d�i d�d�i d�d�i d�Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#S )$�UblaCommandz#Implements the gsutil ubla command.�ublaZuniformbucketlevelaccess� � F� �mode�on�off)�choices��get�set)�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%Configure Uniform bucket-level access)� help_name�help_name_aliases� help_type�help_one_line_summary� help_text�subcommand_help_text�storage�buckets�listz--raw)�gcloud_command�flag_map)r/ r0 �updatez--uniform-bucket-level-access)r/ r0 r4 z --no-uniform-bucket-level-access)r r c C s |j jdkrtd| j ��d S )N�gsz7The %s command can only be used with gs:// bucket URLs.)�storage_url�schemer �command_name)�self�blr� r; �"/opt/gsutil/gslib/commands/ubla.py�,_ValidateBucketListingRefAndReturnBucketName� s ��z8UblaCommand._ValidateBucketListingRefAndReturnBucketNamec C s� | � |� |j}| jj|jdg|jd�}|j}|j}t|�� d�|j d�}d}|jrb|j|d<