gdcloud storage buckets create

名称

gdcloud storage buckets create - 创建新的存储分区。

摘要

gdcloud storage buckets create [ BUCKET_NAME ...]
    --bucket-file=BUCKET_FILE |
    ( [--description=DESCRIPTION]
    [--storage-class=STORAGE_CLASS]
    [--project=PROJECT_ID]
    [--api-version=VERSION]
    [--labels=key1=value1,key2=value2 | --labels-file=LABELS_FILE]
    [--annotations=value1,key2=value2 | --annotations-file=ANNOTATIONS_FILE]
    [--finalizers=value1,value2]
    [--enable-locking-policy]
    [--retention-days=RETENTION_DAYS]
    [--enable-cors-policy=bool]
    [--cors-file=CORS_FILE] )
    [--format=FORMAT]
    [--log-http] [flags]

说明

创建用于存储对象的存储分区。

示例

The following command creates a bucket named my-bucket under the default project:

    gdcloud storage buckets create my-bucket

The following command creates two buckets, one named my-bucket and a second bucket named my-other-bucket:

    gdcloud storage buckets create my-bucket my-other-bucket

The following command creates a bucket with the Standard storage class in a project with ID my-project-id:

    gdcloud storage buckets create my-bucket --storage-class=Standard --project=my-project-id

The following command creates a bucket from a file containing YAML configuration for the bucket. Flags other than --bucket-file are ignored when creating a bucket:

    gdcloud storage buckets create --bucket-file=BUCKET_FILE

可选标志

      --annotations stringToString   Comma-separated list of key-value pairs for annotations. (default [])
      --annotations-file string      Path to a file containing YAML configuration for annotations.
      --api-version string           API version for the bucket (default is the newest API version).
      --bucket-file string           Path to a file containing YAML configuration for a bucket custom resource. If set, the gdcloud CLI creates
                                        the bucket from the YAML configuration and ignores the other flags that define the bucket API field.
      --cors-rules-file string       Path to a file containing YAML configuration for the CORS policy detail. It must contain an array of CORS rules.
      --description string           String description of bucket contents.
      --enable-cors-policy           If set, the custom policy defined in CORS_FILE takes effect.
                                            Otherwise, CORS_FILE is ignored even if it has been set.
                                            (default is false).
      --enable-locking-policy        Locking policy that must be enabled when creating the bucket and cannot be disabled afterwards.
                                        If unset, object locking and versioning is disabled and cannot be enabled. The locking policy does not have a default amount of retention days. Use the --retention-days flag to set the retention days.
      --finalizers strings           Comma-separated list of strings for finalizers.
      --labels stringToString        Comma-separated list of key-value pairs for labels. (default [])
      --labels-file string           Path to a file containing YAML configuration for labels.
      --log-http                     Log all HTTP server requests and responses to stderr.
      --retention-days int32         Minimum number of days as an integer that each version of every object will be retained.
                                            If set, the locking policy controlled by the --enable-locking-policy flag is enabled by default. (default -2147483648)
      --storage-class string         Storage class of the bucket. The available value is "Standard". (default "Standard")

GDCLOUD 全局标志

以下标志适用于所有命令:--configuration--format--help--project--quiet

如需了解详情,请参阅 gdcloud CLI 参考概览页面。