ovh / public-cloud-roadmap

Agile roadmap for OVHcloud Public Cloud services. Discover the features our product teams are working on, comment and influence our backlog.
https://www.ovhcloud.com/en/public-cloud/
185 stars 5 forks source link

s3 get-object does not return header x-amz-tagging-count #546

Closed bkcsfi closed 10 months ago

bkcsfi commented 10 months ago

transcribed from ovhcloud support ticket 380241

As an OVHcloud customer using s3 object storage I want s3 get-object API to return header x-amz-tagging-count so that I can determine which objects have tags to avoid calling get-object-tagging on every object

When tags are assigned to an object in s3 using put-object-tagging, ovhcloud does correctly return the tag when get-object-tagging api is used. However ovhcloud is not compatible with aws s3 because it does not set the "x-amz-tagging-count" header in the get-object response.

That is, there's currently no way to know if an ovhcloud s3 object has tags w/o calling get-object-tagging, which adds overhead to every get-object call. Would you please consider making ovhcloud s3 more compatible with aws by returning the "x-amz-tagging-count" in the get-object response headers, set to the count of assigned tags?

see https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-tagging.html

example:

add 2 tags

$ aws --profile ovhcloud-sup-svc-prod s3api put-object-tagging --bucket sup-svc-prod-northbound  --key 0/0/6/sfi1553600/sfi1553600_packing-slip.pdf --tagging '{    
                                "TagSet": [                                                    
                                    {                                                                                                                                                         
                                        "Value": "true",                                                                                                                                      
                                        "Key": "deleted"                                                                                                                                      
                                    },                                                                                                                                                        
                                    {                                                                                                                                                         
                                        "Value": "2023-12-28",                                                                                                                                
                                        "Key": "delete-date"                                                                                                                                  
                                    }                                                                                                                                                         
                                ]                                                                                                                                                             
                            }'   

get the tags

$ aws --profile ovhcloud-sup-svc-prod s3api get-object-tagging --bucket sup-svc-prod-northbound  --key 0/0/6/sfi1553600/sfi1553600_packing-slip.pdf                 
{                                                                                                                                                                                             
    "VersionId": "1702939346.533058",
    "TagSet": [
        {
            "Key": "deleted",
            "Value": "true"
        },
        {
            "Key": "delete-date",
            "Value": "2023-12-28"
        }
    ]
} 

but get-object doesn't return the x-amz-tagging-count header

 $ aws --profile ovhcloud-sup-svc-prod s3api get-object --bucket sup-svc-prod-northbound  --key 0/0/6/sfi1553600/sfi1553600_packing-slip.pdf /tmp/test               
{        
    "LastModified": "Mon, 18 Dec 2023 22:42:26 GMT",
    "ContentLength": 420604,     
    "ETag": "\"3cb2a45dfe2b6edc3212729f3c59f169\"",
    "VersionId": "1702939346.533058",
    "ContentType": "application/pdf",
    "Metadata": {                                                                                                                                                                             
        "metadata": "[]"
    },                                                                                         
    "StorageClass": "STANDARD"
}                                 

specifically, in debug mode, here are the headers returned from ovhcloud s3 on the get-object call

 botocore.parsers - DEBUG - Response headers: 
    {'Content-Type': 'application/pdf', 
     'x-amz-storage-class': 'STANDARD', 
     'x-amz-meta-metadata': '[]', 
     'ETag': '"3cb2a45dfe2b6edc3212729f3c59f169"', 
     'x-amz-version-id': '1702939346.533058', 
     'Last-Modified': 'Mon, 18 Dec 2023 22:42:26 GMT', 
     'Content-Length': '420604', 
     'x-amz-id-2': 'txae8a729f01a3426793238-00658ddddc', 
     'x-amz-request-id': 'txae8a729f01a3426793238-00658ddddc', 
     'X-Trans-Id': 'txae8a729f01a3426793238-00658ddddc', 
     'X-Openstack-Request-Id': 'txae8a729f01a3426793238-00658ddddc', 
     'Date': 'Thu, 28 Dec 2023 20:43:08 GMT'
   }
lason-ovh commented 10 months ago

@bkcsfi Hi, this improvement has been planned and will be available soon ;)

lason-ovh commented 10 months ago

@bkcsfi this improvement has been released