Service detection API - PUT a full web service rule
Updates an existing service detection rule for full web services.
If a rule with the specified ID doesn’t exist, a new rule is created and appended to the end of the rule list.
The request keeps the existing order of rules unless the order parameter is set.
The request consumes and produces an application/json
payload.
PUT | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/config/v1/service/detectionRules/FULL_WEB_SERVICE/{id} |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/config/v1/service/detectionRules/FULL_WEB_SERVICE/{id} | |
Environment ActiveGate | https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/service/detectionRules/FULL_WEB_SERVICE/{id} |
Authentication
To execute this request, you need an access token with WriteConfig
scope.
To learn how to obtain and use it, see Tokens and authentication.
Parameters
Refer to JSON models to find all JSON models that depend on the type of the model.
Parameter | Type | Description | In | Required |
---|---|---|---|---|
id | string | The ID of the rule to be updated. | path | required |
body | Full | The JSON body of the request containing updated parameters of the service detection rule. | body | optional |
Request body objects
The FullWebServiceRule
object
The service detection rule of the FULL_WEB_SERVICE
type.
If you have a condition with the attributeType set to FRAMEWORK
, the values field from compareOperations is limited to the following possible values:
AXIS
CXF
HESSIAN
JAX_WS_RI
JBOSS
JERSEY
PROGRESS
RESTEASY
RESTLET
SPRING
TIBCO
WEBLOGIC
WEBMETHODS
WEBSPHERE
WINK
Element | Type | Description | Required |
---|---|---|---|
type | string | The type of the service detection rule. | required |
metadata | Configuration | Metadata useful for debugging | optional |
managementZones | string[] | The management zone (specified by the ID) of the process group for which this service detection rule should be created. You can specify only 1 management zone here. | optional |
id | string | The ID of the service detection rule. | optional |
order | string | The order of the rule in the rules list. The rules are evaluated from top to bottom. The first matching rule applies. | optional |
name | string | The name of the rule. | required |
description | string | A short description of the rule. | optional |
enabled | boolean | The rule is enabled( | required |
conditions | Conditions | A list of conditions of the rule. If several conditions are specified, the AND logic applies. | optional |
detectAsWebRequestService | boolean | Detect the matching requests as full web services ( Setting this field to Default is | optional |
webServiceName | Web | The contribution to the service ID calculation from the detected web service name. You have two mutually exclusive options:
| optional |
webServiceNameSpace | Web | The contribution to the service ID calculation from the detected web service name space. You have two mutually exclusive options:
| optional |
applicationId | Application | The contribution to the service ID calculation from the detected application ID. You have two mutually exclusive options:
| optional |
contextRoot | Context | The contribution to the service ID calculation from the detected context root. The context root is the first segment of the request URL after server name. For example, in the You have two options:
You can use one or both options. If you use both, the transformation applies to the modified URL. | optional |
serverName | Server | The contribution to the service ID calculation from the detected server name. You have two mutually exclusive options:
| optional |
The ConfigurationMetadata
object
Metadata useful for debugging
Element | Type | Description | Required |
---|---|---|---|
currentConfigurationVersions | string[] | A sorted list of version numbers of the configuration. | optional |
configurationVersions | integer[] | A sorted list of the version numbers of the configuration. | optional |
clusterVersion | string | Dynatrace version. | optional |
The ConditionsFullWebServiceAttributeTypeDto
object
A condition of the service detection rule.
Element | Type | Description | Required |
---|---|---|---|
attributeType | string | The type of the attribute to be checked. | required |
compareOperations | Compare | A list of conditions for the rule. If several conditions are specified, the AND logic applies. | optional |
The CompareOperation
object
The condition of the rule.
The actual set of fields depends on the type of the condition. Find the list of actual objects in the description of the type field or see Service detection API - JSON models.
Element | Type | Description | Required |
---|---|---|---|
type | string | Defines the actual set of fields depending on the value. See one of the following objects:
| required |
The WebServiceName
object
The contribution to the service ID calculation from the detected web service name.
You have two mutually exclusive options:
- Override the detected value with a specified static value. Specify the new value in the valueOverride field.
- Dynamically transform the detected value. Specify the transformation parameters in the transformations field.
Element | Type | Description | Required |
---|---|---|---|
transformations | Transformation | Transformations to be applied to the detected value. | optional |
valueOverride | string | The value to be used instead of the detected value. | optional |
The TransformationBase
object
Configuration of transformation of the detected value.
If several transformations are specified, they are handled sequentially from top to bottom. Each transformation is applied to the result of the preceding transformation. For example, the second transformation is applied to the result of the first transformation.
The actual set of fields depends on the type of the transformation. Find the list of actual objects in the description of the type field or see Service detection API - JSON models.
Element | Type | Description | Required |
---|---|---|---|
type | string | Defines the actual set of fields depending on the value. See one of the following objects:
| required |
The WebServiceNameSpace
object
The contribution to the service ID calculation from the detected web service name space.
You have two mutually exclusive options:
- Override the detected value with a specified static value. Specify the new value in the valueOverride field.
- Dynamically transform the detected value. Specify the transformation parameters in the transformations field.
Element | Type | Description | Required |
---|---|---|---|
transformations | Transformation | Transformations to be applied to the detected value. | optional |
valueOverride | string | The value to be used instead of the detected value. | optional |
The ApplicationId
object
The contribution to the service ID calculation from the detected application ID.
You have two mutually exclusive options:
- Override the detected value with a specified static value. Specify the new value in the valueOverride field.
- Dynamically transform the detected value. Specify the transformation parameters in the transformations field.
Element | Type | Description | Required |
---|---|---|---|
transformations | Transformation | Transformations to be applied to the detected value. | optional |
valueOverride | string | The value to be used instead of the detected value. | optional |
The ContextRoot
object
The contribution to the service ID calculation from the detected context root.
The context root is the first segment of the request URL after server name. For example, in the www.dynatrace.com/support/help/dynatrace-api/
URL the context root is support
.
You have two options:
- Keep a part of the detected URL. Specify the number of segments to be kept in the segmentsToCopyFromUrlPath field.
- Dynamically transform the detected URL. Specify the transformation parameters in the transformations field.
You can use one or both options. If you use both, the transformation applies to the modified URL.
Element | Type | Description | Required |
---|---|---|---|
transformations | Context | Transformations to be applied to the detected value. | optional |
segmentsToCopyFromUrlPath | integer | The number of segments of the URL to be kept. The URL is divided by slashes ( For example, if you specify | optional |
The ContextRootTransformation
object
Configuration of transformation of the detected value.
If several transformations are specified, they are handled sequentially from top to bottom. Each transformation is applied to the result of the preceding transformation. For example, the second transformation is applied to the result of the first transformation.
The actual set of fields depends on the type
of the transformation.
Element | Type | Description | Required |
---|---|---|---|
type | string | Defines the actual set of fields depending on the value. See one of the following objects:
| required |
The ServerName
object
The contribution to the service ID calculation from the detected server name.
You have two mutually exclusive options:
- Override the detected value with a specified static value. Specify the new value in the valueOverride field.
- Dynamically transform the detected value. Specify the transformation parameters in the transformations field.
Element | Type | Description | Required |
---|---|---|---|
transformations | Transformation | Transformations to be applied to the detected value. | optional |
valueOverride | string | The value to be used instead of the detected value. | optional |
Request body JSON model
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{
"type": "FULL_WEB_SERVICE",
"name": "My sample rule",
"description": "REST API example",
"enabled": true,
"detectAsWebRequestService": false,
"managementZones": [
"zone 1"
],
"conditions": [
{
"attributeType": "APPLICATION_ID",
"compareOperations": [
{
"type": "STRING_CONTAINS",
"invert": "false",
"ignoreCase": "false",
"values": [
"value1",
"value2"
]
}
]
}
],
"webServiceName": {
"valueOverride": "abc"
},
"webServiceNameSpace": {
"valueOverride": "abc"
},
"applicationId": {
"valueOverride": "abc"
},
"contextRoot": {
"segmentsToCopyFromUrlPath": 2,
"transformations": [
{
"type": "BEFORE",
"delimiter": "/"
}
]
},
"serverName": {
"transformations": [
{
"type": "BEFORE",
"delimiter": "-"
}
]
}
}
Response
Response codes
Code | Type | Description |
---|---|---|
201 | Entity | Success. The new service detection rule has been created. The response contains short representation of the rule, including the ID. |
204 | Success. The service detection rule has been updated. Response doesn't have a body. | |
400 | ErrorEnvelope | Failed. The input is invalid. |
Response body objects
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. |
Response body JSON model
{
"id": "6a98d7bc-abb9-44f8-ae6a-73e68e71812a",
"name": "Dynatrace entity",
"description": "Dynatrace entity for the REST API example"
}
Validate payload
We recommend that you validate the payload before submitting it with an actual request. A response code of 204 indicates a valid payload.
The request consumes an application/json
payload.
POST | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/config/v1/service/detectionRules/FULL_WEB_SERVICE/{id}/validator |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/config/v1/service/detectionRules/FULL_WEB_SERVICE/{id}/validator | |
Environment ActiveGate | https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/service/detectionRules/FULL_WEB_SERVICE/{id}/validator |
Authentication
To execute this request, you need an access token with WriteConfig
scope.
To learn how to obtain and use it, see Tokens and authentication.
Response
Response codes
Code | Type | Description |
---|---|---|
204 | Validated. The service detection rule is valid. Response doesn't have a body. | |
400 | ErrorEnvelope | Failed. The input is invalid. |