public final class MetricsAdvisorAdministrationAsyncClient extends Object
Instantiating a asynchronous Metrics Advisor Administration Client
MetricsAdvisorAdministrationAsyncClient
metricsAdvisorAdminAsyncClient = newMetricsAdvisorAdministrationClientBuilder
() .credential(newMetricsAdvisorKeyCredential
("{subscription_key}", "{api_key}")) .endpoint("{endpoint}") .buildAsyncClient();
Modifier and Type | Method and Description |
---|---|
Mono<AnomalyAlertConfiguration> |
createAnomalyAlertConfig(AnomalyAlertConfiguration alertConfiguration)
Create a configuration to trigger alert when anomalies are detected.
|
Mono<com.azure.core.http.rest.Response<AnomalyAlertConfiguration>> |
createAnomalyAlertConfigWithResponse(AnomalyAlertConfiguration alertConfiguration)
Create a configuration to trigger alert when anomalies are detected.
|
Mono<DataFeed> |
createDataFeed(DataFeed dataFeed)
Create a new data feed.
|
Mono<com.azure.core.http.rest.Response<DataFeed>> |
createDataFeedWithResponse(DataFeed dataFeed)
Create a new data feed with REST response.
|
Mono<DatasourceCredentialEntity> |
createDatasourceCredential(DatasourceCredentialEntity datasourceCredential)
Create a data source credential entity.
|
Mono<com.azure.core.http.rest.Response<DatasourceCredentialEntity>> |
createDatasourceCredentialWithResponse(DatasourceCredentialEntity datasourceCredential)
Create a data source credential entity with REST response.
|
Mono<NotificationHook> |
createHook(NotificationHook notificationHook)
Creates a notificationHook that receives anomaly incident alerts.
|
Mono<com.azure.core.http.rest.Response<NotificationHook>> |
createHookWithResponse(NotificationHook notificationHook)
Creates a notificationHook that receives anomaly incident alerts.
|
Mono<AnomalyDetectionConfiguration> |
createMetricAnomalyDetectionConfig(String metricId,
AnomalyDetectionConfiguration detectionConfiguration)
Create a configuration to detect anomalies in the time series of a metric.
|
Mono<com.azure.core.http.rest.Response<AnomalyDetectionConfiguration>> |
createMetricAnomalyDetectionConfigWithResponse(String metricId,
AnomalyDetectionConfiguration detectionConfiguration)
Create a configuration to detect anomalies in the time series of a metric.
|
Mono<Void> |
deleteAnomalyAlertConfig(String alertConfigurationId)
Deletes the anomaly alert configuration identified by
alertConfigurationId . |
Mono<com.azure.core.http.rest.Response<Void>> |
deleteAnomalyAlertConfigWithResponse(String alertConfigurationId)
Deletes the anomaly alert configuration identified by
alertConfigurationId . |
Mono<Void> |
deleteDataFeed(String dataFeedId)
Delete a data feed.
|
Mono<com.azure.core.http.rest.Response<Void>> |
deleteDataFeedWithResponse(String dataFeedId)
Delete a data feed with REST response.
|
Mono<Void> |
deleteDatasourceCredential(String credentialId)
Deletes the data source credential entity identified by
credentialId . |
Mono<com.azure.core.http.rest.Response<Void>> |
deleteDatasourceCredentialWithResponse(String credentialId)
Deletes the data source credential entity identified by
credentialId . |
Mono<Void> |
deleteHook(String hookId)
Delete a hook.
|
Mono<com.azure.core.http.rest.Response<Void>> |
deleteHookWithResponse(String hookId)
Delete a hook.
|
Mono<Void> |
deleteMetricAnomalyDetectionConfiguration(String detectionConfigurationId)
Delete a metric anomaly detection configuration.
|
Mono<com.azure.core.http.rest.Response<Void>> |
deleteMetricAnomalyDetectionConfigWithResponse(String detectionConfigurationId)
Delete a metric anomaly detection configuration.
|
Mono<AnomalyAlertConfiguration> |
getAnomalyAlertConfig(String alertConfigurationId)
Get the anomaly alert configuration identified by
alertConfigurationId . |
Mono<com.azure.core.http.rest.Response<AnomalyAlertConfiguration>> |
getAnomalyAlertConfigWithResponse(String alertConfigurationId)
Get the anomaly alert configuration identified by
alertConfigurationId . |
Mono<DataFeed> |
getDataFeed(String dataFeedId)
Get a data feed by its id.
|
Mono<DataFeedIngestionProgress> |
getDataFeedIngestionProgress(String dataFeedId)
Retrieve the ingestion progress of a data feed.
|
Mono<com.azure.core.http.rest.Response<DataFeedIngestionProgress>> |
getDataFeedIngestionProgressWithResponse(String dataFeedId)
Retrieve the ingestion progress of a data feed.
|
Mono<com.azure.core.http.rest.Response<DataFeed>> |
getDataFeedWithResponse(String dataFeedId)
Get a data feed by its id with REST response.
|
Mono<DatasourceCredentialEntity> |
getDatasourceCredential(String credentialId)
Get a data source credential entity by its id.
|
Mono<com.azure.core.http.rest.Response<DatasourceCredentialEntity>> |
getDatasourceCredentialWithResponse(String credentialId)
Get a data source credential entity by its id with REST response.
|
Mono<NotificationHook> |
getHook(String hookId)
Get a hook by its id.
|
Mono<com.azure.core.http.rest.Response<NotificationHook>> |
getHookWithResponse(String hookId)
Get a hook by its id.
|
Mono<AnomalyDetectionConfiguration> |
getMetricAnomalyDetectionConfig(String detectionConfigurationId)
Get the anomaly detection configuration by its id.
|
Mono<com.azure.core.http.rest.Response<AnomalyDetectionConfiguration>> |
getMetricAnomalyDetectionConfigWithResponse(String detectionConfigurationId)
Get the anomaly detection configuration by its id.
|
com.azure.core.http.rest.PagedFlux<AnomalyAlertConfiguration> |
listAnomalyAlertConfigs(String detectionConfigurationId,
ListAnomalyAlertConfigsOptions options)
Fetch the anomaly alert configurations associated with a detection configuration.
|
com.azure.core.http.rest.PagedFlux<DataFeedIngestionStatus> |
listDataFeedIngestionStatus(String dataFeedId,
ListDataFeedIngestionOptions options)
Fetch the ingestion status of a data feed.
|
com.azure.core.http.rest.PagedFlux<DataFeed> |
listDataFeeds()
List information of all data feeds on the metrics advisor account.
|
com.azure.core.http.rest.PagedFlux<DataFeed> |
listDataFeeds(ListDataFeedOptions options)
List information of all data feeds on the metrics advisor account.
|
com.azure.core.http.rest.PagedFlux<DatasourceCredentialEntity> |
listDatasourceCredentials()
List information of all data source credential entities on the metrics advisor account.
|
com.azure.core.http.rest.PagedFlux<DatasourceCredentialEntity> |
listDatasourceCredentials(ListCredentialEntityOptions options)
List information of all data source credential entities on the metrics advisor account.
|
com.azure.core.http.rest.PagedFlux<NotificationHook> |
listHooks()
List information of hooks on the metrics advisor account.
|
com.azure.core.http.rest.PagedFlux<NotificationHook> |
listHooks(ListHookOptions options)
List information of hooks.
|
com.azure.core.http.rest.PagedFlux<AnomalyDetectionConfiguration> |
listMetricAnomalyDetectionConfigs(String metricId)
Given a metric id, retrieve all anomaly detection configurations applied to it.
|
com.azure.core.http.rest.PagedFlux<AnomalyDetectionConfiguration> |
listMetricAnomalyDetectionConfigs(String metricId,
ListMetricAnomalyDetectionConfigsOptions options)
Given a metric id, retrieve all anomaly detection configurations applied to it.
|
Mono<Void> |
refreshDataFeedIngestion(String dataFeedId,
OffsetDateTime startTime,
OffsetDateTime endTime)
Refresh data ingestion for a period.
|
Mono<com.azure.core.http.rest.Response<Void>> |
refreshDataFeedIngestionWithResponse(String dataFeedId,
OffsetDateTime startTime,
OffsetDateTime endTime)
Refresh data ingestion for a period.
|
Mono<AnomalyAlertConfiguration> |
updateAnomalyAlertConfig(AnomalyAlertConfiguration alertConfiguration)
Update anomaly alert configuration.
|
Mono<com.azure.core.http.rest.Response<AnomalyAlertConfiguration>> |
updateAnomalyAlertConfigWithResponse(AnomalyAlertConfiguration alertConfiguration)
Update anomaly alert configuration.
|
Mono<DataFeed> |
updateDataFeed(DataFeed dataFeed)
Update an existing data feed.
|
Mono<com.azure.core.http.rest.Response<DataFeed>> |
updateDataFeedWithResponse(DataFeed dataFeed)
Update an existing data feed with REST response.
|
Mono<DatasourceCredentialEntity> |
updateDatasourceCredential(DatasourceCredentialEntity datasourceCredential)
Update a data source credential entity.
|
Mono<com.azure.core.http.rest.Response<DatasourceCredentialEntity>> |
updateDatasourceCredentialWithResponse(DatasourceCredentialEntity datasourceCredential)
Update a data source credential entity with REST response.
|
Mono<NotificationHook> |
updateHook(NotificationHook notificationHook)
Update an existing notificationHook.
|
Mono<com.azure.core.http.rest.Response<NotificationHook>> |
updateHookWithResponse(NotificationHook notificationHook)
Update an existing notificationHook.
|
Mono<AnomalyDetectionConfiguration> |
updateMetricAnomalyDetectionConfig(AnomalyDetectionConfiguration detectionConfiguration)
Update a configuration to detect anomalies in the time series of a metric.
|
Mono<com.azure.core.http.rest.Response<AnomalyDetectionConfiguration>> |
updateMetricAnomalyDetectionConfigWithResponse(AnomalyDetectionConfiguration detectionConfiguration)
Update a configuration to detect anomalies in the time series of a metric.
|
public Mono<DataFeed> createDataFeed(DataFeed dataFeed)
Code sample
DataFeed
dataFeed = newDataFeed
() .setName("dataFeedName") .setSource(newMySqlDataFeedSource
("conn-string", "query")) .setGranularity(newDataFeedGranularity
().setGranularityType(DataFeedGranularityType
.DAILY)) .setSchema(newDataFeedSchema
(Arrays
.asList( newDataFeedMetric
().setName("cost"), newDataFeedMetric
().setName("revenue") )).setDimensions(Arrays
.asList( newDataFeedDimension
().setName("city"), newDataFeedDimension
().setName("category") )) ) .setIngestionSettings(newDataFeedIngestionSettings
(OffsetDateTime
.parse("2020-01-01T00:00:00Z"))) .setOptions(newDataFeedOptions
() .setDescription("data feed description") .setRollupSettings(newDataFeedRollupSettings
() .setRollupType(DataFeedRollupType
.AUTO_ROLLUP))); metricsAdvisorAdminAsyncClient.createDataFeed(dataFeed) .subscribe(createdDataFeed -> {System
.out.printf("Data feed Id: %s%n", createdDataFeed.getId());System
.out.printf("Data feed description: %s%n", createdDataFeed.getOptions().getDescription());System
.out.printf("Data feed source type: %s%n", createdDataFeed.getSourceType());System
.out.printf("Data feed creator: %s%n", createdDataFeed.getCreator()); });
dataFeed
- The data feed to be created.Mono
containing the created data feed.NullPointerException
- If dataFeed
, dataFeedName
, dataFeedSource
, metrics
,
granularityType
or ingestionStartTime
is null.public Mono<com.azure.core.http.rest.Response<DataFeed>> createDataFeedWithResponse(DataFeed dataFeed)
Code sample
DataFeed
dataFeed = newDataFeed
() .setName("dataFeedName") .setSource(newMySqlDataFeedSource
("conn-string", "query")) .setGranularity(newDataFeedGranularity
().setGranularityType(DataFeedGranularityType
.DAILY)) .setSchema(newDataFeedSchema
(Arrays
.asList( newDataFeedMetric
().setName("metric1"), newDataFeedMetric
().setName("metric2") ) )) .setIngestionSettings(newDataFeedIngestionSettings
(OffsetDateTime
.parse("2020-01-01T00:00:00Z"))) .setOptions(newDataFeedOptions
() .setDescription("data feed description") .setRollupSettings(newDataFeedRollupSettings
() .setRollupType(DataFeedRollupType
.AUTO_ROLLUP))); metricsAdvisorAdminAsyncClient.createDataFeedWithResponse(dataFeed) .subscribe(dataFeedResponse -> {System
.out.printf("Data feed create operation status: %s%n", dataFeedResponse.getStatusCode());DataFeed
createdDataFeed = dataFeedResponse.getValue();System
.out.printf("Data feed Id: %s%n", createdDataFeed.getId());System
.out.printf("Data feed description: %s%n", createdDataFeed.getOptions().getDescription());System
.out.printf("Data feed source type: %s%n", createdDataFeed.getSourceType());System
.out.printf("Data feed creator: %s%n", createdDataFeed.getCreator()); });
dataFeed
- The data feed to be created.Response
of a Mono
containing the created data feed
.NullPointerException
- If dataFeed
, dataFeedName
, dataFeedSource
, metrics
,
granularityType
or ingestionStartTime
is null.public Mono<DataFeed> getDataFeed(String dataFeedId)
Code sample
finalString
dataFeedId = "r47053f1-9080-09lo-bacf-8dccf2e86f"; metricsAdvisorAdminAsyncClient.getDataFeed(dataFeedId) .subscribe(dataFeed -> {System
.out.printf("Data feed Id: %s%n", dataFeed.getId());System
.out.printf("Data feed description: %s%n", dataFeed.getOptions().getDescription());System
.out.printf("Data feed source type: %s%n", dataFeed.getSourceType());System
.out.printf("Data feed creator: %s%n", dataFeed.getCreator()); });
dataFeedId
- The data feed unique id.IllegalArgumentException
- If dataFeedId
does not conform to the UUID format specification.NullPointerException
- thrown if the dataFeedId
is null.public Mono<com.azure.core.http.rest.Response<DataFeed>> getDataFeedWithResponse(String dataFeedId)
Code sample
finalString
dataFeedId = "r47053f1-9080-09lo-bacf-8dccf2e86f"; metricsAdvisorAdminAsyncClient.getDataFeedWithResponse(dataFeedId) .subscribe(dataFeedResponse -> {System
.out.printf("Data feed get operation status: %s%n", dataFeedResponse.getStatusCode());DataFeed
dataFeed = dataFeedResponse.getValue();System
.out.printf("Data feed Id: %s%n", dataFeed.getId());System
.out.printf("Data feed description: %s%n", dataFeed.getOptions().getDescription());System
.out.printf("Data feed source type: %s%n", dataFeed.getSourceType());System
.out.printf("Data feed creator: %s%n", dataFeed.getCreator()); });
dataFeedId
- The data feed unique id.IllegalArgumentException
- If dataFeedId
does not conform to the UUID format specification.NullPointerException
- thrown if the dataFeedId
is null.public Mono<DataFeed> updateDataFeed(DataFeed dataFeed)
Code sample
finalString
dataFeedId = "r47053f1-9080-09lo-bacf-8dccf2e86f"; metricsAdvisorAdminAsyncClient.getDataFeed(dataFeedId) .flatMap(existingDataFeed -> { return metricsAdvisorAdminAsyncClient.updateDataFeed( existingDataFeed .setOptions(newDataFeedOptions
() .setDescription("set updated description")) ); }) .subscribe(updatedDataFeed -> {System
.out.printf("Data feed Id: %s%n", updatedDataFeed.getId());System
.out.printf("Data feed updated description: %s%n", updatedDataFeed.getOptions().getDescription()); });
dataFeed
- the data feed that needs to be updated.public Mono<com.azure.core.http.rest.Response<DataFeed>> updateDataFeedWithResponse(DataFeed dataFeed)
Code sample
finalString
dataFeedId = "r47053f1-9080-09lo-bacf-8dccf2e86f"; metricsAdvisorAdminAsyncClient.getDataFeed(dataFeedId) .flatMap(existingDataFeed -> { return metricsAdvisorAdminAsyncClient.updateDataFeedWithResponse( existingDataFeed .setOptions(newDataFeedOptions
() .setDescription("set updated description")) ); }) .subscribe(dataFeedResponse -> {System
.out.printf("Data feed update operation status: %s%n", dataFeedResponse.getStatusCode());DataFeed
updatedDataFeed = dataFeedResponse.getValue();System
.out.printf("Data feed Id: %s%n", updatedDataFeed.getId());System
.out.printf("Data feed updated description: %s%n", updatedDataFeed.getOptions().getDescription()); });
public Mono<Void> deleteDataFeed(String dataFeedId)
Code sample
final String
dataFeedId = "t00853f1-9080-447f-bacf-8dccf2e86f";
metricsAdvisorAdminAsyncClient.deleteDataFeed(dataFeedId);
dataFeedId
- The data feed unique id.IllegalArgumentException
- If dataFeedId
does not conform to the UUID format specification.NullPointerException
- thrown if the dataFeedId
is null.public Mono<com.azure.core.http.rest.Response<Void>> deleteDataFeedWithResponse(String dataFeedId)
Code sample
finalString
dataFeedId = "eh0854f1-8927-447f-bacf-8dccf2e86fwe"; metricsAdvisorAdminAsyncClient.deleteDataFeedWithResponse(dataFeedId) .subscribe(response ->System
.out.printf("Data feed delete operation status : %s%n", response.getStatusCode()));
dataFeedId
- The data feed unique id.IllegalArgumentException
- If dataFeedId
does not conform to the UUID format specification.NullPointerException
- thrown if the dataFeedId
is null.public com.azure.core.http.rest.PagedFlux<DataFeed> listDataFeeds()
Code sample
metricsAdvisorAdminAsyncClient.listDataFeeds() .subscribe(dataFeed -> {System
.out.printf("Data feed Id: %s%n", dataFeed.getId());System
.out.printf("Data feed description: %s%n", dataFeed.getOptions().getDescription());System
.out.printf("Data feed source type: %s%n", dataFeed.getSourceType());System
.out.printf("Data feed creator: %s%n", dataFeed.getCreator()); });
PagedFlux
containing information of all the data feeds
in the account.public com.azure.core.http.rest.PagedFlux<DataFeed> listDataFeeds(ListDataFeedOptions options)
Code sample
metricsAdvisorAdminAsyncClient.listDataFeeds( newListDataFeedOptions
() .setListDataFeedFilter( newListDataFeedFilter
() .setDataFeedStatus(DataFeedStatus
.ACTIVE) .setDataFeedGranularityType(DataFeedGranularityType
.DAILY)) .setMaxPageSize(3)) .subscribe(dataFeed -> {System
.out.printf("Data feed Id: %s%n", dataFeed.getId());System
.out.printf("Data feed description: %s%n", dataFeed.getOptions().getDescription());System
.out.printf("Data feed source type: %s%n", dataFeed.getSourceType());System
.out.printf("Data feed creator: %s%n", dataFeed.getCreator());System
.out.printf("Data feed status: %s%n", dataFeed.getStatus());System
.out.printf("Data feed granularity type: %s%n", dataFeed.getGranularity().getGranularityType()); });
options
- The configurable options
to pass for filtering the output result.PagedFlux
containing information of all the data feeds
in the account.public com.azure.core.http.rest.PagedFlux<DataFeedIngestionStatus> listDataFeedIngestionStatus(String dataFeedId, ListDataFeedIngestionOptions options)
Code sample
finalString
dataFeedId = "4957a2f7-a0f4-4fc0-b8d7-d866c1df0f4c"; finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-01-01T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-09-09T00:00:00Z"); finalListDataFeedIngestionOptions
options = newListDataFeedIngestionOptions
(startTime, endTime); metricsAdvisorAdminAsyncClient.listDataFeedIngestionStatus(dataFeedId, options) .subscribe(ingestionStatus -> {System
.out.printf("Timestamp: %s%n", ingestionStatus.getTimestamp());System
.out.printf("Status: %s%n", ingestionStatus.getStatus());System
.out.printf("Message: %s%n", ingestionStatus.getMessage()); });
dataFeedId
- The data feed id.options
- The additional parameters.IllegalArgumentException
- If dataFeedId
does not conform to the UUID format specification.NullPointerException
- If dataFeedId
, options
, options.startTime
,
options.endTime
is null.public Mono<Void> refreshDataFeedIngestion(String dataFeedId, OffsetDateTime startTime, OffsetDateTime endTime)
The data in the data source for the given period will be reingested and any ingested data for the same period will be overwritten.
Code sample
finalString
dataFeedId = "4957a2f7-a0f4-4fc0-b8d7-d866c1df0f4c"; finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-01-01T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-03-03T00:00:00Z"); metricsAdvisorAdminAsyncClient.refreshDataFeedIngestion(dataFeedId, startTime, endTime).subscribe();
dataFeedId
- The data feed id.startTime
- The start point of the period.endTime
- The end point of of the period.Mono
indicating ingestion reset success or failure.IllegalArgumentException
- If dataFeedId
does not conform to the UUID format specification.NullPointerException
- If dataFeedId
, startTime
, endTime
is null.public Mono<com.azure.core.http.rest.Response<Void>> refreshDataFeedIngestionWithResponse(String dataFeedId, OffsetDateTime startTime, OffsetDateTime endTime)
The data in the data source for the given period will be reingested and any ingested data for the same period will be overwritten.
Code sample
finalString
dataFeedId = "4957a2f7-a0f4-4fc0-b8d7-d866c1df0f4c"; finalOffsetDateTime
startTime =OffsetDateTime
.parse("2020-01-01T00:00:00Z"); finalOffsetDateTime
endTime =OffsetDateTime
.parse("2020-03-03T00:00:00Z"); metricsAdvisorAdminAsyncClient.refreshDataFeedIngestionWithResponse(dataFeedId, startTime, endTime) .subscribe(response -> {System
.out.printf("Response statusCode: %d%n", response.getStatusCode()); });
dataFeedId
- The data feed id.startTime
- The start point of the period.endTime
- The end point of of the period.Response
of a Mono
with result of reset request.IllegalArgumentException
- If dataFeedId
does not conform to the UUID format specification.NullPointerException
- If dataFeedId
, startTime
, endTime
is null.public Mono<DataFeedIngestionProgress> getDataFeedIngestionProgress(String dataFeedId)
Code sample
finalString
dataFeedId = "4957a2f7-a0f4-4fc0-b8d7-d866c1df0f4c"; metricsAdvisorAdminAsyncClient.getDataFeedIngestionProgress(dataFeedId) .subscribe(ingestionProgress -> {System
.out.printf("Latest active timestamp: %s%n", ingestionProgress.getLatestActiveTimestamp());System
.out.printf("Latest successful timestamp: %s%n", ingestionProgress.getLatestSuccessTimestamp()); });
dataFeedId
- The data feed id.Mono
containing DataFeedIngestionProgress
of the data feed.IllegalArgumentException
- If dataFeedId
does not conform to the UUID format specification.NullPointerException
- thrown if the dataFeedId
is null.public Mono<com.azure.core.http.rest.Response<DataFeedIngestionProgress>> getDataFeedIngestionProgressWithResponse(String dataFeedId)
Code sample
finalString
dataFeedId = "4957a2f7-a0f4-4fc0-b8d7-d866c1df0f4c"; metricsAdvisorAdminAsyncClient.getDataFeedIngestionProgressWithResponse(dataFeedId,Context
.NONE) .subscribe(response -> {System
.out.printf("Response statusCode: %d%n", response.getStatusCode());DataFeedIngestionProgress
ingestionProgress = response.getValue();System
.out.printf("Latest active timestamp: %s%n", ingestionProgress.getLatestActiveTimestamp());System
.out.printf("Latest successful timestamp: %s%n", ingestionProgress.getLatestSuccessTimestamp()); });
dataFeedId
- The data feed id.Response
of a Mono
containing DataFeedIngestionProgress
of the data feed.IllegalArgumentException
- If dataFeedId
does not conform to the UUID format specification.NullPointerException
- thrown if the dataFeedId
is null.public Mono<AnomalyDetectionConfiguration> createMetricAnomalyDetectionConfig(String metricId, AnomalyDetectionConfiguration detectionConfiguration)
Code sample
finalMetricWholeSeriesDetectionCondition
wholeSeriesCondition = newMetricWholeSeriesDetectionCondition
() .setCrossConditionOperator(DetectionConditionsOperator
.OR) .setSmartDetectionCondition(newSmartDetectionCondition
() .setSensitivity(50) .setAnomalyDetectorDirection(AnomalyDetectorDirection
.BOTH) .setSuppressCondition(newSuppressCondition
().setMinNumber(50).setMinRatio(50))) .setHardThresholdCondition(newHardThresholdCondition
() .setLowerBound(0.0) .setUpperBound(100.0) .setAnomalyDetectorDirection(AnomalyDetectorDirection
.BOTH) .setSuppressCondition(newSuppressCondition
().setMinNumber(5).setMinRatio(5))) .setChangeThresholdCondition(newChangeThresholdCondition
() .setChangePercentage(50) .setShiftPoint(30) .setWithinRange(true) .setAnomalyDetectorDirection(AnomalyDetectorDirection
.BOTH) .setSuppressCondition(newSuppressCondition
().setMinNumber(2).setMinRatio(2))); finalString
detectionConfigName = "my_detection_config"; finalString
detectionConfigDescription = "anomaly detection config for metric"; finalAnomalyDetectionConfiguration
detectionConfig = newAnomalyDetectionConfiguration
(detectionConfigName) .setDescription(detectionConfigDescription) .setWholeSeriesDetectionCondition(wholeSeriesCondition); finalString
metricId = "0b836da8-10e6-46cd-8f4f-28262e113a62"; metricsAdvisorAdminAsyncClient .createMetricAnomalyDetectionConfig(metricId, detectionConfig) .subscribe(createdDetectionConfig -> {System
.out.printf("Detection config Id: %s%n", createdDetectionConfig.getId());System
.out.printf("Name: %s%n", createdDetectionConfig.getName());System
.out.printf("Description: %s%n", createdDetectionConfig.getDescription());System
.out.printf("MetricId: %s%n", createdDetectionConfig.getMetricId()); });
metricId
- The metric id to associate the configuration with.detectionConfiguration
- The anomaly detection configuration.Mono
containing the created AnomalyDetectionConfiguration
.IllegalArgumentException
- If metricId
does not conform to the UUID
format specification, or detectionConfiguration.name
is not set.NullPointerException
- thrown if the metricId
is null
or detectionConfiguration
is null
or detectionConfiguration.wholeSeriesCondition
is null
or seriesKey
is missing for any MetricSingleSeriesDetectionCondition
in the configuration
or seriesGroupKey
is missing for any MetricSeriesGroupDetectionCondition
in the configuration
or crossConditionsOperator
is missing when multiple nested conditions are set in a
MetricSingleSeriesDetectionCondition
or MetricSeriesGroupDetectionCondition
.public Mono<com.azure.core.http.rest.Response<AnomalyDetectionConfiguration>> createMetricAnomalyDetectionConfigWithResponse(String metricId, AnomalyDetectionConfiguration detectionConfiguration)
Code sample
*finalMetricWholeSeriesDetectionCondition
wholeSeriesCondition = newMetricWholeSeriesDetectionCondition
() .setCrossConditionOperator(DetectionConditionsOperator
.OR) .setSmartDetectionCondition(newSmartDetectionCondition
() .setSensitivity(50) .setAnomalyDetectorDirection(AnomalyDetectorDirection
.BOTH) .setSuppressCondition(newSuppressCondition
().setMinNumber(50).setMinRatio(50))) .setHardThresholdCondition(newHardThresholdCondition
() .setLowerBound(0.0) .setUpperBound(100.0) .setAnomalyDetectorDirection(AnomalyDetectorDirection
.BOTH) .setSuppressCondition(newSuppressCondition
().setMinNumber(5).setMinRatio(5))) .setChangeThresholdCondition(newChangeThresholdCondition
() .setChangePercentage(50) .setShiftPoint(30) .setWithinRange(true) .setAnomalyDetectorDirection(AnomalyDetectorDirection
.BOTH) .setSuppressCondition(newSuppressCondition
().setMinNumber(2).setMinRatio(2))); finalString
detectionConfigName = "my_detection_config"; finalString
detectionConfigDescription = "anomaly detection config for metric"; finalAnomalyDetectionConfiguration
detectionConfig = newAnomalyDetectionConfiguration
(detectionConfigName) .setDescription(detectionConfigDescription) .setWholeSeriesDetectionCondition(wholeSeriesCondition); finalString
metricId = "0b836da8-10e6-46cd-8f4f-28262e113a62"; metricsAdvisorAdminAsyncClient .createMetricAnomalyDetectionConfigWithResponse(metricId, detectionConfig) .subscribe(response -> {System
.out.printf("Response statusCode: %d%n", response.getStatusCode());AnomalyDetectionConfiguration
createdDetectionConfig = response.getValue();System
.out.printf("Detection config Id: %s%n", createdDetectionConfig.getId());System
.out.printf("Name: %s%n", createdDetectionConfig.getName());System
.out.printf("Description: %s%n", createdDetectionConfig.getDescription());System
.out.printf("MetricId: %s%n", createdDetectionConfig.getMetricId()); });
metricId
- The metric id to associate the configuration with.detectionConfiguration
- The anomaly detection configuration.Response
of a Mono
containing the created AnomalyDetectionConfiguration
.IllegalArgumentException
- If metricId
does not conform to the UUID
format specification, or detectionConfiguration.name
is not set.NullPointerException
- thrown if the metricId
is null
or detectionConfiguration
is null
or detectionConfiguration.wholeSeriesCondition
is null
or seriesKey
is missing for any MetricSingleSeriesDetectionCondition
in the configuration
or seriesGroupKey
is missing for any MetricSeriesGroupDetectionCondition
in the configuration
or crossConditionsOperator
is missing when multiple nested conditions are set in a
MetricSingleSeriesDetectionCondition
or MetricSeriesGroupDetectionCondition
.public Mono<AnomalyDetectionConfiguration> getMetricAnomalyDetectionConfig(String detectionConfigurationId)
Code sample
finalString
detectionConfigId = "7b8069a1-1564-46da-9f50-b5d0dd9129ab"; metricsAdvisorAdminAsyncClient .getMetricAnomalyDetectionConfig(detectionConfigId) .subscribe(detectionConfig -> {System
.out.printf("Detection config Id: %s%n", detectionConfig.getId());System
.out.printf("Name: %s%n", detectionConfig.getName());System
.out.printf("Description: %s%n", detectionConfig.getDescription());System
.out.printf("MetricId: %s%n", detectionConfig.getMetricId());System
.out.printf("Detection conditions specified for configuration...%n");System
.out.printf("Whole Series Detection Conditions:%n");MetricWholeSeriesDetectionCondition
wholeSeriesDetectionCondition = detectionConfig.getWholeSeriesDetectionCondition();System
.out.printf("- Use %s operator for multiple detection conditions:%n", wholeSeriesDetectionCondition.getCrossConditionsOperator());System
.out.printf("- Smart Detection Condition:%n");System
.out.printf(" - Sensitivity: %s%n", wholeSeriesDetectionCondition.getSmartDetectionCondition() .getSensitivity());System
.out.printf(" - Detection direction: %s%n", wholeSeriesDetectionCondition.getSmartDetectionCondition() .getAnomalyDetectorDirection());System
.out.printf(" - Suppress conditions: minimum number: %s; minimum ratio: %s%n", wholeSeriesDetectionCondition.getSmartDetectionCondition() .getSuppressCondition().getMinNumber(), wholeSeriesDetectionCondition.getSmartDetectionCondition() .getSuppressCondition().getMinRatio());System
.out.printf("- Hard Threshold Condition:%n");System
.out.printf(" - Lower bound: %s%n", wholeSeriesDetectionCondition.getHardThresholdCondition() .getLowerBound());System
.out.printf(" - Upper bound: %s%n", wholeSeriesDetectionCondition.getHardThresholdCondition() .getUpperBound());System
.out.printf(" - Suppress conditions: minimum number: %s; minimum ratio: %s%n", wholeSeriesDetectionCondition.getHardThresholdCondition() .getSuppressCondition().getMinNumber(), wholeSeriesDetectionCondition.getHardThresholdCondition() .getSuppressCondition().getMinRatio());System
.out.printf("- Change Threshold Condition:%n");System
.out.printf(" - Change percentage: %s%n", wholeSeriesDetectionCondition.getChangeThresholdCondition() .getChangePercentage());System
.out.printf(" - Shift point: %s%n", wholeSeriesDetectionCondition.getChangeThresholdCondition() .getShiftPoint());System
.out.printf(" - Detect anomaly if within range: %s%n", wholeSeriesDetectionCondition.getChangeThresholdCondition() .isWithinRange());System
.out.printf(" - Suppress conditions: minimum number: %s; minimum ratio: %s%n", wholeSeriesDetectionCondition.getChangeThresholdCondition() .getSuppressCondition().getMinNumber(), wholeSeriesDetectionCondition.getChangeThresholdCondition() .getSuppressCondition().getMinRatio());List
<MetricSingleSeriesDetectionCondition
> seriesDetectionConditions = detectionConfig.getSeriesDetectionConditions();System
.out.printf("Series Detection Conditions:%n"); for (MetricSingleSeriesDetectionCondition
seriesDetectionCondition : seriesDetectionConditions) {DimensionKey
seriesKey = seriesDetectionCondition.getSeriesKey(); finalString
seriesKeyStr =Arrays
.toString(seriesKey.asMap().entrySet().stream().toArray());System
.out.printf("- Series Key:%n", seriesKeyStr);System
.out.printf(" - Use %s operator for multiple detection conditions:%n", seriesDetectionCondition.getCrossConditionsOperator());System
.out.printf(" - Smart Detection Condition:%n");System
.out.printf(" - Sensitivity: %s%n", seriesDetectionCondition.getSmartDetectionCondition() .getSensitivity());System
.out.printf(" - Detection direction: %s%n", seriesDetectionCondition.getSmartDetectionCondition() .getAnomalyDetectorDirection());System
.out.printf(" - Suppress conditions: minimum number: %s; minimum ratio: %s%n", seriesDetectionCondition.getSmartDetectionCondition() .getSuppressCondition().getMinNumber(), seriesDetectionCondition.getSmartDetectionCondition() .getSuppressCondition().getMinRatio());System
.out.printf(" - Hard Threshold Condition:%n");System
.out.printf(" - Lower bound: %s%n", seriesDetectionCondition.getHardThresholdCondition() .getLowerBound());System
.out.printf(" - Upper bound: %s%n", seriesDetectionCondition.getHardThresholdCondition() .getUpperBound());System
.out.printf(" - Suppress conditions: minimum number: %s; minimum ratio: %s%n", seriesDetectionCondition.getHardThresholdCondition() .getSuppressCondition().getMinNumber(), seriesDetectionCondition.getHardThresholdCondition() .getSuppressCondition().getMinRatio());System
.out.printf(" - Change Threshold Condition:%n");System
.out.printf(" - Change percentage: %s%n", seriesDetectionCondition.getChangeThresholdCondition() .getChangePercentage());System
.out.printf(" - Shift point: %s%n", seriesDetectionCondition.getChangeThresholdCondition() .getShiftPoint());System
.out.printf(" - Detect anomaly if within range: %s%n", seriesDetectionCondition.getChangeThresholdCondition() .isWithinRange());System
.out.printf(" - Suppress conditions: minimum number: %s; minimum ratio: %s%n", seriesDetectionCondition.getChangeThresholdCondition() .getSuppressCondition().getMinNumber(), seriesDetectionCondition.getChangeThresholdCondition() .getSuppressCondition().getMinRatio()); }List
<MetricSeriesGroupDetectionCondition
> seriesGroupDetectionConditions = detectionConfig.getSeriesGroupDetectionConditions();System
.out.printf("Series Group Detection Conditions:%n"); for (MetricSeriesGroupDetectionCondition
seriesGroupDetectionCondition : seriesGroupDetectionConditions) {DimensionKey
seriesGroupKey = seriesGroupDetectionCondition.getSeriesGroupKey(); finalString
seriesGroupKeyStr =Arrays
.toString(seriesGroupKey.asMap().entrySet().stream().toArray());System
.out.printf("- Series Group Key:%n", seriesGroupKeyStr);System
.out.printf(" - Use %s operator for multiple detection conditions:%n", seriesGroupDetectionCondition.getCrossConditionsOperator());System
.out.printf(" - Smart Detection Condition:%n");System
.out.printf(" - Sensitivity: %s%n", seriesGroupDetectionCondition.getSmartDetectionCondition() .getSensitivity());System
.out.printf(" - Detection direction: %s%n", seriesGroupDetectionCondition.getSmartDetectionCondition() .getAnomalyDetectorDirection());System
.out.printf(" - Suppress conditions: minimum number: %s; minimum ratio: %s%n", seriesGroupDetectionCondition.getSmartDetectionCondition() .getSuppressCondition().getMinNumber(), seriesGroupDetectionCondition.getSmartDetectionCondition() .getSuppressCondition().getMinRatio());System
.out.printf(" - Hard Threshold Condition:%n");System
.out.printf(" - Lower bound: %s%n", seriesGroupDetectionCondition.getHardThresholdCondition() .getLowerBound());System
.out.printf(" - Upper bound: %s%n", seriesGroupDetectionCondition.getHardThresholdCondition() .getUpperBound());System
.out.printf(" - Suppress conditions: minimum number: %s; minimum ratio: %s%n", seriesGroupDetectionCondition.getHardThresholdCondition() .getSuppressCondition().getMinNumber(), seriesGroupDetectionCondition.getHardThresholdCondition() .getSuppressCondition().getMinRatio());System
.out.printf(" - Change Threshold Condition:%n");System
.out.printf(" - Change percentage: %s%n", seriesGroupDetectionCondition.getChangeThresholdCondition() .getChangePercentage());System
.out.printf(" - Shift point: %s%n", seriesGroupDetectionCondition.getChangeThresholdCondition() .getShiftPoint());System
.out.printf(" - Detect anomaly if within range: %s%n", seriesGroupDetectionCondition.getChangeThresholdCondition() .isWithinRange());System
.out.printf(" - Suppress conditions: minimum number: %s; minimum ratio: %s%n", seriesGroupDetectionCondition.getChangeThresholdCondition() .getSuppressCondition().getMinNumber(), seriesGroupDetectionCondition.getChangeThresholdCondition() .getSuppressCondition().getMinRatio()); } });
detectionConfigurationId
- The anomaly detection configuration id.Mono
containing the AnomalyDetectionConfiguration
for the provided id.IllegalArgumentException
- If detectionConfigurationId
does not conform to the UUID
format specification.NullPointerException
- thrown if the detectionConfigurationId
is null.public Mono<com.azure.core.http.rest.Response<AnomalyDetectionConfiguration>> getMetricAnomalyDetectionConfigWithResponse(String detectionConfigurationId)
Code sample
finalString
detectionConfigId = "7b8069a1-1564-46da-9f50-b5d0dd9129ab"; metricsAdvisorAdminAsyncClient .getMetricAnomalyDetectionConfigWithResponse(detectionConfigId) .subscribe(response -> {System
.out.printf("Response statusCode: %d%n", response.getStatusCode());AnomalyDetectionConfiguration
detectionConfig = response.getValue();System
.out.printf("Detection config Id: %s%n", detectionConfig.getId());System
.out.printf("Name: %s%n", detectionConfig.getName());System
.out.printf("Description: %s%n", detectionConfig.getDescription());System
.out.printf("MetricId: %s%n", detectionConfig.getMetricId());System
.out.printf("Detection conditions specified for configuration...%n");System
.out.printf("Whole Series Detection Conditions:%n");MetricWholeSeriesDetectionCondition
wholeSeriesDetectionCondition = detectionConfig.getWholeSeriesDetectionCondition();System
.out.printf("- Use %s operator for multiple detection conditions:%n", wholeSeriesDetectionCondition.getCrossConditionsOperator());System
.out.printf("- Smart Detection Condition:%n");System
.out.printf(" - Sensitivity: %s%n", wholeSeriesDetectionCondition.getSmartDetectionCondition() .getSensitivity());System
.out.printf(" - Detection direction: %s%n", wholeSeriesDetectionCondition.getSmartDetectionCondition() .getAnomalyDetectorDirection());System
.out.printf(" - Suppress conditions: minimum number: %s; minimum ratio: %s%n", wholeSeriesDetectionCondition.getSmartDetectionCondition() .getSuppressCondition().getMinNumber(), wholeSeriesDetectionCondition.getSmartDetectionCondition() .getSuppressCondition().getMinRatio());System
.out.printf("- Hard Threshold Condition:%n");System
.out.printf(" - Lower bound: %s%n", wholeSeriesDetectionCondition.getHardThresholdCondition() .getLowerBound());System
.out.printf(" - Upper bound: %s%n", wholeSeriesDetectionCondition.getHardThresholdCondition() .getUpperBound());System
.out.printf(" - Suppress conditions: minimum number: %s; minimum ratio: %s%n", wholeSeriesDetectionCondition.getHardThresholdCondition() .getSuppressCondition().getMinNumber(), wholeSeriesDetectionCondition.getHardThresholdCondition() .getSuppressCondition().getMinRatio());System
.out.printf("- Change Threshold Condition:%n");System
.out.printf(" - Change percentage: %s%n", wholeSeriesDetectionCondition.getChangeThresholdCondition() .getChangePercentage());System
.out.printf(" - Shift point: %s%n", wholeSeriesDetectionCondition.getChangeThresholdCondition() .getShiftPoint());System
.out.printf(" - Detect anomaly if within range: %s%n", wholeSeriesDetectionCondition.getChangeThresholdCondition() .isWithinRange());System
.out.printf(" - Suppress conditions: minimum number: %s; minimum ratio: %s%n", wholeSeriesDetectionCondition.getChangeThresholdCondition() .getSuppressCondition().getMinNumber(), wholeSeriesDetectionCondition.getChangeThresholdCondition() .getSuppressCondition().getMinRatio());List
<MetricSingleSeriesDetectionCondition
> seriesDetectionConditions = detectionConfig.getSeriesDetectionConditions();System
.out.printf("Series Detection Conditions:%n"); for (MetricSingleSeriesDetectionCondition
seriesDetectionCondition : seriesDetectionConditions) {DimensionKey
seriesKey = seriesDetectionCondition.getSeriesKey(); finalString
seriesKeyStr =Arrays
.toString(seriesKey.asMap().entrySet().stream().toArray());System
.out.printf("- Series Key:%n", seriesKeyStr);System
.out.printf(" - Use %s operator for multiple detection conditions:%n", seriesDetectionCondition.getCrossConditionsOperator());System
.out.printf(" - Smart Detection Condition:%n");System
.out.printf(" - Sensitivity: %s%n", seriesDetectionCondition.getSmartDetectionCondition() .getSensitivity());System
.out.printf(" - Detection direction: %s%n", seriesDetectionCondition.getSmartDetectionCondition() .getAnomalyDetectorDirection());System
.out.printf(" - Suppress conditions: minimum number: %s; minimum ratio: %s%n", seriesDetectionCondition.getSmartDetectionCondition() .getSuppressCondition().getMinNumber(), seriesDetectionCondition.getSmartDetectionCondition() .getSuppressCondition().getMinRatio());System
.out.printf(" - Hard Threshold Condition:%n");System
.out.printf(" - Lower bound: %s%n", seriesDetectionCondition.getHardThresholdCondition() .getLowerBound());System
.out.printf(" - Upper bound: %s%n", seriesDetectionCondition.getHardThresholdCondition() .getUpperBound());System
.out.printf(" - Suppress conditions: minimum number: %s; minimum ratio: %s%n", seriesDetectionCondition.getHardThresholdCondition() .getSuppressCondition().getMinNumber(), seriesDetectionCondition.getHardThresholdCondition() .getSuppressCondition().getMinRatio());System
.out.printf(" - Change Threshold Condition:%n");System
.out.printf(" - Change percentage: %s%n", seriesDetectionCondition.getChangeThresholdCondition() .getChangePercentage());System
.out.printf(" - Shift point: %s%n", seriesDetectionCondition.getChangeThresholdCondition() .getShiftPoint());System
.out.printf(" - Detect anomaly if within range: %s%n", seriesDetectionCondition.getChangeThresholdCondition() .isWithinRange());System
.out.printf(" - Suppress conditions: minimum number: %s; minimum ratio: %s%n", seriesDetectionCondition.getChangeThresholdCondition() .getSuppressCondition().getMinNumber(), seriesDetectionCondition.getChangeThresholdCondition() .getSuppressCondition().getMinRatio()); }List
<MetricSeriesGroupDetectionCondition
> seriesGroupDetectionConditions = detectionConfig.getSeriesGroupDetectionConditions();System
.out.printf("Series Group Detection Conditions:%n"); for (MetricSeriesGroupDetectionCondition
seriesGroupDetectionCondition : seriesGroupDetectionConditions) {DimensionKey
seriesGroupKey = seriesGroupDetectionCondition.getSeriesGroupKey(); finalString
seriesGroupKeyStr =Arrays
.toString(seriesGroupKey.asMap().entrySet().stream().toArray());System
.out.printf("- Series Group Key:%n", seriesGroupKeyStr);System
.out.printf(" - Use %s operator for multiple detection conditions:%n", seriesGroupDetectionCondition.getCrossConditionsOperator());System
.out.printf(" - Smart Detection Condition:%n");System
.out.printf(" - Sensitivity: %s%n", seriesGroupDetectionCondition.getSmartDetectionCondition() .getSensitivity());System
.out.printf(" - Detection direction: %s%n", seriesGroupDetectionCondition.getSmartDetectionCondition() .getAnomalyDetectorDirection());System
.out.printf(" - Suppress conditions: minimum number: %s; minimum ratio: %s%n", seriesGroupDetectionCondition.getSmartDetectionCondition() .getSuppressCondition().getMinNumber(), seriesGroupDetectionCondition.getSmartDetectionCondition() .getSuppressCondition().getMinRatio());System
.out.printf(" - Hard Threshold Condition:%n");System
.out.printf(" - Lower bound: %s%n", seriesGroupDetectionCondition.getHardThresholdCondition() .getLowerBound());System
.out.printf(" - Upper bound: %s%n", seriesGroupDetectionCondition.getHardThresholdCondition() .getUpperBound());System
.out.printf(" - Suppress conditions: minimum number: %s; minimum ratio: %s%n", seriesGroupDetectionCondition.getHardThresholdCondition() .getSuppressCondition().getMinNumber(), seriesGroupDetectionCondition.getHardThresholdCondition() .getSuppressCondition().getMinRatio());System
.out.printf(" - Change Threshold Condition:%n");System
.out.printf(" - Change percentage: %s%n", seriesGroupDetectionCondition.getChangeThresholdCondition() .getChangePercentage());System
.out.printf(" - Shift point: %s%n", seriesGroupDetectionCondition.getChangeThresholdCondition() .getShiftPoint());System
.out.printf(" - Detect anomaly if within range: %s%n", seriesGroupDetectionCondition.getChangeThresholdCondition() .isWithinRange());System
.out.printf(" - Suppress conditions: minimum number: %s; minimum ratio: %s%n", seriesGroupDetectionCondition.getChangeThresholdCondition() .getSuppressCondition().getMinNumber(), seriesGroupDetectionCondition.getChangeThresholdCondition() .getSuppressCondition().getMinRatio()); } });
detectionConfigurationId
- The anomaly detection configuration id.Response
of a Mono
containing the AnomalyDetectionConfiguration
for the provided id.IllegalArgumentException
- If detectionConfigurationId
does not conform to the UUID
format specification.NullPointerException
- thrown if the detectionConfigurationId
is null.public Mono<AnomalyDetectionConfiguration> updateMetricAnomalyDetectionConfig(AnomalyDetectionConfiguration detectionConfiguration)
Code sample
finalString
detectionConfigId = "7b8069a1-1564-46da-9f50-b5d0dd9129ab"; metricsAdvisorAdminAsyncClient .getMetricAnomalyDetectionConfig(detectionConfigId) .flatMap(detectionConfig -> { detectionConfig.setName("updated config name"); detectionConfig.setDescription("updated with more detection conditions");DimensionKey
seriesGroupKey = newDimensionKey
() .put("city", "Seoul"); detectionConfig.addSeriesGroupDetectionCondition( newMetricSeriesGroupDetectionCondition
(seriesGroupKey) .setSmartDetectionCondition(newSmartDetectionCondition
() .setSensitivity(10.0) .setAnomalyDetectorDirection(AnomalyDetectorDirection
.UP) .setSuppressCondition(newSuppressCondition
().setMinNumber(2).setMinRatio(2)))); return metricsAdvisorAdminAsyncClient .updateMetricAnomalyDetectionConfig(detectionConfig); }) .subscribe(updatedDetectionConfig -> {System
.out.printf("Detection config Id: %s%n", updatedDetectionConfig.getId());System
.out.printf("Name: %s%n", updatedDetectionConfig.getName());System
.out.printf("Description: %s%n", updatedDetectionConfig.getDescription());System
.out.printf("MetricId: %s%n", updatedDetectionConfig.getMetricId()); });
detectionConfiguration
- The anomaly detection configuration.Mono
containing the updated AnomalyDetectionConfiguration
.NullPointerException
- thrown if the detectionConfiguration
is null
or detectionConfiguration.id
is null.public Mono<com.azure.core.http.rest.Response<AnomalyDetectionConfiguration>> updateMetricAnomalyDetectionConfigWithResponse(AnomalyDetectionConfiguration detectionConfiguration)
Code sample
finalString
detectionConfigId = "7b8069a1-1564-46da-9f50-b5d0dd9129ab"; metricsAdvisorAdminAsyncClient .getMetricAnomalyDetectionConfigWithResponse(detectionConfigId) .flatMap(response -> {AnomalyDetectionConfiguration
detectionConfig = response.getValue(); detectionConfig.setName("updated config name"); detectionConfig.setDescription("updated with more detection conditions");DimensionKey
seriesGroupKey = newDimensionKey
() .put("city", "Seoul"); detectionConfig.addSeriesGroupDetectionCondition( newMetricSeriesGroupDetectionCondition
(seriesGroupKey) .setSmartDetectionCondition(newSmartDetectionCondition
() .setSensitivity(10.0) .setAnomalyDetectorDirection(AnomalyDetectorDirection
.UP) .setSuppressCondition(newSuppressCondition
().setMinNumber(2).setMinRatio(2)))); return metricsAdvisorAdminAsyncClient .updateMetricAnomalyDetectionConfigWithResponse(detectionConfig); }) .subscribe(response -> {AnomalyDetectionConfiguration
updatedDetectionConfig = response.getValue();System
.out.printf("Detection config Id: %s%n", updatedDetectionConfig.getId());System
.out.printf("Name: %s%n", updatedDetectionConfig.getName());System
.out.printf("Description: %s%n", updatedDetectionConfig.getDescription());System
.out.printf("MetricId: %s%n", updatedDetectionConfig.getMetricId()); });
detectionConfiguration
- The anomaly detection configuration.Response
of a Mono
containing the updated AnomalyDetectionConfiguration
.NullPointerException
- thrown if the detectionConfiguration
is null
or detectionConfiguration.id
is null.public Mono<Void> deleteMetricAnomalyDetectionConfiguration(String detectionConfigurationId)
detectionConfigurationId
- The metric anomaly detection configuration unique id.
Code sample
final String
detectionConfigId = "7b8069a1-1564-46da-9f50-b5d0dd9129ab";
metricsAdvisorAdminAsyncClient
.deleteMetricAnomalyDetectionConfiguration(detectionConfigId)
.subscribe();
NullPointerException
- thrown if the detectionConfigurationId
is null.IllegalArgumentException
- If detectionConfigurationId
does not conform to the UUID
format specification.public Mono<com.azure.core.http.rest.Response<Void>> deleteMetricAnomalyDetectionConfigWithResponse(String detectionConfigurationId)
Code sample
finalString
detectionConfigId = "7b8069a1-1564-46da-9f50-b5d0dd9129ab"; metricsAdvisorAdminAsyncClient .deleteMetricAnomalyDetectionConfigWithResponse(detectionConfigId) .subscribe(response ->System
.out.printf("Response statusCode: %d%n", response.getStatusCode()));
detectionConfigurationId
- The metric anomaly detection configuration unique id.Response
of a Mono
.NullPointerException
- thrown if the detectionConfigurationId
is null.IllegalArgumentException
- If detectionConfigurationId
does not conform to the UUID
format specification.public com.azure.core.http.rest.PagedFlux<AnomalyDetectionConfiguration> listMetricAnomalyDetectionConfigs(String metricId)
Code sample
finalString
metricId = "0b836da8-10e6-46cd-8f4f-28262e113a62"; metricsAdvisorAdminAsyncClient.listMetricAnomalyDetectionConfigs(metricId) .subscribe(detectionConfig -> {System
.out.printf("Detection config Id: %s%n", detectionConfig.getId());System
.out.printf("Name: %s%n", detectionConfig.getName());System
.out.printf("Description: %s%n", detectionConfig.getDescription());System
.out.printf("MetricId: %s%n", detectionConfig.getMetricId()); });
metricId
- The metric id.NullPointerException
- thrown if the metricId
is null.IllegalArgumentException
- If metricId
does not conform to the UUID format specification.public com.azure.core.http.rest.PagedFlux<AnomalyDetectionConfiguration> listMetricAnomalyDetectionConfigs(String metricId, ListMetricAnomalyDetectionConfigsOptions options)
Code sample
finalString
metricId = "0b836da8-10e6-46cd-8f4f-28262e113a62"; metricsAdvisorAdminAsyncClient.listMetricAnomalyDetectionConfigs(metricId, newListMetricAnomalyDetectionConfigsOptions
()) .subscribe(detectionConfig -> {System
.out.printf("Detection config Id: %s%n", detectionConfig.getId());System
.out.printf("Name: %s%n", detectionConfig.getName());System
.out.printf("Description: %s%n", detectionConfig.getDescription());System
.out.printf("MetricId: %s%n", detectionConfig.getMetricId()); });
metricId
- The metric id.options
- th e additional configurable options to specify when querying the result.NullPointerException
- thrown if the metricId
is null.IllegalArgumentException
- If metricId
does not conform to the UUID format specification.public Mono<NotificationHook> createHook(NotificationHook notificationHook)
Code sample
NotificationHook
emailNotificationHook = newEmailNotificationHook
("email hook") .setDescription("my email hook") .addEmailToAlert("alertme@alertme.com") .setExternalLink("https://adwiki.azurewebsites.net/articles/howto/alerts/create-hooks.html"); metricsAdvisorAdminAsyncClient.createHook(emailNotificationHook) .subscribe(hook -> {EmailNotificationHook
createdEmailHook = (EmailNotificationHook
) hook;System
.out.printf("NotificationHook Id: %s%n", createdEmailHook.getId());System
.out.printf("NotificationHook Name: %s%n", createdEmailHook.getName());System
.out.printf("NotificationHook Description: %s%n", createdEmailHook.getDescription());System
.out.printf("NotificationHook External Link: %s%n", createdEmailHook.getExternalLink());System
.out.printf("NotificationHook Emails: %s%n",String
.join(",", createdEmailHook.getEmailsToAlert())); });
notificationHook
- The notificationHook.Mono
containing the created NotificationHook
.NullPointerException
- If notificationHook
, notificationHook.name
,
notificationHook.endpoint
(for web notificationHook) is null.IllegalArgumentException
- If at least one email not present for email notificationHook.public Mono<com.azure.core.http.rest.Response<NotificationHook>> createHookWithResponse(NotificationHook notificationHook)
Code sample
NotificationHook
emailNotificationHook = newEmailNotificationHook
("email hook") .setDescription("my email hook") .addEmailToAlert("alertme@alertme.com") .setExternalLink("https://adwiki.azurewebsites.net/articles/howto/alerts/create-hooks.html"); metricsAdvisorAdminAsyncClient.createHookWithResponse(emailNotificationHook) .subscribe(response -> {System
.out.printf("Response statusCode: %d%n", response.getStatusCode());EmailNotificationHook
createdEmailHook = (EmailNotificationHook
) response.getValue();System
.out.printf("NotificationHook Id: %s%n", createdEmailHook.getId());System
.out.printf("NotificationHook Name: %s%n", createdEmailHook.getName());System
.out.printf("NotificationHook Description: %s%n", createdEmailHook.getDescription());System
.out.printf("NotificationHook External Link: %s%n", createdEmailHook.getExternalLink());System
.out.printf("NotificationHook Emails: %s%n",String
.join(",", createdEmailHook.getEmailsToAlert())); });
notificationHook
- The notificationHook.Response
of a Mono
containing the created NotificationHook
.NullPointerException
- If notificationHook
, notificationHook.name
,
notificationHook.endpoint
(for web notificationHook) is null.IllegalArgumentException
- If at least one email not present for email notificationHook.public Mono<NotificationHook> getHook(String hookId)
Code sample
finalString
hookId = "f00853f1-6627-447f-bacf-8dccf2e86fed"; metricsAdvisorAdminAsyncClient.getHook(hookId) .subscribe(hook -> { if (hook instanceofEmailNotificationHook
) {EmailNotificationHook
emailHook = (EmailNotificationHook
) hook;System
.out.printf("Email Hook Id: %s%n", emailHook.getId());System
.out.printf("Email Hook Name: %s%n", emailHook.getName());System
.out.printf("Email Hook Description: %s%n", emailHook.getDescription());System
.out.printf("Email Hook External Link: %s%n", emailHook.getExternalLink());System
.out.printf("Email Hook Emails: %s%n",String
.join(",", emailHook.getEmailsToAlert())); } else if (hook instanceofWebNotificationHook
) {WebNotificationHook
webHook = (WebNotificationHook
) hook;System
.out.printf("Web Hook Id: %s%n", webHook.getId());System
.out.printf("Web Hook Name: %s%n", webHook.getName());System
.out.printf("Web Hook Description: %s%n", webHook.getDescription());System
.out.printf("Web Hook External Link: %s%n", webHook.getExternalLink());System
.out.printf("Web Hook Endpoint: %s%n", webHook.getEndpoint());System
.out.printf("Web Hook Headers: %s%n", webHook.getHttpHeaders()); } });
hookId
- The hook unique id.Mono
containing the NotificationHook
for the provided id.IllegalArgumentException
- If hookId
does not conform to the UUID format specification.NullPointerException
- thrown if the hookId
is null.public Mono<com.azure.core.http.rest.Response<NotificationHook>> getHookWithResponse(String hookId)
Code sample
finalString
hookId = "f00853f1-6627-447f-bacf-8dccf2e86fed"; metricsAdvisorAdminAsyncClient.getHookWithResponse(hookId) .subscribe(response -> {System
.out.printf("Response status code: %d%n", response.getStatusCode());NotificationHook
notificationHook = response.getValue(); if (notificationHook instanceofEmailNotificationHook
) {EmailNotificationHook
emailHook = (EmailNotificationHook
) notificationHook;System
.out.printf("Email Hook Id: %s%n", emailHook.getId());System
.out.printf("Email Hook Name: %s%n", emailHook.getName());System
.out.printf("Email Hook Description: %s%n", emailHook.getDescription());System
.out.printf("Email Hook External Link: %s%n", emailHook.getExternalLink());System
.out.printf("Email Hook Emails: %s%n",String
.join(",", emailHook.getEmailsToAlert())); } else if (notificationHook instanceofWebNotificationHook
) {WebNotificationHook
webHook = (WebNotificationHook
) notificationHook;System
.out.printf("Web Hook Id: %s%n", webHook.getId());System
.out.printf("Web Hook Name: %s%n", webHook.getName());System
.out.printf("Web Hook Description: %s%n", webHook.getDescription());System
.out.printf("Web Hook External Link: %s%n", webHook.getExternalLink());System
.out.printf("Web Hook Endpoint: %s%n", webHook.getEndpoint());System
.out.printf("Web Hook Headers: %s%n", webHook.getHttpHeaders()); } });
hookId
- The hook unique id.Response
of a Mono
containing the NotificationHook
for the provided id.IllegalArgumentException
- If hookId
does not conform to the UUID format specification.NullPointerException
- thrown if the hookId
is null.public Mono<NotificationHook> updateHook(NotificationHook notificationHook)
Code sample
finalString
emailHookId = "f00853f1-6627-447f-bacf-8dccf2e86fed"; metricsAdvisorAdminAsyncClient.getHook(emailHookId) .flatMap(hook -> {EmailNotificationHook
emailHook = (EmailNotificationHook
) hook; emailHook .removeEmailToAlert("alertme@alertme.com") .addEmailToAlert("alertme2@alertme.com") .addEmailToAlert("alertme3@alertme.com"); return metricsAdvisorAdminAsyncClient.updateHook(emailHook); }) .subscribe(hook -> {EmailNotificationHook
emailHook = (EmailNotificationHook
) hook;System
.out.printf("Email Hook Id: %s%n", emailHook.getId());System
.out.printf("Email Hook Name: %s%n", emailHook.getName());System
.out.printf("Email Hook Description: %s%n", emailHook.getDescription());System
.out.printf("Email Hook External Link: %s%n", emailHook.getExternalLink());System
.out.printf("Email Hook Emails: %s%n",String
.join(",", emailHook.getEmailsToAlert())); });
notificationHook
- The notificationHook to update.Mono
containing the updated NotificationHook
.NullPointerException
- If notificationHook.id
is null.public Mono<com.azure.core.http.rest.Response<NotificationHook>> updateHookWithResponse(NotificationHook notificationHook)
Code sample
finalString
emailHookId = "f00853f1-6627-447f-bacf-8dccf2e86fed"; metricsAdvisorAdminAsyncClient.getHookWithResponse(emailHookId) .flatMap(response -> {EmailNotificationHook
emailHook = (EmailNotificationHook
) response.getValue(); emailHook .removeEmailToAlert("alertme@alertme.com") .addEmailToAlert("alertme2@alertme.com") .addEmailToAlert("alertme3@alertme.com"); return metricsAdvisorAdminAsyncClient.updateHookWithResponse(emailHook); }) .subscribe(response -> {System
.out.printf("Response statusCode: %d%n", response.getStatusCode());EmailNotificationHook
emailHook = (EmailNotificationHook
) response.getValue();System
.out.printf("Email Hook Id: %s%n", emailHook.getId());System
.out.printf("Email Hook Name: %s%n", emailHook.getName());System
.out.printf("Email Hook Description: %s%n", emailHook.getDescription());System
.out.printf("Email Hook External Link: %s%n", emailHook.getExternalLink());System
.out.printf("Email Hook Emails: %s%n",String
.join(",", emailHook.getEmailsToAlert())); });
notificationHook
- The notificationHook to update.Response
of a Mono
containing the updated NotificationHook
.NullPointerException
- If notificationHook.id
is null.IllegalArgumentException
- If notificationHook.Id
does not conform to the UUID format
specification.public Mono<Void> deleteHook(String hookId)
Code sample
final String
emailHookId = "f00853f1-6627-447f-bacf-8dccf2e86fed";
metricsAdvisorAdminAsyncClient.deleteHook(emailHookId);
hookId
- The hook unique id.NullPointerException
- thrown if the hookId
is null.IllegalArgumentException
- If hookId
does not conform to the UUID format specification.public Mono<com.azure.core.http.rest.Response<Void>> deleteHookWithResponse(String hookId)
Code sample
finalString
emailHookId = "f00853f1-6627-447f-bacf-8dccf2e86fed"; metricsAdvisorAdminAsyncClient.deleteHookWithResponse(emailHookId) .subscribe(response -> {System
.out.printf("Response statusCode: %d%n", response.getStatusCode()); });
hookId
- The hook unique id.Response
of a Mono
.NullPointerException
- thrown if the hookId
is null.IllegalArgumentException
- If hookId
does not conform to the UUID format specification.public com.azure.core.http.rest.PagedFlux<NotificationHook> listHooks()
Code sample
metricsAdvisorAdminAsyncClient.listHooks() .subscribe(hook -> { if (hook instanceofEmailNotificationHook
) {EmailNotificationHook
emailHook = (EmailNotificationHook
) hook;System
.out.printf("Email Hook Id: %s%n", emailHook.getId());System
.out.printf("Email Hook Name: %s%n", emailHook.getName());System
.out.printf("Email Hook Description: %s%n", emailHook.getDescription());System
.out.printf("Email Hook External Link: %s%n", emailHook.getExternalLink());System
.out.printf("Email Hook Emails: %s%n",String
.join(",", emailHook.getEmailsToAlert())); } else if (hook instanceofWebNotificationHook
) {WebNotificationHook
webHook = (WebNotificationHook
) hook;System
.out.printf("Web Hook Id: %s%n", webHook.getId());System
.out.printf("Web Hook Name: %s%n", webHook.getName());System
.out.printf("Web Hook Description: %s%n", webHook.getDescription());System
.out.printf("Web Hook External Link: %s%n", webHook.getExternalLink());System
.out.printf("Web Hook Endpoint: %s%n", webHook.getEndpoint());System
.out.printf("Web Hook Headers: %s%n", webHook.getHttpHeaders()); } });
PagedFlux
containing information of all the NotificationHook
in the account.public com.azure.core.http.rest.PagedFlux<NotificationHook> listHooks(ListHookOptions options)
Code sample
ListHookOptions
options = newListHookOptions
() .setSkip(100) .setMaxPageSize(20); int[] pageCount = new int[1]; metricsAdvisorAdminAsyncClient.listHooks(options).byPage() .subscribe(hookPage -> {System
.out.printf("Page: %d%n", pageCount[0]++); for (NotificationHook
notificationHook : hookPage.getElements()) { if (notificationHook instanceofEmailNotificationHook
) {EmailNotificationHook
emailHook = (EmailNotificationHook
) notificationHook;System
.out.printf("Email Hook Id: %s%n", emailHook.getId());System
.out.printf("Email Hook Name: %s%n", emailHook.getName());System
.out.printf("Email Hook Description: %s%n", emailHook.getDescription());System
.out.printf("Email Hook External Link: %s%n", emailHook.getExternalLink());System
.out.printf("Email Hook Emails: %s%n",String
.join(",", emailHook.getEmailsToAlert()));System
.out.printf("Email Hook Admins: %s%n",String
.join(",", emailHook.getAdminEmails())); } else if (notificationHook instanceofWebNotificationHook
) {WebNotificationHook
webHook = (WebNotificationHook
) notificationHook;System
.out.printf("Web Hook Id: %s%n", webHook.getId());System
.out.printf("Web Hook Name: %s%n", webHook.getName());System
.out.printf("Web Hook Description: %s%n", webHook.getDescription());System
.out.printf("Web Hook External Link: %s%n", webHook.getExternalLink());System
.out.printf("Web Hook Endpoint: %s%n", webHook.getEndpoint());System
.out.printf("Web Hook Headers: %s%n", webHook.getHttpHeaders());System
.out.printf("Web Hook Admins: %s%n",String
.join(",", webHook.getAdminEmails())); } } });
options
- The additional parametersPagedFlux
containing information of the NotificationHook
resources.public Mono<AnomalyAlertConfiguration> createAnomalyAlertConfig(AnomalyAlertConfiguration alertConfiguration)
Code sample
String
detectionConfigurationId1 = "9ol48er30-6e6e-4391-b78f-b00dfee1e6f5";String
detectionConfigurationId2 = "3e58er30-6e6e-4391-b78f-b00dfee1e6f5";String
hookId1 = "5f48er30-6e6e-4391-b78f-b00dfee1e6f5";String
hookId2 = "8i48er30-6e6e-4391-b78f-b00dfee1e6f5"; metricsAdvisorAdminAsyncClient.createAnomalyAlertConfig( newAnomalyAlertConfiguration
("My AnomalyAlert config name") .setDescription("alert config description") .setMetricAlertConfigurations(Arrays
.asList( newMetricAnomalyAlertConfiguration
(detectionConfigurationId1,MetricAnomalyAlertScope
.forWholeSeries()), newMetricAnomalyAlertConfiguration
(detectionConfigurationId2,MetricAnomalyAlertScope
.forWholeSeries()) .setAlertConditions(newMetricAnomalyAlertConditions
() .setSeverityRangeCondition(newSeverityCondition
().setMaxAlertSeverity(AnomalySeverity
.HIGH))))) .setCrossMetricsOperator(MetricAnomalyAlertConfigurationsOperator
.AND) .setIdOfHooksToAlert(Arrays
.asList(hookId1, hookId2))) .subscribe(anomalyAlertConfiguration -> {System
.out.printf("DataPoint Anomaly alert configuration Id: %s%n", anomalyAlertConfiguration.getId());System
.out.printf("DataPoint Anomaly alert configuration description: %s%n", anomalyAlertConfiguration.getDescription());System
.out.printf("DataPoint Anomaly alert configuration hook ids: %s%n", anomalyAlertConfiguration.getIdOfHooksToAlert());System
.out.printf("DataPoint Anomaly alert configuration cross metrics operator: %s%n", anomalyAlertConfiguration.getCrossMetricsOperator().toString()); });
alertConfiguration
- The anomaly alerting configuration.Mono
containing the created AnomalyAlertConfiguration
.NullPointerException
- thrown if the alertConfiguration
or
alertConfiguration.metricAnomalyAlertConfigurations
is null.public Mono<com.azure.core.http.rest.Response<AnomalyAlertConfiguration>> createAnomalyAlertConfigWithResponse(AnomalyAlertConfiguration alertConfiguration)
Code sample
String
detectionConfigurationId1 = "9ol48er30-6e6e-4391-b78f-b00dfee1e6f5";String
detectionConfigurationId2 = "3e58er30-6e6e-4391-b78f-b00dfee1e6f5";String
hookId1 = "5f48er30-6e6e-4391-b78f-b00dfee1e6f5";String
hookId2 = "8i48er30-6e6e-4391-b78f-b00dfee1e6f5"; metricsAdvisorAdminAsyncClient.createAnomalyAlertConfigWithResponse( newAnomalyAlertConfiguration
("My AnomalyAlert config name") .setDescription("alert config description") .setMetricAlertConfigurations(Arrays
.asList( newMetricAnomalyAlertConfiguration
(detectionConfigurationId1,MetricAnomalyAlertScope
.forWholeSeries()), newMetricAnomalyAlertConfiguration
(detectionConfigurationId2,MetricAnomalyAlertScope
.forWholeSeries()) .setAlertConditions(newMetricAnomalyAlertConditions
() .setSeverityRangeCondition(newSeverityCondition
().setMaxAlertSeverity(AnomalySeverity
.HIGH))))) .setCrossMetricsOperator(MetricAnomalyAlertConfigurationsOperator
.AND) .setIdOfHooksToAlert(Arrays
.asList(hookId1, hookId2))) .subscribe(alertConfigurationResponse -> {System
.out.printf("DataPoint Anomaly alert creation operation status: %s%n", alertConfigurationResponse.getStatusCode()); finalAnomalyAlertConfiguration
anomalyAlertConfiguration = alertConfigurationResponse.getValue();System
.out.printf("DataPoint Anomaly alert configuration Id: %s%n", anomalyAlertConfiguration.getId());System
.out.printf("DataPoint Anomaly alert configuration description: %s%n", anomalyAlertConfiguration.getDescription());System
.out.printf("DataPoint Anomaly alert configuration hook ids: %s%n", anomalyAlertConfiguration.getIdOfHooksToAlert());System
.out.printf("DataPoint Anomaly alert configuration cross metrics operator: %s%n", anomalyAlertConfiguration.getCrossMetricsOperator().toString()); });
alertConfiguration
- The anomaly alerting configuration.Response
of a Mono
containing the created AnomalyAlertConfiguration
.NullPointerException
- thrown if the alertConfiguration
or
alertConfiguration.metricAnomalyAlertConfigurations
is null.public Mono<AnomalyAlertConfiguration> getAnomalyAlertConfig(String alertConfigurationId)
alertConfigurationId
.
Code sample
String
alertConfigId = "1p0f8er30-6e6e-4391-b78f-bpfdfee1e6f5"; metricsAdvisorAdminAsyncClient.getAnomalyAlertConfig(alertConfigId) .subscribe(anomalyAlertConfiguration -> {System
.out.printf("DataPoint Anomaly alert configuration Id: %s%n", anomalyAlertConfiguration.getId());System
.out.printf("DataPoint Anomaly alert configuration description: %s%n", anomalyAlertConfiguration.getDescription());System
.out.printf("DataPoint Anomaly alert configuration hook ids: %s%n", anomalyAlertConfiguration.getIdOfHooksToAlert());System
.out.printf("DataPoint Anomaly alert configuration cross metrics operator: %s%n", anomalyAlertConfiguration.getCrossMetricsOperator().toString()); });
alertConfigurationId
- The anomaly alert configuration id.Mono
containing the AnomalyAlertConfiguration
identified by the given id.IllegalArgumentException
- If alertConfigurationId
does not conform to the
UUID format specification.NullPointerException
- thrown if the alertConfigurationId
is null.public Mono<com.azure.core.http.rest.Response<AnomalyAlertConfiguration>> getAnomalyAlertConfigWithResponse(String alertConfigurationId)
alertConfigurationId
.
Code sample
String
alertConfigId = "1p0f8er30-6e6e-4391-b78f-bpfdfee1e6f5"; metricsAdvisorAdminAsyncClient.getAnomalyAlertConfigWithResponse(alertConfigId) .subscribe(alertConfigurationResponse -> {System
.out.printf("DataPointAnomaly alert creation operation status: %s%n", alertConfigurationResponse.getStatusCode()); finalAnomalyAlertConfiguration
anomalyAlertConfiguration = alertConfigurationResponse.getValue();System
.out.printf("DataPoint Anomaly alert configuration Id: %s%n", anomalyAlertConfiguration.getId());System
.out.printf("DataPoint Anomaly alert configuration description: %s%n", anomalyAlertConfiguration.getDescription());System
.out.printf("DataPoint Anomaly alert configuration hook ids: %s%n", anomalyAlertConfiguration.getIdOfHooksToAlert());System
.out.printf("DataPoint Anomaly alert configuration cross metrics operator: %s%n", anomalyAlertConfiguration.getCrossMetricsOperator().toString()); });
alertConfigurationId
- The anomaly alert configuration id.response
of a Mono
containing the AnomalyAlertConfiguration
identified by the given id.IllegalArgumentException
- If alertConfigurationId
does not conform to the
UUID format specification.NullPointerException
- thrown if the alertConfigurationId
is null.public Mono<AnomalyAlertConfiguration> updateAnomalyAlertConfig(AnomalyAlertConfiguration alertConfiguration)
Code sample
String
alertConfigId = "1p0f8er30-6e6e-4391-b78f-bpfdfee1e6f5";String
additionalHookId = "2gh8er30-6e6e-4391-b78f-bpfdfee1e6f5"; metricsAdvisorAdminAsyncClient.getAnomalyAlertConfig(alertConfigId) .flatMap(existingAnomalyConfig -> { return metricsAdvisorAdminAsyncClient.updateAnomalyAlertConfig( existingAnomalyConfig .addIdOfHookToAlert(additionalHookId) .setDescription("updated to add more hook ids")); }).subscribe(updateAnomalyAlertConfiguration -> {System
.out.printf("Updated anomaly alert configuration Id: %s%n", updateAnomalyAlertConfiguration.getId());System
.out.printf("Updated anomaly alert configuration description: %s%n", updateAnomalyAlertConfiguration.getDescription());System
.out.printf("Updated anomaly alert configuration hook ids: %s%n", updateAnomalyAlertConfiguration.getIdOfHooksToAlert()); });
alertConfiguration
- The anomaly alert configuration to update.Mono
containing the AnomalyAlertConfiguration
that was updated.NullPointerException
- thrown if alertConfiguration
or
alertConfiguration.metricAnomalyAlertConfigurations
is null or empty.public Mono<com.azure.core.http.rest.Response<AnomalyAlertConfiguration>> updateAnomalyAlertConfigWithResponse(AnomalyAlertConfiguration alertConfiguration)
Code sample
String
alertConfigId = "1p0f8er30-6e6e-4391-b78f-bpfdfee1e6f5";String
additionalHookId = "2gh8er30-6e6e-4391-b78f-bpfdfee1e6f5"; metricsAdvisorAdminAsyncClient.getAnomalyAlertConfig(alertConfigId) .flatMap(existingAnomalyConfig -> { return metricsAdvisorAdminAsyncClient.updateAnomalyAlertConfigWithResponse( existingAnomalyConfig .addIdOfHookToAlert(additionalHookId) .setDescription("updated to add more hook ids")); }).subscribe(alertConfigurationResponse -> {System
.out.printf("Update anomaly alert operation status: %s%n", alertConfigurationResponse.getStatusCode()); finalAnomalyAlertConfiguration
updatAnomalyAlertConfiguration = alertConfigurationResponse.getValue();System
.out.printf("Updated anomaly alert configuration Id: %s%n", updatAnomalyAlertConfiguration.getId());System
.out.printf("Updated anomaly alert configuration description: %s%n", updatAnomalyAlertConfiguration.getDescription());System
.out.printf("Updated anomaly alert configuration hook ids: %s%n", updatAnomalyAlertConfiguration.getIdOfHooksToAlert()); });
alertConfiguration
- The anomaly alert configuration to update.Response
of a Mono
containing the AnomalyAlertConfiguration
that was updated.NullPointerException
- thrown if alertConfiguration
or
alertConfiguration.metricAnomalyAlertConfigurations
is null or empty.public Mono<Void> deleteAnomalyAlertConfig(String alertConfigurationId)
alertConfigurationId
.
Code sample
String
alertConfigId = "1p0f8er30-6e6e-4391-b78f-bpfdfee1e6f5";
metricsAdvisorAdminAsyncClient.deleteAnomalyAlertConfig(alertConfigId);
alertConfigurationId
- The anomaly alert configuration id.IllegalArgumentException
- If alertConfigurationId
does not conform to the
UUID format specification.NullPointerException
- thrown if the alertConfigurationId
is null.public Mono<com.azure.core.http.rest.Response<Void>> deleteAnomalyAlertConfigWithResponse(String alertConfigurationId)
alertConfigurationId
.
Code sample
String
alertConfigId = "1p0f8er30-6e6e-4391-b78f-bpfdfee1e6f5"; metricsAdvisorAdminAsyncClient.deleteAnomalyAlertConfigWithResponse(alertConfigId) .subscribe(response -> {System
.out.printf("DataPoint Anomaly alert config delete operation status : %s%n", response.getStatusCode()); });
alertConfigurationId
- The anomaly alert configuration id.IllegalArgumentException
- If alertConfigurationId
does not conform to the
UUID format specification.NullPointerException
- thrown if the alertConfigurationId
is null.public com.azure.core.http.rest.PagedFlux<AnomalyAlertConfiguration> listAnomalyAlertConfigs(String detectionConfigurationId, ListAnomalyAlertConfigsOptions options)
Code sample
String
detectionConfigId = "3rt98er30-6e6e-4391-b78f-bpfdfee1e6f5"; metricsAdvisorAdminAsyncClient.listAnomalyAlertConfigs(detectionConfigId, newListAnomalyAlertConfigsOptions
()) .subscribe(anomalyAlertConfiguration -> {System
.out.printf("DataPoint Anomaly alert configuration Id: %s%n", anomalyAlertConfiguration.getId());System
.out.printf("DataPoint Anomaly alert configuration description: %s%n", anomalyAlertConfiguration.getDescription());System
.out.printf("DataPoint Anomaly alert configuration hook ids: %s%n", anomalyAlertConfiguration.getIdOfHooksToAlert());System
.out.printf("DataPoint Anomaly alert configuration cross metrics operator: %s%n", anomalyAlertConfiguration.getCrossMetricsOperator().toString()); });
detectionConfigurationId
- The id of the detection configuration.options
- th e additional configurable options to specify when querying the result.PagedFlux
containing information of all the
anomaly alert configurations
for the specified detection configuration.NullPointerException
- thrown if the detectionConfigurationId
is null.IllegalArgumentException
- If detectionConfigurationId
does not conform to the
UUID format specification.public Mono<DatasourceCredentialEntity> createDatasourceCredential(DatasourceCredentialEntity datasourceCredential)
Code sample
DatasourceCredentialEntity
datasourceCredential; finalString
name = "sample_name" +UUID
.randomUUID(); finalString
cId = "f45668b2-bffa-11eb-8529-0246ac130003"; finalString
tId = "67890ded-5e07-4e52-b225-4ae8f905afb5"; finalString
mockSecr = "890hy69-5e07-4e52-b225-4ae8f905afb5"; datasourceCredential = newDatasourceServicePrincipalInKeyVault
() .setName(name) .setKeyVaultForDatasourceSecrets("kv", cId, mockSecr) .setTenantId(tId) .setSecretNameForDatasourceClientId("DSClientID_1") .setSecretNameForDatasourceClientSecret("DSClientSer_1"); metricsAdvisorAdminAsyncClient.createDatasourceCredential(datasourceCredential) .subscribe(credentialEntity -> { if (credentialEntity instanceofDatasourceServicePrincipalInKeyVault
) {DatasourceServicePrincipalInKeyVault
actualCredentialSPInKV = (DatasourceServicePrincipalInKeyVault
) credentialEntity;System
.out .printf("Actual credential entity key vault endpoint: %s%n", actualCredentialSPInKV.getKeyVaultEndpoint());System
.out.printf("Actual credential entity key vault client Id: %s%n", actualCredentialSPInKV.getKeyVaultClientId());System
.out.printf("Actual credential entity key vault secret name for data source: %s%n", actualCredentialSPInKV.getSecretNameForDatasourceClientId());System
.out.printf("Actual credential entity key vault secret for data source: %s%n", actualCredentialSPInKV.getSecretNameForDatasourceClientSecret()); } });
datasourceCredential
- The credential entity.Mono
containing the created DatasourceCredentialEntity
.NullPointerException
- thrown if the credentialEntity
is nullpublic Mono<com.azure.core.http.rest.Response<DatasourceCredentialEntity>> createDatasourceCredentialWithResponse(DatasourceCredentialEntity datasourceCredential)
Code sample
DatasourceCredentialEntity
datasourceCredential; finalString
name = "sample_name" +UUID
.randomUUID(); finalString
cId = "f45668b2-bffa-11eb-8529-0246ac130003"; finalString
tId = "67890ded-5e07-4e52-b225-4ae8f905afb5"; finalString
mockSecr = "890hy69-5e07-4e52-b225-4ae8f905afb5"; datasourceCredential = newDatasourceServicePrincipalInKeyVault
() .setName(name) .setKeyVaultForDatasourceSecrets("kv", cId, mockSecr) .setTenantId(tId) .setSecretNameForDatasourceClientId("DSClientID_1") .setSecretNameForDatasourceClientSecret("DSClientSer_1"); metricsAdvisorAdminAsyncClient.createDatasourceCredentialWithResponse(datasourceCredential) .subscribe(credentialEntityWithResponse -> {System
.out.printf("Credential Entity creation operation status: %s%n", credentialEntityWithResponse.getStatusCode()); if (credentialEntityWithResponse.getValue() instanceofDatasourceServicePrincipalInKeyVault
) {DatasourceServicePrincipalInKeyVault
actualCredentialSPInKV = (DatasourceServicePrincipalInKeyVault
) credentialEntityWithResponse.getValue();System
.out .printf("Actual credential entity key vault endpoint: %s%n", actualCredentialSPInKV.getKeyVaultEndpoint());System
.out.printf("Actual credential entity key vault client Id: %s%n", actualCredentialSPInKV.getKeyVaultClientId());System
.out.printf("Actual credential entity key vault secret name for data source: %s%n", actualCredentialSPInKV.getSecretNameForDatasourceClientId());System
.out.printf("Actual credential entity key vault secret for data source: %s%n", actualCredentialSPInKV.getSecretNameForDatasourceClientSecret()); } });
datasourceCredential
- The credential entity.Mono
containing the created DatasourceCredentialEntity
.NullPointerException
- thrown if the credentialEntity
is nullpublic Mono<DatasourceCredentialEntity> updateDatasourceCredential(DatasourceCredentialEntity datasourceCredential)
Code sample
String
credentialId = ""; metricsAdvisorAdminAsyncClient.getDatasourceCredential(credentialId) .flatMap(existingDatasourceCredential -> {DatasourceServicePrincipalInKeyVault
actualCredentialSPInKV = null; if (existingDatasourceCredential instanceofDatasourceServicePrincipalInKeyVault
) { actualCredentialSPInKV = (DatasourceServicePrincipalInKeyVault
) existingDatasourceCredential; } return metricsAdvisorAdminAsyncClient.updateDatasourceCredential( actualCredentialSPInKV.setDescription("set updated description")); }) .subscribe(credentialEntity -> { if (credentialEntity instanceofDatasourceServicePrincipalInKeyVault
) {DatasourceServicePrincipalInKeyVault
actualCredentialSPInKV = (DatasourceServicePrincipalInKeyVault
) credentialEntity;System
.out.printf("Actual credential entity key vault endpoint: %s%n", actualCredentialSPInKV.getKeyVaultEndpoint());System
.out.printf("Actual credential entity key vault updated description: %s%n", actualCredentialSPInKV.getDescription()); } });
datasourceCredential
- The credential entity.Mono
containing the updated DatasourceCredentialEntity
.NullPointerException
- thrown if the credentialEntity
is nullpublic Mono<com.azure.core.http.rest.Response<DatasourceCredentialEntity>> updateDatasourceCredentialWithResponse(DatasourceCredentialEntity datasourceCredential)
Code sample
String
credentialId = ""; metricsAdvisorAdminAsyncClient.getDatasourceCredential(credentialId) .flatMap(existingDatasourceCredential -> {DatasourceServicePrincipalInKeyVault
actualCredentialSPInKV = null; if (existingDatasourceCredential instanceofDatasourceServicePrincipalInKeyVault
) { actualCredentialSPInKV = (DatasourceServicePrincipalInKeyVault
) existingDatasourceCredential; } return metricsAdvisorAdminAsyncClient.updateDatasourceCredentialWithResponse( actualCredentialSPInKV.setDescription("set updated description")); }) .subscribe(credentialEntityWithResponse -> {System
.out.printf("Credential Entity creation operation status: %s%n", credentialEntityWithResponse.getStatusCode()); if (credentialEntityWithResponse.getValue() instanceofDatasourceServicePrincipalInKeyVault
) {DatasourceServicePrincipalInKeyVault
actualCredentialSPInKV = (DatasourceServicePrincipalInKeyVault
) credentialEntityWithResponse.getValue();System
.out.printf("Actual credential entity key vault endpoint: %s%n", actualCredentialSPInKV.getKeyVaultEndpoint());System
.out.printf("Actual credential entity key vault updated description: %s%n", actualCredentialSPInKV.getDescription()); } });
datasourceCredential
- The credential entity.Mono
containing the updated DatasourceCredentialEntity
.NullPointerException
- thrown if the credentialEntity
is nullpublic Mono<DatasourceCredentialEntity> getDatasourceCredential(String credentialId)
Code sample
finalString
datasourceCredentialId = "f45668b2-bffa-11eb-8529-0246ac130003"; metricsAdvisorAdminAsyncClient.getDatasourceCredential(datasourceCredentialId) .subscribe(credentialEntity -> { if (credentialEntity instanceofDatasourceServicePrincipalInKeyVault
) {DatasourceServicePrincipalInKeyVault
actualCredentialSPInKV = (DatasourceServicePrincipalInKeyVault
) credentialEntity;System
.out .printf("Actual credential entity key vault endpoint: %s%n", actualCredentialSPInKV.getKeyVaultEndpoint());System
.out.printf("Actual credential entity key vault client Id: %s%n", actualCredentialSPInKV.getKeyVaultClientId());System
.out.printf("Actual credential entity key vault secret name for data source: %s%n", actualCredentialSPInKV.getSecretNameForDatasourceClientId());System
.out.printf("Actual credential entity key vault secret for data source: %s%n", actualCredentialSPInKV.getSecretNameForDatasourceClientSecret()); } });
credentialId
- The data source credential entity unique id.IllegalArgumentException
- If credentialId
does not conform to the UUID format specification.NullPointerException
- thrown if the credentialId
is null.public Mono<com.azure.core.http.rest.Response<DatasourceCredentialEntity>> getDatasourceCredentialWithResponse(String credentialId)
Code sample
finalString
datasourceCredentialId = "f45668b2-bffa-11eb-8529-0246ac130003"; metricsAdvisorAdminAsyncClient.getDatasourceCredentialWithResponse(datasourceCredentialId) .subscribe(credentialEntityWithResponse -> {System
.out.printf("Credential Entity creation operation status: %s%n", credentialEntityWithResponse.getStatusCode()); if (credentialEntityWithResponse.getValue() instanceofDatasourceServicePrincipalInKeyVault
) {DatasourceServicePrincipalInKeyVault
actualCredentialSPInKV = (DatasourceServicePrincipalInKeyVault
) credentialEntityWithResponse.getValue();System
.out .printf("Actual credential entity key vault endpoint: %s%n", actualCredentialSPInKV.getKeyVaultEndpoint());System
.out.printf("Actual credential entity key vault client Id: %s%n", actualCredentialSPInKV.getKeyVaultClientId());System
.out.printf("Actual credential entity key vault secret name for data source: %s%n", actualCredentialSPInKV.getSecretNameForDatasourceClientId());System
.out.printf("Actual credential entity key vault secret for data source: %s%n", actualCredentialSPInKV.getSecretNameForDatasourceClientSecret()); } });
credentialId
- The data source credential entity unique id.IllegalArgumentException
- If credentialId
does not conform to the UUID format specification.NullPointerException
- thrown if the credentialId
is null.public Mono<Void> deleteDatasourceCredential(String credentialId)
credentialId
.
Code sample
final String
datasourceCredentialId = "t00853f1-9080-447f-bacf-8dccf2e86f";
metricsAdvisorAdminAsyncClient.deleteDataFeed(datasourceCredentialId);
credentialId
- The data source credential entity id.IllegalArgumentException
- If credentialId
does not conform to the
UUID format specification.NullPointerException
- thrown if the credentialId
is null.public Mono<com.azure.core.http.rest.Response<Void>> deleteDatasourceCredentialWithResponse(String credentialId)
credentialId
.
Code sample
finalString
datasourceCredentialId = "eh0854f1-8927-447f-bacf-8dccf2e86fwe"; metricsAdvisorAdminAsyncClient.deleteDatasourceCredentialWithResponse(datasourceCredentialId) .subscribe(response ->System
.out.printf("Datasource credential delete operation status : %s%n", response.getStatusCode()));
credentialId
- The data source credential entity id.IllegalArgumentException
- If credentialId
does not conform to the
UUID format specification.NullPointerException
- thrown if the credentialId
is null.public com.azure.core.http.rest.PagedFlux<DatasourceCredentialEntity> listDatasourceCredentials()
Code sample
metricsAdvisorAdminAsyncClient.listDatasourceCredentials() .subscribe(datasourceCredentialEntity -> { if (datasourceCredentialEntity instanceofDatasourceServicePrincipalInKeyVault
) {DatasourceServicePrincipalInKeyVault
actualCredentialSPInKV = (DatasourceServicePrincipalInKeyVault
) datasourceCredentialEntity;System
.out .printf("Actual credential entity key vault endpoint: %s%n", actualCredentialSPInKV.getKeyVaultEndpoint());System
.out.printf("Actual credential entity key vault client Id: %s%n", actualCredentialSPInKV.getKeyVaultClientId());System
.out.printf("Actual credential entity key vault secret name for data source: %s%n", actualCredentialSPInKV.getSecretNameForDatasourceClientId());System
.out.printf("Actual credential entity key vault secret for data source: %s%n", actualCredentialSPInKV.getSecretNameForDatasourceClientSecret()); } });
PagedFlux
containing information of all the data feeds
in the account.public com.azure.core.http.rest.PagedFlux<DatasourceCredentialEntity> listDatasourceCredentials(ListCredentialEntityOptions options)
Code sample
metricsAdvisorAdminAsyncClient.listDatasourceCredentials( newListCredentialEntityOptions
() .setMaxPageSize(3)) .subscribe(datasourceCredentialEntity -> { if (datasourceCredentialEntity instanceofDatasourceServicePrincipalInKeyVault
) {DatasourceServicePrincipalInKeyVault
actualCredentialSPInKV = (DatasourceServicePrincipalInKeyVault
) datasourceCredentialEntity;System
.out .printf("Actual credential entity key vault endpoint: %s%n", actualCredentialSPInKV.getKeyVaultEndpoint());System
.out.printf("Actual credential entity key vault client Id: %s%n", actualCredentialSPInKV.getKeyVaultClientId());System
.out.printf("Actual credential entity key vault secret name for data source: %s%n", actualCredentialSPInKV.getSecretNameForDatasourceClientId());System
.out.printf("Actual credential entity key vault secret for data source: %s%n", actualCredentialSPInKV.getSecretNameForDatasourceClientSecret()); } });
options
- The configurable options
to pass for filtering
the output result.PagedFlux
containing information of all the data feeds
in the account.Copyright © 2021 Microsoft Corporation. All rights reserved.