快速入门:使用 REST API 自定义解决方案Quickstart: Use the REST APIs to customize your solution

开始使用指标顾问 REST API。Get started with the the Metrics Advisor REST API. 请按照以下步骤安装程序包并试用基本任务的示例代码。Follow these steps to install the package and try out the example code for basic tasks.

使用指标顾问执行以下操作:Use Metrics Advisor to perform:

  • 从数据源添加数据馈送Add a data feed from a data source
  • 检查引入状态Check ingestion status
  • 配置检测和警报Configure detection and alerts
  • 查询异常情况检测结果Query the anomaly detection results
  • 诊断异常Diagnose anomalies

先决条件Prerequisites

  • Azure 订阅 - 创建试用订阅Azure subscription - Create one for trial
  • 获得 Azure 订阅后,在 Azure 门户中创建“指标顾问”资源 ,以部署“指标顾问”实例。Once you have your Azure subscription, create a Metrics Advisor resource in the Azure portal to deploy your Metrics Advisor instance.
  • 最新版本的 cURLThe current version of cURL. 本文使用了 cURL 文档中所述的多个命令行开关。Several command-line switches are used in this article, which are noted in the cURL documentation.
    • 以下 BASH 示例使用 \ 行继续符。The following BASH examples use the \ line continuation character. 如果你的控制台或终端使用不同的行继续符,请使用此字符。If you console or terminal uses a different line continuation character, use this character.

提示

  • 可以在 GitHub 上找到调用 REST API 的 Python 示例。You can find a Python sample that calls the REST API on GitHub.
  • 指标顾问资源可能需要 10 到 30 分钟才能部署一个服务实例供你使用。It may 10 to 30 minutes for your Metrics Advisor resource to deploy a service instance for you to use. 部署成功后,单击“转到资源”。Click Go to resource once it successfully deploys. 部署完成后,可以通过 Web 门户和 REST API 这两种方式开始使用指标顾问实例。After deployment, you can start using your Metrics Advisor instance with both the web portal and REST API.
  • 可以在 Azure 门户的资源“概述”部分中找到 REST API 的 URL。You can find the URL for the REST API in Azure portal, in the Overview section of your resource. 它将如下所示:it will look like this:
    • https://<instance-name>.cognitiveservices.azure.cn/

开始使用 REST API 需要两个密钥:You will need two keys to start using the REST API:

  • 指标顾问资源的密钥。The key to your Metrics Advisor resource. 可以在 Azure 门户中资源的“密钥和终结点”部分中找到此密钥。You can find this in the Keys and Endpoint section of your resource in the Azure portal.
    • 稍后要将示例中的 Ocp-Apim-Subscription-Key 替换为此密钥。Later you will replace Ocp-Apim-Subscription-Key in the examples with this key.
  • 指标顾问实例的 API 密钥。The API key for your Metrics Advisor instance. 可以在指标顾问的 Web 门户中左侧导航菜单上的“API 密钥”中找到此密钥。You can find this in the web portal for Metrics Advisor, in API keys on the left navigation menu.
    • 稍后要将示例中的 x-api-key 替换为此密钥。Later you will replace x-api-key in the examples with this key.

从示例或数据源添加数据馈送Add a data feed from a sample or data source

若要开始监视时序数据,需要添加一个数据馈送。To start monitoring your time series data, you need add a data feed. 若要添加数据馈送,需要根据数据源类型和参数提供数据架构。To add a data feed, you need to provide a data schema according to the data source type and parameters. 将以下 JSON 请求正文保存到名为 body.json 的文件中,然后运行 cURL 命令。Save the below JSON request body to a file named body.json, and run the cURL command.

