Create a monitoring configuration for an Extension 2.0 in Dynatrace with the Extensions API, using the extension name and configuration scope and value.
| POST | SaaS | https://{your-environment-id}.apps.dynatrace.com/platform/extensions/v2/extensions/{extension-name}/monitoring-configurations |
You provide the extension name in the path and send scope and value in the request body. Dynatrace returns 201 Created when it creates the monitoring configuration.
To execute this request, you need a platform token or OAuth access token with extensions:configurations:write scope. To learn how to obtain and use it, see Tokens and authentication.
| Parameter | Type | Description | In | Required |
|---|---|---|---|---|
| extension-name | string | The name of the requested Extension 2.0. | path | Required |
| body | Monitoring | JSON body of the request, containing monitoring configuration parameters. Monitoring configuration scope cannot be updated. | body | Required |
MonitoringConfiguration object| Element | Type | Description | Required |
|---|---|---|---|
| scope | string | The scope this monitoring configuration will be defined for | Required |
| value | Json | The monitoring configuration | Optional |
JsonNode objectThe monitoring configuration
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{"scope": "HOST-D3A3C5A146830A79","value": {}}
| Code | Type | Description |
|---|---|---|
| 201 | Monitoring | Created. |
| 4XX | Error | Client error. |
| 5XX | Error | Server error. |
MonitoringConfigurationResponse object| Element | Type | Description |
|---|---|---|
| code | integer | The HTTP Status code |
| objectId | string | The identifier of the new configuration |
ErrorEnvelope object| Element | Type | Description |
|---|---|---|
| error | Error | - |
Error object| Element | Type | Description |
|---|---|---|
| code | integer | The HTTP status code. |
| details | Error | The error details. |
| message | string | The error message. |
ErrorDetails objectThe error details.
| Element | Type | Description |
|---|---|---|
| constraintViolations | Constraint | A list of constraint violations. |
ConstraintViolation objectA list of constraint violations.
| Element | Type | Description |
|---|---|---|
| location | string | - |
| message | string | - |
| parameterLocation | string | -The element can hold these values
|
| path | string | - |
{"code": 1,"objectId": "331e416f-9ab7-4694-8408-816026820645"}
{"error": {"code": 1,"details": {"constraintViolations": [{"location": "string","message": "string","parameterLocation": "HEADER","path": "string"}]},"message": "string"}}