Content resources API - PUT configuration

Updates the configuration of content providers in your Dynatrace environment.

The request consumes an application/json payload.

PUTSaaShttps://{your-environment-id}.live.dynatrace.com/api/config/v1/contentResources
Environment ActiveGatehttps://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/contentResources

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

Parameter
Type
Description
In
Required
body

The JSON body of the request. Contains the configuration of content resources.

body
optional

Request body objects

The ContentResources object

The configuration of content resources.

Element
Type
Description
Required
resourceProviders

An ordered list of manually added content providers.

Rules are evaluated from top to bottom; the first matching rules applies.

optional
resourceTypes

An ordered list of manually defined resource types.

Rules are evaluated from top to bottom; the first matching rules applies.

optional
resourceUrlCleanupRules

An ordered list of resource URL cleanup rules.

Rules are evaluated from top to bottom; the first matching rules applies.

optional

The ResourceProvider object

A rule for the content provider.

Element
Type
Description
Required
brandIconUrl
string

The URL of the provider's icon.

optional
domainNamePatterns
string[]

A list of domain patterns of the provider.

required
resourceName
string

The name of the provider.

required
resourceType
string

The type of the provider.

  • CDN_RESOURCES
  • FIRST_PARTY_RESOURCES
  • THIRD_PARTY_RESOURCES
required

The ResourceType object

A rule for the resource type.

Element
Type
Description
Required
primaryResourceType
string

The primary type of the resource.

  • CSS
  • IMAGE
  • OTHER
  • SCRIPT
required
regularExpression
string

The regular expression to detect the resource.

required
secondaryResourceType
string

The secondary type of the resource.

optional

The ResourceUrlCleanupRule object

A rule for the URL cleanup rule.

Element
Type
Description
Required
regularExpression
string

The pattern (regular expression) to look for.

required
replaceWith
string

The text to replace the found pattern with.

required
resourceName
string

The name of the rule.

required

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.

{
"resourceProviders": [
{
"brandIconUrl": "string",
"domainNamePatterns": [
"string"
],
"resourceName": "string",
"resourceType": "CDN_RESOURCES"
}
],
"resourceTypes": [
{
"primaryResourceType": "CSS",
"regularExpression": "string",
"secondaryResourceType": "string"
}
],
"resourceUrlCleanupRules": [
{
"regularExpression": "string",
"replaceWith": "string",
"resourceName": "string"
}
]
}

Response

Response codes

Code
Type
Description
204
-

Success. The configuration has been updated. Response doesn't have a body.

400

Failed. The input is invalid

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.

POSTSaaShttps://{your-environment-id}.live.dynatrace.com/api/config/v1/contentResources/validator
Environment ActiveGatehttps://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/contentResources/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 submitted configuration is valid. Response doesn't have a body.

400

Failed. The input is invalid