Data.Cloud.AmazonAPI.TAmazonStorageService.CreateBucket

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function CreateBucket(const BucketName: string; BucketACL: TAmazonACLType = amzbaPrivate;  const BucketRegion: TAmazonRegion = amzrNotSpecified; ResponseInfo: TCloudResponseInfo = nil): Boolean;

C++

bool __fastcall CreateBucket(const System::UnicodeString BucketName, TAmazonACLType BucketACL = (TAmazonACLType)(0x1), const System::UnicodeString BucketRegion = System::UnicodeString(), Data::Cloud::Cloudapi::TCloudResponseInfo* ResponseInfo = (Data::Cloud::Cloudapi::TCloudResponseInfo*)(0x0));

Properties

Type Visibility Source Unit Parent
function public
Data.Cloud.AmazonAPI.pas
Data.Cloud.AmazonAPI.hpp
Data.Cloud.AmazonAPI TAmazonStorageService

Description

Creates a new bucket with the given name on the S3 service.

Bucket names must be unique to the Amazon S3 service (Amazon Simple Storage Service). That means that, if someone else has already used a given bucket name with their account, you cannot create a bucket with the same name.

Bucket names have some restrictions:

  • They must start with a number or letter.
  • They can contain periods, underscores and dashes, numbers, and lowercase letters.
  • They must be in the range from 3 through 255 characters (although they usually should not be longer than 63 characters).
  • They must not be formatted like an IP address (for example, 192.168.0.1).

Furthermore, if you specify a region when creating the bucket, its name must follow these rules:

  • It cannot contain underscores.
  • It must be in the range from 3 through 63 characters.
  • It cannot end in a dash.
  • It cannot contain two adjacent periods.
  • It cannot contain a dash next to a period (for example, 'my.-bucket').

You can set the access control list of the bucket, the region, or both with this call. Also, you can choose a region to reduce costs or to optimize latency. For example, if you are in Europe, you will probably want to create buckets in the EU region.

The following table shows the significance of the parameters:

Parameter Description

BucketName

The name of the bucket to create.

BucketACL

The ACL value to use in the bucket creation. Default is amzbaPrivate.

BucketRegion

The region to create the bucket in.

ResponseInfo

The optional class for storing response info into.

The method returns True if the creation was successful, and False otherwise.

See Also