com.personio.synthetics.client.SyntheticsApiClient.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of datadog-synthetic-test-support Show documentation
Show all versions of datadog-synthetic-test-support Show documentation
Kotlin library for managing Datadog Synthetic test as code
package com.personio.synthetics.client
import com.datadog.api.client.ApiClient
import com.datadog.api.client.v1.api.SyntheticsApi
import com.personio.synthetics.config.Config
/**
* API Client for the Datadog Synthetic test
*/
class SyntheticsApiClient(credentialsProvider: CredentialsProvider, apiHost: String = Config.testConfig.datadogApiHost) : SyntheticsApi() {
init {
val credentials = credentialsProvider.getCredentials()
apiClient =
ApiClient.getDefaultApiClient().apply {
serverVariables = mapOf("site" to apiHost)
configureApiKeys(mapOf("apiKeyAuth" to credentials.apiKey, "appKeyAuth" to credentials.appKey))
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy