Custom services API - POST a custom service rule

Creates a new custom service rule.

The request consumes and produces an application/json payload.

POST
  • Managed https://{your-domain}/e/{your-environment-id}/api/config/v1/service/customServices/{technology}
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/service/customServices/{technology}
  • Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/service/customServices/{technology}

Authentication

To execute this request, you need the Write configuration (WriteConfig) permission assigned to your API token. To learn how to obtain and use it, see Tokens and authentication.

Parameters

Parameter Type Description In Required
technology string

Technology of the new custom service.

path required
position string

Order of the new custom service. Set to PREPEND to prepend it to the list, APPEND to append it. Defaults to APPEND.

query optional
body CustomService

JSON body of the request containing definition of the new custom service.

You must not specify the IDs for the custom service or any of its rules. The order field is not allowed either.

body optional

Body format

The CustomService object

Element Type Description Required
id string

The ID of the custom service.

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
enabled boolean

Custom service enabled/disabled.

required
rules DetectionRule[]

The list of rules defining the custom service.

required
queueEntryPoint boolean

The queue entry point flag.

Set to true for custom messaging services.

required
queueEntryPointType string

The queue entry point type..

optional
processGroups string[]

The list of process groups the custom service should belong to.

optional

The DetectionRule object

Element Type Description Required
id string

The ID of the detection rule.

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 ENDS_WITH (if applicable).

optional
className string

The fully qualified class or interface to instrument.

Required for Java and .NET custom services.

Not applicable to PHP.

optional
matcher string

Matcher applying to the class name. STARTS_WITH can only be used if there is at least one annotation defined. Default value is EQUALS.

optional
methodRules MethodRule[]

List of methods to instrument.

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

The MethodRule object

Element Type Description Required
id string

The ID of the method rule.

optional
methodName string

The method to instrument.

required
argumentTypes string[]

Fully qualified types of argument the method expects.

optional
returnType string

Fully qualified type the method returns.

required

Response

Response codes

Code Description
201

Success. The custom service has been created. Response contains the new service's ID and name.

400

Failed. The input is invalid

Response body

The EntityShortRepresentation object

The short representation of a Dynatrace entity.

Element Type Description
id string

The ID of the Dynatrace entity.

name string

The name of the Dynatrace entity.

description string

A short description of the Dynatrace entity.

Validate payload

{snippet name='dynatrace-api/validate-payload.md'}}

POST
  • Managed https://{your-domain}/e/{your-environment-id}/api/config/v1/service/customServices/{technology}/validator
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/service/customServices/{technology}/validator
  • Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/service/customServices/{technology}/validator

Authentication

To execute this request, you need the Write configuration (WriteConfig) permission assigned to your API token. To learn how to obtain and use it, see Tokens and authentication.

Response

Response codes

Code Description
204

Validated. The submitted configuration is valid. Response does not have a body.

400

Failed. The input is invalid

Response body

A successful request doesn't return any content.