Home > @hapoosjs/api-buckets > Buckets
Provides methods to manage cloud buckets and stored bojects
Signature:
export interface Buckets
Method | Description |
---|---|
blockPublicAccess(bucketName, blockAccess) | (Un) Block ACLs/Policies that provide public bucket access |
bucketExists(bucketName) | Check if a bucket of a given name exists |
clean(bucketName, folder) | Delete all files in a bucket or a folder in the bucket |
createBucket(bucketName, options) | Create a new bucket. |
deleteBucket(bucketName, options) | Delete a bucket |
deleteFile(bucketName, filePath, versionId) | Delete a file |
deletePolicy(bucketName) | Delete resource permission policy associated with a bucket |
getEncryption(bucketName) | Get encryption configuration for a bucket |
getFileAsBuffer(bucketName, filePath, options) | Download file contents |
getFileAsStream(bucketName, filePath, options) | Download file contents |
getFileMetadata(bucketName, filePath) | Get file metadata |
getPolicy(bucketName) | Retrieve resource permission policy associated with a bucket |
getVersioning(bucketName) | Check if versioning of files is enabled for a bucket |
getWebsiteConfiguration(bucketName) | Get Website configuration associated with a bucket |
getWebsiteDomain(bucketName) | Get the Website URL corresponding to a bucket |
listBuckets(options) | List buckets visible to the current user or role |
listFiles(bucketName, options) | List files in a bucket or folder within a bucket |
listFileVersions(bucketName, options) | Retrieve a paginated list of versions for a file |
putFile(bucketName, filePath, file, options) | Upload a file to a bucket |
setEncryption(bucketName, flag, options) | Turn default server side encryption of bucket files on or off |
setPolicy(bucketName, policy) | Set bucket permission policy |
setVersioning(bucketName, flag) | Turn on/off versioning of files in a bucket |
setWebsiteConfiguration(bucketName, options) | Set Website configuration associated with a bucket |