{
        "dataSourceType": "SqlServer",
        "dataFeedName": "test_data_feed_00000001",
        "dataFeedDescription": "",
        "dataSourceParameter": {
            "connectionString": "Server=ad-sample.database.chinacloudapi.cn,1433;Initial Catalog=ad-sample;Persist Security Info=False;User ID=adreadonly;Password=Readonly@2020;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;",
            "query": "select * from adsample3 where Timestamp = @StartTime"
        },
        "granularityName": "Daily",
        "granularityAmount": 0,
        "metrics": [
            {
                "metricName": "revenue",
                "metricDisplayName": "revenue",
                "metricDescription": ""
            },
            {
                "metricName": "cost",
                "metricDisplayName": "cost",
                "metricDescription": ""
            }
        ],
        "dimension": [
            {
                "dimensionName": "city",
                "dimensionDisplayName": "city"
            },
            {
                "dimensionName": "category",
                "dimensionDisplayName": "category"
            }
        ],
        "timestampColumn": "timestamp",
        "dataStartFrom": "2020-06-01T00:00:00.000Z",
        "startOffsetInSeconds": 0,
        "maxConcurrency": -1,
        "minRetryIntervalInSeconds": -1,
        "stopRetryAfterInSeconds": -1,
        "needRollup": "NoRollup",
        "fillMissingPointType": "SmartFilling",
        "fillMissingPointValue": 0,
        "viewMode": "Private",
        "admins": [
            "xxx@microsoft.com"
        ],
        "viewers": [
        ],
        "actionLinkTemplate": ""
}

cURL 命令将从 BASH shell 执行。The cURL command is executed from a BASH shell. 请使用自己的资源名称、资源密钥和 JSON 值编辑此命令。Edit this command with your own resource name, resource key, and JSON values.

curl -i https://REPLACE-WITH-YOUR-ENDPOINT/metricsadvisor/v1.0/datafeeds \
-X POST \
-H "Ocp-Apim-Subscription-Key: REPLACE-WITH-YOUR-RESOURCE-KEY" \
-H "x-api-key: REPLACE-WITH-YOUR-API-KEY" \
-H "Content-Type:application/json" \
-d @body.json

示例响应Example response

HTTP/1.1 201 Created
Content-Length: 0
Location: https://gualala-beta-0617.cognitiveservices.azure.cn/metricsadvisor/v1.0/datafeeds/b5921405-8001-42b2-8746-004ddeeb780d
x-envoy-upstream-service-time: 564
apim-request-id: 4e4fe70b-d663-4fb7-a804-b9dc14ba02a3
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
x-content-type-options: nosniff
Date: Thu, 03 Sep 2020 18:29:27 GMT

在上面的响应中,“位置”标头是所创建的数据馈送的 URL,其中包含“dataFeedID” 。In above response, Location header is the URL of data feed you created, and it contains dataFeedID.

使用上述 URL,可以查询在上一步中创建的数据馈送的详细信息。Using above URL, you can query detailed information of the data feed you've created in previous step. (在以下步骤中,我们将使用数据馈送信息中的“metricID”)(We will use metricID in data feed info in the following steps)

curl https://REPLACE-WITH-YOUR-ENDPOINT/metricsadvisor/v1.0/datafeeds/REPLACE-WITH-YOUR-DATA-FEED-ID \
-H "Ocp-Apim-Subscription-Key: REPLACE-WITH-YOUR-RESOURCE-KEY" \
-H "x-api-key: REPLACE-WITH-YOUR-API-KEY"

示例响应Example response

{
   "dataFeedId":"90919c03-be13-4efa-86e5-aa9dc72764ce",
   "dataFeedName":"test_data_feed_00000007",
   "metrics":[
      {
         "metricId":"8d03e541-a56d-4c28-8d9c-09ce91c6d95f",
         "metricName":"cost",
         "metricDisplayName":"cost",
         "metricDescription":""
      },
      {
         "metricId":"82bbc63d-3739-4d57-b190-accb69721b6a",
         "metricName":"revenue",
         "metricDisplayName":"revenue",
         "metricDescription":""
      }
   ],
   "dimension":[
      {
         "dimensionName":"category",
         "dimensionDisplayName":"category"
      },
      {
         "dimensionName":"city",
         "dimensionDisplayName":"city"
      }
   ],
   "dataStartFrom":"2020-06-01T00:00:00Z",
   "dataSourceType":"SqlServer",
   "timestampColumn":"timestamp",
   "startOffsetInSeconds":0,
   "maxQueryPerMinute":30.0,
   "granularityName":"Daily",
   "granularityAmount":null,
   "allUpIdentification":null,
   "needRollup":"NoRollup",
   "fillMissingPointType":"SmartFilling",
   "fillMissingPointValue":0.0,
   "rollUpMethod":"None",
   "rollUpColumns":[
      
   ],
   "dataFeedDescription":"",
   "stopRetryAfterInSeconds":-1,
   "minRetryIntervalInSeconds":-1,
   "maxConcurrency":-1,
   "viewMode":"Private",
   "admins":[
      "xyz@microsoft.com"
   ],
   "viewers":[
      
   ],
   "creator":"xyz@microsoft.com",
   "status":"Active",
   "createdTime":"2020-09-08T08:39:28Z",
   "isAdmin":true,
   "actionLinkTemplate":"",
   "dataSourceParameter":{
      "connectionString":"Server=ad-sample.database.chinacloudapi.cn,1433;Initial Catalog=ad-sample;Persist Security Info=False;User ID=adreadonly;Password=Readonly@2020;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;",
      "query":"select * from adsample3 where Timestamp = @StartTime"
   }
}

