Skip to content

[LIBCLOUD-612] Customize HTTP vendor prefix for Google Storage#356

Closed
sfriesel wants to merge 1 commit intoapache:trunkfrom
sfriesel:gs_meta_data
Closed

[LIBCLOUD-612] Customize HTTP vendor prefix for Google Storage#356
sfriesel wants to merge 1 commit intoapache:trunkfrom
sfriesel:gs_meta_data

Conversation

@sfriesel
Copy link
Copy Markdown
Contributor

@sfriesel sfriesel commented Sep 9, 2014

https://issues.apache.org/jira/browse/LIBCLOUD-612

Google storage uses/expects custom headers like meta data
and storage class to be prefixed with "x-goog" instead of
"x-amz". This enables use of object tagging in the Google
Storage provider.

@sfriesel
Copy link
Copy Markdown
Contributor Author

sfriesel commented Sep 9, 2014

Unittests passed on 2.7 and I successfully uploaded an object with metadata and retrieved them again.

>>> bucket.upload_object("testfile", 'testfiles/foobar', extra={'meta_data':{'mytag': 'myvalue'}})
>>> bucket.get_object('testfiles/foobar').meta_data
{'mytag': 'myvalue'}

Google storage uses/expects custom headers like meta data
and storage class to be prefixed with "x-goog" instead of
"x-amz". This enables use of object tagging in the Google
Storage provider.
@sfriesel
Copy link
Copy Markdown
Contributor Author

@Kami Is anything missing? I could provide the whole debug log of the interaction or maybe some credentials for testing if needed

@Kami
Copy link
Copy Markdown
Member

Kami commented Sep 11, 2014

@sfriesel I'll have a look asap.

@Kami
Copy link
Copy Markdown
Member

Kami commented Sep 11, 2014

I need to spend some more time testing this myself. The reason for this is that we are using S3 compatible API which requires you to send x-amzn headers.

From your pull request, it seems like you can use x-goog headers even if you use the S3 compatible API, but I need to confirm this myself.

@Kami
Copy link
Copy Markdown
Member

Kami commented Sep 13, 2014

I just tested your changes and verified it works correctly.

While testing the changes I also noticed meta_data is only returned when retrieving information for a single object (get_object), but not when listing objects (list_container_objects).

I will update documentation and add a note about this known limitation.

@Kami
Copy link
Copy Markdown
Member

Kami commented Sep 13, 2014

Merged into trunk. Thanks!

@asfgit asfgit closed this in d1b6bb7 Sep 13, 2014
@sfriesel sfriesel deleted the gs_meta_data branch October 26, 2016 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants