[MUSIC PLAYING]
SPEAKER: Welcome to the quick start
for Cloud Storage, Google Cloud's object
store for unstructured data such as images, videos,
and documents.
In this video, we're going to walk
through how to perform basic tasks in Cloud Storage using
the gsutil command line tool.
To start, visit console.cloud.google.com
to open the Google Cloud Console.
This web portal lets you manage and explore
your cloud resources directly from a browser.
To get started with Cloud Storage,
you need a Google Cloud project.
You can use an existing project or set up a new one.
Next, activate Cloud Shell by clicking its icon
to the right of the search bar.
Cloud Shell is an online development environment
that comes preloaded with helpful tools
for interacting with your cloud resources.
Once it launches, click the Maximize button
to increase the size of the Cloud Shell terminal.
Now you'll run some commands using the gsutil command line
tool, which allows you to interact with your Cloud
Storage resources from command line.
gsutil stands for Google Storage Utility.
Now create a Cloud Storage bucket.
Buckets are the basic containers that hold your data
in Cloud Storage.
To create a bucket, run the gsutil mb command
and provide a global unique name for your bucket.
This demo uses a bucket named storage-quickstart-777.
But you must choose your own bucket name.
Next, I'll put an object into your bucket.
First, run the wget command to download a kitten.png image
to the Cloud Shell environment.
Then run the gsutil cp command to copy the image
from your local Cloud Shell environment to your Cloud
Storage bucket.
Congratulations, you've successfully
outputted an object to your bucket.
Now download the object from Cloud Storage
back to your local Cloud Shell environment
using the gsutil cp command again.
You'll download the object as a file called kitten2.png.
If you run ls, you can see that it was downloaded successfully.
Within Cloud Storage buckets, you
can create folders to organize your objects.
With gsutil cp, you can upload an object
to a specific folder in a Cloud Storage bucket.
This command creates a folder called folder1
within your bucket and uploads the kitten image there.
You can also list the contents of a bucket or folder using
the gsutil ls command.
Here, you can list the contents at the top level
of your bucket.
The two items listed are kitten.png and folder1.
You can also list details for an individual object using
gsutil ls with the -l flag.
Here, you can list details about kitten.png, such as its size
and date of creation.
Now let's explore how to manage Cloud Storage permissions.
Run the gsutil iam ch command, which
allows you to change permissions for a given Cloud Storage
bucket.
Here, you specify that you want to give all users permission
to view objects stored in the bucket.
The command is successful if no error is returned.
To remove public view access to these objects,
run the gsutil iam ch command with the -d flag.
You may also want to give a specific person
access to your bucket.
This command gives the gcpstudentdevelopers7@gmail.com
account permission to read and write object to your bucket.
To remove this permission, run the same gsutil iam ch command,
but with the -d flag.
To delete an object, run this gsutil rm command
to delete kitten.png from the Cloud Storage bucket.
And finally, run this command to delete the Cloud Storage
bucket.
The -r flag is added so that everything inside of the bucket
is deleted as well.
And that's it.
You're now equipped to perform basic tasks
in Cloud Storage using the gsutil command line tool.
While this video used Cloud Shell,
you can also use gsutil from your local computer.
Check out the gsutil Getting Started Guide, linked
in the description below, to learn how to install gsutil
on your local computer.
Make sure to check out the rest of our Cloud Storage
documentation at cloud.google.com/storage/docs,
so you can learn more about how to store and manage your data
in Google Cloud.
[MUSIC PLAYING]