Original Message Follows:
------------------------
From: Sebastián Marconi<
sebastia...@gmail.com>
Subject: Re: Change object metadata without re-uploading
Date: Wed, 1 Aug 2012 06:10:16 -0700 (PDT)
>
>
> On Monday, July 9, 2012 6:32:17 PM UTC-3, Mike Schwartz (Google Storage
> Team) wrote:
> >
> > Hi Eric,
> >
> > Currently there's no way to do it via gsutil; there's an open
issue<
http://code.google.com/p/gsutil/issues/detail?id=89>to add such
You may find it easier to use the new Cloud Storage JSON API to perform
this update, since you can use the PATCH method
(
https://developers.google.com/storage/docs/json_api/v1/objects/patch) to
update it. e.g.,
curl --request PATCH -H 'Content-Type: application/json' --data
'{cacheControl:"public, max-age=3600"}' -H "Authorization: Bearer
OAUTH_ACCESS_TOKEN_HERE"
https://www.googleapis.com/storage/v1beta1/b/bucket/o/object\?projection=full
NOTE: At some point, the projection argument should be unnecessary; we're
working on it.
NOTE: the object needs to be %-encoded, so slashes in the object name need
to be turned into %2f. e.g., gs://mybucket/path/to/object would be
https://www.googleapis.com/storage/v1beta1/b/mybucket/o/path%2Fto%2Fobject.
You can also use the batch mechanism to send multiple PATCH requests up at
one time per
https://developers.google.com/storage/docs/json_api/v1/how-tos/batch, so
you can batch them in batch requests of size less than 10MB. But if this
is a one-time operation, you're find doing it one-at-a-time.
If you need access to the Cloud Storage JSON API, currently in Limited
Availability, click Request Access... link in the APIs Console
(
https://developers.google.com/console) next to the API, or you can
respond to this e-mail with your numeric project ID, and I can provision
your project.
-nh