检查引入状态Check ingestion status

添加数据馈送后,若要检查引入作业的进度,可以检查其状态。After adding data feed, if you want to check the progress of an ingestion job, you can check the status of it. 将以下 JSON 请求正文保存到名为 body.json 的文件中,然后运行 cURL 命令。Save the below JSON request body to a file named body.json, and run the cURL command.

{
  "startTime": "2020-01-01T00:00:00.0000000+00:00",
  "endTime": "2020-01-04T00:00:00.0000000+00:00"
}

cURL 命令将从 BASH shell 执行。The cURL command is executed from a BASH shell. 请使用自己的资源名称、资源密钥、JSON 值和 JSON 大小编辑此命令。Edit this command with your own resource name, resource key, and JSON values and size of JSON.

curl https://REPLACE-WITH-YOUR-ENDPOINT/metricsadvisor/v1.0/datafeeds/REPLACE-WITH-YOUR-DATA-FEED-ID/ingestionStatus/query \
-X POST \
-H "Ocp-Apim-Subscription-Key: REPLACE-WITH-YOUR-RESOURCE-KEY" \
-H "x-api-key: REPLACE-WITH-YOUR-API-KEY" \
-H "Content-Type:application/json" \
-d @body.json

示例响应Example response

{
  "@nextLink": "https://demo.example.com/datafeeds/01234567-8901-2345-6789-012345678901/ingestionStatus/query?$skip=3&$top=1",
  "value": [
    {
      "timestamp": "2020-09-03T00:00:00.0000000+00:00",
      "status": "Running",
      "message": ""
    },
    {
      "timestamp": "2020-09-02T00:00:00.0000000+00:00",
      "status": "Succeeded",
      "message": ""
    },
    {
      "timestamp": "2020-09-01T00:00:00.0000000+00:00",
      "status": "Failed",
      "message": "No valid record pulled from source for current timestamp 2020-01-01T00:00:00Z"
    }
  ]
}

配置异常情况检测配置Configure anomaly detection configuration

虽然默认配置会自动应用于每个指标,但可以调整对数据用的检测模式。While a default configuration is automatically applied to each metric, you can tune the detection modes used on your data. 将以下 JSON 请求正文保存到名为 body.json 的文件中,然后运行 cURL 命令。Save the below JSON request body to a file named body.json, and run the cURL command.

{
        "name": "test_detection_config0000000001",
        "description": "string",
        "metricId": "8d03e541-a56d-4c28-8d9c-09ce91c6d95f",
        "wholeMetricConfiguration": {
            "smartDetectionCondition": {
                "sensitivity": 100,
                "anomalyDetectorDirection": "Both",
                "suppressCondition": {
                    "minNumber": 1,
                    "minRatio": 1
                }
            }
        },
        "dimensionGroupOverrideConfigurations": [
        ],
        "seriesOverrideConfigurations": [
        ]
}

cURL 命令将从 BASH shell 执行。The cURL command is executed from a BASH shell. 请使用自己的资源名称、资源密钥、JSON 值和 JSON 大小编辑此命令。Edit this command with your own resource name, resource key, and JSON values and size of JSON.

