CreateBucket Method

Creates a new bucket.

Syntax

QString CreateBucket(const QString& qsBucketName, const QString& qsKind);

Remarks

This method creates a new bucket named BucketName of the specified Kind. Valid values for Kind are allPrivate (default if empty) and allPublic. Each account may have up to 100 buckets.

The value passed for BucketName must comply with the following restrictions:

  • Must be between 6 and 50 characters long (inclusive).
  • Must consist solely of letters, digits, and hyphens (-).
  • Cannot start with the string b2-.
  • Must be globally unique (i.e., no two accounts may have a bucket with the same name) when compared case-insensitively.

If any items are present in the Metadata* properties, they will also be included in the request and applied to the newly-created bucket. Keep in mind that the server enforces a limit of 10 metadata items per bucket.

The currently-authenticated application key must have the writeBuckets capability to call this method successfully, otherwise the server will return an error. Refer to the AccountCapabilities property for more information.

Error Handling

This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 Qt Edition - Version 20.0 [Build 8265]