1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2026-05-22 10:05:29 +02:00
Files
OpenIntegrations/docs/en/md/S3/Buckets-managment/Create-bucket.mdx
T

58 lines
1.4 KiB
Plaintext
Raw Normal View History

2024-11-13 09:59:01 +03:00
---
sidebar_position: 1
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Create bucket
Creates a new bucket with the specified name
2024-11-14 11:10:08 +03:00
`Function CreateBucket(Val Name, Val BasicData, Val Directory = True, Val Headers = Undefined) Export`
2024-11-13 09:59:01 +03:00
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Name | --name | String | ✔ | Bucket name |
2024-11-13 22:48:21 +03:00
| BasicData | --data | Structure of KeyAndValue | ✔ | Basic request data. See GetBasicDataStructure |
2024-11-14 11:10:08 +03:00
| Directory | --dir | Boolean | ✖ | True > Directory Bucket, False > General Purpose Bucket |
2024-11-13 22:48:21 +03:00
| Headers | --headers | Map Of KeyAndValue | ✖ | Additional request headers, if necessary |
2024-11-13 09:59:01 +03:00
Returns: Map Of KeyAndValue - serialized JSON response from storage
<br/>
2024-11-13 22:48:21 +03:00
:::tip
Method at AWS documentation: [CreateBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html)
:::
<br/>
2024-11-13 09:59:01 +03:00
```bsl title="1C:Enterprise/OneScript code example"
URL = "storage-155.s3hoster.by";
AccessKey = "BRN5RKJE67...";
SecretKey = "NNhv+i9PrytpT8Tu0C1N...";
Region = "BTC";
2024-11-13 22:48:21 +03:00
BasicData = OPI_S3.GetBasicDataStructure(URL, AccessKey, SecretKey, Region);
2024-11-13 09:59:01 +03:00
2024-11-14 11:10:08 +03:00
// Directory bucket
2024-11-14 17:27:44 +03:00
Name = "opi-dirbucket3";
2024-11-13 09:59:01 +03:00
2024-11-13 22:48:21 +03:00
Result = OPI_S3.CreateBucket(Name, BasicData);
2024-11-14 11:10:08 +03:00
// General purpose bucket
2024-11-14 17:27:44 +03:00
Name = "opi-gpbucket3";
2024-11-14 11:10:08 +03:00
Result = OPI_S3.CreateBucket(Name, BasicData, False);
2024-11-13 09:59:01 +03:00
```