All Products
Search
Document Center

Cloud Monitor:DescribeHybridMonitorTaskList

Last Updated:Jun 11, 2026

Mengkueri tugas impor metrik.

Deskripsi operasi

This topic provides an example on how to query all metric import tasks that belong to the current Alibaba Cloud account. The returned result indicates that the current account has only one metric import task. The metric import task is named aliyun_task.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

cms:DescribeHybridMonitorTaskList

list

*全部资源

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

Keyword

string

No

Kata kunci yang digunakan untuk pencarian.

task

TaskId

string

No

ID tugas impor metrik.

36****

GroupId

string

No

ID kelompok aplikasi.

Untuk informasi tentang cara mendapatkan ID kelompok aplikasi, lihat DescribeMonitorGroups.

3607****

Namespace

string

No

Nama namespace.

Untuk informasi tentang cara mendapatkan nama namespace, lihat DescribeHybridMonitorNamespaceList.

aliyun

PageSize

integer

No

Jumlah entri per halaman.

Halaman dimulai dari halaman 1. Nilai default: 10.

10

PageNumber

integer

No

Nomor halaman.

Halaman dimulai dari halaman 1. Nilai default: 1.

1

IncludeAliyunTask

boolean

No

Apakah hasil yang dikembalikan menyertakan tugas impor metrik untuk layanan Alibaba Cloud. Nilai valid:

  • true (default): Hasil yang dikembalikan menyertakan tugas impor metrik untuk layanan Alibaba Cloud.

  • false: Hasil yang dikembalikan tidak menyertakan tugas impor metrik untuk layanan Alibaba Cloud.

true

TaskType

string

No

Jenis tugas impor metrik. Nilai valid:

  • aliyun_fc: tugas impor metrik untuk layanan Alibaba Cloud

  • aliyun_sls: metrik untuk log yang diimpor dari Log Service.

Valid values:

  • aliyun_sls :

    aliyun_sls.

aliyun_fc

TargetUserId

integer

No

ID akun anggota.

Catatan

Parameter ini hanya diperlukan jika Anda menggunakan akun manajemen untuk memanggil operasi ini guna menghapus tugas impor metrik yang dimiliki oleh anggota di direktori sumber daya. Dalam hal ini, parameter TaskType diatur ke aliyun_fc.

120886317861****

Untuk informasi lebih lanjut tentang parameter permintaan umum, lihat Common parameters.

Elemen respons

Element

Type

Description

Example

object

None

RequestId

string

The request ID.

11145B76-566A-5D80-A8A3-FAD98D310079

Success

string

Indicates whether the request was successful. Valid values:

  • true

  • false

true

Code

string

The status code.

Catatan

The status code 200 indicates that the request was successful.

200

Message

string

The returned message.

  • If the request was successful, the value successful is returned.

  • If the request failed, an error message is returned.

success

PageSize

integer

The number of entries per page.

10

PageNumber

integer

The page number.

1

Total

integer

The total number of entries returned.

1

TaskList

array<object>

The metric import tasks.

array<object>

None

YARMConfig

string

The configuration file of the Alibaba Cloud service that you want to monitor by using Hybrid Cloud Monitoring.

  • namespace: the namespace of the Alibaba Cloud service.

  • metric_list: the metrics of the Alibaba Cloud service.

products:- namespace: acs_ecs_dashboard metric_info: - metric_list: - cpu_total

CreateTime

string

The timestamp when the metric import task was created.

Unit: milliseconds.

1639382496000

TaskName

string

The name of the metric import task.

aliyun_task

Namespace

string

The namespace to which the host belongs.

aliyun

UploadRegion

string

The region where the host resides.

cn-hangzhou

NetworkType

string

The network type of the host. Valid values:

  • vpc

  • Internet

vpc

CollectTimout

integer

The timeout period during which the CloudMonitor agent collects host monitoring data. Valid values:

  • 0

  • 15

  • 30

  • 60

Unit: seconds.

15

CollectTargetEndpoint

string

The URL of the destination from which the CloudMonitor agent collects host monitoring data.

http://localhost

TaskType

string

The type of the metric import task. Valid values:

  • aliyun_fc: metric import tasks for Alibaba Cloud services

  • aliyun_sls: metrics for logs imported from Log Service

aliyun_sls

MatchExpressRelation

string

The relationship between the conditions that are used to filter metric import tasks. Valid values:

  • or

  • and

