Kubernetes credentials API - POST new credentials

Creates a new Kubernetes credentials configuration.

The body must not provide an ID. The Dynatrace server automatically assigns an ID.

The request consumes and produces an application/json payload.

Early Adopter

This request is an Early Adopter release and may be changed in non-compatible way.

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

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
body KubernetesCredentials

The JSON body of the request. Contains parameters of the new Kubernetes credentials configuration.

body optional

Body format

The KubernetesCredentials object

Configuration for specific Kubernetes credentials.

Element Type Description Required
active boolean

The monitoring is enabled (true) or disabled (false) for given credentials configuration.

If not set on creation, the true value is used.

If the field is omitted during an update, the old value remains unaffected.

optional
label string

The name of the Kubernetes credentials configuration.

Allowed characters are letters, numbers, whitespaces, and the following characters: .+-_. Leading or trailing whitespace is not allowed.

required
endpointUrl string

The URL of the Kubernetes API server.

It must be unique within a Dynatrace environment.

The URL must valid according to RFC 2396. Leading or trailing whitespaces are not allowed.

required
authToken string

The service account bearer token for the Kubernetes API server.

Submit your token on creation or update of the configuration. For security reasons, GET requests return this field as null.

If the field is omitted during an update, the old value remains unaffected.

optional
activeGateGroup string

Active Gate group to filter active gates for this credentials.

optional
eventsIntegrationEnabled boolean

The monitoring of events is enabled (true) or disabled (false) for the Kubernetes cluster. Event monitoring depends on the active state of this configuration to be true.

If not set on creation, the false value is used.

If the field is omitted during an update, the old value remains unaffected.

optional
eventAnalysisAndAlertingEnabled boolean

Event analysis and alerting is (true) or disabled (false) for the Kubernetes cluster. If the field is omitted during an update, the old value remains unaffected.

optional
workloadIntegrationEnabled boolean

Workload and cloud application processing is enabled (true) or disabled (false) for the Kubernetes cluster. If the field is omitted during an update, the old value remains unaffected.

optional
prometheusExportersIntegrationEnabled boolean

Prometheus exporters integration is enabled (true) or disabled (false) for the Kubernetes cluster. If the field is omitted during an update, the old value remains unaffected.

optional
davisEventsIntegrationEnabled boolean

Inclusion of all Davis relevant events is enabled (true) or disabled (false) for the Kubernetes cluster. If the field is omitted during an update, the old value remains unaffected.

optional
eventsFieldSelectors KubernetesEventPattern[]

Kubernetes event filters based on field-selectors. If set to null on creation, no events field selectors are subscribed. If set to null on update, no change of stored events field selectors is applied. Set an empty list to clear all events field selectors.

optional
certificateCheckEnabled boolean

The check of SSL certificates is enabled (true) or disabled (false) for the Kubernetes cluster.

If not set on creation, the true value is used.

If the field is omitted during an update, the old value remains unaffected.

optional

The KubernetesEventPattern object

Represents a single Kubernetes events field selector (=event filter based on the K8s field selector).

Element Type Description Required
label string

A label of the events field selector.

required
fieldSelector string

The field selector string (url decoding is applied) when storing it.

required
active boolean

Whether subscription to this events field selector is enabled (value set to true). If disabled (value set to false), Dynatrace will stop fetching events from the Kubernetes API for this events field selector

required

Response

Response codes

Code Description
201

Success. The new Kubernetes credentials configuration has been created. The response body contains the ID of the configuration.

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

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.

Early Adopter

This request is an Early Adopter release and may be changed in non-compatible way.

POST
  • Managed https://{your-domain}/e/{your-environment-id}/api/config/v1/kubernetes/credentials/validator
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/kubernetes/credentials/validator
  • Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/kubernetes/credentials/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. The response doesn't have a body.

400

Failed. The input is invalid.

Response body

A successful request doesn't return any content.