更新时间:2026-01-15 GMT+08:00
设置桶配额
功能说明
设置桶的配额值,单位为字节,支持的最大值为263-1,配额值设为0表示桶的配额没有上限。
方法定义
1. ObsClient->setBucketQuota(array $parameter) 2. ObsClient->setBucketQuotaAsync(array $parameter, callable $callback)
请求参数
| 字段名 | 类型 | 约束 | 说明 |
|---|---|---|---|
| Bucket | string | 必选 | 桶名。 |
| StorageQuota | integer | 必选 | 桶的配额值,非负整数。 |
返回结果
| 字段名 | 类型 | 说明 |
|---|---|---|
| HttpStatusCode | integer | HTTP状态码。 |
| Reason | string | HTTP文本描述。 |
| RequestId | string | OBS服务端返回的请求ID。 |
代码样例
try{ $resp = $obsClient -> setBucketQuota([ 'Bucket' => 'bucketname', 'StorageQuota' => 100 * 1024 * 1024 ]); printf("RequestId:%s\n", $resp['RequestId']); }catch (Obs\Common\ObsException $obsException){ printf("ExceptionCode:%s\n", $obsException->getExceptionCode()); printf("ExceptionMessage:%s\n", $obsException->getExceptionMessage()); }
父主题: 桶相关接口