JENNY BROWN: Welcome back to Cloud Storage Bytes.
Now that you've got the billing basics,
let's add a level of complexity, like
when a client needs to be billed for their usage
of your resources.
Today on Cloud Storage Bytes, we'll
take you into the world of Requester Pays.
[MUSIC PLAYING]
Whenever a user accesses a Cloud Storage resource,
like a bucket or an object, there
are charges associated with both making and executing
the request.
This includes operation charges for performing
a request, network charges for reading the data,
and data retrieval charges if the data
is stored as nearline storage or coldline storage.
Now, normally the project owner of the resource
is billed for these access charges.
But this isn't always appropriate.
If the requester provides a billing project
with their request, the requester's project
can be billed instead.
And this feature is appropriately
called Requester Pays.
With Requester Pays enabled on your bucket,
you can require requesters to include a billing project
in their request, thus billing the requester's project.
Enabling Requester Pays is useful.
For example, if you have a lot of data
that you want to make available to your users,
but you don't want to be charged for their access of that data.
Note that there are some charges that are always
going to be applied to the project containing the bucket,
even when Requester Pays is enabled.
These charges include storage charges
for storing data in a bucket and any applicable early deletion
charges.
For complete details on those caveats,
go ahead and check out the docs linked below.
And now, let's look into how to enable Requester Pays.
Start in the Cloud Storage browser
in the Google Cloud Platform Console.
In the list of buckets, find the bucket
that you want to enable and click
the Off button in the Requester Pays column.
In the window that appears, click Enable.
Once enabled, a green bubble and On
will appear in the Requester Pays column for that bucket.
Of course, once you enable Requester Pays,
you may need to disable it.
So let's walk through that process as well.
To disable Requester Pays on a bucket,
go ahead and start in the Cloud Storage browser in the Google
Cloud Platform Console.
In the list of buckets, find the bucket
you want to disable and click the On button in the Requester
Pays column.
In the window that appears, click Disable.
Once disabled, a gray bubble and Off
will appear in the Requester Pays column.
To check whether Requester Pays is enabled on a bucket,
take a look at the list of buckets.
The Requester Pays status of each bucket
is found in that Requester Pays column.
So we've looked at how to enable and disable
Requester Pays on your own storage buckets.
But what if you're on the other side?
What if you're the account who wants
to access an object stored in a Requester Pays bucket?
Let's check out accessing Requester Pays
buckets using gsutil.
Here's how to include a billing project
that you can download an object stored in a Requester Pays
bucket.
Project ID is the ID of the project to be billed.
For example, my-project.
Bucket name is the name of the relevant bucket.
For example, my-bucket.
Object name is the name of the object you want to download.
For example, pets/dog.
Object destination is the location where
you want to save your object.
For example, desktop/dog.
Keep in mind that buckets that have Requester Pays disabled
still accept requests that include a billing project.
And charges are applied to the billing project supplied
in the request.
So make sure you consider any billing implications
prior to including a billing project in any
of your requests.
There's more to come about Cloud Storage,
but that's going to be for another episode.
If you want to know more about using Requester Pays,
check out the links in the description.
Don't forget to subscribe, give us a like,
and tell us what you want to learn about Google Cloud
Storage.
Thanks for joining us for this Quick Byte of Cloud Storage.
See you next time.
[MUSIC PLAYING]