Davis® AI - Predictive and Causal
Overview
This SDK allows you to interact with Davis® predictive and causal AI for customized AI/ML analysis.
Refer to the service documentation to get familiar with the key concepts.
npm install @dynatrace-sdk/client-davis-analyzers
analyzersClient
import { analyzersClient } from "@dynatrace-sdk/client-davis-analyzers";
cancelAnalyzerExecution
Stop a started analyzer execution.
Required scope: davis:analyzers:execute
Use the request token that was returned when starting an analyzer execution to cancel it.
Parameters
Name | Type | Description |
---|---|---|
config.analyzerName*required | string | The name of the analyzer. |
config.requestToken*required | string | The request token is returned when starting a long-running analyzer execution. |
Returns
The current analyzer execution status and an optional partial result.
Code example
import { analyzersClient } from "@dynatrace-sdk/client-davis-analyzers";
const data = await analyzersClient.cancelAnalyzerExecution({
analyzerName: "...",
requestToken: "RHluYXRyYWNlMjAyMw==",
});
executeAnalyzer
Asynchronously execute an analyzer with the given input.
Required scope: davis:analyzers:execute
The analyzer execution is started asynchronously. If the result is not available after a short time (in the order of 1-2 seconds), a request token is returned to poll for the result. Otherwise, the final result is directly available and no request token is returned.
Depending on the chosen analyzer and the analyzer input, additional scopes might be required, e.g.
storage:buckets:read
and storage:metrics:read
to enable the analyzer to read time series data from Grail™.
Parameters
Name | Type | Description |
---|---|---|
config.analyzerName*required | string | The name of the analyzer. |
config.body*required | AnalyzerInput |
Returns
The final analyzer result and execution status. | The current analyzer execution status and a request token and time-to-live (TTL) to continue polling the result with.
Code example
import { analyzersClient } from "@dynatrace-sdk/client-davis-analyzers";
const data = await analyzersClient.executeAnalyzer({
analyzerName: "...",
body: {
timeSeriesData: {
expression: "timeseries avg(dt.host.cpu.usage)",
},
forecastHorizon: 10,
},
});
getAnalyzer
Get the analyzer definition for an analyzer.
Required scope: davis:analyzers:read
All available meta-information for the analyzer is returned.
Parameters
Name | Type | Description |
---|---|---|
config.analyzerName*required | string | The name of the analyzer. |
Returns
The definition of the requested analyzer.
Code example
import { analyzersClient } from "@dynatrace-sdk/client-davis-analyzers";
const data = await analyzersClient.getAnalyzer({
analyzerName: "...",
});
getAnalyzerDocumentation
Get the documentation for an analyzer.
Required scope: davis:analyzers:read
A documentation may provide further information and context for a given analyzer. Not all analyzers provide documentation.
The documentation is returned as Markdown.
Parameters
Name | Type | Description |
---|---|---|
config.analyzerName*required | string | The name of the analyzer. |
Returns
The documentation of the requested analyzer.
Code example
import { analyzersClient } from "@dynatrace-sdk/client-davis-analyzers";
const data = await analyzersClient.getAnalyzerDocumentation({
analyzerName: "...",
});
getJsonSchemaForInput
Get the JSON schema for an analyzer input.
Required scope: davis:analyzers:read
The JSON schema defines a standardized declaration of the input structure, providing well-defined input documentation that is both human- and machine-readable.
Parameters
Name | Type | Description |
---|---|---|
config.analyzerName*required | string | The name of the analyzer. |
Returns
The JSON input schema of the requested analyzer.
Code example
import { analyzersClient } from "@dynatrace-sdk/client-davis-analyzers";
const data = await analyzersClient.getJsonSchemaForInput({
analyzerName: "...",
});
getJsonSchemaForResult
Get the JSON schema for an analyzer result.
Required scope: davis:analyzers:read
The JSON schema defines a standardized declaration of the output structure, providing well-defined output documentation that is both human- and machine-readable.
Parameters
Name | Type | Description |
---|---|---|
config.analyzerName*required | string | The name of the analyzer. |
Returns
The JSON result schema of the requested analyzer.
Code example
import { analyzersClient } from "@dynatrace-sdk/client-davis-analyzers";
const data = await analyzersClient.getJsonSchemaForResult({
analyzerName: "...",
});
pollAnalyzerExecution
Poll for the result of a started analyzer execution.
Required scope: davis:analyzers:execute
Use the request token returned when starting an analyzer execution to poll for a result.
The executionStatus
of the result indicates if the analyzer execution is already completed.
While the status is RUNNING
, wait and poll for the result again in subsequent calls.
Parameters
Name | Type | Description |
---|---|---|
config.analyzerName*required | string | The name of the analyzer. |
config.requestToken*required | string | The request token is returned when starting a long-running analyzer execution. |
Returns
The current analyzer execution status and an optional partial result.
Code example
import { analyzersClient } from "@dynatrace-sdk/client-davis-analyzers";
const data = await analyzersClient.pollAnalyzerExecution({
analyzerName: "...",
requestToken: "RHluYXRyYWNlMjAyMw==",
});
queryAnalyzers
Query all available analyzer definitions.
Required scope: davis:analyzers:read
The analyzer definition contains meta-information about an analyzer, including its input and output structure:
- The
input
definition specifies which fields the analyzer accepts, some of which may be required. - The
output
definition specifies how the returned analyzer result is structured.
Parameters
Name | Type | Description |
---|---|---|
config.addFields | string | Specify which meta-information to fetch in addition to the default fields Valid values are:
Any other field will result in a HTTP 400 response. |
config.filter | string | Use the When using the operators The following operators are supported:
Parenthesis and the The following fields are valid filtering parameters:
Any other field will result in a HTTP 400 response. |
config.pageKey | string | The cursor for the page of results. Find it in the If the If not provided, the first page is always returned. |
config.pageSize | number | The amount of returned analyzer definitions in a single response payload. By default, 50 is used. The maximum is 200. |
Returns
All available analyzer definitions.
Code example
import { analyzersClient } from "@dynatrace-sdk/client-davis-analyzers";
const data = await analyzersClient.queryAnalyzers();
validateAnalyzerExecution
Validate the provided input for an analyzer execution.
Required scope: davis:analyzers:execute
Provide the same input that is planned to be used for an analyzer execution to have it validated without executing the analyzer.
Parameters
Name | Type | Description |
---|---|---|
config.analyzerName*required | string | The name of the analyzer. |
config.body*required | AnalyzerInput |
Returns
The validation result for the requested analyzer execution.
Code example
import { analyzersClient } from "@dynatrace-sdk/client-davis-analyzers";
const data = await analyzersClient.validateAnalyzerExecution({
analyzerName: "...",
body: {},
});
Types
AnalyzerCall
Name | Type |
---|---|
analyzerName | string |
inputBindings | AnalyzerCallInputBindings |
namedValues | AnalyzerData |
outputBindings | AnalyzerCallOutputBindings |
AnalyzerCallInputBindings
AnalyzerCallOutputBindings
AnalyzerCategory
The category of an analyzer used to logically group different analyzers. This category is in addition to the analyzer module name which is part of the fully qualified name of the analyzer.
Name | Type |
---|---|
displayName*required | string |
AnalyzerData
AnalyzerDefinition
Name | Type |
---|---|
analyzerCall | AnalyzerCall |
baseAnalyzer | string |
category | AnalyzerCategory |
description | string |
displayName*required | string |
input | Array<ParameterDefinition> |
inputDefaults | AnalyzerData |
labels | Array<string> |
name*required | string |
output | Array<ParameterDefinition> |
outputDefaults | AnalyzerData |
type | AnalyzerDefinitionType |
AnalyzerDefinitionDetails
Name | Type |
---|---|
analyzerCall | AnalyzerCall |
baseAnalyzer | string |
category | AnalyzerCategory |
description | string |
displayName*required | string |
input | Array<ParameterDefinition> |
inputDefaults | AnalyzerData |
labels | Array<string> |
name*required | string |
output | Array<ParameterDefinition> |
outputDefaults | AnalyzerData |
type | AnalyzerDefinitionType |
AnalyzerDimensionalData
Name | Type |
---|---|
query*required | DimensionQuery |
type*required | string |
value*required | Record<string | any> |
AnalyzerError
Name | Type |
---|---|
code*required | number |
details | AnalyzerErrorDetails |
message*required | string |
AnalyzerErrorDetails
Name | Type |
---|---|
constraintViolations | Array<ConstraintViolation> |
AnalyzerErrorEnvelope
Name | Type |
---|---|
error | AnalyzerError |
AnalyzerExecuteResult
Name | Type |
---|---|
requestToken | string |
result*required | AnalyzerResult |
ttlInSeconds | number |
AnalyzerExecutionLog
Name | Type |
---|---|
analyzerName*required | string |
level*required | AnalyzerExecutionLogLevel |
message*required | string |
path | string |
AnalyzerGeneralParameters
Name | Type | Default |
---|---|---|
logVerbosity | AnalyzerExecutionLogLevel | |
resolveDimensionalQueryData | boolean | false |
timeframe | Timeframe |
AnalyzerInput
The input is specific to an analyzer. Get the definition of an analyzer to find the required input structure.
Name | Type |
---|---|
generalParameters | AnalyzerGeneralParameters |
AnalyzerInterface
Name | Type |
---|---|
baseInterface | string |
AnalyzerOutput
Name | Type |
---|---|
system | AnalyzerOutputSystemParameters |
AnalyzerOutputLog
Name | Type |
---|---|
analyzerName*required | string |
level*required | AnalyzerOutputLogLevel |
message*required | string |
AnalyzerOutputSystemParameters
Name | Type |
---|---|
logs | Array<AnalyzerOutputLog> |
AnalyzerQueryResult
Name | Type |
---|---|
analyzers*required | Array<AnalyzerDefinition> |
nextPageKey | string |
totalCount*required | number |
AnalyzerResult
Name | Type |
---|---|
data | Array<AnalyzerDimensionalData> |
executionStatus*required | AnalyzerResultExecutionStatus |
input*required | AnalyzerInput |
logs | Array<AnalyzerExecutionLog> |
output*required | Array<AnalyzerOutput> |
resultId*required | string |
resultStatus*required | AnalyzerResultResultStatus |
AnalyzerValidationResult
Name | Type |
---|---|
details | AnalyzerErrorDetails |
valid*required | boolean |
ConstraintViolation
Name | Type |
---|---|
analyzerName*required | string |
level*required | AnalyzerExecutionLogLevel |
message*required | string |
path | string |
EnumerationElement
Name | Type |
---|---|
description*required | string |
displayName*required | string |
key*required | string |
ParameterDefinition
Name | Type | Description |
---|---|---|
advanced | boolean | If true, this parameter is considered to be for advanced usage. |
array*required | boolean | |
callInterface | AnalyzerInterface | |
defaultValue | any | |
description | string | |
displayName*required | string | |
enumerationValues | Array<EnumerationElement> | |
extendedType | string | Provides extended type information for this parameter. This allows additional semantics that can be utilized by analyzer consumers. |
fields | Array<ParameterDefinition> | |
maxSize | number | |
name*required | string | |
optional*required | boolean | |
type*required | ParameterDefinitionType | |
valueConstraints | Record<string | any> |
Timeframe
Name | Type | Description |
---|---|---|
endTime | string | Specify the end time in either absolute or relative format. For absolute format, use the ISO 8601 format (yyyy-MM-ddTHH:mm:ssZ). For relative format, use 'now' for the current time or apply an offset with the available units: 's' for seconds, 'm' for minutes, 'h' for hours, and 'd' for days. For example, use 'now-2h' or '-2h' for a relative offset of 2 hours. If not specified, defaults to now. |
startTime*required | string | Specify the start time in either absolute or relative format. For absolute format, use the ISO 8601 format (yyyy-MM-ddTHH:mm:ssZ). For relative format, use 'now' for the current time or apply an offset with the available units: 's' for seconds, 'm' for minutes, 'h' for hours, and 'd' for days. For example, use 'now-2h' or '-2h' for a relative offset of 2 hours. |
Enums
AnalyzerDefinitionType
Enum keys
Declared
| Implemented
| Interface
AnalyzerExecutionLogLevel
Enum keys
Info
| Severe
| Tracing
| Warning
AnalyzerOutputLogLevel
Enum keys
Info
| Tracing
| Warning
AnalyzerResultExecutionStatus
Enum keys
Aborted
| Completed
| Running
AnalyzerResultResultStatus
Enum keys
Failed
| Successful
| SuccessfulWithWarnings
ParameterDefinitionType
Enum keys
AnalyzerCall
| AnalyzerStructure
| Boolean
| DataFrame
| DimensionQuery
| EntityId
| EntityQuery
| EntityTemplate
| Enumeration
| Integer
| ModelId
| Number
| String
| TextTemplate
| Timeframe
| TimeseriesArray
| TimeseriesQuery
| TimeseriesSet
| Timestamp