Skip to content

Commit

Permalink
Custom metadata doc and test changes (#664)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebozduman authored and kannappanr committed Jun 15, 2018
1 parent d27eb1d commit 1efa13d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ except ResponseError as err:

<a name="put_object"></a>
### put_object(bucket_name, object_name, data, length, content_type='application/octet-stream', metadata=None)
Add a new object to the object storage server.
Add a new object to the object storage server. If provided metadata key is not one of the valid/supported metadata names, the metadata information is saved with prefix `X-Amz-Meta-` prepended to the original metadata key name.

NOTE: Maximum object size supported by this API is 5TiB.

Expand Down Expand Up @@ -806,7 +806,7 @@ except ResponseError as err:

<a name="fput_object"></a>
### fput_object(bucket_name, object_name, file_path, content_type='application/octet-stream', metadata=None)
Uploads contents from a file to objectName.
Uploads contents from a file, `file_path`, to `object_name`. If provided metadata key is not one of the valid/supported metadata names, the metadata information is saved with prefix `X-Amz-Meta-` prepended to the original metadata key name.

__Parameters__

Expand Down Expand Up @@ -847,7 +847,7 @@ except ResponseError as err:

<a name="stat_object"></a>
### stat_object(bucket_name, object_name)
Gets metadata of an object.
Gets metadata of an object. If provided metadata key is not one of the valid/supported metadata names when the object was put/fput, the metadata information is saved with prefix `X-Amz-Meta-` prepended to the original metadata key name. So, the metadata returned by stat_object api will be presented with the original metadata key name prepended with `X-Amz-Meta-`.

__Parameters__

Expand Down
6 changes: 3 additions & 3 deletions tests/functional/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def test_fput_object_small_file(client, testfile, log_output):
# upload local small file.
if is_s3(client):
client.fput_object(bucket_name, object_name+'-f', testfile,
metadata)
metadata=metadata)
else:
client.fput_object(bucket_name, object_name+'-f', testfile)
except Exception as err:
Expand Down Expand Up @@ -323,7 +323,7 @@ def test_fput_object_large_file(client, largefile, log_output):
client.make_bucket(bucket_name)
if is_s3(client):
client.fput_object(bucket_name, object_name+'-large', largefile,
metadata)
metadata=metadata)
else:
client.fput_object(bucket_name, object_name+'-large', largefile)

Expand Down Expand Up @@ -354,7 +354,7 @@ def test_fput_object_with_content_type(client, testfile, log_output):
# upload local small file with content_type defined.
if is_s3(client):
client.fput_object(bucket_name, object_name+'-f', testfile,
content_type, metadata)
content_type, metadata=metadata)
else:
client.fput_object(bucket_name, object_name+'-f', testfile,
content_type)
Expand Down

0 comments on commit 1efa13d

Please sign in to comment.