s3cmd icon indicating copy to clipboard operation
s3cmd copied to clipboard

Is it possible to get x-amz-version-id?

Open viktorix opened this issue 2 years ago • 1 comments

I've tried a few commands (v2.3.0), but not finding a way to get x-amz-version-id. I was able to find it when adding -d to the info command, and it's in the response header:

DEBUG: Response:
{'data': b'',
 'headers': {'accept-ranges': 'bytes',
             'cache-control': 'max-age=0, no-cache, no-store',
             'content-length': '10300',
             'content-type': 'application/octet-stream',
             'date': 'Mon, 10 Apr 2023 16:00:28 GMT',
             'etag': '"9a70b1e1bee36b2d399c6e3b01488368"',
             'last-modified': 'Mon, 10 Apr 2023 15:50:42 GMT',
             'x-amz-id-2': 'aNxVlcWVONug42jOgN604f2XPNMhiS2WW',
             'x-amz-meta-s3cmd-attrs': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
             'x-amz-meta-s3tools-gpgenc': 'gpg',
             'x-amz-request-id': '959a6c5ff2c03db3',
             'x-amz-version-id': '4_z773e5ee688e377f87e640b1e'},
 'reason': '',
 's3cmd-attrs': {'atime': '1681141794',
                 'ctime': '1681141794',
                 'gid': '0',
                 'gname': 'root',
                 'md5': 'f1c9645dbc14efddc7d8a322685f26ebvd',
                 'mode': '33188',
                 'mtime': '1681141794',
                 'uid': '0',
                 'uname': 'root'},
 'status': 200}

I've seen that versioning is supported for buckets. Is there a way to work with version IDs? Thanks.

viktorix avatar Apr 10 '23 16:04 viktorix

After digging around more, it appears that s3cmd limits headers to x-amz-meta-:

https://github.com/s3tools/s3cmd/blob/master/s3cmd#L1143-L1151

I think it would be helpful to extend this to x-amz- headers, so they can be accessed as needed.

viktorix avatar Apr 10 '23 18:04 viktorix