Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metadata to get, fget and get_partial methods #522

Merged
merged 7 commits into from
May 14, 2017
9 changes: 3 additions & 6 deletions minio/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,7 @@ def fget_object(self, bucket_name, object_name, file_path, metadata=None):
:param bucket_name: Bucket to read object from.
:param object_name: Name of the object to read.
:param file_path: Local file path to save the object.
:param metadata: Any additional metadata to be uploaded along
with your GET request.
:param metadata: Any additional metadata to be added to GET request's headers.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO we should keep it as request headers, in put_object it is meant to be saved with the object. Here it is meant to be queried.. so it is better to named request_headers or req_headers makes the code more readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, agreed, I will rename it right now :)

"""
is_valid_bucket_name(bucket_name)
is_non_empty_string(object_name)
Expand Down Expand Up @@ -773,8 +772,7 @@ def get_object(self, bucket_name, object_name, metadata=None):

:param bucket_name: Bucket to read object from
:param object_name: Name of object to read
:param metadata: Any additional metadata to be uploaded along
with your GET request.
:param metadata: Any additional metadata to be added to GET request's headers.
:return: :class:`urllib3.response.HTTPResponse` object.

"""
Expand Down Expand Up @@ -802,12 +800,11 @@ def get_partial_object(self, bucket_name, object_name, offset=0, length=0, metad

:param bucket_name: Bucket to retrieve object from
:param object_name: Name of object to retrieve
:param metadata: Any additional metadata to be uploaded along
with your GET request.
:param offset: Optional offset to retrieve bytes from.
Must be >= 0.
:param length: Optional number of bytes to retrieve.
Must be an integer.
:param metadata: Any additional metadata to be added to GET request's headers.
:return: :class:`urllib3.response.HTTPResponse` object.

"""
Expand Down