Annotations and ZIP
Object annotations (?annotation) and ZIP member extraction (x-minio-extract) are Preview features in the MVP scope. Annotations also depend on four silo-pkg policy actions (s3:*ObjectAnnotation*) that have not been published to the public silo-pkg repository yet, and the general Silo Console (2.6.0) does not include an annotation UI.
This tutorial uses SigV4-signed Python requests to write, read, list and delete object annotations, and to list and read members inside an uploaded ZIP archive without unpacking it into separate S3 objects. Complete Use an S3 SDK first.
Interfaces and permissions
An annotation is attached to a specific parent object version. Each annotation body must be valid UTF-8 text between 1 byte and 1 MiB, and each parent version accepts at most 1,000 annotation names. Updating or deleting an annotation leaves the parent object’s body, ETag and Last-Modified timestamp unchanged.
| Operation | SigV4-signed HTTP request | Required IAM action |
|---|---|---|
| Create or replace | PUT /attachments/<key>?annotation=&annotationName=labels.json | s3:PutObjectAnnotation |
| Read body | GET /attachments/<key>?annotation=&annotationName=labels.json | s3:GetObjectAnnotation |
| List names | GET /attachments/<key>?annotation= | s3:ListObjectAnnotations |
| Delete | DELETE /attachments/<key>?annotation=&annotationName=labels.json | s3:DeleteObjectAnnotation |
Standard object actions (s3:GetObject, s3:PutObject) do not grant annotation access. Pass versionId in the query string to target a historical version, or x-amz-object-if-match on PUT/DELETE to require a matching parent ETag. Annotation bodies inherit the parent object’s server-side encryption mode.
To read or list members inside a ZIP archive stored as an S3 object, include header x-minio-extract: true:
- Read or stat a member:
GETorHEAD /attachments/demo.zip/readme.txtwithx-minio-extract: true. - List archive members:
GET /attachments?list-type=2&prefix=demo.zip/withx-minio-extract: true.
ZIP extraction reads directly from the parent object snapshot without persisting member objects or an index table. It supports Store and Deflate compression (plus bounded ZIP64), up to 10,000 central-directory entries, and up to 256 MiB per uncompressed member. Range and partNumber requests on ZIP members are not supported.
Complete Python example
Because standard S3 SDKs do not have built-in methods for ?annotation or x-minio-extract, sign the requests with botocore.auth.SigV4Auth. Save the script below as ~/.local/share/silo-tutorial/extensions.py:
Run the script:
The script prints the PUT status (200), the annotation JSON, the annotation list XML, the DELETE status (204), the extracted hello from ZIP member content, the HEAD status (200), and the ListObjectsV2 XML for demo.zip/. See Annotations and ZIP extraction for full protocol rules and error codes.