curl -i https://REPLACE-WITH-YOUR-ENDPOINT/metricsadvisor/v1.0/enrichment/anomalyDetection/configurations \
-X POST \
-H "Ocp-Apim-Subscription-Key: REPLACE-WITH-YOUR-RESOURCE-KEY" \
-H "x-api-key: REPLACE-WITH-YOUR-API-KEY" \
-H "Content-Type:application/json" \
-d @body.json

示例响应Example response

HTTP/1.1 201 Created
Content-Length: 0
Location: https://gualala-beta-0617.cognitiveservices.azure.cn/metricsadvisor/v1.0/enrichment/anomalyDetection/configurations/6a977d61-f0f5-488a-a162-2feb4643ae09
x-request-id: 17752fcc-9085-46d5-ad37-c4e9e9ba6a5a
x-envoy-upstream-service-time: 253
apim-request-id: 17752fcc-9085-46d5-ad37-c4e9e9ba6a5a
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
x-content-type-options: nosniff
Date: Tue, 08 Sep 2020 09:50:38 GMT

在上述“Location”标头中,包含新创建的资源(检测配置)的 URL。In above Location header, it contains the URL of the new created resource(detection configuration).

使用上述“Location”标头的 URL,可以查询已创建的检测配置(在以下步骤中,将在响应内容中使用“anomalyDetectionConfigurationId” )Using above URL in Location header , you can query detection configuration you've created (We will use anomalyDetectionConfigurationId in response content in the following steps)

curl https://REPLACE-WITH-YOUR-ENDPOINT/metricsadvisor/v1.0/enrichment/anomalyDetection/configurations/REPLACE-WITH-YOUR-DETECTION-CONFIGURATION-ID \
-H "Ocp-Apim-Subscription-Key: REPLACE-WITH-YOUR-RESOURCE-KEY" \
-H "x-api-key: REPLACE-WITH-YOUR-API-KEY"

示例响应Example response

{
   "anomalyDetectionConfigurationId":"6a977d61-f0f5-488a-a162-2feb4643ae09",
   "name":"test_detection_config0000000001",
   "description":"string",
   "metricId":"8d03e541-a56d-4c28-8d9c-09ce91c6d95f",
   "wholeMetricConfiguration":{
      "smartDetectionCondition":{
         "sensitivity":100.0,
         "anomalyDetectorDirection":"Both",
         "suppressCondition":{
            "minNumber":1,
            "minRatio":1.0
         }
      }
   },
   "dimensionGroupOverrideConfigurations":[
      
   ],
   "seriesOverrideConfigurations":[
      
   ]
}

配置警报配置Configure alert configuration

在配置警报之前,需要创建一个将用于通知警报的挂钩。Before configuring alert, you need create a hook which will be used to notify alert. 有两种方法可以在触发警报时获取通知,即 Webhook 和电子邮件。There are two ways to get notified if an alert is triggered, that is webhook and email. 创建挂钩时,可以在挂钩配置中将其中之一指定为挂钩类型。You can specify either of them in hook configuration as hook type while creating a hook.

将以下 JSON 请求正文保存到名为 body.json 的文件中,然后运行 cURL 命令。Save the below JSON request body to a file named body.json, and run the cURL command.

{
        "hookType": "Webhook",
        "hookName": "test_web_hook000001",
        "description": "",
        "externalLink": "",
        "hookParameter": {
            "endpoint": "https://www.xxx.com/aaa",
            "username": "",
            "password": ""
        }
}

cURL 命令将从 BASH shell 执行。The cURL command is executed from a BASH shell. 请使用自己的资源名称、资源密钥、JSON 值和 JSON 大小编辑此命令。Edit this command with your own resource name, resource key, and JSON values and size of JSON.

curl -i https://REPLACE-WITH-YOUR-ENDPOINT/metricsadvisor/v1.0/hooks \
-X POST \
-H "Ocp-Apim-Subscription-Key: REPLACE-WITH-YOUR-RESOURCE-KEY" \
-H "x-api-key: REPLACE-WITH-YOUR-API-KEY" \
-H "Content-Type:application/json" \
-d @body.json

示例响应Example response

