All Products
Search
Document Center

EventBridge:EventCenterQueryEvents

Last Updated:Dec 04, 2024

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
eventbridge:EventCenterQueryEventsget
*EventBus
acs:eventbridge:{#regionId}:{#accountId}:eventbus/{#eventbus}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
BusNamestringNo

The name of the event bus.

default
MaxResultsintegerNo

The number of entries per page. Valid values: 0 to 10000. Default value: 100.

100
BodyobjectYes

The parameters in the request body.

SchemaIdstringYes

The schema ID.

ecs:GeneralSchema
QueryTypestringYes

The query type. Valid values:

  • timeseries: queries time series data.
  • table: queries table data.
  • timeseries_and_table: queries time series data and table data at the same time.
timeseries_and_table
ParametersobjectYes

The query parameters.

BreakdownsarrayNo

Specifies whether to further split the data set based on the column name.

stringNo

The name of the column based on which data is split.

source
Calculationsarray<object>No

The operator that is used to calculate the specified column.

objectNo
OpstringNo

The operator.

COUNT_DISTINCT
ColumnstringNo

The column name.

source
Filtersarray<object>No

The filter conditions.

objectNo
ColumnstringNo

The column name.

source
OpstringNo

The operator.

=
ValuesarrayNo

The values that are used together with the operator.

stringNo

If the value is a string, you must enclose it in a pair of single quotation mark (').

'acs.ecs'
FilterCombinationstringNo

The logic used to filter the combination of conditions.

AND
GranularityintegerNo

The minimum time unit for querying time series data. Minimum value: 1. Unit: seconds. The value of this parameter is a recommended value. The actual value returned shall prevail.

30
Ordersarray<object>No

The order of the query results. This parameter is valid only if you set QueryType to table.

objectNo
OpstringNo

The operator.

AVG
ColumnstringNo

The column name.

source
DescbooleanNo

Specifies whether to sort the query results in descending order.

true
OffsetintegerNo

The offset of the start position for this query. The offset starts from 0.

0
LimitintegerNo

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

100
TimeRangeintegerNo

The time range during which events are queried. Unit: milliseconds. Minimum value: 1000.

1000000
StartTimeintegerNo

The timestamp that specifies the beginning of the time range to query. Unit: milliseconds.

1687860901814
EndTimeintegerNo

The timestamp that specifies the end of the time range to query. Unit: milliseconds.

1687861201814

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

Examples

Sample success responses

JSONformat

{
  "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

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-10-18The internal configuration of the API is changed, but the call is not affectedView Change Details
2024-08-05The internal configuration of the API is changed, but the call is not affectedView Change Details