HEX
Server: Apache/2.4.68 (Debian)
System: Linux as-cs-widget-demo-us-central1 6.1.0-44-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
User: root (0)
PHP: 8.2.32
Disabled: NONE
Upload Files
File: //lib/google-cloud-sdk/lib/surface/storage/buckets/__pycache__/create.cpython-312.pyc
�

������dZddlmZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
dd	lmZdd
lmZddlm
Z
ddlmZdd
lmZdZej&Gd�dej(��Zy)z4Implementation of create command for making buckets.�)�absolute_import)�division)�unicode_literals)�arg_parsers)�base)�errors)�errors_util)�flags)�storage_url)�user_request_args_factory)�resource_reference)�create_bucket_taskad
Sets the lifecycle management configuration on a bucket. For example,
The following lifecycle management configuration JSON document
specifies that all objects in this bucket that are more than 365 days
old are deleted automatically:

  {
    "rule":
    [
      {
        "action": {"type": "Delete"},
        "condition": {"age": 365}
      }
    ]
  }
c�0�eZdZdZddd�Zed��Zd�Zy)�Createz#Create buckets for storing objects.z!
      Create new buckets.
      a

      The following command creates 2 Cloud Storage buckets, one named
      ``my-bucket'' and a second bucket named ``my-other-bucket'':

        $ {command} gs://my-bucket gs://my-other-bucket

      The following command creates a bucket with the ``nearline'' default
      [storage class](https://cloud.google.com/storage/docs/storage-classes) in
      the ``asia'' [location](https://cloud.google.com/storage/docs/locations):

        $ {command} gs://my-bucket --default-storage-class=nearline --location=asia
      )�DESCRIPTION�EXAMPLESc	�L�|jdtdd��|jddttjdd�	�d
��|jdd
tjd��|jddtjd��|jdddtd��|jddtd��|jdd��tj|�|jdtj�d��tj|�tj|�tj|�tj|�|jd d!dd"�#�|jd$t��tj|�y)%N�url�+z"The URLs of the buckets to create.)�type�nargs�helpz
--locationz-lFT)�default_universe�non_default_universez�[Location](https://cloud.google.com/storage/docs/locations) for the bucket. If not specified, the location used by Cloud Storage is ``us''. A bucket's location cannot be changed after creation.)r�requiredrz--public-access-preventionz--papz�Sets public access prevention to "enforced". For details on how exactly public access is blocked, see: http://cloud.google.com/storage/docs/public-access-prevention)�actionrz--uniform-bucket-level-accessz-bz?Turns on uniform bucket-level access setting. Default is False.z--default-storage-classz-cz-sz�Default [storage class](https://cloud.google.com/storage/docs/storage-classes) for the bucket. If not specified, the default storage class used by Cloud Storage is "Standard".)rrz--default-encryption-keyz-kz�Set the default KMS key using the full path to the key, which has the following form: ``projects/[project-id]/locations/[location]/keyRings/[key-ring]/cryptoKeys/[my-key]''.z--retention-periodaoMinimum [retention period](https://cloud.google.com/storage/docs/bucket-lock#retention-periods) for objects stored in the bucket, for example ``--retention-period=P1Y1M1DT5S''. Objects added to the bucket cannot be deleted until they've been stored for the specified length of time. Default is no retention period. Only available for Cloud Storage using the JSON API.)rz--soft-delete-durationz�Duration to retain soft-deleted objects. For example, "2w1d" is two weeks and one day. See `gcloud topic datetimes` for more information on the duration format. Setting `0` will disable soft delete policy on the bucket. Default is 7 days.z--enable-hierarchical-namespace�
store_truezoEnable hierarchical namespace for the bucket. To use this flag, you must also use --uniform-bucket-level-access)r�defaultrz--lifecycle-file)�add_argument�strr�ArgRequiredInUniverse�StoreTrueFalseActionr
�add_placement_flag�Duration�add_additional_headers_flag�add_autoclass_flags�$add_enable_per_object_retention_flag�!add_recovery_point_objective_flag�_LIFECYCLE_HELP_TEXT�add_ip_filter_file_flag)�cls�parsers  �%lib/surface/storage/buckets/create.py�ArgszCreate.ArgsHs���
���
�C�s�)M��������
��2�2�"��
�
��
����$���/�/�
M��	����'���/�/�
N�	�����!���
�
4�
�����"��
�
f��	�����
5���
���V�$�
��� �
�
!�
!�
#�
D�	�	�
�%�%�f�-�	���f�%�	�.�.�v�6�	�+�+�F�3�
���)���
E������*�1E��F�	�!�!�&�)�c���|jD]�}tj|�}tj|j
|�t
j|�}tj|tjj��}|jj	�+|jjstj d��t#j$||��j'���y)N)�
metadata_typezP--autoclass_terminal_storage_class is only allowed if --enable-autoclass is set.)�user_request_args)rr�storage_url_from_stringr	�raise_error_if_not_bucket�command_pathr
�UnknownResourcer�'get_user_request_args_from_command_args�MetadataType�BUCKET�
resource_args� autoclass_terminal_storage_class�enable_autoclassr�Errorr�CreateBucketTask�execute)�self�args�
url_stringr�resourcer2s      r-�Runz
Create.Run�s����h�h�
��/�/�
�;�c��+�+�D�,=�,=�s�C�#�3�3�C�8�h�
#�
K�
K��";�"H�"H�"O�"O����
)�
)�
J�
J���#�1�1�B�B��l�l�
*�
�	
��)�)�
�&7����	�)r/N)�__name__�
__module__�__qualname__�__doc__�
detailed_help�classmethodr.rD�r/r-rr1s2��+�
�
�	�-�&�_*��_*�Br/rN)rH�
__future__rrr�googlecloudsdk.callioperr�"googlecloudsdk.command_lib.storagerr	r
rr�,googlecloudsdk.command_lib.storage.resourcesr
�0googlecloudsdk.command_lib.storage.tasks.bucketsrr)�UniverseCompatible�CommandrrKr/r-�<module>rSs^��;�&��'�/�(�5�:�4�:�H�K�O���$���M�T�\�\�M��Mr/