HTTP/1.1 201 Created
Content-Length: 0
Location: https://gualala-beta-0617.cognitiveservices.azure.cn/metricsadvisor/v1.0/hooks/34d677bd-0875-4760-8bf6-24d48abde7c3
x-request-id: 7b6cc1a6-02cb-405b-bee3-174fdae0a7d2
x-envoy-upstream-service-time: 1640
apim-request-id: 7b6cc1a6-02cb-405b-bee3-174fdae0a7d2
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
x-content-type-options: nosniff
Date: Tue, 08 Sep 2020 10:37:59 GMT

使用上述“Location”标头中的 URL,可以查询已创建的 Webhook。Using above URL in Location header , you can query the webhook you've created.

curl https://REPLACE-WITH-YOUR-ENDPOINT/metricsadvisor/v1.0/hooks/REPLACE-WITH-YOUR-HOOK-ID \
-H "Ocp-Apim-Subscription-Key: REPLACE-WITH-YOUR-RESOURCE-KEY" \
-H "x-api-key: REPLACE-WITH-YOUR-API-KEY"

示例响应Example response

{
   "hookId":"34d677bd-0875-4760-8bf6-24d48abde7c3",
   "hookName":"test_web_hook000001",
   "hookType":"Webhook",
   "externalLink":"",
   "description":"",
   "admins":[
      "bowgong@microsoft.com"
   ],
   "hookParameter":{
      "endpoint":"https://www.xxx.com/aaa",
      "username":"",
      "password":"",
      "headers":{
         

      },
      "certificateKey":"",
      "certificatePassword":""

   }
}

通过配置警报配置,可以指定可用于触发警报的检测条件。By configuring alert configuration, you can specify detection condition which can be used to trigger alert. 将以下 JSON 请求正文保存到名为 body.json 的文件中,然后运行 cURL 命令。Save the below JSON request body to a file named body.json, and run the cURL command.

{
        "name": "test_alert_config00000001",
        "description": "",
        "crossMetricsOperator": "AND",
        "hookIds": [
           "34d677bd-0875-4760-8bf6-24d48abde7c3" 
        ],
        "metricAlertingConfigurations": [
            {
                "anomalyDetectionConfigurationId": "6a977d61-f0f5-488a-a162-2feb4643ae09",
                "anomalyScopeType": "All",
                "severityFilter": {
                    "minAlertSeverity": "Low",
                    "maxAlertSeverity": "High"
                },
                "snoozeFilter": {
                    "autoSnooze": 0,
                    "snoozeScope": "Metric",
                    "onlyForSuccessive": true
                },
            }
        ]
}

cURL 命令将从 BASH shell 执行。The cURL command is executed from a BASH shell. 请使用自己的资源名称、资源密钥、JSON 值和 JSON 大小编辑此命令。Edit this command with your own resource name, resource key, and JSON values and size of JSON.

curl -i https://REPLACE-WITH-YOUR-ENDPOINT/metricsadvisor/v1.0/alert/anomaly/configurations \
-X POST \
-H "Ocp-Apim-Subscription-Key: REPLACE-WITH-YOUR-RESOURCE-KEY" \
-H "x-api-key: REPLACE-WITH-YOUR-API-KEY" \
-H "Content-Type:application/json" \
-d @body.json

示例响应Example response

HTTP/1.1 201 Created
Content-Length: 0
Location: https://gualala-beta-0617.cognitiveservices.azure.cn/metricsadvisor/v1.0/alert/anomaly/configurations/40004c91-6996-47c0-b8c8-fd20a8f4f0ab
x-request-id: 17752fcc-9085-46d5-ad37-c4e9e9ba6a5a
x-envoy-upstream-service-time: 253
apim-request-id: 17752fcc-9085-46d5-ad37-c4e9e9ba6a5a
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
x-content-type-options: nosniff
Date: Tue, 08 Sep 2020 09:50:38 GMT

在上述“Location”标头中,包含新创建的资源(检测配置)的 URL。In above Location header, it contains the URL of the new created resource(detection configuration).

使用上述“Location”标头中的 URL,可以查询已创建的警报配置。Using above URL in Location header , you can query alert configuration you've created. (在以下步骤中,将在警报配置中使用“anomalyAlertingConfigurationId”)(We will use anomalyAlertingConfigurationId in alert configuration in the following steps)