or

Description

string

The description of the metric import task.

aliyun

GroupId

string

The ID of the application group.

3607****

CollectInterval

integer

The interval at which the CloudMonitor agent collects host monitoring data. Valid values:

  • 15

  • 30

  • 60

Unit: seconds.

60

TargetUserId

string

The ID of the member account.

Catatan

This parameter is displayed only when you call this operation by using a management account.

120886317861****

CollectTargetPath

string

The relative path from which the CloudMonitor agent collects monitoring data.

/metrics

CollectTargetType

string

The type of the monitoring data. Valid values: Spring, Tomcat, Nginx, Tengine, JVM, Redis, and MySQL.

nginx

TaskId

string

The ID of the metric import task.

36****

AttachLabels

array<object>

The tags of the metric import task.

object

None

Name

string

The tag key.

key1

Value

string

The tag value.

value1

MatchExpress

array<object>

The conditions that are used to match the instances in the application group.

object

None

Value

string

The keyword that corresponds to the instance name.

ECS_instance1

Name

string

The instance name.

name

Function

string

The method that is used to match the instance name. Valid values:

  • startWith: starts with a prefix

  • endWith: ends with a suffix

  • all: matches all

  • equals: equals

  • contains: contains

  • notContains: does not contain

all

Instances

array

The instances where monitoring data is collected in batches.

string

The instance ID.

i-hp368focau7dp0hw****

ExtraInfo

string

The additional information of the instance.

test

LogFilePath

string

The path where on-premises log data is stored. On-premises log data is stored in the specified path of the host where CloudMonitor is deployed.

  • Windows: The log path must start with a drive letter. Example: C:\UserData\log\\*.Log. You cannot specify wildcard characters in a log path.

  • Linux: The log path must start with a forward slash (/). Example: /home/appdata/log/**/*.log. In this example, /**/ is used to match all files in the appdata directory.

C:\UserData\log\*.Log

LogSplit

string

The result that is returned after on-premises log data is split based on the specified matching mode.

Catatan

The matching modes of on-premises log data include full regex mode, delimiter mode, and JSON mode.

{"type": "regex","regex": "\\d+\\.\\d+\\.\\d+\\.\\d+\\s+(\\d+)\\s+\\S+\\s+\\[\\d+/\\S+/\\d+:\\d+:\\d+:\\d+\\s+\\+\\d+\\]\\s+(\\S+)\\s+\\S+\\s+/\\S+/\\S+/\\S+\\s+(\\d+)","columns": [{"name": "field1"},{"name": "filed2","translate": {"default": "-","mappings": [{"from": "(\\w+)","to": "$1x","type": "regex"}]}},{"name": "filed3","translate": {"default": "-","mappings": [{"from": "NumberRange(100,300)","to": "true","type": "function"}]}}]}

LogProcess

string

The method that is used to aggregate on-premises log data.

[{"metric": "metric1","filters": [{"column": "filed2","type": "include","values": ["222222"]}],"groupBys": [{"column": "filed3","name": "filed3"}],"calculates": [{"column": "field1","name": "avg","type": "avg"}]},{"metric": "metric2","filters": [{"column": "field1","type": "include","values": ["11111"]}],"groupBys": [{"column": "filed2","name": "filed2"}],"calculates": [{"column": "field1","name": "avg","type": "avg"}]}]

LogSample

string

The sample on-premises log.

{"logContent":"100.116.134.26 1119 - [13/Aug/2019:16:55:46 +0800] POST metrichub-cn-hongkong.aliyun.com /agent/metrics/putLines 200 0 \"-\" \"127.0.0.1:7001\" \"Go-http-client/1.1\" \"-\" \"-\" \"0a98a21a15656865460656276e\"","addData":{"field1":["1119","1119"],"filed2":["POSTx","POST"],"filed3":["true","200"]}}

SLSProcess

string

The configurations of the logs that are imported from Log Service.

{"express": [],"filter": {"filters": [{"key": "task_type","operator": "=","value": "1"}]},"groupby": [{"alias": "isp","key": "isp","sqlKey": "t.`isp`","valueKey": "isp"}],"interval": 60,"labels": [{"name": "__cms_app__","type": 0,"value": "sitemonitor"}],"statistics": [{"alias": "http_dns_time_avg","function": "avg","key": "http_dns_time"}]}

SLSProcessConfig

object

