Head object
Receives information about the properties of the object in the baquette
Function HeadObject(Val Name, Val Bucket, Val BasicData, Val Version = Undefined, Val Headers = Undefined) Export
Parameter | CLI option | Type | Required | Description |
---|---|---|---|---|
Name | --name | String | ✔ | Name of the object in the bucket |
Bucket | --bucket | String | ✔ | Name of the bucket in which the object is stored |
BasicData | --basic | Structure of KeyAndValue | ✔ | Basic request data. See GetBasicDataStructure |
Version | --ver | String | ✖ | Token for receiving a specific version of an object |
Headers | --headers | Map Of KeyAndValue | ✖ | Additional request headers, if necessary |
Returns: Structure of KeyAndValue - serialized JSON response from storage
tip
Object metadata is contained in the headers
Method at AWS documentation: GetObjectAttributes
1C:Enterprise/OneScript code example
URL = "storage-155.s3hoster.by";
AccessKey = "BRN5RKJE67...";
SecretKey = "NNhv+i9PrytpT8Tu0C1N...";
Region = "BTC";
BasicData = OPI_S3.GetBasicDataStructure(URL, AccessKey, SecretKey, Region);
Name = "picture.jpg";
Bucket = "opi-gpbucket3";
Result = OPI_S3.HeadObject(Name, Bucket, BasicData);
- Bash
- CMD/Bat
# JSON data can also be passed as a path to a .json file
oint s3 HeadObject \
--name "picture.jpg" \
--bucket "opi-gpbucket3" \
--basic "{'URL':'storage-155.s3hoster.by','AccessKey':'***','SecretKey':'***','Region':'BTC','Service':'s3'}"
:: JSON data can also be passed as a path to a .json file
oint s3 HeadObject ^
--name "picture.jpg" ^
--bucket "opi-gpbucket3" ^
--basic "{'URL':'storage-155.s3hoster.by','AccessKey':'***','SecretKey':'***','Region':'BTC','Service':'s3'}"
Result
{
"status": 200,
"response": {},
"headers": {
"Accept-Ranges": "bytes",
"Content-Length": "2114023",
"Content-Type": "binary/octet-stream",
"Date": "Fri, 22 Nov 2024 10:12:24 GMT",
"Etag": "\"9e0176f87f6565a22f78e0f9b39a4d78\"",
"Last-Modified": "Fri, 22 Nov 2024 10:12:02 GMT",
"Server": "MinIO",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"Vary": "Origin,Accept-Encoding",
"X-Amz-Id-2": "93c576aa54c960b355da9e2934476635fe3243f5df9dbb4db8b7c0d94bec7cd1",
"X-Amz-Request-Id": "180A42B32D61F286",
"X-Content-Type-Options": "nosniff",
"X-Xss-Protection": "1; mode=block"
}
}