curl https://REPLACE-WITH-YOUR-ENDPOINT/metricsadvisor/v1.0/alert/anomaly/configurations/REPLACE-WITH-YOUR-ANOMALY-ALERTING-CONFIGURATION-ID \
-H "Ocp-Apim-Subscription-Key: REPLACE-WITH-YOUR-RESOURCE-KEY" \
-H "x-api-key: REPLACE-WITH-YOUR-API-KEY"

示例响应Example response

{
   "anomalyAlertingConfigurationId":"40004c91-6996-47c0-b8c8-fd20a8f4f0ab",
   "name":"test_alert_config00000001",
   "description":"",
   "hookIds":[
      "34d677bd-0875-4760-8bf6-24d48abde7c3"
   ],
   "metricAlertingConfigurations":[
      {
         "anomalyDetectionConfigurationId":"6a977d61-f0f5-488a-a162-2feb4643ae09",
         "anomalyScopeType":"All",
         "negationOperation":false,
         "severityFilter":{
            "minAlertSeverity":"Low",
            "maxAlertSeverity":"High"
         },
         "snoozeFilter":{
            "autoSnooze":0,
            "snoozeScope":"Metric",
            "onlyForSuccessive":true
         }
      }
   ]
}

查询异常情况检测结果Query anomaly detection results

可以通过不同的方式获取检测结果。There are different ways to get detection result. 例如,可以使用创建的检测配置定期主动查询检测结果,也可以通过警报获取通知,然后可以使用此警报来查询相应的异常。For instance, you can actively query detection result periodically using detection config you created, or you could be notified through alert, and then you can use this alert to query corresponding anomalies.

以下示例中演示了如何查询警报,并使用此警报来查询与其相关的异常。In following sample, it shows how to query alert, and using this alert to query anomalies related to this alert.

查询警报Query alert

可以使用在上述步骤中创建的警报配置来查询警报。You can use alert configuration created in above step to query the alert.

curl https://REPLACE-WITH-YOUR-ENDPOINT/metricsadvisor/v1.0/alert/anomaly/configurations/REPLACE-WITH-YOUR-ANOMALY-ALERTING-CONFIGURATION-ID/alerts/query \
-H "Ocp-Apim-Subscription-Key: REPLACE-WITH-YOUR-RESOURCE-KEY" \
-H "x-api-key: REPLACE-WITH-YOUR-API-KEY"

示例响应Example response

{
   "value":[
      {
         "alertId":"17465dcc000",
         "timestamp":"2020-09-07T00:00:00Z",
         "createdTime":"2020-09-08T19:12:46.532Z",
         "modifiedTime":"2020-09-08T19:12:46.588Z"
      }
   ],
   "@nextLink":null
}

在上述响应中,我们收到了一个警报。In above response, we got an alert. 使用此“alertID”,我们可以查询导致此警报的所有相关异常。Using this alertID, we can query all related anomalies caused this alert.

(获取警报的另一种方法是配置 Webhook,并在发现警报后被动收到警报)(Another way to get alert is to configure webhook, and passively received alert once it is found)

使用 alertID 查询异常Query anomalies using alertID

curl https://REPLACE-WITH-YOUR-ENDPOINT/metricsadvisor/v1.0/alert/anomaly/configurations/REPLACE-WITH-YOUR-ANOMALY-ALERTING-CONFIGURATION-ID/alerts/REPLACE-WITH-YOUR-ALERTID/anomalies \
-H "Ocp-Apim-Subscription-Key: REPLACE-WITH-YOUR-RESOURCE-KEY" \
-H "x-api-key: REPLACE-WITH-YOUR-API-KEY"

示例响应Example response

