Gargi-jais11 opened a new pull request, #10930:
URL: https://github.com/apache/ozone/pull/10930

   ## What changes were proposed in this pull request?
   Implement the initial GetObjectAttributes support in the S3 Gateway.
   
   **PR Changes:**
   
   - API : GET /{bucket}/{key}?attributes
   - Required header: x-amz-object-attributes
   - Supported attributes:
                 - ETag — object ETag (MD5 or composite hash for multipart 
objects)
                 - ObjectSize — object size in bytes
                 - StorageClass — storage/replication class
                 - ObjectParts — for multipart objects,
   - Response format: XML GetObjectAttributesResponse with Last-Modified 
response header
   - Error handling: 404 NoSuchKey when the object does not exist, 403 
AccessDenied on authorization failure, 400 InvalidArgument when the attributes 
header is missing or invalid
   - Audit and metrics: GET_OBJECT_ATTRIBUTES audit action and success/failure 
metrics
   
   **Out of scope:**
   
   - Populating Checksum - non-MD5 checksums are not stored in ozone.
   - ObjectParts.Part[] with per-part PartNumber / Size -> this will be 
implemented in follow-up PR
   - Pagination (MaxParts, markers, real IsTruncated behavior) -> this will be 
implemented in followip PR
   - versionId and SSE-C -> Not implemented in ozone
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-16072
   
   ## How was this patch tested?
   
   Added unit test and integration test.
   Manually tested:
   ```
   bash-5.1$ BUCKET=get-attr-test-bucket
   KEY=get-attr-test-key
   bash-5.1$ aws s3api create-bucket --bucket "$BUCKET" --endpoint-url 
http://s3g:9878/
   {
       "Location": "http://s3g:9878/get-attr-test-bucket";
   }
   bash-5.1$ echo "hello-get-object-attributes" | aws s3 cp - 
"s3://$BUCKET/$KEY" --endpoint-url http://s3g:9878/
   bash-5.1$ aws s3api get-object-attributes \
     --bucket "$BUCKET" \
     --key "$KEY" \
     --object-attributes ETag ObjectSize StorageClass \
     --endpoint-url http://s3g:9878/
   {
       "LastModified": "Mon, 03 Aug 2026 06:39:03 GMT",
       "ETag": "\"88fa5b0b7b11af7d6bdd31a64e1cad0a\"",
       "StorageClass": "STANDARD",
       "ObjectSize": 28
   }
   --------------------------------
   // Test multipart ObjectParts
   --------------------------------
   bash-5.1$ dd if=/dev/zero of=/tmp/mpu-test.bin bs=1M count=15
   15+0 records in
   15+0 records out
   15728640 bytes (16 MB, 15 MiB) copied, 0.00987967 s, 1.6 GB/s
   bash-5.1$ aws s3 cp /tmp/mpu-test.bin "s3://$BUCKET/mpu-key" --endpoint-url 
http://s3g:9878/
   upload: ../../tmp/mpu-test.bin to s3://get-attr-test-bucket/mpu-key
   bash-5.1$ aws s3api get-object-attributes   --bucket "$BUCKET"   --key 
"mpu-key"   --object-attributes ETag ObjectSize ObjectParts   --endpoint-url 
http://s3g:9878/
   {
       "LastModified": "Mon, 03 Aug 2026 06:40:01 GMT",
       "ETag": "\"cb075a2e9cd2c450e3822ba742921b31-2\"",
       "ObjectParts": {
           "TotalPartsCount": 2,
           "PartNumberMarker": 0,
           "NextPartNumberMarker": 0,
           "MaxParts": 0,
           "IsTruncated": false
       },
       "ObjectSize": 15728640
   }
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to