Partially update a bucket definition in Dynatrace with the Grail Storage Management API by changing displayName, includedQueryLimitDays, or retentionDays.
| PATCH | SaaS | https://{your-environment-id}.apps.dynatrace.com/platform/storage/management/v1/bucket-definitions/{bucketName} |
You update a bucket definition by providing the bucketName path parameter and the optimistic-locking-version query parameter. In the request body, include the fields you want to change: displayName, includedQueryLimitDays, or retentionDays. The operation returns a successfully updated bucket definition.
To execute this request, you need a platform token or OAuth access token with storage:bucket-definitions:write scope. To learn how to obtain and use it, see Tokens and authentication.
| Parameter | Type | Description | In | Required |
|---|---|---|---|---|
| bucketName | string | Bucket name to update. | path | Required |
| optimistic-locking-version | integer | optimistic-locking-version defines the base version that this update applies to. You can get the current version of a bucket definition by checking the version field in the JSON response of GET bucket definitions or GET bucket definition. | query | Required |
| body | Partial | Information for partial update of bucket | body | Required |
PartialUpdateBucket object| Element | Type | Description | Required |
|---|---|---|---|
| displayName | string | Descriptive name of the bucket. No restriction regarding unique naming or valid characters. | Optional |
| includedQueryLimitDays | integer | The period in days in which queries from the bucket are included in the pricing model. | Optional |
| retentionDays | integer | The retention period in days of the data in the bucket. Important note: the new retention days will also apply to existing records. Shortening the retention period could result in data deletion! | Optional |
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{"displayName": "Custom logs bucket (updated)","retentionDays": 10,"includedQueryLimitDays": 0}
| Code | Type | Description |
|---|---|---|
| 200 | - | Successfully updated bucket definition |
| 202 | - | Accepted update bucket definition |
| 400 | Error | bad request |
| 401 | Error | unauthorized |
| 403 | Error | Forbidden |
| 404 | Error | Bucket with provided name was not found |
| 409 | Error | Attempt to update an old version or an operation is currently in progress that prevents current modifications (creating, deleting, updating) |
ErrorEnvelope object| Element | Type | Description |
|---|---|---|
| error | Exceptional | - |
ExceptionalReturn object| Element | Type | Description |
|---|---|---|
| code | integer | - |
| errorDetails | (Custom | - |
| message | string | - |
CustomValidationErrorInfo objectErrorInfo object| Element | Type | Description |
|---|---|---|
| message | string | - |
InvalidAuditEventsErrorInfo objectMediaTypeErrorInfo objectParameterErrorInfo objectProxyErrorInfo objectQueryFrontendRawErrorInfo objectRequestBodyErrorInfo object{"error": {"code": 400,"message": "Missing request header","errorDetails": [{"type": "parameter","parameterDescriptor": "Dt-Tenant","message": "is required"}]}}