Partially update a filter segment in Dynatrace with the Grail Filter Segments API by UID, changing only the fields you send.
| PATCH | SaaS | https://{your-environment-id}.apps.dynatrace.com/v1/filter-segments/{filterSegmentUid} |
You provide the filterSegmentUid path parameter and the optimistic-locking-version query parameter, then include the fields to change in the request body. The operation updates the supported fields you send and returns the updated filter segment.
To execute this request, you need a platform token or OAuth access token with all of the following scopes:
storage:filter-segments:writestorage:filter-segments:share to change isPublic to trueTo learn how to obtain and use it, see Tokens and authentication.
| Parameter | Type | Description | In | Required |
|---|---|---|---|---|
| filterSegmentUid | string | UID of the filter-segment | path | Required |
| optimistic-locking-version | integer | version which should be updated. used for optimistic locking. | query | Required |
| body | Partial | - | body | Required |
PartialUpdateFilterSegment object| Element | Type | Description | Required |
|---|---|---|---|
| description | string | Description of the filter-segment. | Optional |
| externalId | string | Optional unique identifier of the filter-segment. Used for Dynatrace Configuration as Code | Optional |
| includes | New | List of includes of the filter-segment. | Optional |
| isPublic | boolean | Indicates if the filter-segment is publicly accessible within the tenant. | Optional |
| name | string | Name of the filter-segment. | Optional |
| variables | Filter | Variables of the filter-segment. | Optional |
NewInclude objectList of includes of the filter-segment.
| Element | Type | Description | Required |
|---|---|---|---|
| applyTo | string[] | [Experimental] The tables that the entity-filter will be applied to. | Optional |
| dataObject | string | The data object that the filter will be applied to. Use '_all_data_object' to apply it to all dataObjects. | Required |
| filter | string | Data will be filtered by this value. Field names must only contain letters, numbers and underscores, otherwise they need to be escaped using quotes(`). | Required |
| relationship | New | [Experimental] The relationship of an include which has to be be specified when the data object is an entity view. | Optional |
NewRelationship object[Experimental] The relationship of an include which has to be be specified when the data object is an entity view.
| Element | Type | Description | Required |
|---|---|---|---|
| name | string | Name of the relationship. | Required |
| target | string | Target of the relationship. | Required |
FilterSegmentVariables objectVariables of the filter-segment.
| Element | Type | Description | Required |
|---|---|---|---|
| type | string | Type of the variable. | Required |
| value | string | Value of the variable. | Required |
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{"description": "only includes data of the development environment"}
| Code | Type | Description |
|---|---|---|
| 200 | - | Filter-segment successfully updated. |
| 400 | Error | bad request |
| 401 | Error | unauthorized |
| 403 | Error | missing permissions |
| 404 | Error | Not found: the server cannot find the requested filter-segment. |
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"}]}}