The configurations of the logs that are imported from Log Service.

Catatan

This parameter is returned only if the TaskType parameter is set to aliyun_sls.

Filter

object

The conditions that are used to filter logs imported from Log Service.

Relation

string

The relationship between multiple filter conditions. Valid values:

  • and (default): Logs are processed only if all filter conditions are met.

  • or: Logs are processed if one of the filter conditions is met.

and

Filters

array<object>

The conditions that are used to filter logs imported from Log Service.

object

The conditions that are used to filter logs imported from Log Service.

SLSKeyName

string

The name of the key that is used to filter logs imported from Log Service.

host

Operator

string

The method that is used to filter logs imported from Log Service. Valid values:

  • contain: contains

  • notContain: does not contain

  • >: greater than

  • <: less than

  • =: equal to

  • ! =: not equal to

  • >=: greater than or equal to

  • <=: less than or equal to

=

Value

string

The value of the key that is used to filter logs imported from Log Service.

200

Statistics

array<object>

The methods that are used to aggregate logs imported from Log Service.

object

The method that is used to aggregate logs imported from Log Service.

SLSKeyName

string

The name of the key that is used to aggregate logs imported from Log Service.

name

Function

string

The function that is used to aggregate log data within a statistical period. Valid values:

  • count: counts the number.

  • sum: calculates the total value.

  • avg: calculates the average value.

  • max: calculates the maximum value.

  • min: calculates the minimum value.

  • value: collects samples within the statistical period.

  • countps: calculates the average number of the specified field per second by using the following formula: Counted number of the specified field/Total number of seconds within the statistical period.

  • sumps: calculates the average number of the specified field per second by using the following formula: Total value of the specified field/Total number of seconds within the statistical period.

  • distinct: counts the number of logs where the specified field appears within the statistical period.

  • distribution: counts the number of logs that meet a specified condition within the statistical period.

  • percentile: sorts the values of the specified field in ascending order, and then returns the value that is at the specified percentile within the statistical period. Example: P50.

count

Alias

string

The alias of the aggregation result.

level_count

Parameter1

string

The value of the function that is used to aggregate logs imported from Log Service.

  • If the Function parameter is set to distribution, this parameter indicates the lower limit of the statistical interval. For example, 200 indicates that the number of HTTP requests whose status code is 2XX is calculated.

  • If the Function parameter is set to percentile, this parameter specifies the percentile at which the expected value is. For example, 0.5 specifies P50.

200

Parameter2

string

The value of the function that is used to aggregate logs imported from Log Service.

Catatan

This parameter is returned only if the Function parameter is set to distribution. This parameter indicates the upper limit of the statistical interval. For example, 299 indicates that the number of HTTP requests whose status code is 2XX is calculated.

299

GroupBy

array<object>

The dimensions based on which data is aggregated. This parameter is equivalent to the GROUP BY clause in SQL.

object

The dimension based on which data is aggregated. This parameter is equivalent to the GROUP BY clause in SQL.

SLSKeyName

string

The name of the key that is used to aggregate logs imported from Log Service.

code

Alias

string

The alias of the aggregation result.

ApiResult

Express

array<object>

The extended fields that indicate the results of basic operations that are performed on aggregation results.

object

The extended field that indicates the result of basic operations that are performed on aggregation results.

Express

string

The extended field that indicates the result of basic operations that are performed on aggregation results.

success_count

Alias

string

The alias of the extended field that indicates the result of basic operations that are performed on aggregation results.

SuccRate

Contoh

Respons sukses

JSONformat

