gdcloud storage buckets create

NAME

gdcloud storage buckets create - Create new storage buckets.

SYNOPSIS

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]

DESCRIPTION

Create buckets for storing objects.

EXAMPLES

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

OPTIONAL FLAGS

      --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 WIDE FLAGS

These flags are available to all commands: --configuration, --format, --help, --project, --quiet.

For more information, see the gdcloud CLI reference overview page.