API overview

Updated at:
Copy as MD

API standards and multilingual preset SDKs

The OpenAPI of this product (Ons/2019-02-14) uses the RPC signature style. We have encapsulated SDKs for common programming languages for developers. Developers can download the SDK to directly call this product's OpenAPI without worrying about technical details. If the existing SDK does not meet your needs, you can use the signature mechanism for self-signing integration. Since the details of self-signing are very complex, it may take around 5 business days. Therefore, we recommend joining our DingTalk service group (147535001692) and conducting signature integration under expert guidance.

Before using the API, you need to prepare your identity account and access key (AccessKey) to effectively access the API through client tools (such as SDK and CLI). For details, see Obtain an AccessKey.

Custom signature scenarios

If your business scenario has special requirements and you need to integrate the API through self-signing, we recommend consulting our technical support team first (DingTalk service group: 147535001692) to obtain professional guidance and ensure efficient integration.

Account and security preparation

Alibaba Cloud accounts have full administrative permissions over all resources. Once an AccessKey is compromised, all associated resources will be at risk of unauthorized access. To ensure security, it is recommended to create a RAM user with only API access permissions and configure its AccessKey, while configuring RAM policies based on the principle of least privilege (PoLP). Use the Alibaba Cloud account only in specific scenarios where Alibaba Cloud account permissions are explicitly required.

Services

API

Title

Description

OpenOnsService Activate service Invokes the OpenOnsService operation to activate the ApsaraMQ for RocketMQ service.

Messages

API

Title

Description

OnsMessageTrace OnsMessageTrace You can call the OnsMessageTrace operation to determine whether a message has been consumed based on its message ID.
OnsMessageGetByKey OnsMessageGetByKey Performs a fuzzy query for a list of messages based on a topic and a message key.
OnsMessageDetail OnsMessageDetail You can call OnsMessageDetail to query the details of a specific message.

Regions

API

Title

Description

OnsRegionList OnsRegionList Call the OnsRegionList operation to obtain a list of regions where ApsaraMQ for RocketMQ is available.

Instances

API

Title

Description

OnsInstanceCreate OnsInstanceCreate Call the OnsInstanceCreate operation to create an instance.
OnsInstanceBaseInfo OnsInstanceBaseInfo Queries the basic information about an instance and its endpoints for sending and receiving messages.
OnsInstanceUpdate OnsInstanceUpdate You can call the OnsInstanceUpdate operation to update the name and description of an instance.
OnsInstanceInServiceList OnsInstanceInServiceList Queries all ApsaraMQ for RocketMQ 4.x instances in a specified region.
OnsInstanceDelete OnsInstanceDelete Call the OnsInstanceDelete operation to delete an ApsaraMQ for RocketMQ instance.

Topic

API

Title

Description

OnsTopicCreate OnsTopicCreate You can call the OnsTopicCreate operation to create a topic.
OnsTopicStatus OnsTopicStatus Queries the total number of messages in a topic and the status of the topic.
OnsTopicList OnsTopicList Queries information about all topics in your account.
OnsTopicSubDetail OnsTopicSubDetail Queries the online consumer groups that subscribe to a specified topic.
OnsTopicDelete OnsTopicDelete Deletes a specified topic.

Group

API

Title

Description

OnsGroupCreate OnsGroupCreate Creates a client group ID.
OnsGroupConsumerUpdate OnsGroupConsumerUpdate Sets the message read permission for the consumer cluster that corresponds to a specified group ID. This operation is typically used to prevent a specific consumer group from reading messages.
OnsGroupList OnsGroupList Queries all Group IDs in a specified instance.
OnsGroupSubDetail OnsGroupSubDetail Queries the topics to which a group subscribes. The query fails if the consumer instances for the specified group ID are offline.
OnsGroupDelete OnsGroupDelete You can call the OnsGroupDelete operation to delete a group.

Tags

API

Title

Description

OnsConsumerStatus OnsConsumerStatus This operation queries detailed status data for a specified group ID, including subscription relationship checks, consumption TPS statistics, load balancing status, and consumer-side connections.
OnsConsumerAccumulate OnsConsumerAccumulate Queries the message accumulation for a specified group ID. The results include the number of stacked messages and the consumption latency.
OnsConsumerGetConnection OnsConsumerGetConnection Queries the connections of clients in a specified group.
OnsMessagePush OnsMessagePush The OnsMessagePush operation pushes a message to a specified consumer.

Consumption

API

Title

Description

OnsTrendGroupOutputTps OnsTrendGroupOutputTps Queries the message consumption statistics for a specified group ID over a period of time.

Message sending and receiving statistics

API

Title

Description

OnsTraceQueryByMsgId OnsTraceQueryByMsgId Creates a trace query task based on a topic and a message ID, and returns the task ID. You can then call the OnsTraceGetResult operation with the returned task ID to retrieve the detailed message trace.
OnsTraceQueryByMsgKey OnsTraceQueryByMsgKey Creates a trace query task based on a topic name and a message key and returns the ID of the query task. You must then call the OnsTraceGetResult operation and pass the returned query task ID to retrieve the detailed results of the message trace.
OnsTraceGetResult OnsTraceGetResult Fetches the results of a message trace query task using its task ID.

Traces

API

Title

Description

OnsDLQMessagePageQueryByGroupId OnsDLQMessagePageQueryByGroupId Queries dead-letter messages by page for a specified Group ID and time range.
OnsDLQMessageGetById OnsDLQMessageGetById Queries a specific dead-letter message by its message ID. The returned information includes the storage time, message body, key, and tag.
OnsDLQMessageResendById OnsDLQMessageResendById Resends a dead-letter message specified by a message ID to allow a consumer to consume the message again.

Dead-letter messages

API

Title

Description

Others

API

Title

Description

ListTagResources ListTagResources Call the ListTagResources operation to query the tags attached to a resource.
OnsConsumerResetOffset OnsConsumerResetOffset Resets a consumer offset to a specified timestamp for a consumer group.
OnsConsumerTimeSpan OnsConsumerTimeSpan Queries the time range within which you can specify a point in time to reset the consumer offset for a specified topic. The time range is from the point in time when the earliest stored message was published to the topic to the point in time when the most recently stored message was published to the topic.
OnsMessageGetByMsgId OnsMessageGetByMsgId Queries the information about a message by specifying the message ID and determines whether the message has been consumed.
OnsMessagePageQueryByTopic OnsMessagePageQueryByTopic Queries all messages that are stored in a specified topic within a specified time range by page.
OnsTrendTopicInputTps OnsTrendTopicInputTps Queries the statistics about messages that are published to a topic within a period of time.
TagResources TagResources Adds tags to a resource.
UntagResources UntagResources You can call UntagResources to detach and delete tags from resources.