All Products
Search
Document Center

Cloud Monitor:DescribeLogMonitorAttribute

Last Updated:Jun 11, 2026

Mengkueri tugas Pemantauan Log.

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:DescribeLogMonitorAttribute

get

*全部资源

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

MetricName

string

Yes

Nama metrik.

cpu_total_******

Elemen respons

Element

Type

Description

Example

object

Code

string

The status code.

Catatan

A status code of 200 indicates a successful request.

200

Message

string

The returned message.

The specified resource is not found.

RequestId

string

The request ID.

C6718537-E673-4A58-8EE1-24B8B38C7AAE

Success

boolean

Indicates whether the operation was successful. Valid values:

  • true: The operation was successful.

  • false: The operation failed.

true

LogMonitor

object

The details of the Log Monitoring task.

ValueFilterRelation

string

The logical operator for the filter conditions. This parameter is used with `ValueFilter`. Valid values:

  • and: The logical AND operator.

  • or: The logical OR operator.

and

SlsLogstore

string

The name of the Simple Log Service Logstore.

logstore_******

MetricName

string

The name of the metric.

cpu_total_******

GroupId

integer

The ID of the application group.

123******

LogId

integer

The ID of the Log Monitoring task.

123******

MetricExpress

string

The metric expression.

{}

SlsRegionId

string

The ID of the region where Simple Log Service resides.

cn-hangzhou

GmtCreate

integer

The time when the task was created.

This value is a UNIX timestamp that represents the number of milliseconds that have elapsed since January 1, 1970.

1678440033000

SlsProject

string

The name of the Simple Log Service project.

project_******

Aggregates

array<object>

The definitions of aggregations.

object

The definition of an aggregation.

Max

string

The maximum value.

0

Min

string

The minimum value.

0

Function

string

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

  • count: Counts the number of logs.

  • sum: Calculates the sum of values in a field.

  • avg: Calculates the average of values in a field.

  • max: Selects the maximum value in a field.

  • min: Selects the minimum value in a field.

  • countps: Calculates the average number of logs that are generated per second in a statistical period.

  • sumps: Calculates the average sum of values in a field per second in a statistical period.

  • distinct: Counts the number of unique values in a field in a statistical period.

count

Alias

string

The alias of the field.

alias_******

FieldName

string

The original name of the field in the log.

field_******

ValueFilter

array<object>

The filter conditions. This parameter is used with `ValueFilterRelation`. This parameter is equivalent to the `WHERE` clause in an SQL statement.

If you do not specify this parameter, all data is processed. For example, if a log contains a `Level` field and you want to count the number of logs where the value of `Level` is `Error`, you can set the aggregation function to `count` and specify a filter condition where `Level` equals `Error`.

object

The filter condition.

Key

string

The key.

key_******

Value

string

The value.

value_******

Operator

string

The operator that is used to match the field value. Valid values:

  • contain: contains.

  • notContain: does not contain.

  • >: greater than.

  • <: less than.

  • >=: greater than or equal to.

  • <=: less than or equal to.

contain

Tumblingwindows

array

The pre-aggregation window. Unit: seconds. Cloud Monitor aggregates data in the specified pre-aggregation window.

string

The pre-aggregation window. Unit: seconds. Cloud Monitor aggregates data in the specified pre-aggregation window.

60

Groupbys

array

The dimension based on which log data is aggregated. This parameter is equivalent to the `GROUP BY` clause in an SQL statement. You can specify a dimension to group monitoring data. If you do not specify this parameter, all monitoring data is aggregated based on the aggregation method.

string

The `group by` definition

userId

Contoh

Respons sukses

JSONformat

{
  "Code": "200",
  "Message": "The specified resource is not found.",
  "RequestId": "C6718537-E673-4A58-8EE1-24B8B38C7AAE",
  "Success": true,
  "LogMonitor": {
    "ValueFilterRelation": "and",
    "SlsLogstore": "logstore_******",
    "MetricName": "cpu_total_******",
    "GroupId": 0,
    "LogId": 0,
    "MetricExpress": "{}",
    "SlsRegionId": "cn-hangzhou",
    "GmtCreate": 1678440033000,
    "SlsProject": "project_******",
    "Aggregates": [
      {
        "Max": "0",
        "Min": "0",
        "Function": "count",
        "Alias": "alias_******",
        "FieldName": "field_******"
      }
    ],
    "ValueFilter": [
      {
        "Key": "key_******",
        "Value": "value_******",
        "Operator": "contain"
      }
    ],
    "Tumblingwindows": [
      "60"
    ],
    "Groupbys": [
      "userId"
    ]
  }
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 ParameterInvalid Illegal parameters.
500 InternalError The request processing has failed due to some unknown error.
403 AccessForbidden User not authorized to operate on the specified resource.
404 ResourceNotFound The specified resource is not found.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.