{
  "RequestId": "11145B76-566A-5D80-A8A3-FAD98D310079",
  "Success": "true",
  "Code": "200",
  "Message": "success",
  "PageSize": 10,
  "PageNumber": 1,
  "Total": 1,
  "TaskList": [
    {
      "YARMConfig": "products:- namespace: acs_ecs_dashboard metric_info: - metric_list: - cpu_total",
      "CreateTime": "1639382496000",
      "TaskName": "aliyun_task",
      "Namespace": "aliyun",
      "UploadRegion": "cn-hangzhou",
      "NetworkType": "vpc",
      "CollectTimout": 15,
      "CollectTargetEndpoint": "http://localhost",
      "TaskType": "aliyun_sls",
      "MatchExpressRelation": "or",
      "Description": "aliyun",
      "GroupId": "3607****",
      "CollectInterval": 60,
      "TargetUserId": "120886317861****",
      "CollectTargetPath": "/metrics",
      "CollectTargetType": "nginx",
      "TaskId": "36****",
      "AttachLabels": [
        {
          "Name": "key1",
          "Value": "value1"
        }
      ],
      "MatchExpress": [
        {
          "Value": "ECS_instance1",
          "Name": "name",
          "Function": "all"
        }
      ],
      "Instances": [
        "i-hp368focau7dp0hw****"
      ],
      "ExtraInfo": "test",
      "LogFilePath": "C:\\UserData\\log\\*.Log",
      "LogSplit": "{\"type\": \"regex\",\"regex\": \"\\\\d+\\\\.\\\\d+\\\\.\\\\d+\\\\.\\\\d+\\\\s+(\\\\d+)\\\\s+\\\\S+\\\\s+\\\\[\\\\d+/\\\\S+/\\\\d+:\\\\d+:\\\\d+:\\\\d+\\\\s+\\\\+\\\\d+\\\\]\\\\s+(\\\\S+)\\\\s+\\\\S+\\\\s+/\\\\S+/\\\\S+/\\\\S+\\\\s+(\\\\d+)\",\"columns\": [{\"name\": \"field1\"},{\"name\": \"filed2\",\"translate\": {\"default\": \"-\",\"mappings\": [{\"from\": \"(\\\\w+)\",\"to\": \"$1x\",\"type\": \"regex\"}]}},{\"name\": \"filed3\",\"translate\": {\"default\": \"-\",\"mappings\": [{\"from\": \"NumberRange(100,300)\",\"to\": \"true\",\"type\": \"function\"}]}}]}",
      "LogProcess": "[{\"metric\": \"metric1\",\"filters\": [{\"column\": \"filed2\",\"type\": \"include\",\"values\": [\"222222\"]}],\"groupBys\": [{\"column\": \"filed3\",\"name\": \"filed3\"}],\"calculates\": [{\"column\": \"field1\",\"name\": \"avg\",\"type\": \"avg\"}]},{\"metric\": \"metric2\",\"filters\": [{\"column\": \"field1\",\"type\": \"include\",\"values\": [\"11111\"]}],\"groupBys\": [{\"column\": \"filed2\",\"name\": \"filed2\"}],\"calculates\": [{\"column\": \"field1\",\"name\": \"avg\",\"type\": \"avg\"}]}]",
      "LogSample": "{\"logContent\":\"100.116.134.26 1119 - [13/Aug/2019:16:55:46 +0800] POST metrichub-cn-hongkong.aliyun.com /agent/metrics/putLines 200 0 \\\"-\\\" \\\"127.0.0.1:7001\\\" \\\"Go-http-client/1.1\\\" \\\"-\\\" \\\"-\\\" \\\"0a98a21a15656865460656276e\\\"\",\"addData\":{\"field1\":[\"1119\",\"1119\"],\"filed2\":[\"POSTx\",\"POST\"],\"filed3\":[\"true\",\"200\"]}}",
      "SLSProcess": "{\"express\": [],\"filter\": {\"filters\": [{\"key\": \"task_type\",\"operator\": \"=\",\"value\": \"1\"}]},\"groupby\": [{\"alias\": \"isp\",\"key\": \"isp\",\"sqlKey\": \"t.`isp`\",\"valueKey\": \"isp\"}],\"interval\": 60,\"labels\": [{\"name\": \"__cms_app__\",\"type\": 0,\"value\": \"sitemonitor\"}],\"statistics\": [{\"alias\": \"http_dns_time_avg\",\"function\": \"avg\",\"key\": \"http_dns_time\"}]}",
      "SLSProcessConfig": {
        "Filter": {
          "Relation": "and",
          "Filters": [
            {
              "SLSKeyName": "host",
              "Operator": "=",
              "Value": "200"
            }
          ]
        },
        "Statistics": [
          {
            "SLSKeyName": "name",
            "Function": "count",
            "Alias": "level_count",
            "Parameter1": "200",
            "Parameter2": "299"
          }
        ],
        "GroupBy": [
          {
            "SLSKeyName": "code",
            "Alias": "ApiResult"
          }
        ],
        "Express": [
          {
            "Express": "success_count",
            "Alias": "SuccRate"
          }
        ]
      }
    }
  ]
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 %s %s
500 %s %s
500 InternalError %s
403 %s %s
404 %s %s

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.