Use the Google Developers Console to perform simple storage management tasks for Google Cloud Storage. Some typical uses for Google Developers Console include:
- Enabling the Google Cloud Storage API for a project
- Creating and deleting buckets
- Uploading, downloading, and deleting objects
- Managing access control lists (ACLs) for objects and buckets
This guide discusses how to access Google Developers Console and how to use it to manage your data. You can also accomplish all the tasks discussed here using the gsutil command line tool or any of the libraries that support Google Cloud Storage.
- Accessing Google Developers Console
- Using the Google Developers Console to Manage Your Data
- Creating a bucket
- Uploading data to a bucket
- Downloading data from a bucket
- Creating and using folders
- Deleting objects, folders, and buckets
- Sharing your data publicly
- Setting bucket permissions
- Setting object permissions and metadata
- Filtering objects to view
- Adding a member to a project
Accessing Google Developers Console
Google Developers Console requires no setup or installation and you can access it directly in a browser. Depending on your use case, you access Developers Console in slightly different ways. If you are:
- A project member
In order to use Google Developers Console as a project member, you must be added to the project’s member list. A current project owner can give you owner, editor, or viewer access to the project which applies to all buckets defined in the project. For more information, see Adding a member to a project.
- A user granted read or write access to a bucket
In this use case, a project owner or editor gives you read or write access to a bucket and then sends you the bucket name which you substitute into the URL above. You will be able to only work with objects in the specified bucket. This use case is useful for users who are not project members, but who need to access a bucket. This URL will prompt you to authenticate with a Google account if you are not already signed in. Note that the trailing slash (/) in the URL must be used.
A variation of this use case is when a project owner or editor grants Reader permission to the bucket entity All Users. This creates a bucket whose contents are publicly readable for authenticated users. For more information, see Setting bucket permissions.
- A user is granted read access to an object
In this use case, a project owner or editor configures an object as publicly viewable and sends you the URL to access the object. This URL will prompt you to authenticate with a Google account if you are not already signed in.
Compare the form of the URL above (
storage.cloud.google.com) with the one shown in the Sharing your data publicly instructions. When you share a link publicly, the URL is of the form:
https://storage.googleapis.com/<bucket-name>/<object-name>. This URL does not require a recipient to authenticate with Google and can be used for non-authenticated access to an object.
Using the Google Developers Console to Manage Your Data
The Google Developers Console enables you to perform basic storage management tasks with your data using a browser. To use the Developers Console, you must authenticate with Google and have appropriate permission to complete the tasks below. If you are the account owner who created the project, it is likely you already have all the permission you need to complete the tasks below. Otherwise, you can be added as a project member (Adding a member to a project) or be given permission to perform actions on a bucket (Setting bucket permissions).
Creating a bucket
Google Cloud Storage uses a flat namespace to store your data but you can use the Google Developers Console to create folders and mimic a folder hierarchy. Your data isn't physically stored in a hierarchical structure, but is displayed like that in the Developers Console.
Because Google Cloud Storage has no notion of folders, the folder suffix and object name delimiters are visible when you view your folders using gsutil or any other command-line tools that may work with Google Cloud Storage. You can use many tools to manage your data but there are some differences between the Google Developers Console and command-line tools like gsutil that you should be aware of.
To create a bucket:
- In the Developers Console, go to
Storage > Cloud Storage > Storage
If there are no buckets already defined for the project, click Create a bucket. Otherwise, click Add bucket.
In the New bucket dialog, specify:
- A bucket name subject to the bucket name requirements.
- A storage class.
- A location where bucket data will be stored.
- If applicable for the storage class, a region defining a more specific geographic location for your data.
Uploading data to a bucket
You can upload data to your bucket by uploading one or more files or a folder containing files. When you upload a folder, the Google Developers Console maintains the same hierarchical structure of the folder, including all of the files and folders it contains. You can track the progress of uploads to the Developers Console using the upload progress window. You can minimize the progress window and continue working with your bucket.
Before you upload objects to your bucket, review the Object Name Requirements.
To upload data to a bucket:
- In the Developers Console, click
To upload a folder, click Upload folder.
- In the file dialog, select one or more files to upload. Or, if you selected Upload folder, select a folder to upload.
- Click Open to start the upload process.
- A window showing the upload progress is displayed. You can minimize this window and the
upload will continue.
To upload data to a bucket by dragging and dropping:
- In the Google Developers Console, navigate to the location in the bucket where you want to put the content.
- From your desktop or file manager tool, select one or more files or a folder to upload.
Drag the selected files or folder to the object list in the Developers Console and release.
Downloading data from a bucket
You can download data from your bucket, directly from your browser, by placing your cursor over an object name, right clicking, and selecting the option to save the object. For example, the following example demonstrates downloading an image using the Google Chrome browser.
If you click an object's name, your browser will try to display the object if it can; otherwise, your browser will download the object or prompt you to download it.
Creating and using folders
Because the Google Cloud Storage system has no notion of folders, folders created in the Google Developers Console are a convenience to help you organize objects in a bucket. As a visual aid, the Google Developers Console shows folders with a folder icon image to help you distinguish folders from objects.
To create a folder:
- In the Developers Console, navigate to a bucket or existing folder in a bucket where you want to create a new folder.
- Click New folder.
- In the New folder dialog, provide a name for the folder.
- Click the folder icon to navigate into the folder.
- At this point, you can:
- Upload data into the folder or create a new folder.
- Navigate up to the container of the folder by clicking the container name in the
breadcrumb trail. In the following example, the container of the archive
folder is example-bucket.
Working with folders in gsutil
When you use other tools to work with your buckets and data, the presentation of folders may be different than as presented in the Google Developers Console. For example, when you list the same folder created in the preceding steps using gsutil, you see that the folder name is part of the object name.
$ gsutil ls gs://example-bucket gs://example-bucket/archive
gsutil provides the illusion of a hierarchical file tree atop the “flat” name space supported by Google Cloud Storage service. To Google Cloud Storage, the object gs://bucket/abc/def/ghi.txt is just an object that happens to have “/” characters in its name. There are no “abc” or “abc/def” directories; just a single object with the given name. The following diagram illustrates how gsutil provides a hierarchical view of objects in a bucket.
If you use gsutil to list all the items in a bucket shown in the example, you will see the following output:
$ gsutil ls -R gs://bucket gs://bucket/image.jpeg gs://bucket/abc/: gs://bucket/abc/ghi.txt gs://bucket/abc/xyz.avi gs://bucket/def/: gs://bucket/def/123.png
For more information about working with folders in gsutil, see How Subdirectories Work.
Deleting objects, folders, and buckets
You can delete any folder or object in the Google Developers Console by selecting the checkbox next to it and clicking the delete button. When you delete a folder, you also delete all objects inside it. Note that even objects marked as SHARED PUBLICLY are deleted without a prompt from Google Cloud Storage to confirm your choice.
To delete objects and folders:
- In the Developers Console, select the objects and folders that you want to delete by checking the box next to them.
- Click Delete.
- Click OK.
Warning: Object deletion cannot be undone. Google Cloud Storage is designed to give developers a high amount of flexibility and control over their data, and Google maintains strict controls over the processing and purging of deleted data. To protect yourself from mistakes, you can configure object versioning on your bucket(s).
In order to delete a bucket, you do not need to delete all folders and objects within that bucket. When you delete a bucket with objects in it, the Google Developers Console shows a dialog warning you that the bucket content will be deleted. You can continue or cancel the delete.
Sharing your data publicly
With the Google Developers Console, you can share your objects easily with others by making it publicly accessible. You do this by selecting the checkbox in the SHARED PUBLICLY column for the object. The bucket that contains a publicly accessible object does not have to be publicly accessible itself. If you want to make a bucket publicly accessible, see Setting bucket permissions.
When you share an object publicly, a link appears in the SHARED PUBLICLY column
which is suitable for sharing. The sharable link references your objects using the
storage.googleapis.com domain which is different than the domain used in the
Developers Console to navigate in a bucket. For example, for a bucket named
bucket and an object named
image1.JPG, the public link to share the object is
http://storage.googleapis.com/example-bucket/image1.JPG. For an example of accessing
a publicly shared object, see Accessing Public Data.
Note: If you do not use the SHARED PUBLICLY link and instead right-click on an object and share the URL address to the object, then this URL will redirect users to sign in.
To share an object publicly:
- In the Developers Console, select the checkbox in the
SHARED PUBLICLY column for the object to share.
- Get the link to share by doing one of the following:
- Click the Public link that is displayed next to the checkbox, wait for the object to load in a new browser window, and then get the object's sharable URL in the browser's address bar.
- Right click the Public link element and copy the object's URL directly.
To stop sharing an object publicly:
You can stop publicly sharing an object in two ways: by deselecting the checkbox in the SHARED PUBLICLY column or by editing the object permissions. The latter approach is shown below to highlight what permissions are changed when you stop sharing an object.
- In the Developers Console, click more actions () at the end of the
object row, and select Edit permissions.
- In the permissions dialog, remove the permission entry for anonymous users. This is the
entry with the ID
- Click Save.
Setting bucket permissions
You can control access to a Google Cloud Storage bucket by using
Access Control Lists (ACLs). For example, you can set a bucket's permissions to allow an
entity such as a user or group to read or write to your bucket. You might do this in cases
when it isn't appropriate to add a user as a project team member. The entity specified in the
ACL permission must authenticate with Google, by signing in, when accessing the bucket. Share the
bucket URL with the user(s) as
Making a bucket readable to
allAuthenticatedUsers does not make all it's objects publicly accessible.
To make objects publicly accessible, which does not require authentication with Google, share
each object publicly as shown in Sharing your data publicly. If
you need to do this for a large number of objects in a bucket, use the
To make a bucket readable to all authenticated users:
- In the Developers Console, click more actions
() at the end of the bucket row, and select Edit permissions.
- In the permissions dialog, add a new User entry for the entity
allAuthenticatedUserswith Reader permission.
- Click Save to save the new permission entry.
For other choices you can make for bucket ACLs, see Specifying Bucket and Object ACLs.
Setting object permissions and metadata
You can control access to your Google Cloud Storage object data by using Access Control Lists (ACLs) and Signed URLs. In the Developers Console, you can view and configure an object's ACLs. In addition to ACLs, you can also configure an object's metadata in the Developers Console. An object's metadata controls aspects of how requests are handled, including what type of content your data represents and how your data is encoded.
You cannot set permissions and metadata on a folder.
To view or change object permissions:
- In the Developers Console, click more actions
() at the end of the object row, and select Edit permissions.
In the permissions dialog, make changes to the permissions. For example,
you can change an existing ACL by changing its permission or add a new permission.
- Click Save.
To view or change object metadata:
- In the Developers Console, click more actions
() at the end of the object row, and select Edit metadata.
In the metadata dialog, make changes to the metadata. For example, you
can change values of existing metadata, add new metadata,
or remove existing metadata.
- Click Save.
Filtering objects to view
In the Google Developers Console, you can filter the objects you see by specifying a prefix that is used to match the names of objects to display. The prefix filters objects to display only for your current bucket view, that is, the prefix does not select for objects contained in folders.
To filter objects to display:
- In the Developers Console, type a prefix value in the filter box.
- To remove the filter, clear the filter box.
Adding a member to a project
If you are a not a project owner or a member of a project, you must be added to the project's member list in order to work with its associated buckets and objects. Once you have been added to the member list of the project, the project name appears in your list of projects. If you are an existing project owner, you can add a member to your project using the following steps.
To add a member to a project:
- In the Developers Console, select the project to which to add a member.
In the left sidebar, click Permissions.
- Click Add Member.
In the Add Member dialog specify the email address of the
new team member.
Set the appropriate permission for the team member.
In general, set the minimum permission possible while still giving the team member the required access. For example, if the team member needs to only read from a project's bucket, then select the Can view permission. Similarly, if the team member needs to read and write to a project's bucket, then select Can edit. Select the Is owner permission only if the team member needs to change project settings and manage team members.
- Click Add.