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: mb.cpython-39.pyc
Close
a +(WgkB � @ sx d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlZddlm Z m Z ddlmZ dd l mZ dd lmZ ddlmZ ddlmZ dd lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl m!Z! ddl m"Z" ddl#m$Z$ ddl#m%Z% ddl#m&Z& ddl'm(Z( d�)e�Z*de* dj)ed� Z+e�,d�Z-e�,d�Z.dZ/ej0j1Z1e1j2Z2G d d!� d!e�Z3dS )"z@Implementation of mb command for creating cloud storage buckets.� )�absolute_import)�print_function)�division)�unicode_literalsN)�AccessDeniedException�BadRequestException)�Command)�CommandArgument)�VALID_RPO_VALUES)�VALID_RPO_VALUES_STRING)�ApiSelector)�CommandException)�InvalidUrlError)�StorageUrlFromString)�storage_v1_messages)�NO_MAX)�RetentionInSeconds)�GcloudStorageFlag)�GcloudStorageMap)�InsistAscii)� InsistOnOrOff)�NormalizeStorageClass)�ValidateCMEKz� gsutil mb [-b (on|off)] [-c <class>] [-k <key>] [-l <location>] [-p <project>] [--autoclass] [--retention <time>] [--pap <setting>] [--placement <region1>,<region2>] [--rpo {}] gs://<bucket_name>... z <B>SYNOPSIS</B> a� <B>DESCRIPTION</B> Create one or more new buckets. Google Cloud Storage has a single namespace, so you are not allowed to create a bucket with a name already in use by another user. You can, however, carve out parts of the bucket name space corresponding to your company's domain name (see "gsutil help naming"). If you don't specify a project ID or project number using the -p option, the buckets are created using the default project ID specified in your `gsutil configuration file <https://cloud.google.com/storage/docs/boto-gsutil>`_. The -l option specifies the location for the buckets. Once a bucket is created in a given location, it cannot be moved to a different location. Instead, you need to create a new bucket, move the data over, and then delete the original bucket. <B>BUCKET STORAGE CLASSES</B> You can specify one of the `storage classes <https://cloud.google.com/storage/docs/storage-classes>`_ for a bucket with the -c option. Example: gsutil mb -c nearline gs://some-bucket See online documentation for `pricing <https://cloud.google.com/storage/pricing>`_ and `SLA <https://cloud.google.com/storage/sla>`_ details. If you don't specify a -c option, the bucket is created with the default storage class Standard Storage. <B>BUCKET LOCATIONS</B> You can specify one of the `available locations <https://cloud.google.com/storage/docs/locations>`_ for a bucket with the -l option. Examples: gsutil mb -l asia gs://some-bucket gsutil mb -c standard -l us-east1 gs://some-bucket If you don't specify a -l option, the bucket is created in the default location (US). <B>Retention Policy</B> You can specify retention period in one of the following formats: --retention <number>s Specifies retention period of <number> seconds for objects in this bucket. --retention <number>d Specifies retention period of <number> days for objects in this bucket. --retention <number>m Specifies retention period of <number> months for objects in this bucket. --retention <number>y Specifies retention period of <number> years for objects in this bucket. Examples: gsutil mb --retention 1y gs://some-bucket gsutil mb --retention 36m gs://some-bucket If you don't specify a --retention option, the bucket is created with no retention policy. <B>OPTIONS</B> --autoclass Enables the Autoclass feature that automatically sets object storage classes. -b <on|off> Specifies the uniform bucket-level access setting. When "on", ACLs assigned to objects in the bucket are not evaluated. Consequently, only IAM policies grant access to objects in these buckets. Default is "off". -c class Specifies the default storage class. Default is ``Standard``. See `Available storage classes <https://cloud.google.com/storage/docs/storage-classes#classes>`_ for a list of possible values. -k <key> 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]`` -l location Can be any supported location. See https://cloud.google.com/storage/docs/locations for a discussion of this distinction. Default is US. Locations are case insensitive. -p project Specifies the project ID or project number to create the bucket under. -s class Same as -c. --retention time Specifies the retention policy. Default is no retention policy. This can only be set on gs:// buckets and requires using the JSON API. For more details about retention policy see "gsutil help retention" --pap setting Specifies the public access prevention setting. Valid values are "enforced" or "inherited". When "enforced", objects in this bucket cannot be made publicly accessible. Default is "inherited". --placement reg1,reg2 Two regions that form the custom dual-region. Only regions within the same continent are or will ever be valid. Invalid location pairs (such as mixed-continent, or with unsupported regions) will return an error. --rpo setting Specifies the `replication setting <https://cloud.google.com/storage/docs/availability-durability#cross-region-redundancy>`_. This flag is not valid for single-region buckets, and multi-region buckets only accept a value of DEFAULT. Valid values for dual region buckets are {rpo_values}. If unspecified, DEFAULT is applied for dual-region and multi-region buckets. )Z rpo_valuesz.^[a-zA-Z0-9][a-zA-Z0-9\._-]{1,253}[a-zA-Z0-9]$z[-_a-z0-9]{64}z--retentionc s� e Zd ZdZejdg d�ededg d�dddej ej gej e�� gd � Z ejdg d �ddei d �Zeg d�deddd��ded�ded�ded�ded�deddd��ded�eed�d ed!�i d"�Z� fd#d$�Zd%d&� Z� ZS )'� MbCommandz$Implementation of gsutil mb command.�mb)� makebucket�createbucket�md�mkdir� zb:c:l:p:s:k:)� autoclassz retention=zpap=z placement=zrpo=Fr )�command_name_aliases�usage_synopsis�min_args�max_args�supported_sub_args�supported_private_args�file_url_ok�provider_url_ok�urls_start_arg�gs_api_support�gs_default_api�argparse_arguments)r r r r �locationZdraZdrasZreduced_availabilityZdurable_reduced_availability�rr�reduced_redundancy�standardz storage class�nearline�nl�command_helpzMake buckets)� help_name�help_name_aliases� help_type�help_one_line_summary� help_text�subcommand_help_text)�storage�buckets�create�-bz--uniform-bucket-level-accessN)�on�off�-cz--default-storage-class�-kz--default-encryption-key�-lz --location�-pz --project�--papz--public-access-prevention)ZenforcedZ inherited�--placementz--retention-period�--rpoz--recovery-point-objective)�gcloud_command�flag_mapc sp d}|t | j�k r0| j| d tkr&q0|d7 }q|t | j�k rbttt| j| d ��d f| j|<