-
Notifications
You must be signed in to change notification settings - Fork 1
BucketModel
Craig edited this page Jan 1, 2024
·
4 revisions
$bucketId = $bucket->getId();
// e.g: abc123def456ghi789jkl
$bucketName = $bucket->getName();
// e.g This-Bucket-Is-So-Cool
$type = $bucket->getType();
// e.g allPublic
$revision = $bucket->getRevision();
// e.g 2
$corsRules = $bucket->getCORSRules();
// e.g [0] => [
// 'allowedHeaders' => [
// 'authorization',
// 'range'
// ],
// 'allowedOperations' => [
// 'b2_download_file_by_id',
// 'b2_download_file_by_name',
// ],
// 'allowedOrigins' => ['https'],
// 'corsRuleName' => 'downloadFromAnyHttpsOrigin',
// 'exposeHeaders' => null,
// 'maxAgeSeconds' => 3600,
// ],
// ...
$sse = $bucket->getServerSideEncryption();
// e.g [
// 'algorithm' => 'AES256',
// 'mode' => 'SSE-B2',
// ],
// ...
$fileLock = $bucket->getFileLock();
// e.g [0] => [
// 'defaultRetention' => [
// 'mode' => 'value',
// 'period' => 'value',
// ],
// 'isFileLockEnabled' => true,
// ],
// ...
$lifecycleRules = $bucket->getLifeCycleRules();
// e.g [
// 'daysFromHidingToDeleting' => 7
// 'daysFromUploadingToHiding' => null,
// 'fileNamePrefix' => null,
// ],
// ...
$replication = $bucket->getReplicationConfig();
// e.g [asReplicationSource] => [
// 'replicationRules' => [
// [0] => [
// 'destinationBucketId' => 'DESTINATION_BUCKET_ID',
// 'fileNamePrefix' => 'value',
// 'includeExistingFiles' => true,
// 'isEnabled' => true,
// 'priority' => 1,
// 'replicationRuleName' => 'demo-replication',
// ],
// ],
// 'sourceApplicationKeyId' => 'KEY_ID',
// ],
// ...
Below is a list of all the available native API endpoints that this library currently supports:
- cancelLargeFile
- copyFile
- copyPart
- createBucket
- createKey
- deleteBucket
- deleteFileVersion
- deleteKey
- downloadFileById
- downloadFileByName
- finishLargeFile
- getDownloadAuthorization
- getFileInfo
- getUploadPartUrl
- getUploadUrl
- hideFile
- listBuckets
- listFileNames
- listFileVersions
- listKeys
- listParts
- listUnfinishedLargeFiles
- startLargeFile
- updateBucket
- updateFileLegalHold
- updateFileRetention
- uploadFile
- uploadPart