Creating buckets using gsutil

If you prefer to use the command line to provision a bucket, the gsutil tool is what you will use:

  1. Use the gsutil mb command as follows to create the bucket. -c-l and -p respectively stand for class (storage class), location (region), and project ID. If the project ID field is skipped, it opts for a default project ID and the URL is used for naming the bucket:
gsutil mb -c nearline -l asia gs://loonycorn-bucket-00
  1. Click on the Refresh button or use the gsutil ls command to verify your bucket creation.

It is possible to change the storage class of a bucket according to will, although regional and multi-regional classes are not interchangeable.

Notice how conversions from regional to multi-regional, or vice versa, are not directly allowed. That's because of some underlying implementation detail, so be sure to plan ahead regarding your choice of storage location.

One feature that might work a bit differently than you expect is the following: if we change the storage class of a bucket, that change will only affect new objects added to the bucket. The existing content will retain its old storage class. This is pretty important to keep in mind, and hints at the fact that GCS is not exactly traditional file storage. If it were, we'd expect the storage class to be a directory-level property that flows down to each file within the directory. That gets us to our next bit of doggerel:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.20.237.21