Updates the specified custom service rule.
The request consumes and produces an application/json payload.
| PUT | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/config/v1/service/customServices/{technology}/{id} |
| Environment ActiveGate | https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/service/customServices/{technology}/{id} |
To execute this request, you need an access token with WriteConfig scope.
To learn how to obtain and use it, see Tokens and authentication.
| Parameter | Type | Description | In | Required |
|---|---|---|---|---|
| technology | string | Technology of the custom service to update. The element can hold these values
| path | Required |
| id | string | The ID of the custom service to update. The ID of the custom service in the body of the request must match this ID. | path | Required |
| body | Custom | JSON body of the request containing updated definition of the custom service. If order is present, it will be used. | body | Optional |
CustomService object| Element | Type | Description | Required |
|---|---|---|---|
| enabled | boolean | Custom service enabled/disabled. | Required |
| id | string | The ID of the custom service. | Optional |
| metadata | Configuration | Metadata useful for debugging | Optional |
| name | string | The name of the custom service, displayed in the UI. | Required |
| order | string | The order string. Sorting custom services alphabetically by their order string determines their relative ordering. Typically this is managed by Dynatrace internally and will not be present in GET responses. | Optional |
| processGroups | string[] | The list of process groups the custom service should belong to. | Optional |
| queueEntryPoint | boolean | The queue entry point flag. Set to | Required |
| queueEntryPointType | string | The queue entry point type.. The element can hold these values
| Optional |
| rules | Detection | The list of rules defining the custom service. | Required |
ConfigurationMetadata objectMetadata useful for debugging
| Element | Type | Description | Required |
|---|---|---|---|
| clusterVersion | string | Dynatrace version. | Optional |
| configurationVersions | integer[] | A sorted list of the version numbers of the configuration. | Optional |
| currentConfigurationVersions | string[] | A sorted list of version numbers of the configuration. | Optional |
DetectionRule object| Element | Type | Description | Required |
|---|---|---|---|
| annotations | string[] | Additional annotations filter of the rule. Only classes where all listed annotations are available in the class itself or any of its superclasses are instrumented. Not applicable to PHP. | Optional |
| className | string | The fully qualified class or interface to instrument. Required for Java and .NET custom services. Not applicable to PHP. | Optional |
| enabled | boolean | Rule enabled/disabled. | Required |
| fileName | string | The PHP file containing the class or methods to instrument. Required for PHP custom service. Not applicable to Java and .NET. | Optional |
| fileNameMatcher | string | Matcher applying to the file name. Default value is The element can hold these values
| Optional |
| id | string | The ID of the detection rule. | Optional |
| matcher | string | Matcher applying to the class name. The element can hold these values
| Optional |
| methodRules | Method | List of methods to instrument. | Required |
MethodRule object| Element | Type | Description | Required |
|---|---|---|---|
| argumentTypes | string[] | Fully qualified types of argument the method expects. | Optional |
| id | string | The ID of the method rule. | Optional |
| methodName | string | The method to instrument. | Required |
| modifiers | string[] | The modifiers of the method rule. The element can hold these values
| Optional |
| returnType | string | Fully qualified type the method returns. | Required |
| visibility | string | The visibility of the method rule. The element can hold these values
| Optional |
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{"enabled": true,"name": "CustomService","queueEntryPoint": false,"rules": [{"className": "com.your.company.ClassName","enabled": true,"methodRules": [{"argumentTypes": ["java.lang.String"],"methodName": "AMethod","returnType": "void"}]}]}
| Code | Type | Description |
|---|---|---|
| 201 | Entity | Success. Custom service has been created. Response contains the new service's ID and name. |
| 204 | - | Success. Custom service has been updated. Response doesn't have a body. |
| 400 | Error | Failed. The input is invalid |
EntityShortRepresentation objectThe short representation of a Dynatrace entity.
| Element | Type | Description |
|---|---|---|
| description | string | A short description of the Dynatrace entity. |
| id | string | The ID of the Dynatrace entity. |
| name | string | The name of the Dynatrace entity. |
ErrorEnvelope object| Element | Type | Description |
|---|---|---|
| error | Error | - |
Error object| Element | Type | Description |
|---|---|---|
| code | integer | The HTTP status code |
| constraintViolations | Constraint | A list of constraint violations |
| message | string | The error message |
ConstraintViolation objectA list of constraint violations
| Element | Type | Description |
|---|---|---|
| location | string | - |
| message | string | - |
| parameterLocation | string | -The element can hold these values
|
| path | string | - |
{"description": "Dynatrace entity for the REST API example","id": "6a98d7bc-abb9-44f8-ae6a-73e68e71812a","name": "Dynatrace entity"}
{"error": {"code": 1,"constraintViolations": [{"location": "string","message": "string","parameterLocation": "HEADER","path": "string"}],"message": "string"}}
{snippet name='dynatrace-api/validate-payload.md'}}
| POST | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/config/v1/service/customServices/{technology}/{id}/validator |
| Environment ActiveGate | https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/service/customServices/{technology}/{id}/validator |
To execute this request, you need an access token with WriteConfig scope.
To learn how to obtain and use it, see Tokens and authentication.
| Code | Type | Description |
|---|---|---|
| 204 | - | Validated. The submitted configuration is valid. Response does not have a body. |
| 400 | Error | Failed. The input is invalid |
ErrorEnvelope object| Element | Type | Description |
|---|---|---|
| error | Error | - |
Error object| Element | Type | Description |
|---|---|---|
| code | integer | The HTTP status code |
| constraintViolations | Constraint | A list of constraint violations |
| message | string | The error message |
ConstraintViolation objectA list of constraint violations
| Element | Type | Description |
|---|---|---|
| location | string | - |
| message | string | - |
| parameterLocation | string | -The element can hold these values
|
| path | string | - |
{"error": {"code": 1,"constraintViolations": [{"location": "string","message": "string","parameterLocation": "HEADER","path": "string"}],"message": "string"}}