EventCenterQueryEvents

更新时间:
复制 MD 格式

Queries events from the event center.

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 to retrieve the next page of results.

100

MaxResults

integer

No

The maximum number of results to return. Valid values: 0 to 10,000. The default value is 100.

100

Body

object

Yes

The request body.

SchemaId

string

Yes

The schema ID.

ecs:GeneralSchema

QueryType

string

Yes

The query type. Valid values:

  • timeseries: queries time series data.

  • table: queries table data.

  • timeseries_and_table: queries both time series data and table data.

timeseries_and_table

Parameters

object

Yes

The query parameters.

Breakdowns

array

No

An array of column names to use as dimensions for splitting the dataset.

string

No

The name of the column to use as a dimension for splitting.

source

Calculations

array<object>

No

The calculations to perform on specified columns.

object

No

Op

string

No

The operator.

COUNT_DISTINCT

Column

string

No

The column name.

source

Filters

array<object>

No

A list of filter conditions.

array<object>

No

Column

string

No

The column name.

source

Op

string

No

The operator.

=

Values

array

No

The values to use with the operator.

string

No

If the value is a string, enclose it in single quotation marks (').

'acs.ecs'

NestedFilterCombination

string

No

The logical operator for combining nested filters.

AND

NestedFilters

array<object>

No

A list of nested filters.

object

No

Column

string

No

The column name.

Op

string

No

The operator.

Values

array

No

A list of values to use with the operator.

string

No

FilterCombination

string

No

The logical operator for combining filter conditions.

AND

Granularity

integer

No

The time granularity, in seconds, for querying time series data. The minimum value is 1. This is a suggested value; the actual granularity is returned in the response.

30

Orders

array<object>

No

The sort order for the query results. This parameter applies only when QueryType is set to table.

object

No

Op

string

No

The operator.

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 query. The count starts from 0.

0

Limit

integer

No

The maximum number of events to query. Valid values: 1 to 10,000.

100

TimeRange

integer

No

The time range. Unit: milliseconds. The minimum value is 1,000.

1000000

StartTime

integer

No

The start timestamp for the event query. Unit: milliseconds.

1687860901814

EndTime

integer

No

The end timestamp for the event query. Unit: milliseconds.

1687861201814

Response elements

Element

Type

Description

Example

object

The response schema.

Message

string

The error message.

Specified parameter Limit is not valid.

RequestId

string

The request ID.

5DAF96FB-A4B6-548C-B999-XXXXXXXX

Data

object

The returned data.

NextToken

string

The token used to retrieve the next page of results. If this parameter is empty, all results have been returned.

100

MaxResults

integer

The maximum number of entries to return.

100

TotalCount

integer

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

76

TimeSeries

array<object>

The query results for the time series query type.

array<object>

RowData

object

A query result entry, represented as a key-value pair.

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

Time

string

The timestamp.

1683561600000

Table

array<object>

The query results for the table query type.

array<object>

RowData

object

A query result entry, represented as a key-value pair.

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

Code

string

The status of the API call, which can be Success or a POP error code.

Success

Success

boolean

Indicates whether the call was successful. true indicates success, and false indicates failure.

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.