{
   "value":[
      {
         "metricId":"8d03e541-a56d-4c28-8d9c-09ce91c6d95f",
         "anomalyDetectionConfigurationId":"6a977d61-f0f5-488a-a162-2feb4643ae09",
         "timestamp":"2020-09-07T00:00:00Z",
         "createdTime":"2020-09-08T19:12:46.566Z",
         "modifiedTime":"2020-09-08T19:12:46.566Z",
         "dimension":{
            "city":"Amphibian",
            "category":"Caucasian Fir"
         },
         "property":{
            "anomalySeverity":"High",
            "anomalyStatus":"Active"
         }
      },
      {
         "metricId":"8d03e541-a56d-4c28-8d9c-09ce91c6d95f",
         "anomalyDetectionConfigurationId":"6a977d61-f0f5-488a-a162-2feb4643ae09",
         "timestamp":"2020-09-07T00:00:00Z",
         "createdTime":"2020-09-08T19:12:46.566Z",
         "modifiedTime":"2020-09-08T19:12:46.566Z",
         "dimension":{
            "city":"Animals by number of neurons",
            "category":"Crack willow"
         },
         "property":{
            "anomalySeverity":"High",
            "anomalyStatus":"Active"
         }
      },
      {
         "metricId":"8d03e541-a56d-4c28-8d9c-09ce91c6d95f",
         "anomalyDetectionConfigurationId":"6a977d61-f0f5-488a-a162-2feb4643ae09",
         "timestamp":"2020-09-07T00:00:00Z",
         "createdTime":"2020-09-08T19:12:46.566Z",
         "modifiedTime":"2020-09-08T19:12:46.566Z",
         "dimension":{
            "city":"Amphibian",
            "category":"Crack willow"
         },
         "property":{
            "anomalySeverity":"High",
            "anomalyStatus":"Active"
         }
      },
      {
         "metricId":"8d03e541-a56d-4c28-8d9c-09ce91c6d95f",
         "anomalyDetectionConfigurationId":"6a977d61-f0f5-488a-a162-2feb4643ae09",
         "timestamp":"2020-09-07T00:00:00Z",
         "createdTime":"2020-09-08T19:12:46.566Z",
         "modifiedTime":"2020-09-08T19:12:46.566Z",
         "dimension":{
            "city":"Animals by number of neurons",
            "category":"Common Lime"
         },
         "property":{
            "anomalySeverity":"High",
            "anomalyStatus":"Active"
         }
      },
      {
         "metricId":"8d03e541-a56d-4c28-8d9c-09ce91c6d95f",
         "anomalyDetectionConfigurationId":"6a977d61-f0f5-488a-a162-2feb4643ae09",
         "timestamp":"2020-09-07T00:00:00Z",
         "createdTime":"2020-09-08T19:12:46.566Z",
         "modifiedTime":"2020-09-08T19:12:46.566Z",
         "dimension":{
            "city":"Chickadee",
            "category":"Common Lime"
         },
         "property":{
            "anomalySeverity":"High",
            "anomalyStatus":"Active"
         }
      },
      {
         "metricId":"8d03e541-a56d-4c28-8d9c-09ce91c6d95f",
         "anomalyDetectionConfigurationId":"6a977d61-f0f5-488a-a162-2feb4643ae09",
         "timestamp":"2020-09-07T00:00:00Z",
         "createdTime":"2020-09-08T19:12:46.566Z",
         "modifiedTime":"2020-09-08T19:12:46.566Z",
         "dimension":{
            "city":"Amphibian",
            "category":"Common Lime"
         },
         "property":{
            "anomalySeverity":"High",
            "anomalyStatus":"Active"
         }
      },
      {
         "metricId":"8d03e541-a56d-4c28-8d9c-09ce91c6d95f",
         "anomalyDetectionConfigurationId":"6a977d61-f0f5-488a-a162-2feb4643ae09",
         "timestamp":"2020-09-07T00:00:00Z",
         "createdTime":"2020-09-08T19:12:46.566Z",
         "modifiedTime":"2020-09-08T19:12:46.566Z",
         "dimension":{
            "city":"Chickadee",
            "category":"Crack willow"
         },
         "property":{
            "anomalySeverity":"High",
            "anomalyStatus":"Active"
         }
      }
   ],
   "@nextLink":null
}

清理资源Clean up resources

如果想要清理并删除认知服务订阅,可以删除资源或资源组。If you want to clean up and remove a Cognitive Services subscription, you can delete the resource or resource group. 删除资源组同时也会删除与之相关联的任何其他资源。Deleting the resource group also deletes any other resources associated with it.

后续步骤Next steps