Plugins API - POST a plugin

Uploads a ZIP plugin file to your Dynatrace environment.

The request consumes a multipart/form-data payload and produces an application/json payload.

POST
  • Managed https://{your-domain}/e/{your-environment-id}/api/config/v1/plugins
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/plugins

Parameters

Parameter Type Description In Required
file ZIP file Plugin ZIP file to be uploaded.

The file name must match the name field in the plugin.json file.

For example, for the plugin whose name is custom.remote.python.demo, the name of the plugin file must be custom.remote.python.demo.zip.
body required
overrideAlerts Boolean Use plugin-defined thresholds for alerts (true) or user-defined thresholds (false).

Plugin-defined thresholds are stored in the plugin.json file.

If not set, user-defined thresholds are used.
query optional

Response format

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

We recommend that you validate the payload before submitting it with an actual request. A response code of 204 indicates a valid payload.

POST
  • Managed https://{your-domain}/e/{your-environment-id}/api/config/v1/plugins/validator
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/plugins/validator

Parameters

Parameter Type Description In Required
file ZIP file Plugin ZIP file to be validated.

The file name must match the name field in the plugin.json file.

For example, for the plugin whose name is custom.remote.python.demo, the name of the plugin file must be custom.remote.python.demo.zip.
body required
jsonOnly Boolean Validate only the plugin.json file (true) or the entire plugin structure (false).

If not set, the entire plugin is validated.
query optional

Response codes

Code Description
204 Validated. The submitted plugin is valid. Response doesn't have a body.
400 Failed. The input is invalid.

Example

In this example the request uploads the custom.remote.python.simple_math.zip file, which is stored in the C:\temp\ directory, to the mySampleEnv environment.

The API token is passed in the Authorization header.

The response code of 201 confirms a successful upload. The ID of the plugin is returned.

Curl

curl -X POST \
  https://mySampleEnv.live.dynatrace.com/api/config/v1/plugins/ \
  -H 'Authorization: Api-token abcdefjhij1234567890' \  
  -H 'content-type: multipart/form-data' \
  -F 'file=@C:\temp\custom.remote.python.simple_math.zip'

Request URL

https://mySampleEnv.live.dynatrace.com/api/config/v1/plugins/

Response body

{
  "id": "custom.remote.python.simple_math"
}

Response code

201