diff --git a/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/CHANGELOG.md b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/CHANGELOG.md new file mode 100644 index 000000000000..5350cdc0924f --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/CHANGELOG.md @@ -0,0 +1,13 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +- Azure AnomalyDetectorClient client library for Java. This package contains Microsoft Azure AnomalyDetectorClient client library. + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/README.md b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/README.md new file mode 100644 index 000000000000..8e3559ac2c04 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/README.md @@ -0,0 +1,63 @@ +# Azure AnomalyDetectorClient client library for Java + +Azure AnomalyDetectorClient client library for Java. + +This package contains Microsoft Azure AnomalyDetectorClient client library. + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] +- [Product documentation][product_documentation] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure:azure-cognitiveservices-multidimensionalrootcauseanalysis;current}) +```xml + + com.azure + azure-cognitiveservices-multidimensionalrootcauseanalysis + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Authentication + +[Azure Identity][azure_identity] package provides the default implementation for authenticating the client. + +## Key concepts + +## Examples + +```java com.azure.cognitiveservices.multidimensionalrootcauseanalysis.readme +``` + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[product_documentation]: https://azure.microsoft.com/services/ +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity diff --git a/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/pom.xml b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/pom.xml new file mode 100644 index 000000000000..a1229ffd1374 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/pom.xml @@ -0,0 +1,76 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure + azure-cognitiveservices-multidimensionalrootcauseanalysis + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for AnomalyDetectorClient Management + This package contains Microsoft Azure AnomalyDetectorClient client library. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + false + + + + + + com.azure + azure-core + 1.23.1 + + + com.azure + azure-core-http-netty + 1.11.4 + + + org.junit.jupiter + junit-jupiter-engine + 5.8.1 + test + + + com.azure + azure-core-test + 1.7.5 + test + + + com.azure + azure-identity + 1.4.2 + test + + + diff --git a/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/AnomalyDetectorAsyncClient.java b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/AnomalyDetectorAsyncClient.java new file mode 100644 index 000000000000..15f023f123cc --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/AnomalyDetectorAsyncClient.java @@ -0,0 +1,654 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.cognitiveservices.multidimensionalrootcauseanalysis; + +import com.azure.cognitiveservices.multidimensionalrootcauseanalysis.implementation.AnomalyDetectorClientImpl; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the asynchronous AnomalyDetectorClient type. */ +@ServiceClient(builder = AnomalyDetectorClientBuilder.class, isAsync = true) +public final class AnomalyDetectorAsyncClient { + @Generated private final AnomalyDetectorClientImpl serviceClient; + + /** + * Initializes an instance of AnomalyDetectorClient client. + * + * @param serviceClient the service client implementation. + */ + @Generated + AnomalyDetectorAsyncClient(AnomalyDetectorClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Create a multidimensional root cause analysis data set. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none)
+     *     customInterval: int
+     *     dimensionKeys: [
+     *         String
+     *     ]
+     *     aggregateValue: String
+     *     measures: [
+     *         {
+     *             name: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createMultiDimRcaDataSetWithResponse(RequestOptions requestOptions) { + return this.serviceClient.createMultiDimRcaDataSetWithResponseAsync(requestOptions); + } + + /** + * List multidimensional root cause analysis data set. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoMultidimensional root cause analysis data set name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             dataSetId: String
+     *             name: String
+     *             granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none)
+     *             customInterval: int
+     *             dimensionKeys: [
+     *                 String
+     *             ]
+     *             aggregateValue: String
+     *             measures: [
+     *                 {
+     *                     name: String
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMultiDimRcaDataSet(RequestOptions requestOptions) { + return this.serviceClient.listMultiDimRcaDataSetAsync(requestOptions); + } + + /** + * Get a multidimensional root cause analysis data set by its id. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     dataSetId: String
+     *     name: String
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none)
+     *     customInterval: int
+     *     dimensionKeys: [
+     *         String
+     *     ]
+     *     aggregateValue: String
+     *     measures: [
+     *         {
+     *             name: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return a multidimensional root cause analysis data set by its id. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMultiDimRcaDataSetWithResponse( + String dataSetId, RequestOptions requestOptions) { + return this.serviceClient.getMultiDimRcaDataSetWithResponseAsync(dataSetId, requestOptions); + } + + /** + * Delete a multidimensional root cause analysis data set. + * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteMultiDimRcaDataSetWithResponse(String dataSetId, RequestOptions requestOptions) { + return this.serviceClient.deleteMultiDimRcaDataSetWithResponseAsync(dataSetId, requestOptions); + } + + /** + * Upload data to multidimensional root cause analysis data set. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             partitionIdentity: String
+     *             timestamp: String
+     *             data: [
+     *                 [
+     *                     Object
+     *                 ]
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> uploadMultiDimRcaDataWithResponse(String dataSetId, RequestOptions requestOptions) { + return this.serviceClient.uploadMultiDimRcaDataWithResponseAsync(dataSetId, requestOptions); + } + + /** + * Delete a multidimensional root cause analysis data. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startDateTimeStringNoStart time of data to be deleted
endDateTimeStringNoEnd time of data to be deleted
partitionIdentityStringNoPartition identity of the data to be deleted
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteMultiDimRcaDataWithResponse(String dataSetId, RequestOptions requestOptions) { + return this.serviceClient.deleteMultiDimRcaDataWithResponseAsync(dataSetId, requestOptions); + } + + /** + * List multidimensional root cause analysis data in a specified data set. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startDateTimeStringNoStart time of data
endDateTimeStringNoEnd time of data
partitionIdentityStringNoPartition identity of data
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             partitionIdentity: String
+     *             dataSize: int
+     *             timestamp: String
+     *             createdDateTime: String
+     *             lastUploadedDateTime: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMultiDimRcaData(String dataSetId, RequestOptions requestOptions) { + return this.serviceClient.listMultiDimRcaDataAsync(dataSetId, requestOptions); + } + + /** + * Create an instance for multidimensional RCA. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String
+     *     targetMeasure: {
+     *         dataSetId: String
+     *         measureName: String
+     *     }
+     *     dataSets: [
+     *         {
+     *             dataSetId: String
+     *             measureNames: [
+     *                 String
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createMultiDimRcaInstanceWithResponse(RequestOptions requestOptions) { + return this.serviceClient.createMultiDimRcaInstanceWithResponseAsync(requestOptions); + } + + /** + * Get instance list for multidimensional RCA. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoFilter instance by name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             instanceId: String
+     *             name: String
+     *             targetMeasure: {
+     *                 dataSetId: String
+     *                 measureName: String
+     *             }
+     *             dataSets: [
+     *                 {
+     *                     dataSetId: String
+     *                     measureNames: [
+     *                         String
+     *                     ]
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return instance list for multidimensional RCA. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMultiDimRcaInstance(RequestOptions requestOptions) { + return this.serviceClient.listMultiDimRcaInstanceAsync(requestOptions); + } + + /** + * Query an instance information for multidimensional RCA. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     instanceId: String
+     *     name: String
+     *     targetMeasure: {
+     *         dataSetId: String
+     *         measureName: String
+     *     }
+     *     dataSets: [
+     *         {
+     *             dataSetId: String
+     *             measureNames: [
+     *                 String
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMultiDimRcaInstanceWithResponse( + String instanceId, RequestOptions requestOptions) { + return this.serviceClient.getMultiDimRcaInstanceWithResponseAsync(instanceId, requestOptions); + } + + /** + * Delete an instance for multidimensional RCA. + * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteMultiDimRcaInstanceWithResponse( + String instanceId, RequestOptions requestOptions) { + return this.serviceClient.deleteMultiDimRcaInstanceWithResponseAsync(instanceId, requestOptions); + } + + /** + * Trigger a model training task for multidimensional RCA. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String
+     *     parameter: {
+     *         startDateTime: String
+     *         endDateTime: String
+     *     }
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createMultiDimRcaTrainingTaskWithResponse( + String instanceId, RequestOptions requestOptions) { + return this.serviceClient.createMultiDimRcaTrainingTaskWithResponseAsync(instanceId, requestOptions); + } + + /** + * Query training task state list for multidimensional RCA. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoFilter model by name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             taskId: String
+     *             instanceId: String
+     *             modelId: String
+     *             name: String
+     *             status: String(scheduled/running/succeeded/failed/canceled)
+     *             createdDateTime: String
+     *             lastModifiedDateTime: String
+     *             parameter: {
+     *                 startDateTime: String
+     *                 endDateTime: String
+     *             }
+     *             error: {
+     *                 message: String
+     *                 code: String
+     *             }
+     *             taskInfo: {
+     *                 epochs: [
+     *                     int
+     *                 ]
+     *                 trainLoss: [
+     *                     double
+     *                 ]
+     *                 validationLoss: [
+     *                     double
+     *                 ]
+     *                 latencyInSecond: [
+     *                     double
+     *                 ]
+     *                 bestEpoch: int
+     *                 bestValidationLoss: double
+     *                 dataSize: [
+     *                     int
+     *                 ]
+     *                 edgeSize: int
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMultiDimRcaTrainingStates(String instanceId, RequestOptions requestOptions) { + return this.serviceClient.listMultiDimRcaTrainingStatesAsync(instanceId, requestOptions); + } + + /** + * Delete a model for multidimensional RCA. + * + * @param instanceId Instance unique id. + * @param modelId Model unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteMultiDimRcaModelWithResponse( + String instanceId, String modelId, RequestOptions requestOptions) { + return this.serviceClient.deleteMultiDimRcaModelWithResponseAsync(instanceId, modelId, requestOptions); + } + + /** + * Query an training task state for multidimensional RCA. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     taskId: String
+     *     instanceId: String
+     *     modelId: String
+     *     name: String
+     *     status: String(scheduled/running/succeeded/failed/canceled)
+     *     createdDateTime: String
+     *     lastModifiedDateTime: String
+     *     parameter: {
+     *         startDateTime: String
+     *         endDateTime: String
+     *     }
+     *     error: {
+     *         message: String
+     *         code: String
+     *     }
+     *     taskInfo: {
+     *         epochs: [
+     *             int
+     *         ]
+     *         trainLoss: [
+     *             double
+     *         ]
+     *         validationLoss: [
+     *             double
+     *         ]
+     *         latencyInSecond: [
+     *             double
+     *         ]
+     *         bestEpoch: int
+     *         bestValidationLoss: double
+     *         dataSize: [
+     *             int
+     *         ]
+     *         edgeSize: int
+     *     }
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param modelId Model unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMultiDimRcaTrainingStateWithResponse( + String instanceId, String modelId, RequestOptions requestOptions) { + return this.serviceClient.getMultiDimRcaTrainingStateWithResponseAsync(instanceId, modelId, requestOptions); + } + + /** + * Trigger an inference task for multidimensional RCA. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     parameter: {
+     *         timestamp: String
+     *         dimensionScope: {
+     *             String: String
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param modelId Model unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createMultiDimRcaInferenceTaskWithResponse( + String instanceId, String modelId, RequestOptions requestOptions) { + return this.serviceClient.createMultiDimRcaInferenceTaskWithResponseAsync(instanceId, modelId, requestOptions); + } + + /** + * Query an inference task state for multidimensional RCA. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     inferenceId: String
+     *     instanceId: String
+     *     modelId: String
+     *     status: String(scheduled/running/succeeded/failed/canceled)
+     *     createdDateTime: String
+     *     lastModifiedDateTime: String
+     *     parameter: {
+     *         timestamp: String
+     *         dimensionScope: {
+     *             String: String
+     *         }
+     *     }
+     *     result: {
+     *         rootCauses: [
+     *             {
+     *                 dimension: {
+     *                     String: String
+     *                 }
+     *                 score: double
+     *                 measures: [
+     *                     {
+     *                         dataSetId: String
+     *                         name: String
+     *                         trendType: String(rise/drop)
+     *                         contributionScore: double
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *     }
+     *     error: {
+     *         message: String
+     *         code: String
+     *     }
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param modelId Model unique id. + * @param inferenceId Inference unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMultiDimRcaInferenceStateWithResponse( + String instanceId, String modelId, String inferenceId, RequestOptions requestOptions) { + return this.serviceClient.getMultiDimRcaInferenceStateWithResponseAsync( + instanceId, modelId, inferenceId, requestOptions); + } +} diff --git a/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/AnomalyDetectorClient.java b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/AnomalyDetectorClient.java new file mode 100644 index 000000000000..1dcc9f8fb998 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/AnomalyDetectorClient.java @@ -0,0 +1,649 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.cognitiveservices.multidimensionalrootcauseanalysis; + +import com.azure.cognitiveservices.multidimensionalrootcauseanalysis.implementation.AnomalyDetectorClientImpl; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; + +/** Initializes a new instance of the synchronous AnomalyDetectorClient type. */ +@ServiceClient(builder = AnomalyDetectorClientBuilder.class) +public final class AnomalyDetectorClient { + @Generated private final AnomalyDetectorClientImpl serviceClient; + + /** + * Initializes an instance of AnomalyDetectorClient client. + * + * @param serviceClient the service client implementation. + */ + @Generated + AnomalyDetectorClient(AnomalyDetectorClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Create a multidimensional root cause analysis data set. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none)
+     *     customInterval: int
+     *     dimensionKeys: [
+     *         String
+     *     ]
+     *     aggregateValue: String
+     *     measures: [
+     *         {
+     *             name: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createMultiDimRcaDataSetWithResponse(RequestOptions requestOptions) { + return this.serviceClient.createMultiDimRcaDataSetWithResponse(requestOptions); + } + + /** + * List multidimensional root cause analysis data set. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoMultidimensional root cause analysis data set name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             dataSetId: String
+     *             name: String
+     *             granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none)
+     *             customInterval: int
+     *             dimensionKeys: [
+     *                 String
+     *             ]
+     *             aggregateValue: String
+     *             measures: [
+     *                 {
+     *                     name: String
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMultiDimRcaDataSet(RequestOptions requestOptions) { + return this.serviceClient.listMultiDimRcaDataSet(requestOptions); + } + + /** + * Get a multidimensional root cause analysis data set by its id. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     dataSetId: String
+     *     name: String
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none)
+     *     customInterval: int
+     *     dimensionKeys: [
+     *         String
+     *     ]
+     *     aggregateValue: String
+     *     measures: [
+     *         {
+     *             name: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return a multidimensional root cause analysis data set by its id. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMultiDimRcaDataSetWithResponse(String dataSetId, RequestOptions requestOptions) { + return this.serviceClient.getMultiDimRcaDataSetWithResponse(dataSetId, requestOptions); + } + + /** + * Delete a multidimensional root cause analysis data set. + * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteMultiDimRcaDataSetWithResponse(String dataSetId, RequestOptions requestOptions) { + return this.serviceClient.deleteMultiDimRcaDataSetWithResponse(dataSetId, requestOptions); + } + + /** + * Upload data to multidimensional root cause analysis data set. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             partitionIdentity: String
+     *             timestamp: String
+     *             data: [
+     *                 [
+     *                     Object
+     *                 ]
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response uploadMultiDimRcaDataWithResponse(String dataSetId, RequestOptions requestOptions) { + return this.serviceClient.uploadMultiDimRcaDataWithResponse(dataSetId, requestOptions); + } + + /** + * Delete a multidimensional root cause analysis data. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startDateTimeStringNoStart time of data to be deleted
endDateTimeStringNoEnd time of data to be deleted
partitionIdentityStringNoPartition identity of the data to be deleted
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteMultiDimRcaDataWithResponse(String dataSetId, RequestOptions requestOptions) { + return this.serviceClient.deleteMultiDimRcaDataWithResponse(dataSetId, requestOptions); + } + + /** + * List multidimensional root cause analysis data in a specified data set. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startDateTimeStringNoStart time of data
endDateTimeStringNoEnd time of data
partitionIdentityStringNoPartition identity of data
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             partitionIdentity: String
+     *             dataSize: int
+     *             timestamp: String
+     *             createdDateTime: String
+     *             lastUploadedDateTime: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMultiDimRcaData(String dataSetId, RequestOptions requestOptions) { + return this.serviceClient.listMultiDimRcaData(dataSetId, requestOptions); + } + + /** + * Create an instance for multidimensional RCA. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String
+     *     targetMeasure: {
+     *         dataSetId: String
+     *         measureName: String
+     *     }
+     *     dataSets: [
+     *         {
+     *             dataSetId: String
+     *             measureNames: [
+     *                 String
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createMultiDimRcaInstanceWithResponse(RequestOptions requestOptions) { + return this.serviceClient.createMultiDimRcaInstanceWithResponse(requestOptions); + } + + /** + * Get instance list for multidimensional RCA. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoFilter instance by name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             instanceId: String
+     *             name: String
+     *             targetMeasure: {
+     *                 dataSetId: String
+     *                 measureName: String
+     *             }
+     *             dataSets: [
+     *                 {
+     *                     dataSetId: String
+     *                     measureNames: [
+     *                         String
+     *                     ]
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return instance list for multidimensional RCA. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMultiDimRcaInstance(RequestOptions requestOptions) { + return this.serviceClient.listMultiDimRcaInstance(requestOptions); + } + + /** + * Query an instance information for multidimensional RCA. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     instanceId: String
+     *     name: String
+     *     targetMeasure: {
+     *         dataSetId: String
+     *         measureName: String
+     *     }
+     *     dataSets: [
+     *         {
+     *             dataSetId: String
+     *             measureNames: [
+     *                 String
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMultiDimRcaInstanceWithResponse(String instanceId, RequestOptions requestOptions) { + return this.serviceClient.getMultiDimRcaInstanceWithResponse(instanceId, requestOptions); + } + + /** + * Delete an instance for multidimensional RCA. + * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteMultiDimRcaInstanceWithResponse(String instanceId, RequestOptions requestOptions) { + return this.serviceClient.deleteMultiDimRcaInstanceWithResponse(instanceId, requestOptions); + } + + /** + * Trigger a model training task for multidimensional RCA. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String
+     *     parameter: {
+     *         startDateTime: String
+     *         endDateTime: String
+     *     }
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createMultiDimRcaTrainingTaskWithResponse(String instanceId, RequestOptions requestOptions) { + return this.serviceClient.createMultiDimRcaTrainingTaskWithResponse(instanceId, requestOptions); + } + + /** + * Query training task state list for multidimensional RCA. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoFilter model by name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             taskId: String
+     *             instanceId: String
+     *             modelId: String
+     *             name: String
+     *             status: String(scheduled/running/succeeded/failed/canceled)
+     *             createdDateTime: String
+     *             lastModifiedDateTime: String
+     *             parameter: {
+     *                 startDateTime: String
+     *                 endDateTime: String
+     *             }
+     *             error: {
+     *                 message: String
+     *                 code: String
+     *             }
+     *             taskInfo: {
+     *                 epochs: [
+     *                     int
+     *                 ]
+     *                 trainLoss: [
+     *                     double
+     *                 ]
+     *                 validationLoss: [
+     *                     double
+     *                 ]
+     *                 latencyInSecond: [
+     *                     double
+     *                 ]
+     *                 bestEpoch: int
+     *                 bestValidationLoss: double
+     *                 dataSize: [
+     *                     int
+     *                 ]
+     *                 edgeSize: int
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMultiDimRcaTrainingStates(String instanceId, RequestOptions requestOptions) { + return this.serviceClient.listMultiDimRcaTrainingStates(instanceId, requestOptions); + } + + /** + * Delete a model for multidimensional RCA. + * + * @param instanceId Instance unique id. + * @param modelId Model unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteMultiDimRcaModelWithResponse( + String instanceId, String modelId, RequestOptions requestOptions) { + return this.serviceClient.deleteMultiDimRcaModelWithResponse(instanceId, modelId, requestOptions); + } + + /** + * Query an training task state for multidimensional RCA. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     taskId: String
+     *     instanceId: String
+     *     modelId: String
+     *     name: String
+     *     status: String(scheduled/running/succeeded/failed/canceled)
+     *     createdDateTime: String
+     *     lastModifiedDateTime: String
+     *     parameter: {
+     *         startDateTime: String
+     *         endDateTime: String
+     *     }
+     *     error: {
+     *         message: String
+     *         code: String
+     *     }
+     *     taskInfo: {
+     *         epochs: [
+     *             int
+     *         ]
+     *         trainLoss: [
+     *             double
+     *         ]
+     *         validationLoss: [
+     *             double
+     *         ]
+     *         latencyInSecond: [
+     *             double
+     *         ]
+     *         bestEpoch: int
+     *         bestValidationLoss: double
+     *         dataSize: [
+     *             int
+     *         ]
+     *         edgeSize: int
+     *     }
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param modelId Model unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMultiDimRcaTrainingStateWithResponse( + String instanceId, String modelId, RequestOptions requestOptions) { + return this.serviceClient.getMultiDimRcaTrainingStateWithResponse(instanceId, modelId, requestOptions); + } + + /** + * Trigger an inference task for multidimensional RCA. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     parameter: {
+     *         timestamp: String
+     *         dimensionScope: {
+     *             String: String
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param modelId Model unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createMultiDimRcaInferenceTaskWithResponse( + String instanceId, String modelId, RequestOptions requestOptions) { + return this.serviceClient.createMultiDimRcaInferenceTaskWithResponse(instanceId, modelId, requestOptions); + } + + /** + * Query an inference task state for multidimensional RCA. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     inferenceId: String
+     *     instanceId: String
+     *     modelId: String
+     *     status: String(scheduled/running/succeeded/failed/canceled)
+     *     createdDateTime: String
+     *     lastModifiedDateTime: String
+     *     parameter: {
+     *         timestamp: String
+     *         dimensionScope: {
+     *             String: String
+     *         }
+     *     }
+     *     result: {
+     *         rootCauses: [
+     *             {
+     *                 dimension: {
+     *                     String: String
+     *                 }
+     *                 score: double
+     *                 measures: [
+     *                     {
+     *                         dataSetId: String
+     *                         name: String
+     *                         trendType: String(rise/drop)
+     *                         contributionScore: double
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *     }
+     *     error: {
+     *         message: String
+     *         code: String
+     *     }
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param modelId Model unique id. + * @param inferenceId Inference unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMultiDimRcaInferenceStateWithResponse( + String instanceId, String modelId, String inferenceId, RequestOptions requestOptions) { + return this.serviceClient.getMultiDimRcaInferenceStateWithResponse( + instanceId, modelId, inferenceId, requestOptions); + } +} diff --git a/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/AnomalyDetectorClientBuilder.java b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/AnomalyDetectorClientBuilder.java new file mode 100644 index 000000000000..71a635ddbf28 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/AnomalyDetectorClientBuilder.java @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.cognitiveservices.multidimensionalrootcauseanalysis; + +import com.azure.cognitiveservices.multidimensionalrootcauseanalysis.implementation.AnomalyDetectorClientImpl; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.serializer.JacksonAdapter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** A builder for creating a new instance of the AnomalyDetectorClient type. */ +@ServiceClientBuilder(serviceClients = {AnomalyDetectorClient.class, AnomalyDetectorAsyncClient.class}) +public final class AnomalyDetectorClientBuilder { + @Generated private static final String SDK_NAME = "name"; + + @Generated private static final String SDK_VERSION = "version"; + + @Generated static final String[] DEFAULT_SCOPES = new String[] {"https://cognitiveservices.azure.com/.default"}; + + @Generated private final Map properties = new HashMap<>(); + + /** Create an instance of the AnomalyDetectorClientBuilder. */ + @Generated + public AnomalyDetectorClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * Supported Cognitive Services endpoints (protocol and hostname, for + * example: https://westus2.api.cognitive.microsoft.com). + */ + @Generated private String endpoint; + + /** + * Sets Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://westus2.api.cognitive.microsoft.com). + * + * @param endpoint the endpoint value. + * @return the AnomalyDetectorClientBuilder. + */ + @Generated + public AnomalyDetectorClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + @Generated private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the AnomalyDetectorClientBuilder. + */ + @Generated + public AnomalyDetectorClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated private HttpClient httpClient; + + /** + * Sets The HTTP client used to send the request. + * + * @param httpClient the httpClient value. + * @return the AnomalyDetectorClientBuilder. + */ + @Generated + public AnomalyDetectorClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The configuration store that is used during construction of the service + * client. + */ + @Generated private Configuration configuration; + + /** + * Sets The configuration store that is used during construction of the service client. + * + * @param configuration the configuration value. + * @return the AnomalyDetectorClientBuilder. + */ + @Generated + public AnomalyDetectorClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated private TokenCredential tokenCredential; + + /** + * Sets The TokenCredential used for authentication. + * + * @param tokenCredential the tokenCredential value. + * @return the AnomalyDetectorClientBuilder. + */ + @Generated + public AnomalyDetectorClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated private HttpLogOptions httpLogOptions; + + /** + * Sets The logging configuration for HTTP requests and responses. + * + * @param httpLogOptions the httpLogOptions value. + * @return the AnomalyDetectorClientBuilder. + */ + @Generated + public AnomalyDetectorClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if + * applicable. + */ + @Generated private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the AnomalyDetectorClientBuilder. + */ + @Generated + public AnomalyDetectorClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /* + * The list of Http pipeline policies to add. + */ + @Generated private final List pipelinePolicies; + + /* + * The client options such as application ID and custom headers to set on a + * request. + */ + @Generated private ClientOptions clientOptions; + + /** + * Sets The client options such as application ID and custom headers to set on a request. + * + * @param clientOptions the clientOptions value. + * @return the AnomalyDetectorClientBuilder. + */ + @Generated + public AnomalyDetectorClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /** + * Adds a custom Http pipeline policy. + * + * @param customPolicy The custom Http pipeline policy to add. + * @return the AnomalyDetectorClientBuilder. + */ + @Generated + public AnomalyDetectorClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + pipelinePolicies.add(customPolicy); + return this; + } + + /** + * Builds an instance of AnomalyDetectorClientImpl with the provided parameters. + * + * @return an instance of AnomalyDetectorClientImpl. + */ + @Generated + private AnomalyDetectorClientImpl buildInnerClient() { + if (pipeline == null) { + this.pipeline = createHttpPipeline(); + } + AnomalyDetectorClientImpl client = + new AnomalyDetectorClientImpl(pipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); + return client; + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration = + (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + if (httpLogOptions == null) { + httpLogOptions = new HttpLogOptions(); + } + if (clientOptions == null) { + clientOptions = new ClientOptions(); + } + List policies = new ArrayList<>(); + String clientName = properties.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + HttpHeaders headers = new HttpHeaders(); + clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); + if (headers.getSize() > 0) { + policies.add(new AddHeadersPolicy(headers)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy == null ? new RetryPolicy() : retryPolicy); + policies.add(new CookiePolicy()); + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(clientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of AnomalyDetectorAsyncClient async client. + * + * @return an instance of AnomalyDetectorAsyncClient. + */ + @Generated + public AnomalyDetectorAsyncClient buildAsyncClient() { + return new AnomalyDetectorAsyncClient(buildInnerClient()); + } + + /** + * Builds an instance of AnomalyDetectorClient sync client. + * + * @return an instance of AnomalyDetectorClient. + */ + @Generated + public AnomalyDetectorClient buildClient() { + return new AnomalyDetectorClient(buildInnerClient()); + } +} diff --git a/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/AnomalyDetectorServiceVersion.java b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/AnomalyDetectorServiceVersion.java new file mode 100644 index 000000000000..ab364525b138 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/AnomalyDetectorServiceVersion.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.cognitiveservices.multidimensionalrootcauseanalysis; + +import com.azure.core.util.ServiceVersion; + +/** Service version of AnomalyDetectorClient. */ +public enum AnomalyDetectorServiceVersion implements ServiceVersion { + /** Enum value 2.0-preview. */ + V2_0_PREVIEW("2.0-preview"); + + private final String version; + + AnomalyDetectorServiceVersion(String version) { + this.version = version; + } + + @Override + public String getVersion() { + return this.version; + } + + /** + * Gets the latest service version supported by this client library. + * + * @return The latest {@link AnomalyDetectorServiceVersion}. + */ + public static AnomalyDetectorServiceVersion getLatest() { + return V2_0_PREVIEW; + } +} diff --git a/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/implementation/AnomalyDetectorClientImpl.java b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/implementation/AnomalyDetectorClientImpl.java new file mode 100644 index 000000000000..4771f1f28302 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/implementation/AnomalyDetectorClientImpl.java @@ -0,0 +1,3117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.cognitiveservices.multidimensionalrootcauseanalysis.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the AnomalyDetectorClient type. */ +public final class AnomalyDetectorClientImpl { + /** The proxy service used to perform REST calls. */ + private final AnomalyDetectorClientService service; + + /** + * Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://westus2.api.cognitive.microsoft.com). + */ + private final String endpoint; + + /** + * Gets Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://westus2.api.cognitive.microsoft.com). + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * Initializes an instance of AnomalyDetectorClient client. + * + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://westus2.api.cognitive.microsoft.com). + */ + public AnomalyDetectorClientImpl(String endpoint) { + this( + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(), + JacksonAdapter.createDefaultSerializerAdapter(), + endpoint); + } + + /** + * Initializes an instance of AnomalyDetectorClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://westus2.api.cognitive.microsoft.com). + */ + public AnomalyDetectorClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); + } + + /** + * Initializes an instance of AnomalyDetectorClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://westus2.api.cognitive.microsoft.com). + */ + public AnomalyDetectorClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.service = + RestProxy.create(AnomalyDetectorClientService.class, this.httpPipeline, this.getSerializerAdapter()); + } + + /** + * The interface defining all the services for AnomalyDetectorClient to be used by the proxy service to perform REST + * calls. + */ + @Host("{Endpoint}/anomalydetector/v2.0-preview") + @ServiceInterface(name = "AnomalyDetectorClien") + private interface AnomalyDetectorClientService { + @Post("/rootCauseAnalysis/multiDimension/dataSets") + @ExpectedResponses({201}) + Mono> createMultiDimRcaDataSet( + @HostParam("Endpoint") String endpoint, RequestOptions requestOptions, Context context); + + @Get("/rootCauseAnalysis/multiDimension/dataSets") + @ExpectedResponses({200}) + Mono> listMultiDimRcaDataSet( + @HostParam("Endpoint") String endpoint, RequestOptions requestOptions, Context context); + + @Get("/rootCauseAnalysis/multiDimension/dataSets/{dataSetId}") + @ExpectedResponses({200}) + Mono> getMultiDimRcaDataSet( + @HostParam("Endpoint") String endpoint, + @PathParam("dataSetId") String dataSetId, + RequestOptions requestOptions, + Context context); + + @Delete("/rootCauseAnalysis/multiDimension/dataSets/{dataSetId}") + @ExpectedResponses({204}) + Mono> deleteMultiDimRcaDataSet( + @HostParam("Endpoint") String endpoint, + @PathParam("dataSetId") String dataSetId, + RequestOptions requestOptions, + Context context); + + @Put("/rootCauseAnalysis/multiDimension/dataSets/{dataSetId}/data") + @ExpectedResponses({201}) + Mono> uploadMultiDimRcaData( + @HostParam("Endpoint") String endpoint, + @PathParam("dataSetId") String dataSetId, + RequestOptions requestOptions, + Context context); + + @Delete("/rootCauseAnalysis/multiDimension/dataSets/{dataSetId}/data") + @ExpectedResponses({204}) + Mono> deleteMultiDimRcaData( + @HostParam("Endpoint") String endpoint, + @PathParam("dataSetId") String dataSetId, + RequestOptions requestOptions, + Context context); + + @Get("/rootCauseAnalysis/multiDimension/dataSets/{dataSetId}/data") + @ExpectedResponses({200}) + Mono> listMultiDimRcaData( + @HostParam("Endpoint") String endpoint, + @PathParam("dataSetId") String dataSetId, + RequestOptions requestOptions, + Context context); + + @Post("/rootCauseAnalysis/multiDimension/instances") + @ExpectedResponses({201}) + Mono> createMultiDimRcaInstance( + @HostParam("Endpoint") String endpoint, RequestOptions requestOptions, Context context); + + @Get("/rootCauseAnalysis/multiDimension/instances") + @ExpectedResponses({200}) + Mono> listMultiDimRcaInstance( + @HostParam("Endpoint") String endpoint, RequestOptions requestOptions, Context context); + + @Get("/rootCauseAnalysis/multiDimension/instances/{instanceId}") + @ExpectedResponses({200}) + Mono> getMultiDimRcaInstance( + @HostParam("Endpoint") String endpoint, + @PathParam("instanceId") String instanceId, + RequestOptions requestOptions, + Context context); + + @Delete("/rootCauseAnalysis/multiDimension/instances/{instanceId}") + @ExpectedResponses({204}) + Mono> deleteMultiDimRcaInstance( + @HostParam("Endpoint") String endpoint, + @PathParam("instanceId") String instanceId, + RequestOptions requestOptions, + Context context); + + @Post("/rootCauseAnalysis/multiDimension/instances/{instanceId}/models") + @ExpectedResponses({201}) + Mono> createMultiDimRcaTrainingTask( + @HostParam("Endpoint") String endpoint, + @PathParam("instanceId") String instanceId, + RequestOptions requestOptions, + Context context); + + @Get("/rootCauseAnalysis/multiDimension/instances/{instanceId}/models") + @ExpectedResponses({200}) + Mono> listMultiDimRcaTrainingStates( + @HostParam("Endpoint") String endpoint, + @PathParam("instanceId") String instanceId, + RequestOptions requestOptions, + Context context); + + @Delete("/rootCauseAnalysis/multiDimension/instances/{instanceId}/models/{modelId}") + @ExpectedResponses({204}) + Mono> deleteMultiDimRcaModel( + @HostParam("Endpoint") String endpoint, + @PathParam("instanceId") String instanceId, + @PathParam("modelId") String modelId, + RequestOptions requestOptions, + Context context); + + @Get("/rootCauseAnalysis/multiDimension/instances/{instanceId}/models/{modelId}") + @ExpectedResponses({200}) + Mono> getMultiDimRcaTrainingState( + @HostParam("Endpoint") String endpoint, + @PathParam("instanceId") String instanceId, + @PathParam("modelId") String modelId, + RequestOptions requestOptions, + Context context); + + @Post("/rootCauseAnalysis/multiDimension/instances/{instanceId}/models/{modelId}/inferences") + @ExpectedResponses({201}) + Mono> createMultiDimRcaInferenceTask( + @HostParam("Endpoint") String endpoint, + @PathParam("instanceId") String instanceId, + @PathParam("modelId") String modelId, + RequestOptions requestOptions, + Context context); + + @Get("/rootCauseAnalysis/multiDimension/instances/{instanceId}/models/{modelId}/inferences/{inferenceId}") + @ExpectedResponses({200}) + Mono> getMultiDimRcaInferenceState( + @HostParam("Endpoint") String endpoint, + @PathParam("instanceId") String instanceId, + @PathParam("modelId") String modelId, + @PathParam("inferenceId") String inferenceId, + RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + Mono> listMultiDimRcaDataSetNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("Endpoint") String endpoint, + RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + Mono> listMultiDimRcaDataNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("Endpoint") String endpoint, + RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + Mono> listMultiDimRcaInstanceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("Endpoint") String endpoint, + RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + Mono> listMultiDimRcaTrainingStatesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("Endpoint") String endpoint, + RequestOptions requestOptions, + Context context); + } + + /** + * Create a multidimensional root cause analysis data set. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none)
+     *     customInterval: int
+     *     dimensionKeys: [
+     *         String
+     *     ]
+     *     aggregateValue: String
+     *     measures: [
+     *         {
+     *             name: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createMultiDimRcaDataSetWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> service.createMultiDimRcaDataSet(this.getEndpoint(), requestOptions, context)); + } + + /** + * Create a multidimensional root cause analysis data set. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none)
+     *     customInterval: int
+     *     dimensionKeys: [
+     *         String
+     *     ]
+     *     aggregateValue: String
+     *     measures: [
+     *         {
+     *             name: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createMultiDimRcaDataSetWithResponseAsync( + RequestOptions requestOptions, Context context) { + return service.createMultiDimRcaDataSet(this.getEndpoint(), requestOptions, context); + } + + /** + * Create a multidimensional root cause analysis data set. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none)
+     *     customInterval: int
+     *     dimensionKeys: [
+     *         String
+     *     ]
+     *     aggregateValue: String
+     *     measures: [
+     *         {
+     *             name: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createMultiDimRcaDataSetWithResponse(RequestOptions requestOptions) { + return createMultiDimRcaDataSetWithResponseAsync(requestOptions).block(); + } + + /** + * List multidimensional root cause analysis data set. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoMultidimensional root cause analysis data set name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             dataSetId: String
+     *             name: String
+     *             granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none)
+     *             customInterval: int
+     *             dimensionKeys: [
+     *                 String
+     *             ]
+     *             aggregateValue: String
+     *             measures: [
+     *                 {
+     *                     name: String
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listMultiDimRcaDataSetSinglePageAsync(RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> service.listMultiDimRcaDataSet(this.getEndpoint(), requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "@nextLink"), + null)); + } + + /** + * List multidimensional root cause analysis data set. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoMultidimensional root cause analysis data set name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             dataSetId: String
+     *             name: String
+     *             granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none)
+     *             customInterval: int
+     *             dimensionKeys: [
+     *                 String
+     *             ]
+     *             aggregateValue: String
+     *             measures: [
+     *                 {
+     *                     name: String
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listMultiDimRcaDataSetSinglePageAsync( + RequestOptions requestOptions, Context context) { + return service.listMultiDimRcaDataSet(this.getEndpoint(), requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "@nextLink"), + null)); + } + + /** + * List multidimensional root cause analysis data set. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoMultidimensional root cause analysis data set name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             dataSetId: String
+     *             name: String
+     *             granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none)
+     *             customInterval: int
+     *             dimensionKeys: [
+     *                 String
+     *             ]
+     *             aggregateValue: String
+     *             measures: [
+     *                 {
+     *                     name: String
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMultiDimRcaDataSetAsync(RequestOptions requestOptions) { + return new PagedFlux<>( + () -> listMultiDimRcaDataSetSinglePageAsync(requestOptions), + nextLink -> listMultiDimRcaDataSetNextSinglePageAsync(nextLink, null)); + } + + /** + * List multidimensional root cause analysis data set. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoMultidimensional root cause analysis data set name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             dataSetId: String
+     *             name: String
+     *             granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none)
+     *             customInterval: int
+     *             dimensionKeys: [
+     *                 String
+     *             ]
+     *             aggregateValue: String
+     *             measures: [
+     *                 {
+     *                     name: String
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMultiDimRcaDataSetAsync(RequestOptions requestOptions, Context context) { + return new PagedFlux<>( + () -> listMultiDimRcaDataSetSinglePageAsync(requestOptions, context), + nextLink -> listMultiDimRcaDataSetNextSinglePageAsync(nextLink, null, context)); + } + + /** + * List multidimensional root cause analysis data set. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoMultidimensional root cause analysis data set name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             dataSetId: String
+     *             name: String
+     *             granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none)
+     *             customInterval: int
+     *             dimensionKeys: [
+     *                 String
+     *             ]
+     *             aggregateValue: String
+     *             measures: [
+     *                 {
+     *                     name: String
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMultiDimRcaDataSet(RequestOptions requestOptions) { + return new PagedIterable<>(listMultiDimRcaDataSetAsync(requestOptions)); + } + + /** + * Get a multidimensional root cause analysis data set by its id. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     dataSetId: String
+     *     name: String
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none)
+     *     customInterval: int
+     *     dimensionKeys: [
+     *         String
+     *     ]
+     *     aggregateValue: String
+     *     measures: [
+     *         {
+     *             name: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return a multidimensional root cause analysis data set by its id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMultiDimRcaDataSetWithResponseAsync( + String dataSetId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> service.getMultiDimRcaDataSet(this.getEndpoint(), dataSetId, requestOptions, context)); + } + + /** + * Get a multidimensional root cause analysis data set by its id. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     dataSetId: String
+     *     name: String
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none)
+     *     customInterval: int
+     *     dimensionKeys: [
+     *         String
+     *     ]
+     *     aggregateValue: String
+     *     measures: [
+     *         {
+     *             name: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return a multidimensional root cause analysis data set by its id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMultiDimRcaDataSetWithResponseAsync( + String dataSetId, RequestOptions requestOptions, Context context) { + return service.getMultiDimRcaDataSet(this.getEndpoint(), dataSetId, requestOptions, context); + } + + /** + * Get a multidimensional root cause analysis data set by its id. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     dataSetId: String
+     *     name: String
+     *     granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none)
+     *     customInterval: int
+     *     dimensionKeys: [
+     *         String
+     *     ]
+     *     aggregateValue: String
+     *     measures: [
+     *         {
+     *             name: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return a multidimensional root cause analysis data set by its id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMultiDimRcaDataSetWithResponse(String dataSetId, RequestOptions requestOptions) { + return getMultiDimRcaDataSetWithResponseAsync(dataSetId, requestOptions).block(); + } + + /** + * Delete a multidimensional root cause analysis data set. + * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteMultiDimRcaDataSetWithResponseAsync( + String dataSetId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> service.deleteMultiDimRcaDataSet(this.getEndpoint(), dataSetId, requestOptions, context)); + } + + /** + * Delete a multidimensional root cause analysis data set. + * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteMultiDimRcaDataSetWithResponseAsync( + String dataSetId, RequestOptions requestOptions, Context context) { + return service.deleteMultiDimRcaDataSet(this.getEndpoint(), dataSetId, requestOptions, context); + } + + /** + * Delete a multidimensional root cause analysis data set. + * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteMultiDimRcaDataSetWithResponse(String dataSetId, RequestOptions requestOptions) { + return deleteMultiDimRcaDataSetWithResponseAsync(dataSetId, requestOptions).block(); + } + + /** + * Upload data to multidimensional root cause analysis data set. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             partitionIdentity: String
+     *             timestamp: String
+     *             data: [
+     *                 [
+     *                     Object
+     *                 ]
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> uploadMultiDimRcaDataWithResponseAsync( + String dataSetId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> service.uploadMultiDimRcaData(this.getEndpoint(), dataSetId, requestOptions, context)); + } + + /** + * Upload data to multidimensional root cause analysis data set. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             partitionIdentity: String
+     *             timestamp: String
+     *             data: [
+     *                 [
+     *                     Object
+     *                 ]
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> uploadMultiDimRcaDataWithResponseAsync( + String dataSetId, RequestOptions requestOptions, Context context) { + return service.uploadMultiDimRcaData(this.getEndpoint(), dataSetId, requestOptions, context); + } + + /** + * Upload data to multidimensional root cause analysis data set. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             partitionIdentity: String
+     *             timestamp: String
+     *             data: [
+     *                 [
+     *                     Object
+     *                 ]
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response uploadMultiDimRcaDataWithResponse(String dataSetId, RequestOptions requestOptions) { + return uploadMultiDimRcaDataWithResponseAsync(dataSetId, requestOptions).block(); + } + + /** + * Delete a multidimensional root cause analysis data. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startDateTimeStringNoStart time of data to be deleted
endDateTimeStringNoEnd time of data to be deleted
partitionIdentityStringNoPartition identity of the data to be deleted
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteMultiDimRcaDataWithResponseAsync( + String dataSetId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> service.deleteMultiDimRcaData(this.getEndpoint(), dataSetId, requestOptions, context)); + } + + /** + * Delete a multidimensional root cause analysis data. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startDateTimeStringNoStart time of data to be deleted
endDateTimeStringNoEnd time of data to be deleted
partitionIdentityStringNoPartition identity of the data to be deleted
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteMultiDimRcaDataWithResponseAsync( + String dataSetId, RequestOptions requestOptions, Context context) { + return service.deleteMultiDimRcaData(this.getEndpoint(), dataSetId, requestOptions, context); + } + + /** + * Delete a multidimensional root cause analysis data. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startDateTimeStringNoStart time of data to be deleted
endDateTimeStringNoEnd time of data to be deleted
partitionIdentityStringNoPartition identity of the data to be deleted
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteMultiDimRcaDataWithResponse(String dataSetId, RequestOptions requestOptions) { + return deleteMultiDimRcaDataWithResponseAsync(dataSetId, requestOptions).block(); + } + + /** + * List multidimensional root cause analysis data in a specified data set. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startDateTimeStringNoStart time of data
endDateTimeStringNoEnd time of data
partitionIdentityStringNoPartition identity of data
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             partitionIdentity: String
+     *             dataSize: int
+     *             timestamp: String
+     *             createdDateTime: String
+     *             lastUploadedDateTime: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listMultiDimRcaDataSinglePageAsync( + String dataSetId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> service.listMultiDimRcaData(this.getEndpoint(), dataSetId, requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "@nextLink"), + null)); + } + + /** + * List multidimensional root cause analysis data in a specified data set. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startDateTimeStringNoStart time of data
endDateTimeStringNoEnd time of data
partitionIdentityStringNoPartition identity of data
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             partitionIdentity: String
+     *             dataSize: int
+     *             timestamp: String
+     *             createdDateTime: String
+     *             lastUploadedDateTime: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listMultiDimRcaDataSinglePageAsync( + String dataSetId, RequestOptions requestOptions, Context context) { + return service.listMultiDimRcaData(this.getEndpoint(), dataSetId, requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "@nextLink"), + null)); + } + + /** + * List multidimensional root cause analysis data in a specified data set. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startDateTimeStringNoStart time of data
endDateTimeStringNoEnd time of data
partitionIdentityStringNoPartition identity of data
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             partitionIdentity: String
+     *             dataSize: int
+     *             timestamp: String
+     *             createdDateTime: String
+     *             lastUploadedDateTime: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMultiDimRcaDataAsync(String dataSetId, RequestOptions requestOptions) { + return new PagedFlux<>( + () -> listMultiDimRcaDataSinglePageAsync(dataSetId, requestOptions), + nextLink -> listMultiDimRcaDataNextSinglePageAsync(nextLink, null)); + } + + /** + * List multidimensional root cause analysis data in a specified data set. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startDateTimeStringNoStart time of data
endDateTimeStringNoEnd time of data
partitionIdentityStringNoPartition identity of data
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             partitionIdentity: String
+     *             dataSize: int
+     *             timestamp: String
+     *             createdDateTime: String
+     *             lastUploadedDateTime: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMultiDimRcaDataAsync( + String dataSetId, RequestOptions requestOptions, Context context) { + return new PagedFlux<>( + () -> listMultiDimRcaDataSinglePageAsync(dataSetId, requestOptions, context), + nextLink -> listMultiDimRcaDataNextSinglePageAsync(nextLink, null, context)); + } + + /** + * List multidimensional root cause analysis data in a specified data set. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startDateTimeStringNoStart time of data
endDateTimeStringNoEnd time of data
partitionIdentityStringNoPartition identity of data
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             partitionIdentity: String
+     *             dataSize: int
+     *             timestamp: String
+     *             createdDateTime: String
+     *             lastUploadedDateTime: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param dataSetId The multidimensional root cause analysis data set unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMultiDimRcaData(String dataSetId, RequestOptions requestOptions) { + return new PagedIterable<>(listMultiDimRcaDataAsync(dataSetId, requestOptions)); + } + + /** + * Create an instance for multidimensional RCA. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String
+     *     targetMeasure: {
+     *         dataSetId: String
+     *         measureName: String
+     *     }
+     *     dataSets: [
+     *         {
+     *             dataSetId: String
+     *             measureNames: [
+     *                 String
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createMultiDimRcaInstanceWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> service.createMultiDimRcaInstance(this.getEndpoint(), requestOptions, context)); + } + + /** + * Create an instance for multidimensional RCA. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String
+     *     targetMeasure: {
+     *         dataSetId: String
+     *         measureName: String
+     *     }
+     *     dataSets: [
+     *         {
+     *             dataSetId: String
+     *             measureNames: [
+     *                 String
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createMultiDimRcaInstanceWithResponseAsync( + RequestOptions requestOptions, Context context) { + return service.createMultiDimRcaInstance(this.getEndpoint(), requestOptions, context); + } + + /** + * Create an instance for multidimensional RCA. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String
+     *     targetMeasure: {
+     *         dataSetId: String
+     *         measureName: String
+     *     }
+     *     dataSets: [
+     *         {
+     *             dataSetId: String
+     *             measureNames: [
+     *                 String
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createMultiDimRcaInstanceWithResponse(RequestOptions requestOptions) { + return createMultiDimRcaInstanceWithResponseAsync(requestOptions).block(); + } + + /** + * Get instance list for multidimensional RCA. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoFilter instance by name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             instanceId: String
+     *             name: String
+     *             targetMeasure: {
+     *                 dataSetId: String
+     *                 measureName: String
+     *             }
+     *             dataSets: [
+     *                 {
+     *                     dataSetId: String
+     *                     measureNames: [
+     *                         String
+     *                     ]
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return instance list for multidimensional RCA. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listMultiDimRcaInstanceSinglePageAsync(RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> service.listMultiDimRcaInstance(this.getEndpoint(), requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "@nextLink"), + null)); + } + + /** + * Get instance list for multidimensional RCA. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoFilter instance by name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             instanceId: String
+     *             name: String
+     *             targetMeasure: {
+     *                 dataSetId: String
+     *                 measureName: String
+     *             }
+     *             dataSets: [
+     *                 {
+     *                     dataSetId: String
+     *                     measureNames: [
+     *                         String
+     *                     ]
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return instance list for multidimensional RCA. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listMultiDimRcaInstanceSinglePageAsync( + RequestOptions requestOptions, Context context) { + return service.listMultiDimRcaInstance(this.getEndpoint(), requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "@nextLink"), + null)); + } + + /** + * Get instance list for multidimensional RCA. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoFilter instance by name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             instanceId: String
+     *             name: String
+     *             targetMeasure: {
+     *                 dataSetId: String
+     *                 measureName: String
+     *             }
+     *             dataSets: [
+     *                 {
+     *                     dataSetId: String
+     *                     measureNames: [
+     *                         String
+     *                     ]
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return instance list for multidimensional RCA. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMultiDimRcaInstanceAsync(RequestOptions requestOptions) { + return new PagedFlux<>( + () -> listMultiDimRcaInstanceSinglePageAsync(requestOptions), + nextLink -> listMultiDimRcaInstanceNextSinglePageAsync(nextLink, null)); + } + + /** + * Get instance list for multidimensional RCA. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoFilter instance by name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             instanceId: String
+     *             name: String
+     *             targetMeasure: {
+     *                 dataSetId: String
+     *                 measureName: String
+     *             }
+     *             dataSets: [
+     *                 {
+     *                     dataSetId: String
+     *                     measureNames: [
+     *                         String
+     *                     ]
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return instance list for multidimensional RCA. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMultiDimRcaInstanceAsync(RequestOptions requestOptions, Context context) { + return new PagedFlux<>( + () -> listMultiDimRcaInstanceSinglePageAsync(requestOptions, context), + nextLink -> listMultiDimRcaInstanceNextSinglePageAsync(nextLink, null, context)); + } + + /** + * Get instance list for multidimensional RCA. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoFilter instance by name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             instanceId: String
+     *             name: String
+     *             targetMeasure: {
+     *                 dataSetId: String
+     *                 measureName: String
+     *             }
+     *             dataSets: [
+     *                 {
+     *                     dataSetId: String
+     *                     measureNames: [
+     *                         String
+     *                     ]
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return instance list for multidimensional RCA. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMultiDimRcaInstance(RequestOptions requestOptions) { + return new PagedIterable<>(listMultiDimRcaInstanceAsync(requestOptions)); + } + + /** + * Query an instance information for multidimensional RCA. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     instanceId: String
+     *     name: String
+     *     targetMeasure: {
+     *         dataSetId: String
+     *         measureName: String
+     *     }
+     *     dataSets: [
+     *         {
+     *             dataSetId: String
+     *             measureNames: [
+     *                 String
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMultiDimRcaInstanceWithResponseAsync( + String instanceId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> service.getMultiDimRcaInstance(this.getEndpoint(), instanceId, requestOptions, context)); + } + + /** + * Query an instance information for multidimensional RCA. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     instanceId: String
+     *     name: String
+     *     targetMeasure: {
+     *         dataSetId: String
+     *         measureName: String
+     *     }
+     *     dataSets: [
+     *         {
+     *             dataSetId: String
+     *             measureNames: [
+     *                 String
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMultiDimRcaInstanceWithResponseAsync( + String instanceId, RequestOptions requestOptions, Context context) { + return service.getMultiDimRcaInstance(this.getEndpoint(), instanceId, requestOptions, context); + } + + /** + * Query an instance information for multidimensional RCA. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     instanceId: String
+     *     name: String
+     *     targetMeasure: {
+     *         dataSetId: String
+     *         measureName: String
+     *     }
+     *     dataSets: [
+     *         {
+     *             dataSetId: String
+     *             measureNames: [
+     *                 String
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMultiDimRcaInstanceWithResponse(String instanceId, RequestOptions requestOptions) { + return getMultiDimRcaInstanceWithResponseAsync(instanceId, requestOptions).block(); + } + + /** + * Delete an instance for multidimensional RCA. + * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteMultiDimRcaInstanceWithResponseAsync( + String instanceId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> service.deleteMultiDimRcaInstance(this.getEndpoint(), instanceId, requestOptions, context)); + } + + /** + * Delete an instance for multidimensional RCA. + * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteMultiDimRcaInstanceWithResponseAsync( + String instanceId, RequestOptions requestOptions, Context context) { + return service.deleteMultiDimRcaInstance(this.getEndpoint(), instanceId, requestOptions, context); + } + + /** + * Delete an instance for multidimensional RCA. + * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteMultiDimRcaInstanceWithResponse(String instanceId, RequestOptions requestOptions) { + return deleteMultiDimRcaInstanceWithResponseAsync(instanceId, requestOptions).block(); + } + + /** + * Trigger a model training task for multidimensional RCA. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String
+     *     parameter: {
+     *         startDateTime: String
+     *         endDateTime: String
+     *     }
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createMultiDimRcaTrainingTaskWithResponseAsync( + String instanceId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.createMultiDimRcaTrainingTask(this.getEndpoint(), instanceId, requestOptions, context)); + } + + /** + * Trigger a model training task for multidimensional RCA. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String
+     *     parameter: {
+     *         startDateTime: String
+     *         endDateTime: String
+     *     }
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createMultiDimRcaTrainingTaskWithResponseAsync( + String instanceId, RequestOptions requestOptions, Context context) { + return service.createMultiDimRcaTrainingTask(this.getEndpoint(), instanceId, requestOptions, context); + } + + /** + * Trigger a model training task for multidimensional RCA. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     name: String
+     *     parameter: {
+     *         startDateTime: String
+     *         endDateTime: String
+     *     }
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createMultiDimRcaTrainingTaskWithResponse(String instanceId, RequestOptions requestOptions) { + return createMultiDimRcaTrainingTaskWithResponseAsync(instanceId, requestOptions).block(); + } + + /** + * Query training task state list for multidimensional RCA. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoFilter model by name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             taskId: String
+     *             instanceId: String
+     *             modelId: String
+     *             name: String
+     *             status: String(scheduled/running/succeeded/failed/canceled)
+     *             createdDateTime: String
+     *             lastModifiedDateTime: String
+     *             parameter: {
+     *                 startDateTime: String
+     *                 endDateTime: String
+     *             }
+     *             error: {
+     *                 message: String
+     *                 code: String
+     *             }
+     *             taskInfo: {
+     *                 epochs: [
+     *                     int
+     *                 ]
+     *                 trainLoss: [
+     *                     double
+     *                 ]
+     *                 validationLoss: [
+     *                     double
+     *                 ]
+     *                 latencyInSecond: [
+     *                     double
+     *                 ]
+     *                 bestEpoch: int
+     *                 bestValidationLoss: double
+     *                 dataSize: [
+     *                     int
+     *                 ]
+     *                 edgeSize: int
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listMultiDimRcaTrainingStatesSinglePageAsync( + String instanceId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.listMultiDimRcaTrainingStates( + this.getEndpoint(), instanceId, requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "@nextLink"), + null)); + } + + /** + * Query training task state list for multidimensional RCA. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoFilter model by name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             taskId: String
+     *             instanceId: String
+     *             modelId: String
+     *             name: String
+     *             status: String(scheduled/running/succeeded/failed/canceled)
+     *             createdDateTime: String
+     *             lastModifiedDateTime: String
+     *             parameter: {
+     *                 startDateTime: String
+     *                 endDateTime: String
+     *             }
+     *             error: {
+     *                 message: String
+     *                 code: String
+     *             }
+     *             taskInfo: {
+     *                 epochs: [
+     *                     int
+     *                 ]
+     *                 trainLoss: [
+     *                     double
+     *                 ]
+     *                 validationLoss: [
+     *                     double
+     *                 ]
+     *                 latencyInSecond: [
+     *                     double
+     *                 ]
+     *                 bestEpoch: int
+     *                 bestValidationLoss: double
+     *                 dataSize: [
+     *                     int
+     *                 ]
+     *                 edgeSize: int
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listMultiDimRcaTrainingStatesSinglePageAsync( + String instanceId, RequestOptions requestOptions, Context context) { + return service.listMultiDimRcaTrainingStates(this.getEndpoint(), instanceId, requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "@nextLink"), + null)); + } + + /** + * Query training task state list for multidimensional RCA. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoFilter model by name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             taskId: String
+     *             instanceId: String
+     *             modelId: String
+     *             name: String
+     *             status: String(scheduled/running/succeeded/failed/canceled)
+     *             createdDateTime: String
+     *             lastModifiedDateTime: String
+     *             parameter: {
+     *                 startDateTime: String
+     *                 endDateTime: String
+     *             }
+     *             error: {
+     *                 message: String
+     *                 code: String
+     *             }
+     *             taskInfo: {
+     *                 epochs: [
+     *                     int
+     *                 ]
+     *                 trainLoss: [
+     *                     double
+     *                 ]
+     *                 validationLoss: [
+     *                     double
+     *                 ]
+     *                 latencyInSecond: [
+     *                     double
+     *                 ]
+     *                 bestEpoch: int
+     *                 bestValidationLoss: double
+     *                 dataSize: [
+     *                     int
+     *                 ]
+     *                 edgeSize: int
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMultiDimRcaTrainingStatesAsync(String instanceId, RequestOptions requestOptions) { + return new PagedFlux<>( + () -> listMultiDimRcaTrainingStatesSinglePageAsync(instanceId, requestOptions), + nextLink -> listMultiDimRcaTrainingStatesNextSinglePageAsync(nextLink, null)); + } + + /** + * Query training task state list for multidimensional RCA. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoFilter model by name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             taskId: String
+     *             instanceId: String
+     *             modelId: String
+     *             name: String
+     *             status: String(scheduled/running/succeeded/failed/canceled)
+     *             createdDateTime: String
+     *             lastModifiedDateTime: String
+     *             parameter: {
+     *                 startDateTime: String
+     *                 endDateTime: String
+     *             }
+     *             error: {
+     *                 message: String
+     *                 code: String
+     *             }
+     *             taskInfo: {
+     *                 epochs: [
+     *                     int
+     *                 ]
+     *                 trainLoss: [
+     *                     double
+     *                 ]
+     *                 validationLoss: [
+     *                     double
+     *                 ]
+     *                 latencyInSecond: [
+     *                     double
+     *                 ]
+     *                 bestEpoch: int
+     *                 bestValidationLoss: double
+     *                 dataSize: [
+     *                     int
+     *                 ]
+     *                 edgeSize: int
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMultiDimRcaTrainingStatesAsync( + String instanceId, RequestOptions requestOptions, Context context) { + return new PagedFlux<>( + () -> listMultiDimRcaTrainingStatesSinglePageAsync(instanceId, requestOptions, context), + nextLink -> listMultiDimRcaTrainingStatesNextSinglePageAsync(nextLink, null, context)); + } + + /** + * Query training task state list for multidimensional RCA. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoFilter model by name
skipStringNoFor paging, skipped number
maxpagesizeStringNoThe maximum number of items in one page
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             taskId: String
+     *             instanceId: String
+     *             modelId: String
+     *             name: String
+     *             status: String(scheduled/running/succeeded/failed/canceled)
+     *             createdDateTime: String
+     *             lastModifiedDateTime: String
+     *             parameter: {
+     *                 startDateTime: String
+     *                 endDateTime: String
+     *             }
+     *             error: {
+     *                 message: String
+     *                 code: String
+     *             }
+     *             taskInfo: {
+     *                 epochs: [
+     *                     int
+     *                 ]
+     *                 trainLoss: [
+     *                     double
+     *                 ]
+     *                 validationLoss: [
+     *                     double
+     *                 ]
+     *                 latencyInSecond: [
+     *                     double
+     *                 ]
+     *                 bestEpoch: int
+     *                 bestValidationLoss: double
+     *                 dataSize: [
+     *                     int
+     *                 ]
+     *                 edgeSize: int
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMultiDimRcaTrainingStates(String instanceId, RequestOptions requestOptions) { + return new PagedIterable<>(listMultiDimRcaTrainingStatesAsync(instanceId, requestOptions)); + } + + /** + * Delete a model for multidimensional RCA. + * + * @param instanceId Instance unique id. + * @param modelId Model unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteMultiDimRcaModelWithResponseAsync( + String instanceId, String modelId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.deleteMultiDimRcaModel( + this.getEndpoint(), instanceId, modelId, requestOptions, context)); + } + + /** + * Delete a model for multidimensional RCA. + * + * @param instanceId Instance unique id. + * @param modelId Model unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteMultiDimRcaModelWithResponseAsync( + String instanceId, String modelId, RequestOptions requestOptions, Context context) { + return service.deleteMultiDimRcaModel(this.getEndpoint(), instanceId, modelId, requestOptions, context); + } + + /** + * Delete a model for multidimensional RCA. + * + * @param instanceId Instance unique id. + * @param modelId Model unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteMultiDimRcaModelWithResponse( + String instanceId, String modelId, RequestOptions requestOptions) { + return deleteMultiDimRcaModelWithResponseAsync(instanceId, modelId, requestOptions).block(); + } + + /** + * Query an training task state for multidimensional RCA. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     taskId: String
+     *     instanceId: String
+     *     modelId: String
+     *     name: String
+     *     status: String(scheduled/running/succeeded/failed/canceled)
+     *     createdDateTime: String
+     *     lastModifiedDateTime: String
+     *     parameter: {
+     *         startDateTime: String
+     *         endDateTime: String
+     *     }
+     *     error: {
+     *         message: String
+     *         code: String
+     *     }
+     *     taskInfo: {
+     *         epochs: [
+     *             int
+     *         ]
+     *         trainLoss: [
+     *             double
+     *         ]
+     *         validationLoss: [
+     *             double
+     *         ]
+     *         latencyInSecond: [
+     *             double
+     *         ]
+     *         bestEpoch: int
+     *         bestValidationLoss: double
+     *         dataSize: [
+     *             int
+     *         ]
+     *         edgeSize: int
+     *     }
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param modelId Model unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMultiDimRcaTrainingStateWithResponseAsync( + String instanceId, String modelId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.getMultiDimRcaTrainingState( + this.getEndpoint(), instanceId, modelId, requestOptions, context)); + } + + /** + * Query an training task state for multidimensional RCA. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     taskId: String
+     *     instanceId: String
+     *     modelId: String
+     *     name: String
+     *     status: String(scheduled/running/succeeded/failed/canceled)
+     *     createdDateTime: String
+     *     lastModifiedDateTime: String
+     *     parameter: {
+     *         startDateTime: String
+     *         endDateTime: String
+     *     }
+     *     error: {
+     *         message: String
+     *         code: String
+     *     }
+     *     taskInfo: {
+     *         epochs: [
+     *             int
+     *         ]
+     *         trainLoss: [
+     *             double
+     *         ]
+     *         validationLoss: [
+     *             double
+     *         ]
+     *         latencyInSecond: [
+     *             double
+     *         ]
+     *         bestEpoch: int
+     *         bestValidationLoss: double
+     *         dataSize: [
+     *             int
+     *         ]
+     *         edgeSize: int
+     *     }
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param modelId Model unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMultiDimRcaTrainingStateWithResponseAsync( + String instanceId, String modelId, RequestOptions requestOptions, Context context) { + return service.getMultiDimRcaTrainingState(this.getEndpoint(), instanceId, modelId, requestOptions, context); + } + + /** + * Query an training task state for multidimensional RCA. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     taskId: String
+     *     instanceId: String
+     *     modelId: String
+     *     name: String
+     *     status: String(scheduled/running/succeeded/failed/canceled)
+     *     createdDateTime: String
+     *     lastModifiedDateTime: String
+     *     parameter: {
+     *         startDateTime: String
+     *         endDateTime: String
+     *     }
+     *     error: {
+     *         message: String
+     *         code: String
+     *     }
+     *     taskInfo: {
+     *         epochs: [
+     *             int
+     *         ]
+     *         trainLoss: [
+     *             double
+     *         ]
+     *         validationLoss: [
+     *             double
+     *         ]
+     *         latencyInSecond: [
+     *             double
+     *         ]
+     *         bestEpoch: int
+     *         bestValidationLoss: double
+     *         dataSize: [
+     *             int
+     *         ]
+     *         edgeSize: int
+     *     }
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param modelId Model unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMultiDimRcaTrainingStateWithResponse( + String instanceId, String modelId, RequestOptions requestOptions) { + return getMultiDimRcaTrainingStateWithResponseAsync(instanceId, modelId, requestOptions).block(); + } + + /** + * Trigger an inference task for multidimensional RCA. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     parameter: {
+     *         timestamp: String
+     *         dimensionScope: {
+     *             String: String
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param modelId Model unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createMultiDimRcaInferenceTaskWithResponseAsync( + String instanceId, String modelId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.createMultiDimRcaInferenceTask( + this.getEndpoint(), instanceId, modelId, requestOptions, context)); + } + + /** + * Trigger an inference task for multidimensional RCA. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     parameter: {
+     *         timestamp: String
+     *         dimensionScope: {
+     *             String: String
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param modelId Model unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createMultiDimRcaInferenceTaskWithResponseAsync( + String instanceId, String modelId, RequestOptions requestOptions, Context context) { + return service.createMultiDimRcaInferenceTask(this.getEndpoint(), instanceId, modelId, requestOptions, context); + } + + /** + * Trigger an inference task for multidimensional RCA. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     parameter: {
+     *         timestamp: String
+     *         dimensionScope: {
+     *             String: String
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param modelId Model unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createMultiDimRcaInferenceTaskWithResponse( + String instanceId, String modelId, RequestOptions requestOptions) { + return createMultiDimRcaInferenceTaskWithResponseAsync(instanceId, modelId, requestOptions).block(); + } + + /** + * Query an inference task state for multidimensional RCA. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     inferenceId: String
+     *     instanceId: String
+     *     modelId: String
+     *     status: String(scheduled/running/succeeded/failed/canceled)
+     *     createdDateTime: String
+     *     lastModifiedDateTime: String
+     *     parameter: {
+     *         timestamp: String
+     *         dimensionScope: {
+     *             String: String
+     *         }
+     *     }
+     *     result: {
+     *         rootCauses: [
+     *             {
+     *                 dimension: {
+     *                     String: String
+     *                 }
+     *                 score: double
+     *                 measures: [
+     *                     {
+     *                         dataSetId: String
+     *                         name: String
+     *                         trendType: String(rise/drop)
+     *                         contributionScore: double
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *     }
+     *     error: {
+     *         message: String
+     *         code: String
+     *     }
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param modelId Model unique id. + * @param inferenceId Inference unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMultiDimRcaInferenceStateWithResponseAsync( + String instanceId, String modelId, String inferenceId, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.getMultiDimRcaInferenceState( + this.getEndpoint(), instanceId, modelId, inferenceId, requestOptions, context)); + } + + /** + * Query an inference task state for multidimensional RCA. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     inferenceId: String
+     *     instanceId: String
+     *     modelId: String
+     *     status: String(scheduled/running/succeeded/failed/canceled)
+     *     createdDateTime: String
+     *     lastModifiedDateTime: String
+     *     parameter: {
+     *         timestamp: String
+     *         dimensionScope: {
+     *             String: String
+     *         }
+     *     }
+     *     result: {
+     *         rootCauses: [
+     *             {
+     *                 dimension: {
+     *                     String: String
+     *                 }
+     *                 score: double
+     *                 measures: [
+     *                     {
+     *                         dataSetId: String
+     *                         name: String
+     *                         trendType: String(rise/drop)
+     *                         contributionScore: double
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *     }
+     *     error: {
+     *         message: String
+     *         code: String
+     *     }
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param modelId Model unique id. + * @param inferenceId Inference unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMultiDimRcaInferenceStateWithResponseAsync( + String instanceId, String modelId, String inferenceId, RequestOptions requestOptions, Context context) { + return service.getMultiDimRcaInferenceState( + this.getEndpoint(), instanceId, modelId, inferenceId, requestOptions, context); + } + + /** + * Query an inference task state for multidimensional RCA. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     inferenceId: String
+     *     instanceId: String
+     *     modelId: String
+     *     status: String(scheduled/running/succeeded/failed/canceled)
+     *     createdDateTime: String
+     *     lastModifiedDateTime: String
+     *     parameter: {
+     *         timestamp: String
+     *         dimensionScope: {
+     *             String: String
+     *         }
+     *     }
+     *     result: {
+     *         rootCauses: [
+     *             {
+     *                 dimension: {
+     *                     String: String
+     *                 }
+     *                 score: double
+     *                 measures: [
+     *                     {
+     *                         dataSetId: String
+     *                         name: String
+     *                         trendType: String(rise/drop)
+     *                         contributionScore: double
+     *                     }
+     *                 ]
+     *             }
+     *         ]
+     *     }
+     *     error: {
+     *         message: String
+     *         code: String
+     *     }
+     * }
+     * }
+ * + * @param instanceId Instance unique id. + * @param modelId Model unique id. + * @param inferenceId Inference unique id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMultiDimRcaInferenceStateWithResponse( + String instanceId, String modelId, String inferenceId, RequestOptions requestOptions) { + return getMultiDimRcaInferenceStateWithResponseAsync(instanceId, modelId, inferenceId, requestOptions).block(); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             dataSetId: String
+     *             name: String
+     *             granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none)
+     *             customInterval: int
+     *             dimensionKeys: [
+     *                 String
+     *             ]
+     *             aggregateValue: String
+     *             measures: [
+     *                 {
+     *                     name: String
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listMultiDimRcaDataSetNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.listMultiDimRcaDataSetNext( + nextLink, this.getEndpoint(), requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "@nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             dataSetId: String
+     *             name: String
+     *             granularity: String(yearly/monthly/weekly/daily/hourly/minutely/secondly/microsecond/none)
+     *             customInterval: int
+     *             dimensionKeys: [
+     *                 String
+     *             ]
+     *             aggregateValue: String
+     *             measures: [
+     *                 {
+     *                     name: String
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listMultiDimRcaDataSetNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + return service.listMultiDimRcaDataSetNext(nextLink, this.getEndpoint(), requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "@nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             partitionIdentity: String
+     *             dataSize: int
+     *             timestamp: String
+     *             createdDateTime: String
+     *             lastUploadedDateTime: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listMultiDimRcaDataNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.listMultiDimRcaDataNext(nextLink, this.getEndpoint(), requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "@nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             partitionIdentity: String
+     *             dataSize: int
+     *             timestamp: String
+     *             createdDateTime: String
+     *             lastUploadedDateTime: String
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listMultiDimRcaDataNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + return service.listMultiDimRcaDataNext(nextLink, this.getEndpoint(), requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "@nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             instanceId: String
+     *             name: String
+     *             targetMeasure: {
+     *                 dataSetId: String
+     *                 measureName: String
+     *             }
+     *             dataSets: [
+     *                 {
+     *                     dataSetId: String
+     *                     measureNames: [
+     *                         String
+     *                     ]
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listMultiDimRcaInstanceNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.listMultiDimRcaInstanceNext( + nextLink, this.getEndpoint(), requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "@nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             instanceId: String
+     *             name: String
+     *             targetMeasure: {
+     *                 dataSetId: String
+     *                 measureName: String
+     *             }
+     *             dataSets: [
+     *                 {
+     *                     dataSetId: String
+     *                     measureNames: [
+     *                         String
+     *                     ]
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listMultiDimRcaInstanceNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + return service.listMultiDimRcaInstanceNext(nextLink, this.getEndpoint(), requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "@nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             taskId: String
+     *             instanceId: String
+     *             modelId: String
+     *             name: String
+     *             status: String(scheduled/running/succeeded/failed/canceled)
+     *             createdDateTime: String
+     *             lastModifiedDateTime: String
+     *             parameter: {
+     *                 startDateTime: String
+     *                 endDateTime: String
+     *             }
+     *             error: {
+     *                 message: String
+     *                 code: String
+     *             }
+     *             taskInfo: {
+     *                 epochs: [
+     *                     int
+     *                 ]
+     *                 trainLoss: [
+     *                     double
+     *                 ]
+     *                 validationLoss: [
+     *                     double
+     *                 ]
+     *                 latencyInSecond: [
+     *                     double
+     *                 ]
+     *                 bestEpoch: int
+     *                 bestValidationLoss: double
+     *                 dataSize: [
+     *                     int
+     *                 ]
+     *                 edgeSize: int
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listMultiDimRcaTrainingStatesNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.listMultiDimRcaTrainingStatesNext( + nextLink, this.getEndpoint(), requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "@nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     nextLink: String
+     *     value: [
+     *         {
+     *             taskId: String
+     *             instanceId: String
+     *             modelId: String
+     *             name: String
+     *             status: String(scheduled/running/succeeded/failed/canceled)
+     *             createdDateTime: String
+     *             lastModifiedDateTime: String
+     *             parameter: {
+     *                 startDateTime: String
+     *                 endDateTime: String
+     *             }
+     *             error: {
+     *                 message: String
+     *                 code: String
+     *             }
+     *             taskInfo: {
+     *                 epochs: [
+     *                     int
+     *                 ]
+     *                 trainLoss: [
+     *                     double
+     *                 ]
+     *                 validationLoss: [
+     *                     double
+     *                 ]
+     *                 latencyInSecond: [
+     *                     double
+     *                 ]
+     *                 bestEpoch: int
+     *                 bestValidationLoss: double
+     *                 dataSize: [
+     *                     int
+     *                 ]
+     *                 edgeSize: int
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listMultiDimRcaTrainingStatesNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + return service.listMultiDimRcaTrainingStatesNext(nextLink, this.getEndpoint(), requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "@nextLink"), + null)); + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } +} diff --git a/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/package-info.java b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/package-info.java new file mode 100644 index 000000000000..b2c029874a18 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/package-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for AnomalyDetectorClient. The Anomaly Detector API detects anomalies automatically in + * time series data. It supports two kinds of mode, one is for stateless using, another is for stateful using. In + * stateless mode, there are three functionalities. Entire Detect is for detecting the whole series with model trained + * by the time series, Last Detect is detecting last point with model trained by points before. ChangePoint Detect is + * for detecting trend changes in time series. In stateful mode, user can store time series, the stored time series will + * be used for detection anomalies. Under this mode, user can still use the above three functionalities by only giving a + * time range without preparing time series in client side. Besides the above three functionalities, stateful model also + * provide group based detection and labeling service. By leveraging labeling service user can provide labels for each + * detection result, these labels will be used for retuning or regenerating detection models. Inconsistency detection is + * a kind of group based detection, this detection will find inconsistency ones in a set of time series. By using + * anomaly detector service, business customers can discover incidents and establish a logic flow for root cause + * analysis. + */ +package com.azure.cognitiveservices.multidimensionalrootcauseanalysis; diff --git a/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/module-info.java b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/module-info.java new file mode 100644 index 000000000000..e693d14aeed0 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/main/java/module-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.cognitiveservices.multidimensionalrootcauseanalysis { + requires transitive com.azure.core; + + exports com.azure.cognitiveservices.multidimensionalrootcauseanalysis; +} diff --git a/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/samples/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/ReadmeSamples.java b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/samples/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/ReadmeSamples.java new file mode 100644 index 000000000000..94efef84263e --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/samples/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/ReadmeSamples.java @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.cognitiveservices.multidimensionalrootcauseanalysis; + +public final class ReadmeSamples { + public void readmeSamples() { + // BEGIN: com.azure.cognitiveservices.multidimensionalrootcauseanalysis.readme + // END: com.azure.cognitiveservices.multidimensionalrootcauseanalysis.readme + } +} diff --git a/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/test/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/ClientTests.java b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/test/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/ClientTests.java new file mode 100644 index 000000000000..8dd59d43c238 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/src/test/java/com/azure/cognitiveservices/multidimensionalrootcauseanalysis/ClientTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.cognitiveservices.multidimensionalrootcauseanalysis; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestBase; +import com.azure.core.test.TestMode; +import com.azure.core.test.annotation.DoNotRecord; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ClientTests extends TestBase { + private AnomalyDetectorClientBuilder builder; + + @BeforeEach + public void setup() { + builder = + new AnomalyDetectorClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)); + if (getTestMode() == TestMode.PLAYBACK) { + builder.httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + builder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + builder.credential(new DefaultAzureCredentialBuilder().build()); + } + } + + @Test + @DoNotRecord(skipInPlayback = true) + public void testClient() { + // use the builder to create client + } +} diff --git a/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/swagger/README_SPEC.md b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/swagger/README_SPEC.md new file mode 100644 index 000000000000..68fd2da2222d --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-MultidimensionalRootCauseAnalysis/swagger/README_SPEC.md @@ -0,0 +1,25 @@ +## Generate autorest code + +```yaml +input-file: + - /home/vsts/work/1/s/azure-rest-api-specs/specification/cognitiveservices/data-plane/AnomalyDetector/preview/v2.0-preview/MultidimensionalRootCauseAnalysis.json +java: true +output-folder: ../ +partial-update: true +regenerate-pom: false +generate-sync-async-clients: true +generate-client-as-impl: true +generate-client-interfaces: false +add-context-parameter: true +low-level-client: true +sync-methods: all +generate-samples: true +license-header: MICROSOFT_MIT_SMALL +namespace: com.azure.cognitiveservices.MultidimensionalRootCauseAnalysis +context-client-method-parameter: true +azure-arm: false +credential-types: tokencredential +credential-scopes: https://cognitiveservices.azure.com/.default +service-versions: + - '2.0-preview' +```