1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-11-27 22:18:36 +02:00
Files
OpenIntegrations/docs/en/md/S3/Objects-management/Head-object.mdx
Vitaly the Alpaca (bot) 9be4b23629 Main build (Jenkins)
2025-10-31 15:42:42 +03:00

102 lines
3.4 KiB
Plaintext
Vendored

---
sidebar_position: 7
description: Head object and other functions to work with S3 in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, S3]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# 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, Val Directory = False) 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 |
| Directory | --dir | Boolean | ✖ | True > Path style URL, False > Virtual hosted style URL |
Returns: Structure Of KeyAndValue - serialized JSON response from storage
<br/>
:::tip
Object metadata is contained in the headers
Method at AWS documentation: [GetObjectAttributes](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html)
:::
<br/>
```bsl title="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";
Directory = True; // Formation URL in path-style
Bucket = "opi-dirbucket4";
Result = OPI_S3.HeadObject(Name, Bucket, BasicData, , , Directory);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
# JSON data can also be passed as a path to a .json file
oint s3 HeadObject \
--name "pictureU.jpg" \
--bucket "newbucket2" \
--basic "{'URL':'storage-155.s3hoster.by','AccessKey':'***','SecretKey':'***','Region':'BTC','Service':'s3'}"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
:: JSON data can also be passed as a path to a .json file
oint s3 HeadObject ^
--name "pictureU.jpg" ^
--bucket "newbucket2" ^
--basic "{'URL':'storage-155.s3hoster.by','AccessKey':'***','SecretKey':'***','Region':'BTC','Service':'s3'}"
```
</TabItem>
</Tabs>
```json title="Result"
{
"status": 200,
"response": {},
"headers": {
"Accept-Ranges": "bytes",
"Date": "Fri, 31 Oct 2025 12:18:02 GMT",
"ETag": "\"9e0176f87f6565a22f78e0f9b39a4d78\"",
"Server": "MinIO",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"Vary": "Origin, Accept-Encoding",
"X-Amz-Id-2": "0757065d17b69556603743b9ea63f04bc7b9f349245bbff6b0ba901258e9c169",
"X-Amz-Request-Id": "1873929D0A998337",
"X-Content-Type-Options": "nosniff",
"X-XSS-Protection": "1; mode=block",
"Content-Length": "2114023",
"Content-Type": "application/octet-stream",
"Last-Modified": "Fri, 31 Oct 2025 12:14:44 GMT"
}
}
```