Package com.azure.ai.anomalydetector
Class AnomalyDetectorClient
- java.lang.Object
-
- com.azure.ai.anomalydetector.AnomalyDetectorClient
-
public final class AnomalyDetectorClient extends Object
Initializes a new instance of the synchronous AnomalyDetectorClient type.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteMultivariateModel(UUID modelId)
Delete an existing multivariate model according to the modelId.com.azure.core.http.rest.Response<Void>
deleteMultivariateModelWithResponse(UUID modelId, com.azure.core.util.Context context)
Delete an existing multivariate model according to the modelId.void
detectAnomaly(UUID modelId, DetectionRequest body)
Submit detection multivariate anomaly task with the trained model of modelId, the input schema should be the same with the training request.DetectAnomalyResponse
detectAnomalyWithResponse(UUID modelId, DetectionRequest body, com.azure.core.util.Context context)
Submit detection multivariate anomaly task with the trained model of modelId, the input schema should be the same with the training request.ChangePointDetectResponse
detectChangePoint(ChangePointDetectRequest body)
Evaluate change point score of every series point.com.azure.core.http.rest.Response<ChangePointDetectResponse>
detectChangePointWithResponse(ChangePointDetectRequest body, com.azure.core.util.Context context)
Evaluate change point score of every series point.EntireDetectResponse
detectEntireSeries(DetectRequest body)
This operation generates a model with an entire series, each point is detected with the same model.com.azure.core.http.rest.Response<EntireDetectResponse>
detectEntireSeriesWithResponse(DetectRequest body, com.azure.core.util.Context context)
This operation generates a model with an entire series, each point is detected with the same model.LastDetectResponse
detectLastPoint(DetectRequest body)
This operation generates a model using points before the latest one.com.azure.core.http.rest.Response<LastDetectResponse>
detectLastPointWithResponse(DetectRequest body, com.azure.core.util.Context context)
This operation generates a model using points before the latest one.InputStream
exportModel(UUID modelId)
Export multivariate anomaly detection model based on modelId.com.azure.core.http.rest.StreamResponse
exportModelWithResponse(UUID modelId, com.azure.core.util.Context context)
Export multivariate anomaly detection model based on modelId.DetectionResult
getDetectionResult(UUID resultId)
Get multivariate anomaly detection result based on resultId returned by the DetectAnomalyAsync api.com.azure.core.http.rest.Response<DetectionResult>
getDetectionResultWithResponse(UUID resultId, com.azure.core.util.Context context)
Get multivariate anomaly detection result based on resultId returned by the DetectAnomalyAsync api.Model
getMultivariateModel(UUID modelId)
Get detailed information of multivariate model, including the training status and variables used in the model.com.azure.core.http.rest.Response<Model>
getMultivariateModelWithResponse(UUID modelId, com.azure.core.util.Context context)
Get detailed information of multivariate model, including the training status and variables used in the model.LastDetectionResult
lastDetectAnomaly(UUID modelId, LastDetectionRequest body)
Synchronized API for anomaly detection.com.azure.core.http.rest.Response<LastDetectionResult>
lastDetectAnomalyWithResponse(UUID modelId, LastDetectionRequest body, com.azure.core.util.Context context)
Synchronized API for anomaly detection.com.azure.core.http.rest.PagedIterable<ModelSnapshot>
listMultivariateModel(Integer skip, Integer top)
List models of a subscription.com.azure.core.http.rest.PagedIterable<ModelSnapshot>
listMultivariateModel(Integer skip, Integer top, com.azure.core.util.Context context)
List models of a subscription.void
trainMultivariateModel(ModelInfo body)
Create and train a multivariate anomaly detection model.TrainMultivariateModelResponse
trainMultivariateModelWithResponse(ModelInfo body, com.azure.core.util.Context context)
Create and train a multivariate anomaly detection model.
-
-
-
Method Detail
-
detectEntireSeries
public EntireDetectResponse detectEntireSeries(DetectRequest body)
This operation generates a model with an entire series, each point is detected with the same model. With this method, points before and after a certain point are used to determine whether it is an anomaly. The entire detection can give user an overall status of the time series.- Parameters:
body
- Time series points and period if needed. Advanced model parameters can also be set in the request.- Returns:
- the response of entire anomaly detection.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.AnomalyDetectorErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
detectEntireSeriesWithResponse
public com.azure.core.http.rest.Response<EntireDetectResponse> detectEntireSeriesWithResponse(DetectRequest body, com.azure.core.util.Context context)
This operation generates a model with an entire series, each point is detected with the same model. With this method, points before and after a certain point are used to determine whether it is an anomaly. The entire detection can give user an overall status of the time series.- Parameters:
body
- Time series points and period if needed. Advanced model parameters can also be set in the request.context
- The context to associate with this operation.- Returns:
- the response of entire anomaly detection.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.AnomalyDetectorErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
detectLastPoint
public LastDetectResponse detectLastPoint(DetectRequest body)
This operation generates a model using points before the latest one. With this method, only historical points are used to determine whether the target point is an anomaly. The latest point detecting operation matches the scenario of real-time monitoring of business metrics.- Parameters:
body
- Time series points and period if needed. Advanced model parameters can also be set in the request.- Returns:
- the response of last anomaly detection.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.AnomalyDetectorErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
detectLastPointWithResponse
public com.azure.core.http.rest.Response<LastDetectResponse> detectLastPointWithResponse(DetectRequest body, com.azure.core.util.Context context)
This operation generates a model using points before the latest one. With this method, only historical points are used to determine whether the target point is an anomaly. The latest point detecting operation matches the scenario of real-time monitoring of business metrics.- Parameters:
body
- Time series points and period if needed. Advanced model parameters can also be set in the request.context
- The context to associate with this operation.- Returns:
- the response of last anomaly detection.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.AnomalyDetectorErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
detectChangePoint
public ChangePointDetectResponse detectChangePoint(ChangePointDetectRequest body)
Evaluate change point score of every series point.- Parameters:
body
- Time series points and granularity is needed. Advanced model parameters can also be set in the request if needed.- Returns:
- the response of change point detection.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.AnomalyDetectorErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
detectChangePointWithResponse
public com.azure.core.http.rest.Response<ChangePointDetectResponse> detectChangePointWithResponse(ChangePointDetectRequest body, com.azure.core.util.Context context)
Evaluate change point score of every series point.- Parameters:
body
- Time series points and granularity is needed. Advanced model parameters can also be set in the request if needed.context
- The context to associate with this operation.- Returns:
- the response of change point detection.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.AnomalyDetectorErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
trainMultivariateModel
public void trainMultivariateModel(ModelInfo body)
Create and train a multivariate anomaly detection model. The request must include a source parameter to indicate an externally accessible Azure storage Uri (preferably a Shared Access Signature Uri). All time-series used in generate the model must be zipped into one single file. Each time-series will be in a single CSV file in which the first column is timestamp and the second column is value.- Parameters:
body
- Training request.- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
trainMultivariateModelWithResponse
public TrainMultivariateModelResponse trainMultivariateModelWithResponse(ModelInfo body, com.azure.core.util.Context context)
Create and train a multivariate anomaly detection model. The request must include a source parameter to indicate an externally accessible Azure storage Uri (preferably a Shared Access Signature Uri). All time-series used in generate the model must be zipped into one single file. Each time-series will be in a single CSV file in which the first column is timestamp and the second column is value.- Parameters:
body
- Training request.context
- The context to associate with this operation.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
listMultivariateModel
public com.azure.core.http.rest.PagedIterable<ModelSnapshot> listMultivariateModel(Integer skip, Integer top)
List models of a subscription.- Parameters:
skip
- $skip indicates how many models will be skipped.top
- $top indicates how many models will be fetched.- Returns:
- response of listing models.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
listMultivariateModel
public com.azure.core.http.rest.PagedIterable<ModelSnapshot> listMultivariateModel(Integer skip, Integer top, com.azure.core.util.Context context)
List models of a subscription.- Parameters:
skip
- $skip indicates how many models will be skipped.top
- $top indicates how many models will be fetched.context
- The context to associate with this operation.- Returns:
- response of listing models.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
getMultivariateModel
public Model getMultivariateModel(UUID modelId)
Get detailed information of multivariate model, including the training status and variables used in the model.- Parameters:
modelId
- Model identifier.- Returns:
- detailed information of multivariate model, including the training status and variables used in the model.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
getMultivariateModelWithResponse
public com.azure.core.http.rest.Response<Model> getMultivariateModelWithResponse(UUID modelId, com.azure.core.util.Context context)
Get detailed information of multivariate model, including the training status and variables used in the model.- Parameters:
modelId
- Model identifier.context
- The context to associate with this operation.- Returns:
- detailed information of multivariate model, including the training status and variables used in the model.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
deleteMultivariateModel
public void deleteMultivariateModel(UUID modelId)
Delete an existing multivariate model according to the modelId.- Parameters:
modelId
- Model identifier.- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
deleteMultivariateModelWithResponse
public com.azure.core.http.rest.Response<Void> deleteMultivariateModelWithResponse(UUID modelId, com.azure.core.util.Context context)
Delete an existing multivariate model according to the modelId.- Parameters:
modelId
- Model identifier.context
- The context to associate with this operation.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
detectAnomaly
public void detectAnomaly(UUID modelId, DetectionRequest body)
Submit detection multivariate anomaly task with the trained model of modelId, the input schema should be the same with the training request. Thus request will be complete asynchronously and will return a resultId for querying the detection result.The request should be a source link to indicate an externally accessible Azure storage Uri (preferably a Shared Access Signature Uri). All time-series used in generate the model must be zipped into one single file. Each time-series will be as follows: the first column is timestamp and the second column is value.- Parameters:
modelId
- Model identifier.body
- Detect anomaly request.- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
detectAnomalyWithResponse
public DetectAnomalyResponse detectAnomalyWithResponse(UUID modelId, DetectionRequest body, com.azure.core.util.Context context)
Submit detection multivariate anomaly task with the trained model of modelId, the input schema should be the same with the training request. Thus request will be complete asynchronously and will return a resultId for querying the detection result.The request should be a source link to indicate an externally accessible Azure storage Uri (preferably a Shared Access Signature Uri). All time-series used in generate the model must be zipped into one single file. Each time-series will be as follows: the first column is timestamp and the second column is value.- Parameters:
modelId
- Model identifier.body
- Detect anomaly request.context
- The context to associate with this operation.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
getDetectionResult
public DetectionResult getDetectionResult(UUID resultId)
Get multivariate anomaly detection result based on resultId returned by the DetectAnomalyAsync api.- Parameters:
resultId
- Result identifier.- Returns:
- multivariate anomaly detection result based on resultId returned by the DetectAnomalyAsync api.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
getDetectionResultWithResponse
public com.azure.core.http.rest.Response<DetectionResult> getDetectionResultWithResponse(UUID resultId, com.azure.core.util.Context context)
Get multivariate anomaly detection result based on resultId returned by the DetectAnomalyAsync api.- Parameters:
resultId
- Result identifier.context
- The context to associate with this operation.- Returns:
- multivariate anomaly detection result based on resultId returned by the DetectAnomalyAsync api.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
exportModel
public InputStream exportModel(UUID modelId)
Export multivariate anomaly detection model based on modelId.- Parameters:
modelId
- Model identifier.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
exportModelWithResponse
public com.azure.core.http.rest.StreamResponse exportModelWithResponse(UUID modelId, com.azure.core.util.Context context)
Export multivariate anomaly detection model based on modelId.- Parameters:
modelId
- Model identifier.context
- The context to associate with this operation.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
lastDetectAnomaly
public LastDetectionResult lastDetectAnomaly(UUID modelId, LastDetectionRequest body)
Synchronized API for anomaly detection.- Parameters:
modelId
- Model identifier.body
- Request for last detection.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
lastDetectAnomalyWithResponse
public com.azure.core.http.rest.Response<LastDetectionResult> lastDetectAnomalyWithResponse(UUID modelId, LastDetectionRequest body, com.azure.core.util.Context context)
Synchronized API for anomaly detection.- Parameters:
modelId
- Model identifier.body
- Request for last detection.context
- The context to associate with this operation.- Returns:
- the response.
- Throws:
IllegalArgumentException
- thrown if parameters fail the validation.ErrorResponseException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
-