EventCenterQueryEvents

Updated at:

Queries events in the event analysis feature.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

eventbridge:EventCenterQueryEvents

get

*EventBus

acs:eventbridge:{#regionId}:{#accountId}:eventbus/{#eventbus}

None None

Request parameters

Parameter

Type

Required

Description

Example

BusName

string

No

The name of the event bus.

default

NextToken

string

No

The token used to retrieve the next page of results.

100

MaxResults

integer

No

The maximum number of results to return. Valid values: 0 to 10000. Default value: 100.

100

Body

object

Yes

The request body.

SchemaId

string

Yes

The ID of the schema.

ecs:GeneralSchema

QueryType

string

Yes

The query type. Valid values:

  • timeseries: time series data

  • table: tabular data

  • timeseries_and_table: both time series and tabular data

Valid values:

  • timeseries :

    Time series data.

  • timeseries_and_table :

    Time series and tabular data.

  • table :

    Tabular data.

timeseries_and_table

Parameters

object

Yes

The query parameters.

Breakdowns

array

No

Further splits the dataset by specific dimensions (column names).

string

No

The name of a column that can be used as a breakdown dimension.

source

Calculations

array<object>

No

Performs calculations on the specified columns by using operators.

object

No

Op

string

No

The operator.

Valid values:

  • P99 :

    The 99th percentile.

  • AVG :

    The average value.

  • COUNT_DISTINCT :

    The distinct count.

  • MIN :

    The minimum value.

  • MAX :

    The maximum value.

  • P90 :

    The 90th percentile.

  • COUNT :

    The count.

  • SUM :

    The sum.

  • P50 :

    The 50th percentile.

  • P95 :

    The 95th percentile.

COUNT_DISTINCT

Column

string

No

The column name.

source

Filters

array<object>

No

The list of filter conditions.

array<object>

No

Column

string

No

The column name.

source

Op

string

No

The operator.

Valid values:

  • <= :

    Less than or equal to.

  • in :

    In the specified set.

  • does-not-start-with :

    Does not start with.

  • contains :

    Contains.

  • does-not-exist :

    The field does not exist.

  • exists :

    The field exists.

  • does-not-contain :

    Does not contain.

  • not-in :

    Not in the specified set.

  • starts-with :

    Starts with.

  • text-match :

    Matches the text.

  • != :

    Not equal to.

  • < :

    Less than.

  • = :

    Equal to.

  • > :

    Greater than.

  • >= :

    Greater than or equal to.

=

Values

array

No

The values used with the operator.

string

No

The value. If the value is a string, enclose it in single quotation marks.

'acs.ecs'

NestedFilterCombination

string

No

The logical combination method for nested filter conditions.

Valid values:

  • OR :

    OR (any condition is met).

  • AND :

    AND (all conditions are met).

AND

NestedFilters

array<object>

No

The list of nested filter conditions.

object

No

Column

string

No

The column name.

source

Op

string

No

The operator.

Valid values:

  • <= :

    Less than or equal to.

  • in :

    In the specified set.

  • does-not-start-with :

    Does not start with.

  • contains :

    Contains.

  • does-not-exist :

    The field does not exist.

  • exists :

    The field exists.

  • does-not-contain :

    Does not contain.

  • not-in :

    Not in the specified set.

  • starts-with :

    Starts with.

  • text-match :

    Matches the text.

  • != :

    Not equal to.

  • < :

    Less than.

  • = :

    Equal to.

  • > :

    Greater than.

  • >= :

    Greater than or equal to.

=

Values

array

No

The list of values used with the operator.

string

No

The single value used with the operator.

'acs.ecs'

FilterCombination

string

No

The logic for combining filter conditions.

Valid values:

  • OR :

    OR (any condition is met).

  • AND :

    AND (all conditions are met).

AND

Granularity

integer

No

The time granularity, which is the minimum time unit for querying time series data. Unit: seconds. Minimum value: 1. This parameter is a recommended value. The actual granularity is subject to the returned value.

30

Orders

array<object>

No

Sorts the query results. This parameter is valid only for queries where QueryType is set to table.

object

No

Op

string

No

The operator.

Valid values:

  • P99 :

    The 99th percentile.

  • AVG :

    The average value.

  • COUNT_DISTINCT :

    The distinct count.

  • MIN :

    The minimum value.

  • MAX :

    The maximum value.

  • P90 :

    The 90th percentile.

  • COUNT :

    The count.

  • SUM :

    The sum.

  • P50 :

    The 50th percentile.

  • P95 :

    The 95th percentile.

AVG

Column

string

No

The column name.

source

Desc

boolean

No

Specifies whether to sort the results in descending order.

true

Offset

integer

No

The starting position of the current query. The value starts from 0.

0

Limit

integer

No

The maximum number of events to query. Valid values: 1 to 10000.

100

TimeRange

integer

No

The time range. Unit: milliseconds. Minimum value: 1000.

1000000

StartTime

integer

No

The start timestamp for querying events, in milliseconds.

1687860901814

EndTime

integer

No

The end timestamp for querying events, in milliseconds.

1687861201814

Response elements

Element

Type

Description

Example

object

Schema of Response

Message

string

The error message.

Specified parameter Limit is not valid.

RequestId

string

The ID of the request.

5DAF96FB-A4B6-548C-B999-XXXXXXXX

Data

object

The returned result.

NextToken

string

The token that indicates the read position returned by the current call. An empty value indicates that all data has been read.

100

MaxResults

integer

The maximum number of records returned for the current request.

100

TotalCount

integer

The total number of data entries that meet the request conditions. This parameter is optional and is not returned by default.

76

TimeSeries

array<object>

The query results for the timeseries query type.

array<object>

RowData

object

The entries in the query results, represented as key-value pairs.

{ "id":"xxx", "source":"acs.ecs" }

Time

string

The timestamp used for display.

1683561600000

Table

array<object>

The query results for the table query type.

array<object>

RowData

object

The entries in the query results, represented as key-value pairs.

{ "id":"xxx", "source":"acs.ecs" }

Code

string

The API status or POP error code. Valid values: Success: Successful.

Success

Success

boolean

Indicates whether the operation is successful. Valid values: true: Successful. false: Failed.

true

Examples

Success response

JSON format

{
  "Message": "Specified parameter Limit is not valid.",
  "RequestId": "5DAF96FB-A4B6-548C-B999-XXXXXXXX",
  "Data": {
    "NextToken": "100",
    "MaxResults": 100,
    "TotalCount": 76,
    "TimeSeries": [
      {
        "RowData": {
          "id": "xxx",
          "source": "acs.ecs"
        },
        "Time": "1683561600000"
      }
    ],
    "Table": [
      {
        "RowData": {
          "id": "xxx",
          "source": "acs.ecs"
        }
      }
    ]
  },
  "Code": "Success",
  "Success": true
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.