ons-20190214/v2/main.tea (3,672 lines of code) (raw):

/** * */ import OpenApi; import OpenApi.OpenApiUtil; extends OpenApi; init(config: OpenApiUtil.Config){ super(config); @endpointRule = 'regional'; @endpointMap = { 'ap-northeast-2-pop' = 'ons.ap-northeast-1.aliyuncs.com', 'cn-beijing-finance-1' = 'ons.aliyuncs.com', 'cn-beijing-finance-pop' = 'ons.aliyuncs.com', 'cn-beijing-gov-1' = 'ons.aliyuncs.com', 'cn-beijing-nu16-b01' = 'ons.aliyuncs.com', 'cn-edge-1' = 'ons.aliyuncs.com', 'cn-fujian' = 'ons.aliyuncs.com', 'cn-haidian-cm12-c01' = 'ons.aliyuncs.com', 'cn-hangzhou-bj-b01' = 'ons.aliyuncs.com', 'cn-hangzhou-internal-prod-1' = 'ons.aliyuncs.com', 'cn-hangzhou-internal-test-1' = 'ons.aliyuncs.com', 'cn-hangzhou-internal-test-2' = 'ons.aliyuncs.com', 'cn-hangzhou-internal-test-3' = 'ons.aliyuncs.com', 'cn-hangzhou-test-306' = 'ons.aliyuncs.com', 'cn-hongkong-finance-pop' = 'ons.aliyuncs.com', 'cn-qingdao-nebula' = 'ons.aliyuncs.com', 'cn-shanghai-et15-b01' = 'ons.aliyuncs.com', 'cn-shanghai-et2-b01' = 'ons.aliyuncs.com', 'cn-shanghai-inner' = 'ons.aliyuncs.com', 'cn-shanghai-internal-test-1' = 'ons.aliyuncs.com', 'cn-shenzhen-inner' = 'ons.aliyuncs.com', 'cn-shenzhen-st4-d01' = 'ons.aliyuncs.com', 'cn-shenzhen-su18-b01' = 'ons.aliyuncs.com', 'cn-wuhan' = 'ons.aliyuncs.com', 'cn-yushanfang' = 'ons.aliyuncs.com', 'cn-zhangbei-na61-b01' = 'ons.aliyuncs.com', 'cn-zhangjiakou-na62-a01' = 'ons.aliyuncs.com', 'cn-zhengzhou-nebula-1' = 'ons.aliyuncs.com', 'eu-west-1-oxs' = 'ons.ap-northeast-1.aliyuncs.com', 'rus-west-1-pop' = 'ons.ap-northeast-1.aliyuncs.com', }; checkConfig(config); @endpoint = getEndpoint('ons', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint); } function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{ if (!$isNull(endpoint)) { return endpoint; } if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) { return endpointMap[regionId]; } return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix); } model ListTagResourcesRequest { instanceId?: string(name='InstanceId', description='The ID of the ApsaraMQ for RocketMQ instance to which the resource whose tags you want to query belongs. > This parameter is required when you query the tags of a topic or a group.', example='MQ_INST_188077086902****_BXSuW61e'), nextToken?: string(name='NextToken', description='The token that determines the start point of the next query.', example='caeba0****be03f84eb48b699f0a4883'), resourceId?: [ string ](name='ResourceId', description='The list of resource IDs.', example='TopicA'), resourceType?: string(name='ResourceType', description='The type of the resource whose tags you want to query. Valid values: * **INSTANCE** * **TOPIC** * **GROUP** This parameter is required.', example='TOPIC'), tag?: [ { key?: string(name='Key', description='The key of the tag that you want to detach from the resource. * If you include this parameter in a request, the value of this parameter cannot be an empty string. * The tag value can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`.', example='CartService'), value?: string(name='Value', description='The value of the tag that you want to query. * The value of this parameter can be an empty string. * The tag key must be 1 to 128 characters in length and cannot contain `http://` or `https://`. It cannot start with `acs:` or `aliyun`.', example='ServiceA'), } ](name='Tag', description='The tags that you want to query. A maximum of 20 tags can be included in the list.'), } model ListTagResourcesResponseBody = { nextToken?: string(name='NextToken', description='The token that determines the start point of the next query.', example='caeba0****be03f84eb48b699f0a4883'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='301D2CBE-66F8-403D-AEC0-82582478****'), tagResources?: [ { instanceId?: string(name='InstanceId', description='The ID of the instance', example='MQ_INST_188077086902****_BXSuW61e'), resourceId?: string(name='ResourceId', description='Indicates the ID of the resource.', example='TopicA'), resourceType?: string(name='ResourceType', description='The type of the resource whose tags you want to query. * ALIYUN::MQ::INSTANCE: indicates that the resource is a ApsaraMQ for RocketMQ instance. * ALIYUN::MQ::TOPIC: indicates that the resource is a topic. * ALIYUN::MQ::GROUP: indicates that the resource is a group.', example='ALIYUN::MQ::TOPIC'), tagKey?: string(name='TagKey', description='The tag key.', example='CartService'), tagValue?: string(name='TagValue', description='The tag value.', example='ServiceA'), } ](name='TagResources', description='Details of the resource and tags, including the resource ID, the resource type, tag keys, and tag values.'), } model ListTagResourcesResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ListTagResourcesResponseBody(name='body'), } /** * @summary Queries the tags that are attached to a specified resource. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * When you call the **ListTagResources** operation, specify at least one of the following parameters in the request: **Key** and **ResourceId**. You can specify a resource ID to query all tags that are attached to the specified resource. You can also specify a tag key to query the tag value and resource to which the tag is attached. * * If you include the **Key** parameter in a request, you can obtain the tag value and the ID of the resource to which the tag is attached. * * If you include the **ResourceId** parameter in a request, you can obtain the keys and values of all tags that are attached to the specified resource. * * @param request ListTagResourcesRequest * @param runtime runtime options for this request RuntimeOptions * @return ListTagResourcesResponse */ async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: $RuntimeOptions): ListTagResourcesResponse { request.validate(); var query = {}; if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.nextToken)) { query['NextToken'] = request.nextToken; } if (!$isNull(request.resourceId)) { query['ResourceId'] = request.resourceId; } if (!$isNull(request.resourceType)) { query['ResourceType'] = request.resourceType; } if (!$isNull(request.tag)) { query['Tag'] = request.tag; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'ListTagResources', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries the tags that are attached to a specified resource. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * When you call the **ListTagResources** operation, specify at least one of the following parameters in the request: **Key** and **ResourceId**. You can specify a resource ID to query all tags that are attached to the specified resource. You can also specify a tag key to query the tag value and resource to which the tag is attached. * * If you include the **Key** parameter in a request, you can obtain the tag value and the ID of the resource to which the tag is attached. * * If you include the **ResourceId** parameter in a request, you can obtain the keys and values of all tags that are attached to the specified resource. * * @param request ListTagResourcesRequest * @return ListTagResourcesResponse */ async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse { var runtime = new $RuntimeOptions{}; return listTagResourcesWithOptions(request, runtime); } model OnsConsumerAccumulateRequest { detail?: boolean(name='Detail', description='Specifies whether to query the details of each topic to which the consumer group subscribes. Valid values: * **true**: The details of each topic are queried. You can obtain the details from the **DetailInTopicList** response parameter. * **false**: The details of each topic are not queried. This is the default value. If you use this value, the value of the **DetailInTopicList** response parameter is empty.', example='true'), groupId?: string(name='GroupId', description='The ID of the consumer group. This parameter is required.', example='GID_test_consumer_id'), instanceId?: string(name='InstanceId', description='The ID of the instance.', example='MQ_INST_111111111111_DOxxxxxx'), } model OnsConsumerAccumulateResponseBody = { data?: { consumeTps?: float(name='ConsumeTps', description='The transactions per second (TPS) for message consumption performed by consumers in the group.', example='10'), delayTime?: long(name='DelayTime', description='The consumption latency.', example='10000'), detailInTopicList?: { detailInTopicDo?: [ { delayTime?: long(name='DelayTime', description='The maximum latency of message consumption in the topic.', example='10000'), lastTimestamp?: long(name='LastTimestamp', description='The point in time when the latest consumed message in the topic was produced.', example='1566231000000'), topic?: string(name='Topic', description='The topic name.', example='test-mq-topic'), totalDiff?: long(name='TotalDiff', description='The number of accumulated messages in the topic.', example='100'), } ](name='DetailInTopicDo') }(name='DetailInTopicList', description='The information about each topic to which the consumer group subscribes. If the **Detail** parameter in the request is set to **false**, the value of this parameter is empty.'), lastTimestamp?: long(name='LastTimestamp', description='The point in time when the latest message consumed by a consumer in the consumer group was produced.', example='1566231000000'), online?: boolean(name='Online', description='Indicates whether the consumer group is online. The consumer group is online if one of the consumers in the group is online. Valid values: * **true**: The consumer group is online. * **false**: The consumer group is offline.', example='true'), totalDiff?: long(name='TotalDiff', description='The total number of accumulated messages in all topics to which the consumer group subscribes.', example='100'), }(name='Data', description='The message accumulation information about topics to which the specified consumer subscribes.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='CE817BFF-B389-43CD-9419-95011AC9****'), } model OnsConsumerAccumulateResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsConsumerAccumulateResponseBody(name='body'), } /** * @summary Queries the information about message accumulation in topics to which a specified consumer group subscribes. The returned information includes the number of accumulated messages and the consumption latency. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can call this operation in scenarios in which you want to know the message consumption progress of a specified consumer group in production environments. You can obtain the information about message consumption and consumption latency based on the returned information. This operation returns the total number of accumulated messages in all topics to which the specified consumer group subscribes and the number of accumulated messages in each topic. * * @param request OnsConsumerAccumulateRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsConsumerAccumulateResponse */ async function onsConsumerAccumulateWithOptions(request: OnsConsumerAccumulateRequest, runtime: $RuntimeOptions): OnsConsumerAccumulateResponse { request.validate(); var query = {}; if (!$isNull(request.detail)) { query['Detail'] = request.detail; } if (!$isNull(request.groupId)) { query['GroupId'] = request.groupId; } if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsConsumerAccumulate', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries the information about message accumulation in topics to which a specified consumer group subscribes. The returned information includes the number of accumulated messages and the consumption latency. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can call this operation in scenarios in which you want to know the message consumption progress of a specified consumer group in production environments. You can obtain the information about message consumption and consumption latency based on the returned information. This operation returns the total number of accumulated messages in all topics to which the specified consumer group subscribes and the number of accumulated messages in each topic. * * @param request OnsConsumerAccumulateRequest * @return OnsConsumerAccumulateResponse */ async function onsConsumerAccumulate(request: OnsConsumerAccumulateRequest): OnsConsumerAccumulateResponse { var runtime = new $RuntimeOptions{}; return onsConsumerAccumulateWithOptions(request, runtime); } model OnsConsumerGetConnectionRequest { groupId?: string(name='GroupId', description='The ID of the consumer group whose client connection status you want to query. This parameter is required.', example='GID_test_consumer_id'), instanceId?: string(name='InstanceId', description='The ID of the instance to which the consumer group belongs.', example='MQ_INST_111111111111_DOxxxxxx'), } model OnsConsumerGetConnectionResponseBody = { data?: { connectionList?: { connectionDo?: [ { clientAddr?: string(name='ClientAddr', description='The IP address and port number of the consumer client.', example='30.5.121.**'), clientId?: string(name='ClientId', description='The ID of the consumer client.', example='30.5.121.**@24813#-1999745829#-1737591554#453111174894656'), language?: string(name='Language', description='The programming language in which the consumer application was developed.', example='JAVA'), version?: string(name='Version', description='The version of the consumer client.', example='V4_3_6'), } ](name='ConnectionDo') }(name='ConnectionList', description='The client connection information of the consumer group.'), messageModel?: string(name='MessageModel'), }(name='Data', description='The data returned.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='DE4140C7-F42D-473D-A5FF-B1E31692****'), } model OnsConsumerGetConnectionResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsConsumerGetConnectionResponseBody(name='body'), } /** * @summary Queries the client connection status of a specified consumer group. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * When messages are accumulated in a topic, you can call this operation to check whether a consumer is online. * * @param request OnsConsumerGetConnectionRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsConsumerGetConnectionResponse */ async function onsConsumerGetConnectionWithOptions(request: OnsConsumerGetConnectionRequest, runtime: $RuntimeOptions): OnsConsumerGetConnectionResponse { request.validate(); var query = {}; if (!$isNull(request.groupId)) { query['GroupId'] = request.groupId; } if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsConsumerGetConnection', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries the client connection status of a specified consumer group. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * When messages are accumulated in a topic, you can call this operation to check whether a consumer is online. * * @param request OnsConsumerGetConnectionRequest * @return OnsConsumerGetConnectionResponse */ async function onsConsumerGetConnection(request: OnsConsumerGetConnectionRequest): OnsConsumerGetConnectionResponse { var runtime = new $RuntimeOptions{}; return onsConsumerGetConnectionWithOptions(request, runtime); } model OnsConsumerResetOffsetRequest { groupId?: string(name='GroupId', description='The ID of the consumer group whose dead-letter message you want to query. This parameter is required.', example='GID_test_consumer_id'), instanceId?: string(name='InstanceId', description='The ID of the instance to which the consumer group belongs.', example='MQ_INST_111111111111_DOxxxxxx'), resetTimestamp?: long(name='ResetTimestamp', description='The timestamp to which you want to reset the consumer offset. This parameter takes effect only when the **Type** parameter is set to **1**. Unit: milliseconds.', example='1591153871000'), topic?: string(name='Topic', description='The name of the topic for which you want to reset the consumer offset. This parameter is required.', example='test-mq-topic'), type?: int32(name='Type', description='The method that you want to use to clear accumulated messages. Valid values: * **0:** All accumulated messages are cleared. Messages that are not consumed are ignored. Consumers in the specified consumer group consume only messages that are published to the topic after the specified point in time. If "reconsumeLater" is returned, the accumulated messages are not cleared because the system is retrying to resend the messages to consumers. * **1:** The messages that were published to the topic before the specified point in time are cleared. You must specify a point in time. Consumers in the specified consumer group consume only the messages that are published to the topic after the specified point in time. You can specify a point in time from the earliest point in time when a message was published to the topic to the most recent point in time when a message was published to the topic. Points in time that are not within the allowed time range are invalid. This parameter is required.', example='1'), } model OnsConsumerResetOffsetResponseBody = { requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='D52C68F8-EC5D-4294-BFFF-1A6A25AF****'), } model OnsConsumerResetOffsetResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsConsumerResetOffsetResponseBody(name='body'), } /** * @summary Resets a consumer offset to a specified timestamp for a consumer group. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can call this operation to clear accumulated messages or reset a consumer offset to a specified timestamp. You can use one of the following methods to clear accumulated messages: * * Clear all accumulated messages in a specified topic. * * Clear the messages that were published to the specified topic before a specified point in time. * * @param request OnsConsumerResetOffsetRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsConsumerResetOffsetResponse */ async function onsConsumerResetOffsetWithOptions(request: OnsConsumerResetOffsetRequest, runtime: $RuntimeOptions): OnsConsumerResetOffsetResponse { request.validate(); var query = {}; if (!$isNull(request.groupId)) { query['GroupId'] = request.groupId; } if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.resetTimestamp)) { query['ResetTimestamp'] = request.resetTimestamp; } if (!$isNull(request.topic)) { query['Topic'] = request.topic; } if (!$isNull(request.type)) { query['Type'] = request.type; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsConsumerResetOffset', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Resets a consumer offset to a specified timestamp for a consumer group. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can call this operation to clear accumulated messages or reset a consumer offset to a specified timestamp. You can use one of the following methods to clear accumulated messages: * * Clear all accumulated messages in a specified topic. * * Clear the messages that were published to the specified topic before a specified point in time. * * @param request OnsConsumerResetOffsetRequest * @return OnsConsumerResetOffsetResponse */ async function onsConsumerResetOffset(request: OnsConsumerResetOffsetRequest): OnsConsumerResetOffsetResponse { var runtime = new $RuntimeOptions{}; return onsConsumerResetOffsetWithOptions(request, runtime); } model OnsConsumerStatusRequest { detail?: boolean(name='Detail', description='Specifies whether to query the details of the consumer group. Valid values: * **true**: The details of the consumer group are queried. You can obtain details from the **ConsumerConnectionInfoList** and **DetailInTopicList** response parameters. * **false**: The details of the consumer group are not queried. The values of the **ConsumerConnectionInfoList** and **DetailInTopicList** response parameters are empty. This value is the default value of the Detail parameter.', example='true'), groupId?: string(name='GroupId', description='The ID of the consumer group whose details you want to query. This parameter is required.', example='GID_test_group_id'), instanceId?: string(name='InstanceId', description='The ID of the instance to which the consumer group belongs.', example='MQ_INST_111111111111_DOxxxxxx'), needJstack?: boolean(name='NeedJstack', description='Specifies whether to query the information about thread stack traces. Valid values: * **true**: The information about thread stack traces is queried. You can obtain the information from the **Jstack** response parameter. > If you want to obtain the information about thread stack traces, make sure that the **Detail** parameter in the request is set to **true**. * **false**: The information about thread stack traces is not queried. The value of the **Jstack** response parameter is empty. This value is the default value of the NeedJstack parameter.', example='true'), } model OnsConsumerStatusResponseBody = { data?: { connectionSet?: { connectionDo?: [ { clientAddr?: string(name='ClientAddr', description='The IP address and port number of the consumer instance.', example='30.5.121.**'), clientId?: string(name='ClientId', description='The ID of the consumer instance.', example='30.5.121.**@25560#-1999745829#-1737591554#458773089270275'), language?: string(name='Language', description='The programming language in which the consumer is developed.', example='JAVA'), remoteIP?: string(name='RemoteIP', description='The private or public IP address of the host.', example='42.120.74.**'), version?: string(name='Version', description='The version of the consumer client.', example='V4_3_6_SNAPSHOT'), } ](name='ConnectionDo') }(name='ConnectionSet', description='The information about online consumers in the consumer group.'), consumeModel?: string(name='ConsumeModel', description='The consumption mode. Valid values: * **CLUSTERING**: the clustering consumption mode * **BROADCASTING**: the broadcasting consumption mode For more information about consumption modes, see [Clustering consumption and broadcasting consumption](https://help.aliyun.com/document_detail/43163.html).', example='CLUSTERING'), consumeTps?: float(name='ConsumeTps', description='The TPS for message consumption.', example='0'), consumerConnectionInfoList?: { consumerConnectionInfoDo?: [ { clientId?: string(name='ClientId', description='The ID of the consumer instance.', example='``30.5.**.**``@25560#-1999745829#-1737591554#458773089270275'), connection?: string(name='Connection', description='The connection information.', example='**'), consumeModel?: string(name='ConsumeModel', description='The consumption mode. Valid values: * **CLUSTERING**: the clustering consumption mode * **BROADCASTING**: the broadcasting consumption mode For more information about consumption modes, see [Clustering consumption and broadcasting consumption](https://help.aliyun.com/document_detail/43163.html).', example='CLUSTERING'), consumeType?: string(name='ConsumeType', description='The mode in which the consumer consumes messages. Valid values: * **PUSH**: The ApsaraMQ for RocketMQ broker pushes messages to the consumer. * **PULL**: The consumer pulls messages from the ApsaraMQ for RocketMQ broker.', example='PUSH'), jstack?: { threadTrackDo?: [ { thread?: string(name='Thread', description='The name of the thread.', example='ConsumeMessageThread_0'), trackList?: { track?: [ string ](name='Track') }(name='TrackList', description='The details of thread stack traces.'), } ](name='ThreadTrackDo') }(name='Jstack', description='The information about thread stack traces. If you want to obtain the information about thread stack traces, make sure that the **NeedJstack** parameter in the request is set to **true**. If the NeedJstack parameter is not set to true, the value of this parameter is empty.'), language?: string(name='Language', description='The programming language that the consumer supports.', example='JAVA'), lastTimeStamp?: long(name='LastTimeStamp', description='The most recent point in time when a message was consumed. The value of this parameter is a UNIX timestamp in milliseconds.', example='1570701368114'), runningDataList?: { consumerRunningDataDo?: [ { failedCountPerHour?: long(name='FailedCountPerHour', description='The number of messages that failed to be consumed each hour.', example='0'), failedTps?: float(name='FailedTps', description='The TPS for failed message consumption.', example='0'), okTps?: float(name='OkTps', description='The TPS for successful message consumption.', example='0'), rt?: float(name='Rt', description='The consumption RT. Unit: milliseconds.', example='0'), topic?: string(name='Topic', description='The name of the topic to which the consumer subscribes.', example='test-mq_topic'), } ](name='ConsumerRunningDataDo') }(name='RunningDataList', description='The real-time statistics.'), startTimeStamp?: long(name='StartTimeStamp', description='The earliest point in time when a message was consumed. The value of this parameter is a UNIX timestamp in milliseconds.', example='1570701361528'), subscriptionSet?: { subscriptionData?: [ { subString?: string(name='SubString', description='The expression that is used to specify the tags of messages in the subscribed topic.', example='*'), subVersion?: long(name='SubVersion', description='The subscription version. The value is of the LONG type and is automatically incremented.', example='1570701364301'), tagsSet?: { tag?: [ string ](name='Tag') }(name='TagsSet', description='The information about the tags of the topic to which the consumer subscribes.'), topic?: string(name='Topic', description='The name of the topic to which the consumer subscribes.', example='test-mq_topic'), } ](name='SubscriptionData') }(name='SubscriptionSet', description='The information about subscriptions.'), threadCount?: int32(name='ThreadCount', description='The number of consumer threads.', example='20'), version?: string(name='Version', description='The version of the consumer client.', example='V4_3_6'), } ](name='ConsumerConnectionInfoDo') }(name='ConsumerConnectionInfoList', description='The details of online consumers in the consumer group, including the information about the thread stack traces and the consumption response time (RT). If you want to obtain the details of online consumers in the consumer group, make sure that the **Detail** parameter in the request is set to **true**. If the Detail parameter is not set to true, the value of this parameter is empty.'), delayTime?: long(name='DelayTime', description='The maximum latency of message consumption in all topics to which the consumer group subscribes. Unit: milliseconds.', example='100857'), detailInTopicList?: { detailInTopicDo?: [ { delayTime?: long(name='DelayTime', description='The latency of message consumption in the topic. Unit: milliseconds.', example='0'), lastTimestamp?: long(name='LastTimestamp', description='The most recent point in time when a message was consumed. The value of this parameter is a UNIX timestamp in milliseconds.', example='1570701259403'), topic?: string(name='Topic', description='The topic name.', example='test-mq_topic'), totalDiff?: long(name='TotalDiff', description='The number of accumulated messages in the topic.', example='0'), } ](name='DetailInTopicDo') }(name='DetailInTopicList', description='The information about message consumption by topic. If you want to obtain the information about the consumption status of each topic, make sure that the **Detail** parameter in the request is set to **true**. If the Detail parameter is not set to true, the value of this parameter is empty.'), instanceId?: string(name='InstanceId', description='The ID of the instance', example='MQ_INST_111111111111_DOxxxxxx'), lastTimestamp?: long(name='LastTimestamp', description='The most recent point in time when a message was consumed. The value of this parameter is a UNIX timestamp in milliseconds.', example='1566883844954'), online?: boolean(name='Online', description='Indicates whether the consumer group is online.', example='true'), rebalanceOK?: boolean(name='RebalanceOK', description='Indicates whether load balancing is performed as expected. Valid values: * **true**: Load balancing is performed as expected. * **false**: Load balancing is not performed as expected.', example='true'), subscriptionSame?: boolean(name='SubscriptionSame', description='Indicates whether all consumers in the consumer group subscribe to the same topics and tags.', example='true'), totalDiff?: long(name='TotalDiff', description='The total number of accumulated messages.', example='197'), }(name='Data', description='The data returned.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='10EDC518-10E7-4B34-92FB-171235FA****'), } model OnsConsumerStatusResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsConsumerStatusResponseBody(name='body'), } /** * @summary Queries the detailed information about the status of a specified consumer group. This operation returns the transactions per second (TPS) for message consumption, load balancing status, consumer connection status, and whether all consumers in the consumer group subscribe to the same topics and tags. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * You can call this operation in scenarios in which consumers are online and messages are accumulated. You can troubleshoot errors based on the information that is returned by this operation. You can check whether all consumers in the consumer group subscribe to the same topics and tags, and whether load balancing is performed as expected. You can also obtain the information about thread stack traces of online consumers. * * This operation uses multiple backend operations to query and aggregate data. The system requires a long period of time to process a request. We recommend that you do not frequently call this operation. * * @param request OnsConsumerStatusRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsConsumerStatusResponse */ async function onsConsumerStatusWithOptions(request: OnsConsumerStatusRequest, runtime: $RuntimeOptions): OnsConsumerStatusResponse { request.validate(); var query = {}; if (!$isNull(request.detail)) { query['Detail'] = request.detail; } if (!$isNull(request.groupId)) { query['GroupId'] = request.groupId; } if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.needJstack)) { query['NeedJstack'] = request.needJstack; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsConsumerStatus', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries the detailed information about the status of a specified consumer group. This operation returns the transactions per second (TPS) for message consumption, load balancing status, consumer connection status, and whether all consumers in the consumer group subscribe to the same topics and tags. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * You can call this operation in scenarios in which consumers are online and messages are accumulated. You can troubleshoot errors based on the information that is returned by this operation. You can check whether all consumers in the consumer group subscribe to the same topics and tags, and whether load balancing is performed as expected. You can also obtain the information about thread stack traces of online consumers. * * This operation uses multiple backend operations to query and aggregate data. The system requires a long period of time to process a request. We recommend that you do not frequently call this operation. * * @param request OnsConsumerStatusRequest * @return OnsConsumerStatusResponse */ async function onsConsumerStatus(request: OnsConsumerStatusRequest): OnsConsumerStatusResponse { var runtime = new $RuntimeOptions{}; return onsConsumerStatusWithOptions(request, runtime); } model OnsConsumerTimeSpanRequest { groupId?: string(name='GroupId', description='The ID of the consumer group whose reset time range you want to query. This parameter is required.', example='GID_test_group_id'), instanceId?: string(name='InstanceId', description='The ID of the instance to which the consumer group belongs.', example='MQ_INST_111111111111_DOxxxxxx'), topic?: string(name='Topic', description='The topic to which the consumer group subscribes. This parameter is required.', example='test-mq_topic'), } model OnsConsumerTimeSpanResponseBody = { data?: { consumeTimeStamp?: long(name='ConsumeTimeStamp', description='The most recent point in time when a message in the topic was consumed by the customer group.', example='1570761026400'), instanceId?: string(name='InstanceId', description='The ID of the instance to which the consumer group belongs.', example='MQ_INST_111111111111_DOxxxxxx'), maxTimeStamp?: long(name='MaxTimeStamp', description='The point in time when the earliest stored message was published to the topic.', example='1570761026804'), minTimeStamp?: long(name='MinTimeStamp', description='The point in time when the most recently stored message was published to the topic.', example='1570701231122'), topic?: string(name='Topic', description='The name of the topic that you want to query.', example='test-mq_topic'), }(name='Data', description='The data returned.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='A07E3902-B92E-44A6-B6C5-6AA111111****'), } model OnsConsumerTimeSpanResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsConsumerTimeSpanResponseBody(name='body'), } /** * @summary 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. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can call this operation to query the point in time when the earliest stored message was published to a specified topic and the point in time when the most recently stored message was published to the specified topic. You can also call this operation to query the most recent point in time when a message in the topic was consumed. This operation is usually used with the \\*\\*OnsConsumerAccumulate\\*\\* operation to display the overview of the consumption progress. * * @param request OnsConsumerTimeSpanRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsConsumerTimeSpanResponse */ async function onsConsumerTimeSpanWithOptions(request: OnsConsumerTimeSpanRequest, runtime: $RuntimeOptions): OnsConsumerTimeSpanResponse { request.validate(); var query = {}; if (!$isNull(request.groupId)) { query['GroupId'] = request.groupId; } if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.topic)) { query['Topic'] = request.topic; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsConsumerTimeSpan', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary 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. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can call this operation to query the point in time when the earliest stored message was published to a specified topic and the point in time when the most recently stored message was published to the specified topic. You can also call this operation to query the most recent point in time when a message in the topic was consumed. This operation is usually used with the \\*\\*OnsConsumerAccumulate\\*\\* operation to display the overview of the consumption progress. * * @param request OnsConsumerTimeSpanRequest * @return OnsConsumerTimeSpanResponse */ async function onsConsumerTimeSpan(request: OnsConsumerTimeSpanRequest): OnsConsumerTimeSpanResponse { var runtime = new $RuntimeOptions{}; return onsConsumerTimeSpanWithOptions(request, runtime); } model OnsDLQMessageGetByIdRequest { groupId?: string(name='GroupId', description='The ID of the consumer group whose dead-letter message you want to query. This parameter is required.', example='GID_test_group_id'), instanceId?: string(name='InstanceId', description='The ID of the instance to which the message you want to query belongs.', example='MQ_INST_111111111111_DOxxxxxx'), msgId?: string(name='MsgId', description='The ID of the dead-letter message that you want to query. This parameter is required.', example='0BC16699165C03B925DB8A404E2D****'), } model OnsDLQMessageGetByIdResponseBody = { data?: { bodyCRC?: int32(name='BodyCRC', description='The cyclic redundancy check (CRC) value of the message body.', example='914112295'), bornHost?: string(name='BornHost', description='The producer instance that generated the message.', example='``42.120.**.**``:64646'), bornTimestamp?: long(name='BornTimestamp', description='The timestamp that indicates the point in time when the message was generated. Unit: milliseconds.', example='1570761026630'), instanceId?: string(name='InstanceId', description='The ID of the instance', example='MQ_INST_111111111111_DOxxxxxx'), msgId?: string(name='MsgId', description='The ID of the dead-letter message.', example='0BC16699165C03B925DB8A404E2D****'), propertyList?: { messageProperty?: [ { name?: string(name='Name', description='The name of the attribute. Valid values: * **TRACE_ON**: indicates whether the message trace exists. * **KEYS**: indicates the key of the message. * **TAGS**: indicates the tag that is attached to the message. * **INSTANCE_ID**: indicates the ID of the instance that contains the message. For information about the terms that are used in ApsaraMQ for RocketMQ, see [Terms](https://help.aliyun.com/document_detail/29533.html).', example='TAGS'), value?: string(name='Value', description='The value of the attribute.', example='TagA'), } ](name='MessageProperty') }(name='PropertyList', description='The attributes of the message.'), reconsumeTimes?: int32(name='ReconsumeTimes', description='The number of retries that were performed to send the message to consumers.', example='1'), storeHost?: string(name='StoreHost', description='The ApsaraMQ for RocketMQ broker that stores the message.', example='11.220.***.***:10911'), storeSize?: int32(name='StoreSize', description='The size of the message. Unit: KB.', example='407'), storeTimestamp?: long(name='StoreTimestamp', description='The timestamp that indicates the point in time when the ApsaraMQ for RocketMQ broker stored the message. Unit: milliseconds.', example='1570761026708'), topic?: string(name='Topic', description='The topic to which the message belongs.', example='test-mq_topic'), }(name='Data', description='The data returned.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID.', example='A07E3902-B92E-44A6-B6C5-6AA111111****'), } model OnsDLQMessageGetByIdResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsDLQMessageGetByIdResponseBody(name='body'), } /** * @summary Queries a dead-letter message based on the message ID. The queried information about the dead-letter message includes the point in time when the message is stored, the message body, and attributes such as the message tag and the message key. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * This operation uses the exact match method to query a dead-letter message based on the message ID. You can obtain the message ID that is required to query the information about a dead-letter message from the SendResult parameter that is returned after the message is sent. You can also obtain the message ID by calling the OnsDLQMessagePageQueryByGroupId operation to query multiple messages at a time. The queried information about the dead-letter message includes the point in time when the message is stored, the message body, and attributes such as the message tag and the message key. * * @param request OnsDLQMessageGetByIdRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsDLQMessageGetByIdResponse */ async function onsDLQMessageGetByIdWithOptions(request: OnsDLQMessageGetByIdRequest, runtime: $RuntimeOptions): OnsDLQMessageGetByIdResponse { request.validate(); var query = {}; if (!$isNull(request.groupId)) { query['GroupId'] = request.groupId; } if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.msgId)) { query['MsgId'] = request.msgId; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsDLQMessageGetById', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries a dead-letter message based on the message ID. The queried information about the dead-letter message includes the point in time when the message is stored, the message body, and attributes such as the message tag and the message key. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * This operation uses the exact match method to query a dead-letter message based on the message ID. You can obtain the message ID that is required to query the information about a dead-letter message from the SendResult parameter that is returned after the message is sent. You can also obtain the message ID by calling the OnsDLQMessagePageQueryByGroupId operation to query multiple messages at a time. The queried information about the dead-letter message includes the point in time when the message is stored, the message body, and attributes such as the message tag and the message key. * * @param request OnsDLQMessageGetByIdRequest * @return OnsDLQMessageGetByIdResponse */ async function onsDLQMessageGetById(request: OnsDLQMessageGetByIdRequest): OnsDLQMessageGetByIdResponse { var runtime = new $RuntimeOptions{}; return onsDLQMessageGetByIdWithOptions(request, runtime); } model OnsDLQMessagePageQueryByGroupIdRequest { beginTime?: long(name='BeginTime', description='The beginning of the time range to query. The value of this parameter is a UNIX timestamp in milliseconds. If you specify a valid value for the **TaskId** parameter in the request, this parameter does not take effect. The system uses the value of the BeginTime parameter that you specified in the request when you created the specified query task. This parameter is required.', example='1570723200000'), currentPage?: int32(name='CurrentPage', description='The number of the page to return. Pages start from page 1. Valid values: 1 to 50. This parameter is required.', example='2'), endTime?: long(name='EndTime', description='The end of the time range to query. The value of this parameter is a UNIX timestamp in milliseconds. If you specify a valid value for the **TaskId** parameter in the request, this parameter does not take effect. The system uses the value of the EndTime parameter that you specified in the request when you created the specified query task. This parameter is required.', example='1570809600000'), groupId?: string(name='GroupId', description='The ID of the consumer group whose dead-letter messages you want to query. This parameter is required.', example='GID_test_group_id'), instanceId?: string(name='InstanceId', description='The ID of the instance to which the dead-letter messages you want to query belong.', example='MQ_INST_111111111111_DOxxxxxx'), pageSize?: int32(name='PageSize', description='The number of dead-letter messages to return on each page. Valid values: 5 to 50. Default value: 20. If you specify a valid value for the **TaskId** parameter in the request, this parameter does not take effect. The system uses the value of the PageSize parameter that you specified in the request when you created the specified query task.', example='5'), taskId?: string(name='TaskId', description='The ID of the query task. The first time you call this operation to query dead-letter messages that are sent to a specified consumer group within a specified time range, this parameter is not required. This parameter is required in subsequent queries for dead-letter messages on a specified page. You can obtain the task ID from the returned result of the first query.', example='0BC1310300002A9F000021E4D7A48346'), } model OnsDLQMessagePageQueryByGroupIdResponseBody = { msgFoundDo?: { currentPage?: long(name='CurrentPage', description='The page number of the returned page.', example='1'), maxPageCount?: long(name='MaxPageCount', description='The total number of returned pages.', example='400'), msgFoundList?: { onsRestMessageDo?: [ { bodyCRC?: int32(name='BodyCRC', description='The cyclic redundancy check (CRC) value of the message body.', example='914112295'), bornHost?: string(name='BornHost', description='The producer instance that generated the message.', example='42.120.***.***:59270'), bornTimestamp?: long(name='BornTimestamp', description='The timestamp that indicates when the message was produced.', example='1570760999721'), instanceId?: string(name='InstanceId', description='The ID of the instance', example='MQ_INST_111111111111_DOxxxxxx'), msgId?: string(name='MsgId', description='The ID of the message.', example='1E0578FE110F18B4AAC235C05F2*****'), propertyList?: { messageProperty?: [ { name?: string(name='Name', description='The name of the attribute. Valid values: * **TRACE_ON**: indicates whether a trace of the message exists. * **KEYS**: indicates the key of the message. * **TAGS**: indicates the tag that is attached to the message. * **INSTANCE_ID**: indicates the ID of the instance that contains the message. For information about the terms that are used in ApsaraMQ for RocketMQ, see [Terms](https://help.aliyun.com/document_detail/29533.html).', example='TAGS'), value?: string(name='Value', description='The value of the attribute.', example='TagA'), } ](name='MessageProperty') }(name='PropertyList', description='The attributes of the message.'), reconsumeTimes?: int32(name='ReconsumeTimes', description='The number of retries that were performed to send the message to consumers.', example='1'), storeHost?: string(name='StoreHost', description='The ApsaraMQ for RocketMQ broker that stores the message.', example='11.193.***.***:10911'), storeSize?: int32(name='StoreSize', description='The size of the message. Unit: KB.', example='406'), storeTimestamp?: long(name='StoreTimestamp', description='The timestamp that indicates the point in time when the ApsaraMQ for RocketMQ broker stored the message.', example='1570760999811'), topic?: string(name='Topic', description='The topic to which the message belongs.', example='test-mq_topic'), } ](name='OnsRestMessageDo') }(name='MsgFoundList', description='The information about dead-letter messages that are returned on the current page. The information that is contained in this parameter is the same as the information that is returned by the [OnsDLQMessageGetById](https://help.aliyun.com/document_detail/112667.html) operation.'), taskId?: string(name='TaskId', description='The ID of the query task. The first time you call this operation to query the dead-letter messages that are sent to a specified consumer group within a specified time range, this parameter is returned. You can use the task ID to query the details of dead-letter messages on other returned pages.', example='0BC1310300002A9F000021E4D7A48346'), }(name='MsgFoundDo', description='The information about dead-letter messages that are queried.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='B00CD3C8-D81E-4A41-85E2-38F19252****'), } model OnsDLQMessagePageQueryByGroupIdResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsDLQMessagePageQueryByGroupIdResponseBody(name='body'), } /** * @summary Queries all dead-letter messages in a group within a period of time by page. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * If you do not know the ID of the dead-letter message that you want to query, you can call this operation to query all dead-letter messages that are sent to a specified consumer group within a specified time range. The results are returned by page. * * We recommend that you specify a short time range to query dead-letter messages in this method. If you specify a long time range, a large number of dead-letter messages are returned. In this case, you cannot find the dead-letter message that you want to query in an efficient manner. You can perform the following steps to query dead-letter messages: * 1. Perform a paged query by specifying the group ID, start time, end time, and number of entries to return on each page. If matched messages are found, the information about the dead-letter messages on the first page, total number of pages, and task ID are returned by default. * 2. Specify the task ID and a page number to call this operation again to query the dead-letter messages on the specified page. In this query, the BeginTime, EndTime, and PageSize parameters do not take effect. By default, the system uses the values of these parameters that you specified in the request when you created the specified query task. * * @param request OnsDLQMessagePageQueryByGroupIdRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsDLQMessagePageQueryByGroupIdResponse */ async function onsDLQMessagePageQueryByGroupIdWithOptions(request: OnsDLQMessagePageQueryByGroupIdRequest, runtime: $RuntimeOptions): OnsDLQMessagePageQueryByGroupIdResponse { request.validate(); var query = {}; if (!$isNull(request.beginTime)) { query['BeginTime'] = request.beginTime; } if (!$isNull(request.currentPage)) { query['CurrentPage'] = request.currentPage; } if (!$isNull(request.endTime)) { query['EndTime'] = request.endTime; } if (!$isNull(request.groupId)) { query['GroupId'] = request.groupId; } if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.pageSize)) { query['PageSize'] = request.pageSize; } if (!$isNull(request.taskId)) { query['TaskId'] = request.taskId; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsDLQMessagePageQueryByGroupId', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries all dead-letter messages in a group within a period of time by page. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * If you do not know the ID of the dead-letter message that you want to query, you can call this operation to query all dead-letter messages that are sent to a specified consumer group within a specified time range. The results are returned by page. * * We recommend that you specify a short time range to query dead-letter messages in this method. If you specify a long time range, a large number of dead-letter messages are returned. In this case, you cannot find the dead-letter message that you want to query in an efficient manner. You can perform the following steps to query dead-letter messages: * 1. Perform a paged query by specifying the group ID, start time, end time, and number of entries to return on each page. If matched messages are found, the information about the dead-letter messages on the first page, total number of pages, and task ID are returned by default. * 2. Specify the task ID and a page number to call this operation again to query the dead-letter messages on the specified page. In this query, the BeginTime, EndTime, and PageSize parameters do not take effect. By default, the system uses the values of these parameters that you specified in the request when you created the specified query task. * * @param request OnsDLQMessagePageQueryByGroupIdRequest * @return OnsDLQMessagePageQueryByGroupIdResponse */ async function onsDLQMessagePageQueryByGroupId(request: OnsDLQMessagePageQueryByGroupIdRequest): OnsDLQMessagePageQueryByGroupIdResponse { var runtime = new $RuntimeOptions{}; return onsDLQMessagePageQueryByGroupIdWithOptions(request, runtime); } model OnsDLQMessageResendByIdRequest { groupId?: string(name='GroupId', description='The ID of the consumer group in which you want to query dead-letter messages. This parameter is required.', example='GID_test_group_id'), instanceId?: string(name='InstanceId', description='The ID of the instance in which the dead-letter message you want to query resides.', example='MQ_INST_188077086902****_BXSuW61e'), msgId?: string(name='MsgId', description='The ID of the dead-letter message that you want to send to a consumer group for consumption. This parameter is required.', example='0BC16699343051CD9F1D798E7734****'), } model OnsDLQMessageResendByIdResponseBody = { data?: { msgId?: [ string ](name='MsgId') }(name='Data', description='The returned messages.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='D94CC769-4DC3-4690-A868-9D0631B1****'), } model OnsDLQMessageResendByIdResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsDLQMessageResendByIdResponseBody(name='body'), } /** * @summary Resends a dead-letter message based on a specified message ID so that the dead-letter message can be consumed by consumers. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * A dead-letter message is a message that still fails to be consumed after the number of consumption retries reaches the upper limit. If the message still cannot be consumed after you re-send it, a message with the same message ID is added to the corresponding dead-letter queue. You can query the message ID on the Dead-letter Queues page in the ApsaraMQ for RocketMQ console or by calling API operations. You can obtain the number of consumption failures for a message based on the number of dead-letter messages with the same message ID in the dead-letter queue. * * A dead-letter message is a message that fails to be consumed after the number of consumption retries reaches the upper limit. Generally, dead-letter messages are produced because of incorrect consumption logic. We recommend that you troubleshoot the consumption failures and then call this operation to send the message to the consumer group for consumption again. * * ApsaraMQ for RocketMQ does not manage the status of dead-letter messages based on the consumption status of the dead-letter messages. After you call this operation to send a dead-letter message to a consumer group and the message is consumed, ApsaraMQ for RocketMQ does not remove the dead-letter message from the dead-letter queue. You must manage dead-letter messages and determine whether to send a dead-letter message to a consumer group for consumption. This way, you do not resend or reconsume the messages that are consumed. * * @param request OnsDLQMessageResendByIdRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsDLQMessageResendByIdResponse */ async function onsDLQMessageResendByIdWithOptions(request: OnsDLQMessageResendByIdRequest, runtime: $RuntimeOptions): OnsDLQMessageResendByIdResponse { request.validate(); var query = {}; if (!$isNull(request.groupId)) { query['GroupId'] = request.groupId; } if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.msgId)) { query['MsgId'] = request.msgId; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsDLQMessageResendById', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Resends a dead-letter message based on a specified message ID so that the dead-letter message can be consumed by consumers. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * A dead-letter message is a message that still fails to be consumed after the number of consumption retries reaches the upper limit. If the message still cannot be consumed after you re-send it, a message with the same message ID is added to the corresponding dead-letter queue. You can query the message ID on the Dead-letter Queues page in the ApsaraMQ for RocketMQ console or by calling API operations. You can obtain the number of consumption failures for a message based on the number of dead-letter messages with the same message ID in the dead-letter queue. * * A dead-letter message is a message that fails to be consumed after the number of consumption retries reaches the upper limit. Generally, dead-letter messages are produced because of incorrect consumption logic. We recommend that you troubleshoot the consumption failures and then call this operation to send the message to the consumer group for consumption again. * * ApsaraMQ for RocketMQ does not manage the status of dead-letter messages based on the consumption status of the dead-letter messages. After you call this operation to send a dead-letter message to a consumer group and the message is consumed, ApsaraMQ for RocketMQ does not remove the dead-letter message from the dead-letter queue. You must manage dead-letter messages and determine whether to send a dead-letter message to a consumer group for consumption. This way, you do not resend or reconsume the messages that are consumed. * * @param request OnsDLQMessageResendByIdRequest * @return OnsDLQMessageResendByIdResponse */ async function onsDLQMessageResendById(request: OnsDLQMessageResendByIdRequest): OnsDLQMessageResendByIdResponse { var runtime = new $RuntimeOptions{}; return onsDLQMessageResendByIdWithOptions(request, runtime); } model OnsGroupConsumerUpdateRequest { groupId?: string(name='GroupId', description='The ID of the consumer group for which you want to configure read permissions. This parameter is required.', example='GID_test_groupId'), instanceId?: string(name='InstanceId', description='The ID of the instance to which the consumer group you want to configure belongs.', example='MQ_INST_111111111111_DOxxxxxx'), readEnable?: boolean(name='ReadEnable', description='Specifies whether to authorize the consumer group to read messages. Valid values: * **true**: The consumer group can read messages. * **false**: The consumer group cannot read messages. Default value: **true**. This parameter is required.', example='true'), } model OnsGroupConsumerUpdateResponseBody = { requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='A07E3902-B92E-44A6-B6C5-6AA111111****'), } model OnsGroupConsumerUpdateResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsGroupConsumerUpdateResponseBody(name='body'), } /** * @summary Configures read permissions on messages for a consumer group that is identified by a group ID. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can call this operation to configure the permissions for a consumer group to read messages based on a specified region of ApsaraMQ for RocketMQ and a specified group ID. You can call this operation in scenarios in which you want to forbid consumers in a specific group from reading messages. * * @param request OnsGroupConsumerUpdateRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsGroupConsumerUpdateResponse */ async function onsGroupConsumerUpdateWithOptions(request: OnsGroupConsumerUpdateRequest, runtime: $RuntimeOptions): OnsGroupConsumerUpdateResponse { request.validate(); var query = {}; if (!$isNull(request.groupId)) { query['GroupId'] = request.groupId; } if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.readEnable)) { query['ReadEnable'] = request.readEnable; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsGroupConsumerUpdate', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Configures read permissions on messages for a consumer group that is identified by a group ID. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can call this operation to configure the permissions for a consumer group to read messages based on a specified region of ApsaraMQ for RocketMQ and a specified group ID. You can call this operation in scenarios in which you want to forbid consumers in a specific group from reading messages. * * @param request OnsGroupConsumerUpdateRequest * @return OnsGroupConsumerUpdateResponse */ async function onsGroupConsumerUpdate(request: OnsGroupConsumerUpdateRequest): OnsGroupConsumerUpdateResponse { var runtime = new $RuntimeOptions{}; return onsGroupConsumerUpdateWithOptions(request, runtime); } model OnsGroupCreateRequest { groupId?: string(name='GroupId', description='The ID of the consumer group that you want to create. The group ID must meet the following rules: * The group ID must be 2 to 64 characters in length and can contain only letters, digits, hyphens (-), and underscores (_). * If the ApsaraMQ for RocketMQ instance in which you want to create the consumer group uses a namespace, the group ID must be unique in the instance. The group ID cannot be the same as an existing group ID or a topic name in the instance. The group ID can be the same as a group ID or a topic name in another instance that uses a different namespace. For example, if Instance A and Instance B use different namespaces, a group ID in Instance A can be the same as a group ID or a topic name in Instance B. * If the instance does not use a namespace, the group ID must be globally unique across instances and regions. The group ID cannot be the same as an existing group ID or topic name in ApsaraMQ for RocketMQ instances that belong to your Alibaba Cloud account. > * After the consumer group is created, the group ID cannot be changed. * To check whether an instance uses a namespace, log on to the ApsaraMQ for RocketMQ console, go to the **Instance Details** page, and then view the value of the Namespace field in the **Basic Information** section. This parameter is required.', example='GID_test_groupId'), groupType?: string(name='GroupType', description='The protocol over which clients in the consumer group communicate with the ApsaraMQ for RocketMQ broker. All clients in a consumer group communicate with the ApsaraMQ for RocketMQ broker over the same protocol. You must create different groups for TCP clients and HTTP clients. Valid values: * **tcp**: Clients in the consumer group consume messages over TCP. This is the default value. * **http**: Clients in the consumer group consume messages over HTTP.', example='tcp'), instanceId?: string(name='InstanceId', description='The ID of the instance in which you want to create the consumer group.', example='MQ_INST_111111111111_DOxxxxxx'), remark?: string(name='Remark', description='The description of the consumer group.', example='test'), } model OnsGroupCreateResponseBody = { requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='A07E3902-B92E-44A6-B6C5-6AA111111****'), } model OnsGroupCreateResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsGroupCreateResponseBody(name='body'), } /** * @summary Creates a consumer group. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * When you release a new application or implement new business logic, you need new consumer groups. You can call this operation to create a consumer group. * * @param request OnsGroupCreateRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsGroupCreateResponse */ async function onsGroupCreateWithOptions(request: OnsGroupCreateRequest, runtime: $RuntimeOptions): OnsGroupCreateResponse { request.validate(); var query = {}; if (!$isNull(request.groupId)) { query['GroupId'] = request.groupId; } if (!$isNull(request.groupType)) { query['GroupType'] = request.groupType; } if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.remark)) { query['Remark'] = request.remark; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsGroupCreate', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Creates a consumer group. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * When you release a new application or implement new business logic, you need new consumer groups. You can call this operation to create a consumer group. * * @param request OnsGroupCreateRequest * @return OnsGroupCreateResponse */ async function onsGroupCreate(request: OnsGroupCreateRequest): OnsGroupCreateResponse { var runtime = new $RuntimeOptions{}; return onsGroupCreateWithOptions(request, runtime); } model OnsGroupDeleteRequest { groupId?: string(name='GroupId', description='The ID of the consumer group that you want to delete. This parameter is required.', example='GID_test_groupId'), instanceId?: string(name='InstanceId', description='The ID of the ApsaraMQ for RocketMQ instance to which the specified consumer group belongs.', example='MQ_INST_111111111111_DOxxxxxx'), } model OnsGroupDeleteResponseBody = { requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='A07E3902-B92E-44A6-B6C5-6AA111111****'), } model OnsGroupDeleteResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsGroupDeleteResponseBody(name='body'), } /** * @summary Deletes a consumer group. * * @description > * * API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * After you delete a group, the consumers in the group immediately stop receiving messages. Exercise caution when you call this operation. * You can call this operation to delete a group when you need to reclaim the resources of the group. For example, after an application is brought offline, you can delete the groups that are used for the application. After you delete a group, the backend of ApsaraMQ for RocketMQ reclaims the resources of the group. The system requires a long period of time to reclaim the resources. We recommend that you do not create a group that uses the same name as a deleted group immediately after you delete the group. If the system fails to delete the specified group, troubleshoot the issue based on the error code. * * @param request OnsGroupDeleteRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsGroupDeleteResponse */ async function onsGroupDeleteWithOptions(request: OnsGroupDeleteRequest, runtime: $RuntimeOptions): OnsGroupDeleteResponse { request.validate(); var query = {}; if (!$isNull(request.groupId)) { query['GroupId'] = request.groupId; } if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsGroupDelete', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Deletes a consumer group. * * @description > * * API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * After you delete a group, the consumers in the group immediately stop receiving messages. Exercise caution when you call this operation. * You can call this operation to delete a group when you need to reclaim the resources of the group. For example, after an application is brought offline, you can delete the groups that are used for the application. After you delete a group, the backend of ApsaraMQ for RocketMQ reclaims the resources of the group. The system requires a long period of time to reclaim the resources. We recommend that you do not create a group that uses the same name as a deleted group immediately after you delete the group. If the system fails to delete the specified group, troubleshoot the issue based on the error code. * * @param request OnsGroupDeleteRequest * @return OnsGroupDeleteResponse */ async function onsGroupDelete(request: OnsGroupDeleteRequest): OnsGroupDeleteResponse { var runtime = new $RuntimeOptions{}; return onsGroupDeleteWithOptions(request, runtime); } model OnsGroupListRequest { groupId?: string(name='GroupId', description='This parameter is required only when you query specific consumer groups by using the fuzzy search method. If this parameter is not configured, the system queries all consumer groups that can be accessed by the current account. If you set this parameter to GID_ABC, the information about the consumer groups whose IDs contain GID_ABC is returned. For example, the information about the GID_test_GID_ABC_123 and GID_ABC_356 consumer groups is returned.', example='GID_test_group_id'), groupType?: string(name='GroupType', description='The protocol over which the queried consumer group publishes and subscribes to messages. All clients in a consumer group communicate with the ApsaraMQ for RocketMQ broker over the same protocol. You must create different consumer groups for TCP clients and HTTP clients. Valid values: * **tcp**: specifies that the consumer group publishes or subscribes to messages over TCP. This value is the default value. * **http**: specifies that the consumer group publishes or subscribes to messages over HTTP.', example='tcp'), instanceId?: string(name='InstanceId', description='The ID of the instance to which the consumer group you want to query belongs.', example='MQ_INST_111111111111_DOxxxxxx'), tag?: [ { key?: string(name='Key', description='The key of the tag that is attached to the consumer group. This parameter is not required. If you configure this parameter, you must configure the **Key** parameter.**** If you configure both the Key and Value parameters, the consumer groups are filtered based on the specified tag. If you do not configure these parameters, all consumer groups are queried. * The value of this parameter cannot be an empty string. * The tag value must be 1 to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`. This parameter is required.', example='CartService'), value?: string(name='Value', description='The value of the tag that is attached to the group. This parameter is not required. If you configure this parameter, you must configure the **Key** parameter.**** If you configure both the Key and Value parameters, the consumer groups are filtered based on the specified tag. If you do not configure these parameters, all consumer groups are queried. * The value of this parameter can be an empty string. * The tag key must be 1 to 128 characters in length and cannot contain `http://` or `https://`. It cannot start with `acs:` or `aliyun`. This parameter is required.', example='ServiceA'), } ](name='Tag', description='The list of tags that are attached to the consumer group. A maximum of 20 tags can be included in the list.'), } model OnsGroupListResponseBody = { data?: { subscribeInfoDo?: [ { createTime?: long(name='CreateTime', description='The point in time when the consumer group was created.', example='1568896605000'), groupId?: string(name='GroupId', description='The ID of the consumer group.', example='GID_test_group_id'), groupType?: string(name='GroupType', description='The protocol over which the queried consumer group publishes and subscribes to messages. All clients in a consumer group communicate with the ApsaraMQ for RocketMQ broker over the same protocol. You must create different consumer groups for TCP clients and HTTP clients. Valid values: * **tcp**: indicates that the consumer group publishes and subscribes to messages over TCP. * **http**: indicates that the consumer group publishes and subscribes to messages over HTTP.', example='tcp'), independentNaming?: boolean(name='IndependentNaming', description='Indicates whether the instance uses a namespace. Valid values: * **true**: The instance uses a separate namespace. The name of each resource must be unique in the instance. The names of resources in different instances can be the same. * **false**: The instance does not use a separate namespace. The name of each resource must be globally unique within the instance and across all instances.', example='true'), instanceId?: string(name='InstanceId', description='The ID of the instance', example='MQ_INST_111111111111_DOxxxxxx'), owner?: string(name='Owner', description='The Alibaba Cloud account ID of the user who created the consumer group.', example='138015630679****'), remark?: string(name='Remark', description='The description of the consumer group.', example='test'), tags?: { tag?: [ { key?: string(name='Key', description='The key of the tag that is attached to the consumer group.', example='CartService'), value?: string(name='Value', description='The value of the tag that is attached to the consumer group.', example='ServiceA'), } ](name='Tag') }(name='Tags', description='The tags that are attached to the consumer group.'), updateTime?: long(name='UpdateTime', description='The most recent point in time when the consumer group was updated.', example='1570700979000'), } ](name='SubscribeInfoDo') }(name='Data', description='The returned list of subscriptions.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='16996623-AC4A-43AF-9248-FD9D2D75****'), } model OnsGroupListResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsGroupListResponseBody(name='body'), } /** * @summary Queries one or more group IDs. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * @param request OnsGroupListRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsGroupListResponse */ async function onsGroupListWithOptions(request: OnsGroupListRequest, runtime: $RuntimeOptions): OnsGroupListResponse { request.validate(); var query = {}; if (!$isNull(request.groupId)) { query['GroupId'] = request.groupId; } if (!$isNull(request.groupType)) { query['GroupType'] = request.groupType; } if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.tag)) { query['Tag'] = request.tag; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsGroupList', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries one or more group IDs. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * @param request OnsGroupListRequest * @return OnsGroupListResponse */ async function onsGroupList(request: OnsGroupListRequest): OnsGroupListResponse { var runtime = new $RuntimeOptions{}; return onsGroupListWithOptions(request, runtime); } model OnsGroupSubDetailRequest { groupId?: string(name='GroupId', description='The ID of the consumer group that you want to query. This parameter is required.', example='GID_test_group_id'), instanceId?: string(name='InstanceId', description='The ID of the instance to which the consumer group you want to query belongs. This parameter is required.', example='MQ_INST_111111111111_DOxxxxxx'), } model OnsGroupSubDetailResponseBody = { data?: { groupId?: string(name='GroupId', description='The ID of the consumer group that you want to query.', example='GID_test_group_id'), messageModel?: string(name='MessageModel', description='The consumption mode. Valid values: * **CLUSTERING**: the clustering consumption mode * **BROADCASTING**: the broadcasting consumption mode For more information about consumption modes, see [Clustering consumption and broadcasting consumption](https://help.aliyun.com/document_detail/43163.html).', example='CLUSTERING'), online?: boolean(name='Online', description='Indicates whether consumers in the group are online.', example='true'), subscriptionDataList?: { subscriptionDataList?: [ { subString?: string(name='SubString', description='The expression based on which consumers in the consumer group subscribe to the topic.', example='*'), topic?: string(name='Topic', description='The name of the topic to which consumers in the consumer group subscribe.', example='test-mq_topic'), } ](name='SubscriptionDataList') }(name='SubscriptionDataList', description='The topics to which consumers in the consumer group subscribe. If all consumers in the specified group are offline, no topics are returned.'), }(name='Data', description='The data returned.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='3364E875-013B-442A-BC3C-C1A84DC6****'), } model OnsGroupSubDetailResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsGroupSubDetailResponseBody(name='body'), } /** * @summary Queries all topics to which a specified consumer group subscribes. If no consumer instance in the consumer group is online, no data is returned. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * @param request OnsGroupSubDetailRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsGroupSubDetailResponse */ async function onsGroupSubDetailWithOptions(request: OnsGroupSubDetailRequest, runtime: $RuntimeOptions): OnsGroupSubDetailResponse { request.validate(); var query = {}; if (!$isNull(request.groupId)) { query['GroupId'] = request.groupId; } if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsGroupSubDetail', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries all topics to which a specified consumer group subscribes. If no consumer instance in the consumer group is online, no data is returned. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * @param request OnsGroupSubDetailRequest * @return OnsGroupSubDetailResponse */ async function onsGroupSubDetail(request: OnsGroupSubDetailRequest): OnsGroupSubDetailResponse { var runtime = new $RuntimeOptions{}; return onsGroupSubDetailWithOptions(request, runtime); } model OnsInstanceBaseInfoRequest { instanceId?: string(name='InstanceId', description='The ID of the instance that you want to query. This parameter is required.', example='MQ_INST_138015630679****_BAAy1Hac'), } model OnsInstanceBaseInfoResponseBody = { instanceBaseInfo?: { createTime?: string(name='CreateTime', description='The time when the instance was created. The value of this parameter is a UNIX timestamp in milliseconds.', example='1570701259403'), endpoints?: { httpInternalEndpoint?: string(name='HttpInternalEndpoint', description='The private HTTP endpoint of the instance.', example='http://138015630679****.mqrest.cn-chengdu-internal.aliyuncs.com'), httpInternetEndpoint?: string(name='HttpInternetEndpoint', description='The public HTTP endpoint of the instance.', example='http://138015630679****.mqrest.cn-chengdu.aliyuncs.com'), httpInternetSecureEndpoint?: string(name='HttpInternetSecureEndpoint', description='The public HTTPS endpoint of the instance.', example='https://138015630679****.mqrest.cn-chengdu.aliyuncs.com'), tcpEndpoint?: string(name='TcpEndpoint', description='The private TCP endpoint of the instance.', example='http://MQ_INST_138015630679****_BAAy1Hac.cn-chengdu.mq-internal.aliyuncs.com:8080'), tcpInternetEndpoint?: string(name='TcpInternetEndpoint', description='The public TCP endpoint of the instance. * Only instances that are deployed in the China (Chengdu), China (Qingdao), or China (Shenzhen) region can be accessed by using public TCP endpoints. * Before you use a public TCP endpoint, make sure that your client SDK meets the following requirements: * TCP client SDK for Java: V2.0.0.Final or later For more information, see [Release notes for the SDK for Java](https://help.aliyun.com/document_detail/325569.html). * TCP client SDK for C++: V3.0.0 or later For more information, see [Release notes for the SDK for C++](https://help.aliyun.com/document_detail/325570.html). * You are charged for Internet traffic when you use a public TCP endpoint. For more information, see [Internet traffic fee](https://help.aliyun.com/document_detail/325571.html).', example='http://MQ_INST_138015630679****_BAAy1Hac.mq.cn-chengdu.aliyuncs.com:80'), }(name='Endpoints', description='The endpoints used to access ApsaraMQ for RocketMQ over different protocols.'), independentNaming?: boolean(name='IndependentNaming', description='Indicates whether the instance uses a namespace. Valid values: * **true**: The instance uses a separate namespace. The name of each resource must be unique in the instance. The names of resources in different instances can be the same. * **false**: The instance does not use a separate namespace. The name of each resource must be globally unique within the instance and across all instances.', example='true'), instanceId?: string(name='InstanceId', description='The ID of the instance', example='MQ_INST_138015630679****_BAAy1Hac'), instanceName?: string(name='InstanceName', description='The name of the instance. The name must be 3 to 64 characters in length and can contain letters, digits, hyphens (-), and underscores (_).', example='test'), instanceStatus?: int32(name='InstanceStatus', description='The status of the instance. Valid values: * **0**: The instance is being deployed. This value is valid only for Enterprise Platinum Edition instances. * **2**: The instance has overdue payments. This value is valid only for Standard Edition instances. * **5**: The instance is running. This value is valid for Standard Edition instances and Enterprise Platinum Edition instances. * **7**: The instance is being upgraded and is running. This value is valid only for Enterprise Platinum Edition instances.', example='5'), instanceType?: int32(name='InstanceType', description='The instance type. Valid values: * **1**: Standard Edition instances that use the pay-as-you-go billing method. * **2**: Enterprise Platinum Edition instances that use the subscription billing method. For information about the editions and specifications of ApsaraMQ for RocketMQ instances, see [Instance editions](https://help.aliyun.com/document_detail/185261.html).', example='2'), maxTps?: long(name='MaxTps', description='The maximum messaging transactions per second (TPS). Valid values: 5000, 10000, 20000, 50000, 100000, 200000, 300000, 500000, 800000, and 1000000. You can view the details about messaging TPS on the buy page of ApsaraMQ for RocketMQ. > This parameter is available only to the ApsaraMQ for RocketMQ Enterprise Platinum Edition instances.', example='10000'), releaseTime?: long(name='ReleaseTime', description='The time when the Enterprise Platinum Edition instance expires.', example='1603555200000'), remark?: string(name='Remark', description='The description of the instance.', example='ons-cn-m7r1r5f****'), topicCapacity?: int32(name='TopicCapacity', description='The maximum number of topics that can be created on the instance. Valid values: 25, 50, 100, 300, and 500. > This parameter is available only to the ApsaraMQ for RocketMQ Enterprise Platinum Edition instances.', example='50'), spInstanceId?: string(name='spInstanceId', description='The commodity ID of the instance.', example='ons-cn-m7r1r5f****'), spInstanceType?: int32(name='spInstanceType', description='The commodity type of the instance.', example='1'), }(name='InstanceBaseInfo', description='The information about the instance.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='6CC46974-65E8-4C20-AB07-D20D102E****'), } model OnsInstanceBaseInfoResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsInstanceBaseInfoResponseBody(name='body'), } /** * @summary Queries the basic information of a ApsaraMQ for RocketMQ instance and the endpoint that a client uses to connect to the ApsaraMQ for RocketMQ instance to send and receive messages. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * To send and receive messages, a client must be connected to a ApsaraMQ for RocketMQ instance by using an endpoint. You can call this operation to query the endpoints of the instance. * * @param request OnsInstanceBaseInfoRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsInstanceBaseInfoResponse */ async function onsInstanceBaseInfoWithOptions(request: OnsInstanceBaseInfoRequest, runtime: $RuntimeOptions): OnsInstanceBaseInfoResponse { request.validate(); var query = {}; if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsInstanceBaseInfo', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries the basic information of a ApsaraMQ for RocketMQ instance and the endpoint that a client uses to connect to the ApsaraMQ for RocketMQ instance to send and receive messages. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * To send and receive messages, a client must be connected to a ApsaraMQ for RocketMQ instance by using an endpoint. You can call this operation to query the endpoints of the instance. * * @param request OnsInstanceBaseInfoRequest * @return OnsInstanceBaseInfoResponse */ async function onsInstanceBaseInfo(request: OnsInstanceBaseInfoRequest): OnsInstanceBaseInfoResponse { var runtime = new $RuntimeOptions{}; return onsInstanceBaseInfoWithOptions(request, runtime); } model OnsInstanceCreateRequest { instanceName?: string(name='InstanceName', description='The name of the instance. The name must meet the following rules: * The name of the instance must be unique in the region where the instance is deployed. * The name must be 3 to 64 characters in length and can contain letters, digits, hyphens (-), and underscores (_). This parameter is required.', example='Test instance'), remark?: string(name='Remark', description='The description of the instance.', example='Description'), } model OnsInstanceCreateResponseBody = { data?: { instanceId?: string(name='InstanceId', description='The ID of the instance that you created.', example='MQ_INST_188077086902****_BXSuW61e'), instanceType?: int32(name='InstanceType', description='The edition of the instance that you created. Valid value: * **1**: Standard Edition instances', example='1'), }(name='Data', description='The result returned.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='A07E3902-B92E-44A6-B6C5-6AA111111****'), } model OnsInstanceCreateResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsInstanceCreateResponseBody(name='body'), } /** * @summary Creates a ApsaraMQ for RocketMQ instance. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * An instance is a virtual machine (VM) that can be used to store information about the topics and groups of ApsaraMQ for RocketMQ. You can call this operation when you need to create service resources for the business that you want to launch. Before you call this operation, take note of the following limits: * * A maximum of eight ApsaraMQ for RocketMQ instances can be deployed in each region. * * This operation can be called to create only a Standard Edition instance. You can use the ApsaraMQ for RocketMQ console to create Standard Edition instances and Enterprise Platinum Edition instances. For information about how to create ApsaraMQ for RocketMQ instances, see [Manage instances](https://help.aliyun.com/document_detail/200153.html). * * @param request OnsInstanceCreateRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsInstanceCreateResponse */ async function onsInstanceCreateWithOptions(request: OnsInstanceCreateRequest, runtime: $RuntimeOptions): OnsInstanceCreateResponse { request.validate(); var query = {}; if (!$isNull(request.instanceName)) { query['InstanceName'] = request.instanceName; } if (!$isNull(request.remark)) { query['Remark'] = request.remark; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsInstanceCreate', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Creates a ApsaraMQ for RocketMQ instance. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * An instance is a virtual machine (VM) that can be used to store information about the topics and groups of ApsaraMQ for RocketMQ. You can call this operation when you need to create service resources for the business that you want to launch. Before you call this operation, take note of the following limits: * * A maximum of eight ApsaraMQ for RocketMQ instances can be deployed in each region. * * This operation can be called to create only a Standard Edition instance. You can use the ApsaraMQ for RocketMQ console to create Standard Edition instances and Enterprise Platinum Edition instances. For information about how to create ApsaraMQ for RocketMQ instances, see [Manage instances](https://help.aliyun.com/document_detail/200153.html). * * @param request OnsInstanceCreateRequest * @return OnsInstanceCreateResponse */ async function onsInstanceCreate(request: OnsInstanceCreateRequest): OnsInstanceCreateResponse { var runtime = new $RuntimeOptions{}; return onsInstanceCreateWithOptions(request, runtime); } model OnsInstanceDeleteRequest { instanceId?: string(name='InstanceId', description='The ID of the instance. This parameter is required.', example='MQ_INST_188077086902****_BXSuW61e'), } model OnsInstanceDeleteResponseBody = { requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='A07E3902-B92E-44A6-B6C5-6AA111111****'), } model OnsInstanceDeleteResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsInstanceDeleteResponseBody(name='body'), } /** * @summary Deletes a ApsaraMQ for RocketMQ instance. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * You can call this operation when you need to reclaim resources. For example, after you unpublish an application, you can reclaim the resources that were used for the application. An instance can be deleted only when the instance does not contain topics and groups. * * After an instance is deleted, the instance cannot be restored. Exercise caution when you call this operation. * * @param request OnsInstanceDeleteRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsInstanceDeleteResponse */ async function onsInstanceDeleteWithOptions(request: OnsInstanceDeleteRequest, runtime: $RuntimeOptions): OnsInstanceDeleteResponse { request.validate(); var query = {}; if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsInstanceDelete', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Deletes a ApsaraMQ for RocketMQ instance. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * You can call this operation when you need to reclaim resources. For example, after you unpublish an application, you can reclaim the resources that were used for the application. An instance can be deleted only when the instance does not contain topics and groups. * * After an instance is deleted, the instance cannot be restored. Exercise caution when you call this operation. * * @param request OnsInstanceDeleteRequest * @return OnsInstanceDeleteResponse */ async function onsInstanceDelete(request: OnsInstanceDeleteRequest): OnsInstanceDeleteResponse { var runtime = new $RuntimeOptions{}; return onsInstanceDeleteWithOptions(request, runtime); } model OnsInstanceInServiceListRequest { needResourceInfo?: boolean(name='NeedResourceInfo', description='Specifies whether you want the resource information to be returned.', example='true'), tag?: [ { key?: string(name='Key', description='The tag key. This parameter is not required. If you configure this parameter, you must also configure **Value**.**** If you configure Key and Value in a request, this operation queries only the instances that use the specified tags. If you do not configure these parameters in a request, this operation queries all instances that you can access. * The value of this parameter cannot be an empty string. * The tag key can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. The tag key cannot contain `http://` or `https://`.', example='CartService'), value?: string(name='Value', description='The tag value. This parameter is not required. If you configure this parameter, you must also configure **Key**.**** If you configure Key and Value in a request, this operation queries only the instances that use the specified tags. If you do not configure these parameters in a request, this operation queries all instances that you can access. * The value of this parameter can be an empty string. * The tag value can be up to 128 characters in length and cannot contain `http://` or `https://`. The tag value cannot start with `acs:` or `aliyun`.', example='SericeA'), } ](name='Tag', description='The tags that you want to attach to the instance. You can attach up to 20 tags to the instance.'), } model OnsInstanceInServiceListResponseBody = { data?: { instanceVO?: [ { createTime?: long(name='CreateTime', description='The time when the instance was created. The value of this parameter is a UNIX timestamp in milliseconds.', example='1640847284000'), groupCount?: int32(name='GroupCount', description='The number of consumer groups.', example='3'), independentNaming?: boolean(name='IndependentNaming', description='Indicates whether a namespace is used for the instance. Valid values: * **true**: A separate namespace is used for the instance. The identifier of each resource in the instance must be unique within the instance. However, the identifier of a resource in the instance can be the same as the identifier of a resource in another instance that uses a different namespace. * **false**: A separate namespace is not used for the instance. The name of each resource must be globally unique within the instance and across all instances.', example='true'), instanceId?: string(name='InstanceId', description='The instance ID.', example='MQ_INST_188077086902****_BXSuW61e'), instanceName?: string(name='InstanceName', description='The instance name. The name must be 3 to 64 characters in length and can contain letters, digits, hyphens (-), and underscores (_).', example='test1'), instanceStatus?: int32(name='InstanceStatus', description='The instance status. Valid values: * **0**: The instance is being deployed. This value is valid only for Enterprise Platinum Edition instances. * **2**: The instance has overdue payments. This value is valid only for Standard Edition instances. * **5**: The instance is running. This value is valid only for Standard Edition instances and Enterprise Platinum Edition instances. * **7**: The instance is being upgraded and is running. This value is valid only for Enterprise Platinum Edition instances.', example='5'), instanceType?: int32(name='InstanceType', description='The instance type. Valid values: * **1**: Standard Edition * **2**: Enterprise Platinum Edition For information about the instance editions and the differences between the editions, see [Instance editions](https://help.aliyun.com/document_detail/185261.html).', example='2'), releaseTime?: long(name='ReleaseTime', description='The time when the instance expires. If the instance is of Enterprise Platinum Edition, this parameter is returned.', example='1551024000000'), tags?: { tag?: [ { key?: string(name='Key', description='The tag key.', example='CartService'), value?: string(name='Value', description='The tag value.', example='ServiceA'), } ](name='Tag') }(name='Tags', description='The tags that are attached to the instance.'), topicCount?: int32(name='TopicCount', description='The number of topics.', example='1'), } ](name='InstanceVO') }(name='Data', description='The returned information about the queried instances.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='0598E46F-DB06-40E2-AD7B-C45923EE****'), } model OnsInstanceInServiceListResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsInstanceInServiceListResponseBody(name='body'), } /** * @summary Queries all Message Queue for Apache RocketMQ instances in a specified region within the current account. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * @param request OnsInstanceInServiceListRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsInstanceInServiceListResponse */ async function onsInstanceInServiceListWithOptions(request: OnsInstanceInServiceListRequest, runtime: $RuntimeOptions): OnsInstanceInServiceListResponse { request.validate(); var query = {}; if (!$isNull(request.needResourceInfo)) { query['NeedResourceInfo'] = request.needResourceInfo; } if (!$isNull(request.tag)) { query['Tag'] = request.tag; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsInstanceInServiceList', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries all Message Queue for Apache RocketMQ instances in a specified region within the current account. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * @param request OnsInstanceInServiceListRequest * @return OnsInstanceInServiceListResponse */ async function onsInstanceInServiceList(request: OnsInstanceInServiceListRequest): OnsInstanceInServiceListResponse { var runtime = new $RuntimeOptions{}; return onsInstanceInServiceListWithOptions(request, runtime); } model OnsInstanceUpdateRequest { instanceId?: string(name='InstanceId', description='The ID of the instance whose name or description you want to update. This parameter is required.', example='MQ_INST_188077086902****_BXSuW61e'), instanceName?: string(name='InstanceName', description='The new name of the instance. The name must meet the following rules: * The name of the instance must be unique in the region where the instance is deployed. * The name must be 3 to 64 characters in length and can contain letters, digits, hyphens (-), underscores (_), and Chinese characters. * If you do not configure this parameter, the instance name remains unchanged.', example='Updatedname'), remark?: string(name='Remark', description='The updated description of the instance. If you do not configure this parameter, the instance description remains unchanged.', example='Updateddescription'), } model OnsInstanceUpdateResponseBody = { requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='A07E3902-B92E-44A6-B6C5-6AA111111****'), } model OnsInstanceUpdateResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsInstanceUpdateResponseBody(name='body'), } /** * @summary Updates the name and description of a ApsaraMQ for RocketMQ instance. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * A maximum of eight ApsaraMQ for RocketMQ instances can be deployed in each region. * * @param request OnsInstanceUpdateRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsInstanceUpdateResponse */ async function onsInstanceUpdateWithOptions(request: OnsInstanceUpdateRequest, runtime: $RuntimeOptions): OnsInstanceUpdateResponse { request.validate(); var query = {}; if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.instanceName)) { query['InstanceName'] = request.instanceName; } if (!$isNull(request.remark)) { query['Remark'] = request.remark; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsInstanceUpdate', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Updates the name and description of a ApsaraMQ for RocketMQ instance. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * A maximum of eight ApsaraMQ for RocketMQ instances can be deployed in each region. * * @param request OnsInstanceUpdateRequest * @return OnsInstanceUpdateResponse */ async function onsInstanceUpdate(request: OnsInstanceUpdateRequest): OnsInstanceUpdateResponse { var runtime = new $RuntimeOptions{}; return onsInstanceUpdateWithOptions(request, runtime); } model OnsMessageDetailRequest { instanceId?: string(name='InstanceId', description='The ID of the ApsaraMQ for RocketMQ Instance. This parameter is required.', example='MQ_INST_184681981******_BXig0x6A'), msgId?: string(name='MsgId', description='The ID of the message that you want to query. This parameter is required.', example='1E0578FE110F18B4AAC235C0******'), topic?: string(name='Topic', description='The name of the topic in which the message you want to query is stored. This parameter is required.', example='test-mq_topic'), } model OnsMessageDetailResponseBody = { data?: { body?: string(name='Body', description='The string that is obtained after the message body is encrypted by using the Base 64 algorithm.', example='aGVsbG8='), bodyCRC?: int32(name='BodyCRC', description='The cyclic redundancy check (CRC) value of the message body.', example='907060870'), bodyStr?: string(name='BodyStr', description='The information about the message body.', example='hello'), bornHost?: string(name='BornHost', description='The producer instance that generated the message.', example='``42.120.**.**``:64646'), bornTimestamp?: long(name='BornTimestamp', description='The timestamp that indicates the point in time when the message was generated. Unit: milliseconds.', example='1570761026630'), instanceId?: string(name='InstanceId', description='The ID of the ApsaraMQ for RocketMQ Instance.', example='MQ_INST_184681981******_BXig0x6A'), msgId?: string(name='MsgId', description='The ID of the message.', example='1E0578FE110F18B4AAC235C05F2*****'), propertyList?: [ { name?: string(name='Name', description='The name of the attribute. Valid values: * **TRACE_ON**: indicates whether the trace of the message exists. * **MSG_REGION**: The region ID of the instance to which the topic belongs. * **__MESSAGE_DECODED_TIME**: The time when the message was decoded. * **__BORNHOST**: The IP address of the producer client. * **UNIQ_KEY**: The ID of the message. For information about the terms that are used in ApsaraMQ for RocketMQ, see [Terms](https://help.aliyun.com/document_detail/29533.html).', example='cn-hangzhou'), value?: string(name='Value', description='The value of the attribute.', example='MSG_REGION'), } ](name='PropertyList', description='The attributes of the message.'), reconsumeTimes?: int32(name='ReconsumeTimes', description='The number of retries that ApsaraMQ for RocketMQ performed to send the message to consumers.', example='0'), storeHost?: string(name='StoreHost', description='The ApsaraMQ for RocketMQ broker that stores the message.', example='11.220.***.***:10911'), storeSize?: int32(name='StoreSize', description='The size of the message. Unit: KB.', example='2'), storeTimestamp?: long(name='StoreTimestamp', description='The timestamp that indicates the point in time when the ApsaraMQ for RocketMQ broker stored the message. Unit: milliseconds.', example='1570761026708'), topic?: string(name='Topic', description='The topic to which the message belongs.', example='test-mq_topic'), }(name='Data', description='The data returned.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='EAE5BE23-37A1-4354-94D6-E44AE17E****'), } model OnsMessageDetailResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsMessageDetailResponseBody(name='body'), } /** * @summary Queries the details of a message. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * @param request OnsMessageDetailRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsMessageDetailResponse */ async function onsMessageDetailWithOptions(request: OnsMessageDetailRequest, runtime: $RuntimeOptions): OnsMessageDetailResponse { request.validate(); var query = OpenApiUtil.query(request.toMap()); var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsMessageDetail', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'GET', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries the details of a message. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * @param request OnsMessageDetailRequest * @return OnsMessageDetailResponse */ async function onsMessageDetail(request: OnsMessageDetailRequest): OnsMessageDetailResponse { var runtime = new $RuntimeOptions{}; return onsMessageDetailWithOptions(request, runtime); } model OnsMessageGetByKeyRequest { instanceId?: string(name='InstanceId', description='The ID of the instance to which the messages that you want to query belong.', example='MQ_INST_111111111111_DOxxxxxx'), key?: string(name='Key', description='The key of the messages that you want to query. This parameter is required.', example='messageKey1'), topic?: string(name='Topic', description='The topic that contains the messages that you want to query. This parameter is required.', example='test-mq_topic'), } model OnsMessageGetByKeyResponseBody = { data?: { onsRestMessageDo?: [ { bodyCRC?: int32(name='BodyCRC', description='The cyclic redundancy check (CRC) value of the message body.', example='914112295'), bornHost?: string(name='BornHost', description='The producer client that generated the message.', example='42.120.***.***:59270'), bornTimestamp?: long(name='BornTimestamp', description='The timestamp that indicates when the message was produced.', example='1570760999721'), instanceId?: string(name='InstanceId', description='The ID of the instance', example='MQ_INST_111111111111_DOxxxxxx'), msgId?: string(name='MsgId', description='The ID of the message.', example='1E0578FE110F18B4AAC235C05F2*****'), propertyList?: { messageProperty?: [ { name?: string(name='Name', description='The name of the attribute. Valid values: - **TRACE_ON**: indicates whether the message trace exists. - **KEYS**: indicates the key of the message. - **TAGS**: indicates the tag that is attached to the message. - **INSTANCE_ID**: indicates the ID of the instance that contains the message. For information about the terms that are used in ApsaraMQ for RocketMQ, see [Terms](https://help.aliyun.com/document_detail/29533.html).', example='TAGS'), value?: string(name='Value', description='The value of the attribute.', example='TagA'), } ](name='MessageProperty') }(name='PropertyList', description='The attributes of the message.'), reconsumeTimes?: int32(name='ReconsumeTimes', description='The number of retries that were performed to send the message to consumers.', example='1'), storeHost?: string(name='StoreHost', description='The ApsaraMQ for RocketMQ broker that stores the message.', example='11.193.***.***:10911'), storeSize?: int32(name='StoreSize', description='The size of the message.', example='406'), storeTimestamp?: long(name='StoreTimestamp', description='The timestamp that indicates when the ApsaraMQ for RocketMQ broker stored the message.', example='1570760999811'), topic?: string(name='Topic', description='The topic to which the message belongs.', example='test-mq_topic'), } ](name='OnsRestMessageDo') }(name='Data', description='The list of returned results.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='A07E3902-B92E-44A6-B6C5-6AA111111****'), } model OnsMessageGetByKeyResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsMessageGetByKeyResponseBody(name='body'), } /** * @summary Queries messages by using a specified topic and message key. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * This operation uses the fuzzy match method to query messages based on a specified message key. The same message key may be used by multiple messages. Therefore, the returned result may contain information about multiple messages. * * This operation can be used in scenarios in which you cannot obtain the IDs of the messages that you want to query. You can perform the following steps to query the information about messages: * 1. Call this operation to query message IDs. * 2. Call the **OnsMessageGetByMsgId** operation that uses the exact match method to query the details of a specified message. For more information about the **OnsMessageGetByMsgId** operation, see [OnsMessageGetByMsgId](https://help.aliyun.com/document_detail/29607.html). * * @param request OnsMessageGetByKeyRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsMessageGetByKeyResponse */ async function onsMessageGetByKeyWithOptions(request: OnsMessageGetByKeyRequest, runtime: $RuntimeOptions): OnsMessageGetByKeyResponse { request.validate(); var query = {}; if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.key)) { query['Key'] = request.key; } if (!$isNull(request.topic)) { query['Topic'] = request.topic; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsMessageGetByKey', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries messages by using a specified topic and message key. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * This operation uses the fuzzy match method to query messages based on a specified message key. The same message key may be used by multiple messages. Therefore, the returned result may contain information about multiple messages. * * This operation can be used in scenarios in which you cannot obtain the IDs of the messages that you want to query. You can perform the following steps to query the information about messages: * 1. Call this operation to query message IDs. * 2. Call the **OnsMessageGetByMsgId** operation that uses the exact match method to query the details of a specified message. For more information about the **OnsMessageGetByMsgId** operation, see [OnsMessageGetByMsgId](https://help.aliyun.com/document_detail/29607.html). * * @param request OnsMessageGetByKeyRequest * @return OnsMessageGetByKeyResponse */ async function onsMessageGetByKey(request: OnsMessageGetByKeyRequest): OnsMessageGetByKeyResponse { var runtime = new $RuntimeOptions{}; return onsMessageGetByKeyWithOptions(request, runtime); } model OnsMessageGetByMsgIdRequest { instanceId?: string(name='InstanceId', description='The ID of the instance to which the message you want to query belongs.', example='MQ_INST_111111111111_DOxxxxxx'), msgId?: string(name='MsgId', description='The ID of the message that you want to query. This parameter is required.', example='1E0578FE110F18B4AAC235C05F2*****'), topic?: string(name='Topic', description='The topic that contains the message you want to query. This parameter is required.', example='test-mq_topic'), } model OnsMessageGetByMsgIdResponseBody = { data?: { bodyCRC?: int32(name='BodyCRC', description='The cyclic redundancy check (CRC) value of the message body.', example='914112295'), bornHost?: string(name='BornHost', description='The producer instance that generated the message.', example='``42.120.**.**``:64646'), bornTimestamp?: long(name='BornTimestamp', description='The timestamp that indicates when the message was produced.', example='1570761026630'), instanceId?: string(name='InstanceId', description='The ID of the instance', example='MQ_INST_111111111111_DOxxxxxx'), msgId?: string(name='MsgId', description='The ID of the message.', example='1E0578FE110F18B4AAC235C0C8460BA2'), propertyList?: { messageProperty?: [ { name?: string(name='Name', description='The name of the attribute. Valid values: * **TRACE_ON**: indicates whether a trace of the message exists. * **KEYS**: indicates the key of the message. * **TAGS**: indicates the tag that is attached to the message. * **INSTANCE_ID**: indicates the ID of the instance which contains the message. For information about the terms that are used in Message Queue for Apache RocketMQ, see [Terms](https://help.aliyun.com/document_detail/29533.html).', example='TAGS'), value?: string(name='Value', description='The value of the attribute.', example='TagA'), } ](name='MessageProperty') }(name='PropertyList', description='The attributes of the message.'), reconsumeTimes?: int32(name='ReconsumeTimes', description='The number of retries that were performed to send the message to consumers.', example='1'), storeHost?: string(name='StoreHost', description='The ApsaraMQ for RocketMQ broker that stores the message.', example='11.220.***.***:10911'), storeSize?: int32(name='StoreSize', description='The size of the message.', example='407'), storeTimestamp?: long(name='StoreTimestamp', description='The timestamp that indicates when the ApsaraMQ for RocketMQ broker stored the message.', example='1570761026708'), topic?: string(name='Topic', description='The topic to which the message belongs.', example='test-mq_topic'), }(name='Data', description='The data returned.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='A07E3902-B92E-44A6-B6C5-6AA111111****'), } model OnsMessageGetByMsgIdResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsMessageGetByMsgIdResponseBody(name='body'), } /** * @summary Queries the information about a message by specifying the message ID and determines whether the message has been consumed. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * If a message is not consumed as expected, you can call this operation to query the information about the message for troubleshooting. * * This operation uses the exact match method to query a message based on the message ID. You can obtain the message ID from the SendResult parameter that is returned after the message is sent. You must store the returned information after each message is sent. The queried information about a message includes the point in time when the message was sent, the broker on which the message is stored, and the attributes of the message such as the message key and tag. * * @param request OnsMessageGetByMsgIdRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsMessageGetByMsgIdResponse */ async function onsMessageGetByMsgIdWithOptions(request: OnsMessageGetByMsgIdRequest, runtime: $RuntimeOptions): OnsMessageGetByMsgIdResponse { request.validate(); var query = {}; if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.msgId)) { query['MsgId'] = request.msgId; } if (!$isNull(request.topic)) { query['Topic'] = request.topic; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsMessageGetByMsgId', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries the information about a message by specifying the message ID and determines whether the message has been consumed. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * If a message is not consumed as expected, you can call this operation to query the information about the message for troubleshooting. * * This operation uses the exact match method to query a message based on the message ID. You can obtain the message ID from the SendResult parameter that is returned after the message is sent. You must store the returned information after each message is sent. The queried information about a message includes the point in time when the message was sent, the broker on which the message is stored, and the attributes of the message such as the message key and tag. * * @param request OnsMessageGetByMsgIdRequest * @return OnsMessageGetByMsgIdResponse */ async function onsMessageGetByMsgId(request: OnsMessageGetByMsgIdRequest): OnsMessageGetByMsgIdResponse { var runtime = new $RuntimeOptions{}; return onsMessageGetByMsgIdWithOptions(request, runtime); } model OnsMessagePageQueryByTopicRequest { beginTime?: long(name='BeginTime', description='The beginning of the time range to query. The value of this parameter is a UNIX timestamp in milliseconds. If you specify a valid value for the **TaskId** parameter in the request, this parameter does not take effect. The system uses the value of the BeginTime parameter that you specified in the request when you created the specified query task. This parameter is required.', example='1570723200000'), currentPage?: int32(name='CurrentPage', description='The number of the page to return. Pages start from page 1. Valid values: 1 to 50. This parameter is required.', example='2'), endTime?: long(name='EndTime', description='The end of the time range to query. The value of this parameter is a UNIX timestamp in milliseconds. If you specify a valid value for the **TaskId** parameter in the request, this parameter does not take effect. The system uses the value of the EndTime parameter that you specified in the request when you created the specified query task. This parameter is required.', example='1570809600000'), instanceId?: string(name='InstanceId', description='The ID of the instance to which the message you want to query belongs.', example='MQ_INST_111111111111_DOxxxxxx'), pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: 5 to 50. Default value: 20. If you specify a valid value for the **TaskId** parameter in the request, this parameter does not take effect. The system uses the value of the PageSize parameter that you specified in the request for creating the query task.', example='5'), taskId?: string(name='TaskId', description='The ID of the query task. The first time you call this operation to query the information about messages in a specified topic within a specified time range, this parameter is not required. This parameter is required in subsequent queries for messages on a specified page. You can obtain the task ID from the returned result of the first query.', example='0BC1310300002A9F000021E4D7A48346'), topic?: string(name='Topic', description='The name of the topic whose messages you want to query. This parameter is required.', example='test-mq_topic'), } model OnsMessagePageQueryByTopicResponseBody = { msgFoundDo?: { currentPage?: long(name='CurrentPage', description='The page number of the returned page.', example='1'), maxPageCount?: long(name='MaxPageCount', description='The total number of returned pages.', example='400'), msgFoundList?: { onsRestMessageDo?: [ { bodyCRC?: int32(name='BodyCRC', description='The cyclic redundancy check (CRC) value of the message body.', example='914112295'), bornHost?: string(name='BornHost', description='The producer client that generated the message.', example='42.120.***.***:59270'), bornTimestamp?: long(name='BornTimestamp', description='The time when the message was generated. The value is a UNIX timestamp that represents the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.', example='1570760999721'), instanceId?: string(name='InstanceId', description='The ID of the instance', example='MQ_INST_111111111111_DOxxxxxx'), msgId?: string(name='MsgId', description='The ID of the message.', example='1E0578FE110F18B4AAC235C05F2*****'), propertyList?: { messageProperty?: [ { name?: string(name='Name', description='The name of the attribute. Valid values: * **TRACE_ON**: indicates whether a trace of the message exists. * **KEYS**: indicates the key of the message. * **TAGS**: indicates the tag of the message. * **INSTANCE_ID**: indicates the ID of the instance that contains the message. For information about the terms that are used in ApsaraMQ for RocketMQ see [Terms](https://help.aliyun.com/document_detail/29533.html).', example='TAGS'), value?: string(name='Value', description='The value of the attribute.', example='TagA'), } ](name='MessageProperty') }(name='PropertyList', description='The attributes of the message.'), reconsumeTimes?: int32(name='ReconsumeTimes', description='The number of retries that were performed to send the message to consumers.', example='1'), storeHost?: string(name='StoreHost', description='The ApsaraMQ for RocketMQ broker that stores the message.', example='11.193.***.***:10911'), storeSize?: int32(name='StoreSize', description='The size of the message. Unit: KB.', example='406'), storeTimestamp?: long(name='StoreTimestamp', description='The time when the ApsaraMQ for RocketMQ broker stored the message. The value is a UNIX timestamp that represents the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.', example='1570760999811'), topic?: string(name='Topic', description='The topic to which the message belongs.', example='test-mq_topic'), } ](name='OnsRestMessageDo') }(name='MsgFoundList', description='The information about messages on the returned page. The information that is contained in this parameter is the same as the information that is returned by the [OnsMessageGetByMsgId](https://help.aliyun.com/document_detail/29607.html) operation.'), taskId?: string(name='TaskId', description='The ID of the query task. The first time you call this operation to query the messages that are sent to a specified consumer group within a specified time range, this parameter is returned. You can use the task ID to query the details of messages on other returned pages.', example='0BC1310300002A9F000021E4D7A48346'), }(name='MsgFoundDo', description='The information about the message that is queried.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='5DC2A47E-2B31-4722-96C8-FA59C9*****'), } model OnsMessagePageQueryByTopicResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsMessagePageQueryByTopicResponseBody(name='body'), } /** * @summary Queries all messages that are stored in a specified topic within a specified time range by page. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * If you do not know the ID or key of a message that you want to query, you can call this operation to query all messages that are stored in the topic within a specified time range. The results are displayed by page. * * We recommend that you specify a short time range to query messages. If you specify a long time range, a large number of messages are returned. In this case, you cannot find the message that you want to query in an efficient manner. You can perform the following steps to query messages: * 1. Perform a paged query by specifying the topic, start time, end time, and number of entries to return on each page. If the topic contains messages, the information about the messages on the first page, total number of pages, and task ID are returned by default. * 2. Specify the task ID and a page number to call this operation again to query the messages on the specified page. The BeginTime, EndTime, and PageSize parameters do not take effect. By default, the system uses the values of these parameters that you specified in the request when you created the specified query task. * * @param request OnsMessagePageQueryByTopicRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsMessagePageQueryByTopicResponse */ async function onsMessagePageQueryByTopicWithOptions(request: OnsMessagePageQueryByTopicRequest, runtime: $RuntimeOptions): OnsMessagePageQueryByTopicResponse { request.validate(); var query = {}; if (!$isNull(request.beginTime)) { query['BeginTime'] = request.beginTime; } if (!$isNull(request.currentPage)) { query['CurrentPage'] = request.currentPage; } if (!$isNull(request.endTime)) { query['EndTime'] = request.endTime; } if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.pageSize)) { query['PageSize'] = request.pageSize; } if (!$isNull(request.taskId)) { query['TaskId'] = request.taskId; } if (!$isNull(request.topic)) { query['Topic'] = request.topic; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsMessagePageQueryByTopic', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries all messages that are stored in a specified topic within a specified time range by page. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * If you do not know the ID or key of a message that you want to query, you can call this operation to query all messages that are stored in the topic within a specified time range. The results are displayed by page. * * We recommend that you specify a short time range to query messages. If you specify a long time range, a large number of messages are returned. In this case, you cannot find the message that you want to query in an efficient manner. You can perform the following steps to query messages: * 1. Perform a paged query by specifying the topic, start time, end time, and number of entries to return on each page. If the topic contains messages, the information about the messages on the first page, total number of pages, and task ID are returned by default. * 2. Specify the task ID and a page number to call this operation again to query the messages on the specified page. The BeginTime, EndTime, and PageSize parameters do not take effect. By default, the system uses the values of these parameters that you specified in the request when you created the specified query task. * * @param request OnsMessagePageQueryByTopicRequest * @return OnsMessagePageQueryByTopicResponse */ async function onsMessagePageQueryByTopic(request: OnsMessagePageQueryByTopicRequest): OnsMessagePageQueryByTopicResponse { var runtime = new $RuntimeOptions{}; return onsMessagePageQueryByTopicWithOptions(request, runtime); } model OnsMessagePushRequest { clientId?: string(name='ClientId', description='The ID of the consumer client. You can call the [OnsConsumerGetConnection](https://help.aliyun.com/document_detail/29598.html) operation to query client IDs. This parameter is required.', example='30.5.121.**@24813#-1999745829#-1737591554#453111174894656'), groupId?: string(name='GroupId', description='The ID of the consumer group. For information about what a consumer group is, see [Terms](https://help.aliyun.com/document_detail/29533.html). This parameter is required.', example='GID_test_group_id'), instanceId?: string(name='InstanceId', description='The ID of the ApsaraMQ for RocketMQ instance to which the specified consumer group belongs.', example='MQ_INST_111111111111_DOxxxxxx'), msgId?: string(name='MsgId', description='The ID of the message. This parameter is required.', example='0BC1669963053CF68F733BB70396****'), topic?: string(name='Topic', description='The topic to which the message is pushed. This parameter is required.', example='test-mq_topic'), } model OnsMessagePushResponseBody = { requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='B8EDC90D-F726-4B9E-8BEF-F0DD25EC****'), } model OnsMessagePushResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsMessagePushResponseBody(name='body'), } /** * @summary Pushes a message to a specified consumer. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * This operation can be used to check whether messages in a specified topic can be consumed by consumers in a specified consumer group. This operation obtains the body of the message that is specified by the MsgId parameter, re-encapsulates the message body to produce a new message, and then pushes the new message to a specified consumer. The content of the message that is sent to the consumer is the same as the content of the original message. They are not the same message because they use different message IDs. * * @param request OnsMessagePushRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsMessagePushResponse */ async function onsMessagePushWithOptions(request: OnsMessagePushRequest, runtime: $RuntimeOptions): OnsMessagePushResponse { request.validate(); var query = {}; if (!$isNull(request.clientId)) { query['ClientId'] = request.clientId; } if (!$isNull(request.groupId)) { query['GroupId'] = request.groupId; } if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.msgId)) { query['MsgId'] = request.msgId; } if (!$isNull(request.topic)) { query['Topic'] = request.topic; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsMessagePush', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Pushes a message to a specified consumer. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * This operation can be used to check whether messages in a specified topic can be consumed by consumers in a specified consumer group. This operation obtains the body of the message that is specified by the MsgId parameter, re-encapsulates the message body to produce a new message, and then pushes the new message to a specified consumer. The content of the message that is sent to the consumer is the same as the content of the original message. They are not the same message because they use different message IDs. * * @param request OnsMessagePushRequest * @return OnsMessagePushResponse */ async function onsMessagePush(request: OnsMessagePushRequest): OnsMessagePushResponse { var runtime = new $RuntimeOptions{}; return onsMessagePushWithOptions(request, runtime); } model OnsMessageTraceRequest { instanceId?: string(name='InstanceId', description='The ID of the instance to which the message you want to query belongs.', example='MQ_INST_111111111111_DOxxxxxx'), msgId?: string(name='MsgId', description='The ID of the message that you want to query. This parameter is required.', example='1E05791C117818B4AAC23B1BB0CE****'), topic?: string(name='Topic', description='The topic to which the message belongs. This parameter is required.', example='test-mq_topic'), } model OnsMessageTraceResponseBody = { data?: { messageTrack?: [ { consumerGroup?: string(name='ConsumerGroup', description='The ID of the consumer group that subscribes to the topic.', example='GID_test_group_id'), instanceId?: string(name='InstanceId', description='The ID of the instance to which the message you want to query belongs.', example='MQ_INST_111111111111_DOxxxxxx'), trackType?: string(name='TrackType', description='The status of the message. Valid values: * **CONSUMED**: The message is consumed. * **CONSUMED_BUT_FILTERED**: No consumer group subscribes to the message. The message is filtered out and not consumed. * **NOT_CONSUME_YET**: The message is not consumed. * **NOT_ONLINE**: The consumer group is offline. * **UNKNOWN**: The message is not consumed due to unknown reasons.', example='CONSUMED'), } ](name='MessageTrack') }(name='Data', description='The information about the message that is queried.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='EAE5BE23-37A1-4354-94D6-E44AE17E****'), } model OnsMessageTraceResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsMessageTraceResponseBody(name='body'), } /** * @summary Queries the consumption status of a message by using the message ID. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * You can call this operation to check whether a specified message is consumed. If the message is not consumed, you can troubleshoot the issue based on the returned information. * * This operation queries information based on the built-in offset mechanism of ApsaraMQ for RocketMQ. In most cases, the results are correct. If you have reset the consumer offset or cleared accumulated messages, the results may not be correct. * * @param request OnsMessageTraceRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsMessageTraceResponse */ async function onsMessageTraceWithOptions(request: OnsMessageTraceRequest, runtime: $RuntimeOptions): OnsMessageTraceResponse { request.validate(); var query = {}; if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.msgId)) { query['MsgId'] = request.msgId; } if (!$isNull(request.topic)) { query['Topic'] = request.topic; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsMessageTrace', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries the consumption status of a message by using the message ID. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * You can call this operation to check whether a specified message is consumed. If the message is not consumed, you can troubleshoot the issue based on the returned information. * * This operation queries information based on the built-in offset mechanism of ApsaraMQ for RocketMQ. In most cases, the results are correct. If you have reset the consumer offset or cleared accumulated messages, the results may not be correct. * * @param request OnsMessageTraceRequest * @return OnsMessageTraceResponse */ async function onsMessageTrace(request: OnsMessageTraceRequest): OnsMessageTraceResponse { var runtime = new $RuntimeOptions{}; return onsMessageTraceWithOptions(request, runtime); } model OnsRegionListResponseBody = { data?: { regionDo?: [ { channelName?: string(name='ChannelName', description='The channel name.', example='ALIYUN'), createTime?: long(name='CreateTime', description='The time when the instance was created.', example='1411623866000'), id?: long(name='Id', description='The instance ID.', example='1'), onsRegionId?: string(name='OnsRegionId', description='The region ID.', example='cn-hangzhou'), regionName?: string(name='RegionName', description='The region name.', example='China (Hangzhou)'), updateTime?: long(name='UpdateTime', description='The time when the instance was updated.', example='1411623866000'), } ](name='RegionDo') }(name='Data', description='The returned data.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='72D14A84-45E5-4E01-A6DB-F63C4721****'), } model OnsRegionListResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsRegionListResponseBody(name='body'), } /** * @summary Queries regions where ApsaraMQ for RocketMQ is available. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * When you use an SDK to access and manage a ApsaraMQ for RocketMQ instance, you must sequentially specify the information about two regions. You can query the information about the second region by calling the OnsRegionList operation. You must apply for a public endpoint in the following scenarios: * * Connect your application to ApsaraMQ for RocketMQ: Select the nearest API gateway endpoint based on the region where your application is deployed, and enter the corresponding **region ID**. The **regionId** is used to access Alibaba Cloud API Gateway because ApsaraMQ for RocketMQ instances provide API services by using the OpenAPI Explorer platform, which is also called POP. * * Access a region to manage its resources: Specify a region where you want to manage ApsaraMQ for RocketMQ resources and enter the region ID. You can call the **OnsRegionList** operation to query a region ID. * * @param request OnsRegionListRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsRegionListResponse */ async function onsRegionListWithOptions(runtime: $RuntimeOptions): OnsRegionListResponse { var req = new OpenApiUtil.OpenApiRequest{}; var params = new OpenApiUtil.Params{ action = 'OnsRegionList', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries regions where ApsaraMQ for RocketMQ is available. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * When you use an SDK to access and manage a ApsaraMQ for RocketMQ instance, you must sequentially specify the information about two regions. You can query the information about the second region by calling the OnsRegionList operation. You must apply for a public endpoint in the following scenarios: * * Connect your application to ApsaraMQ for RocketMQ: Select the nearest API gateway endpoint based on the region where your application is deployed, and enter the corresponding **region ID**. The **regionId** is used to access Alibaba Cloud API Gateway because ApsaraMQ for RocketMQ instances provide API services by using the OpenAPI Explorer platform, which is also called POP. * * Access a region to manage its resources: Specify a region where you want to manage ApsaraMQ for RocketMQ resources and enter the region ID. You can call the **OnsRegionList** operation to query a region ID. * * @return OnsRegionListResponse */ async function onsRegionList(): OnsRegionListResponse { var runtime = new $RuntimeOptions{}; return onsRegionListWithOptions(runtime); } model OnsTopicCreateRequest { instanceId?: string(name='InstanceId', description='The ID of the instance in which you want to create the topic.', example='MQ_INST_188077086902****_BXSuW61e'), messageType?: int32(name='MessageType', description='The type of messages that you want to publish to the topic. Valid values: * **0**: normal messages * **1**: partitionally ordered messages * **2**: globally ordered messages * **4**: transactional messages * **5**: scheduled or delayed messages For more information about message types, see [Message types](https://help.aliyun.com/document_detail/155952.html). This parameter is required.', example='0'), remark?: string(name='Remark', description='The description of the topic that you want to create.', example='Test'), topic?: string(name='Topic', description='The name of the topic that you want to create. The name must meet the following rules: * The name must be 3 to 64 characters in length and can contain letters, digits, hyphens (-), and underscores (_). * The topic name cannot start with CID or GID because CID and GID are reserved prefixes for group IDs. * If the ApsaraMQ for RocketMQ instance in which you want to create the topic uses a namespace, the topic name must be unique in the instance. The topic name cannot be the same as an existing topic name or a group ID in the instance. The topic name can be the same as a topic name or a group ID in another instance that uses a different namespace. For example, if Instance A and Instance B use different namespaces, a topic name in Instance A can be the same as a topic name or a group ID in Instance B. * If the instance in which you want to create the topic does not use a namespace, the topic name must be globally unique across instances and regions. The topic name cannot be the same as an existing topic name or group ID in all ApsaraMQ for RocketMQ instances that belong to your Alibaba Cloud account. > To check whether an instance uses a namespace, log on to the ApsaraMQ for RocketMQ console, go to the **Instance Details** page, and then view the value of the Namespace field in the **Basic Information** section. This parameter is required.', example='test'), } model OnsTopicCreateResponseBody = { requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='B6949B58-223E-4B75-B4FE-7797C15E****'), } model OnsTopicCreateResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsTopicCreateResponseBody(name='body'), } /** * @summary Creates a topic. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * When you want to release a new application or expand your business, you can call this operation to create a topic based on your business requirements. * * @param request OnsTopicCreateRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsTopicCreateResponse */ async function onsTopicCreateWithOptions(request: OnsTopicCreateRequest, runtime: $RuntimeOptions): OnsTopicCreateResponse { request.validate(); var query = {}; if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.messageType)) { query['MessageType'] = request.messageType; } if (!$isNull(request.remark)) { query['Remark'] = request.remark; } if (!$isNull(request.topic)) { query['Topic'] = request.topic; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsTopicCreate', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Creates a topic. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * When you want to release a new application or expand your business, you can call this operation to create a topic based on your business requirements. * * @param request OnsTopicCreateRequest * @return OnsTopicCreateResponse */ async function onsTopicCreate(request: OnsTopicCreateRequest): OnsTopicCreateResponse { var runtime = new $RuntimeOptions{}; return onsTopicCreateWithOptions(request, runtime); } model OnsTopicDeleteRequest { instanceId?: string(name='InstanceId', description='The ID of the instance to which the topic you want to delete belongs.', example='MQ_INST_188077086902****_BXSuW61e'), topic?: string(name='Topic', description='The name of the topic that you want to delete. This parameter is required.', example='test'), } model OnsTopicDeleteResponseBody = { requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='4189D4A6-231A-4028-8D89-F66A76C1****'), } model OnsTopicDeleteResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsTopicDeleteResponseBody(name='body'), } /** * @summary Deletes a topic. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. - After you delete the topic, the publishing and subscription relationships that are constructed based on the topic are cleared. Exercise caution when you call this operation. * You can call this operation to delete a topic when you need to reclaim the resources from the topic. For example, after an application is brought offline, you can delete the topics that are used for the application. After you delete a topic, the backend of ApsaraMQ for RocketMQ reclaims the resources from the topic. The system requires a long period of time to reclaim the resources. After you delete a topic, we recommend that you do not create a topic that uses the same name as the deleted topic within a short period of time. If the system fails to delete the specified topic, troubleshoot the issue based on the error code. * * @param request OnsTopicDeleteRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsTopicDeleteResponse */ async function onsTopicDeleteWithOptions(request: OnsTopicDeleteRequest, runtime: $RuntimeOptions): OnsTopicDeleteResponse { request.validate(); var query = {}; if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.topic)) { query['Topic'] = request.topic; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsTopicDelete', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Deletes a topic. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. - After you delete the topic, the publishing and subscription relationships that are constructed based on the topic are cleared. Exercise caution when you call this operation. * You can call this operation to delete a topic when you need to reclaim the resources from the topic. For example, after an application is brought offline, you can delete the topics that are used for the application. After you delete a topic, the backend of ApsaraMQ for RocketMQ reclaims the resources from the topic. The system requires a long period of time to reclaim the resources. After you delete a topic, we recommend that you do not create a topic that uses the same name as the deleted topic within a short period of time. If the system fails to delete the specified topic, troubleshoot the issue based on the error code. * * @param request OnsTopicDeleteRequest * @return OnsTopicDeleteResponse */ async function onsTopicDelete(request: OnsTopicDeleteRequest): OnsTopicDeleteResponse { var runtime = new $RuntimeOptions{}; return onsTopicDeleteWithOptions(request, runtime); } model OnsTopicListRequest { instanceId?: string(name='InstanceId', description='The ID of the instance that contains the topics you want to query.', example='MQ_INST_188077086902****_BXSuW61e'), tag?: [ { key?: string(name='Key', description='The key of the tag that is attached to the topics you want to query. This parameter is not required. If you configure this parameter, you must also configure the **Value** parameter.**** If you include the Key and Value parameters in a request, this operation queries only the topics that use the specified tag. If you do not include these parameters in a request, this operation queries all topics that you can access. * The value of this parameter cannot be an empty string. * A tag value can be up to 128 characters in length and cannot start with `acs:` or `aliyun`. It cannot contain `http://` or `https://`. This parameter is required.', example='CartService'), value?: string(name='Value', description='The value of the tag that is attached to the topics you want to query. This parameter is not required. If you configure this parameter, you must also configure the **Key** parameter.**** If you include the Key and Value parameters in a request, this operation queries only the topics that use the specified tag. If you do not include these parameters in a request, this operation queries all topics that you can access. * The value of this parameter can be an empty string. * A tag key can be up to 128 characters in length and cannot contain `http://` or `https://`. It cannot start with `acs:` or `aliyun`. This parameter is required.', example='ServiceA'), } ](name='Tag', description='The list of tags that are attached to the topic. A maximum of 20 tags can be included in the list.'), topic?: string(name='Topic', description='The name of the topic that you want to query. This parameter is required if you want to query a specific topic. If you do not include this parameter in a request, all topics that you can access are queried.', example='test'), userId?: string(name='UserId', description='The user ID of the topic owner. Set this parameter to an Alibaba Cloud account ID.', example='138015630679****'), } model OnsTopicListResponseBody = { data?: { publishInfoDo?: [ { createTime?: long(name='CreateTime', description='The time when the topic was created.', example='1570700947000'), independentNaming?: boolean(name='IndependentNaming', description='Indicates whether the instance that contains the topic uses a namespace. Valid values: * **true**: The instance uses a separate namespace. The name of each resource must be unique in the instance. The names of resources in different instances can be the same. * **false**: The instance does not use a separate namespace. The name of each resource must be globally unique within an instance and across all instances.', example='true'), instanceId?: string(name='InstanceId', description='The ID of the instance that contains the topic.', example='MQ_INST_188077086902****_BXSuW61e'), messageType?: int32(name='MessageType', description='The message type. Valid values: * **0**: normal messages * **1**: partitionally ordered messages * **2**: globally ordered messages * **4**: transactional messages * **5**: scheduled or delayed messages', example='0'), owner?: string(name='Owner', description='The user ID of the topic owner. The value of this parameter is an Alibaba account ID.', example='138015630679****'), relation?: int32(name='Relation', description='Indicates the relationship between the current account and the topic. Valid values: * **1**: The current account is the owner of the topic. * **2**: The current account can publish messages to the topic. * **4**: The current account can subscribe to the topic. * **6**: The current account can publish messages to and subscribe to the topic.', example='6'), relationName?: string(name='RelationName', description='The relationship between the current account and the topic. The value of this parameter indicates whether the current account is the owner of the topic, and whether the current account can subscribe or publish messages to the topic. the topic.', example='Publish and subscribe'), remark?: string(name='Remark', description='The description of the topic.', example='Test'), serviceStatus?: int32(name='ServiceStatus', description='The status of the topic that is asynchronously created. Valid values: * **0**: The topic is being created. * **1**: The topic is being used.', example='0'), tags?: { tag?: [ { key?: string(name='Key', description='The tag key.', example='CartService'), value?: string(name='Value', description='The tag value.', example='SrviceA'), } ](name='Tag') }(name='Tags', description='The tags that are attached to the topic.'), topic?: string(name='Topic', description='The topic name.', example='test'), } ](name='PublishInfoDo') }(name='Data', description='The information about the topics.'), requestId?: string(name='RequestId', description='The ID of the request. This is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='4A978869-7681-4529-B470-107E1379****'), } model OnsTopicListResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsTopicListResponseBody(name='body'), } /** * @summary Queries the information about topics that belong to the current account. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * This operation returns the basic information about topics and does not return the details of topics. * * @param request OnsTopicListRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsTopicListResponse */ async function onsTopicListWithOptions(request: OnsTopicListRequest, runtime: $RuntimeOptions): OnsTopicListResponse { request.validate(); var query = {}; if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.tag)) { query['Tag'] = request.tag; } if (!$isNull(request.topic)) { query['Topic'] = request.topic; } if (!$isNull(request.userId)) { query['UserId'] = request.userId; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsTopicList', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries the information about topics that belong to the current account. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * This operation returns the basic information about topics and does not return the details of topics. * * @param request OnsTopicListRequest * @return OnsTopicListResponse */ async function onsTopicList(request: OnsTopicListRequest): OnsTopicListResponse { var runtime = new $RuntimeOptions{}; return onsTopicListWithOptions(request, runtime); } model OnsTopicStatusRequest { instanceId?: string(name='InstanceId', description='The ID of the instance that contains the topic you want to query.', example='MQ_INST_188077086902****_BXSuW61e'), topic?: string(name='Topic', description='The name of the topic that you want to query. This parameter is required.', example='test'), } model OnsTopicStatusResponseBody = { data?: { lastTimeStamp?: long(name='LastTimeStamp', description='The point in time when the latest message is ready in the topic. If no message exists in the topic, the return value of this parameter is 0. The value of this parameter is a UNIX timestamp in milliseconds. For information about the definition of ready messages and ready time, see [Terms](https://help.aliyun.com/document_detail/29533.html).', example='1570864984364'), perm?: int32(name='Perm', description='Indicates the operations that you can perform on the topic. Valid values: * **2**: You can publish messages to the topic. * **4**: You can subscribe to the topic. * **6**: You can publish messages to and subscribe to the topic.', example='6'), totalCount?: long(name='TotalCount', description='The total number of messages in all partitions of the topic.', example='2310'), }(name='Data', description='The data structure of the queried topic.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='427EE49D-D762-41FB-8F3D-9BAC96C3****'), } model OnsTopicStatusResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsTopicStatusResponseBody(name='body'), } /** * @summary Queries the total number of messages in a topic and the status of the topic. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can determine the resource usage of a topic based on the information that is returned by this operation. The returned information includes the total number of messages in the topic and the most recent point in time when a message was published to the topic. * * @param request OnsTopicStatusRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsTopicStatusResponse */ async function onsTopicStatusWithOptions(request: OnsTopicStatusRequest, runtime: $RuntimeOptions): OnsTopicStatusResponse { request.validate(); var query = {}; if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.topic)) { query['Topic'] = request.topic; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsTopicStatus', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries the total number of messages in a topic and the status of the topic. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can determine the resource usage of a topic based on the information that is returned by this operation. The returned information includes the total number of messages in the topic and the most recent point in time when a message was published to the topic. * * @param request OnsTopicStatusRequest * @return OnsTopicStatusResponse */ async function onsTopicStatus(request: OnsTopicStatusRequest): OnsTopicStatusResponse { var runtime = new $RuntimeOptions{}; return onsTopicStatusWithOptions(request, runtime); } model OnsTopicSubDetailRequest { instanceId?: string(name='InstanceId', description='The ID of the instance that contains the topic you want to query. This parameter is required.', example='MQ_INST_111111111111_DOxxxxxx'), topic?: string(name='Topic', description='The name of the topic that you want to query. This parameter is required.', example='test'), } model OnsTopicSubDetailResponseBody = { data?: { subscriptionDataList?: { subscriptionDataList?: [ { groupId?: string(name='GroupId', description='The ID of the consumer group that subscribes to the topic.', example='GID_test'), messageModel?: string(name='MessageModel', description='The consumption mode. Valid values: * **CLUSTERING**: the clustering consumption mode * **BROADCASTING**: the broadcasting consumption mode For more information about consumption modes, see [Clustering consumption and broadcasting consumption](https://help.aliyun.com/document_detail/43163.html).', example='CLUSTERING'), online?: string(name='Online'), subString?: string(name='SubString', description='The expression based on which consumers in the consumer group subscribe to the topic.', example='*'), } ](name='SubscriptionDataList') }(name='SubscriptionDataList', description='The information about the online consumer groups that subscribe to the topic.'), topic?: string(name='Topic', description='The topic name.', example='test'), }(name='Data', description='The data returned.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='87B6207F-2908-42B5-A134-84956DCA****'), } model OnsTopicSubDetailResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsTopicSubDetailResponseBody(name='body'), } /** * @summary Queries the online consumer groups that subscribe to a specified topic. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can call this operation to query the online consumer groups that subscribe to a specified topic. If all consumers in a group are offline, the information about the group is not returned. * * @param request OnsTopicSubDetailRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsTopicSubDetailResponse */ async function onsTopicSubDetailWithOptions(request: OnsTopicSubDetailRequest, runtime: $RuntimeOptions): OnsTopicSubDetailResponse { request.validate(); var query = {}; if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.topic)) { query['Topic'] = request.topic; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsTopicSubDetail', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries the online consumer groups that subscribe to a specified topic. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can call this operation to query the online consumer groups that subscribe to a specified topic. If all consumers in a group are offline, the information about the group is not returned. * * @param request OnsTopicSubDetailRequest * @return OnsTopicSubDetailResponse */ async function onsTopicSubDetail(request: OnsTopicSubDetailRequest): OnsTopicSubDetailResponse { var runtime = new $RuntimeOptions{}; return onsTopicSubDetailWithOptions(request, runtime); } model OnsTopicUpdateRequest { instanceId?: string(name='InstanceId', description='The ID of the instance to which the topic belongs.', example='MQ_INST_111111111111_DOxxxxxx'), perm?: int32(name='Perm', description='The read/write mode that you want to configure for the topic. Valid values: * **6**: Both read and write operations are allowed. * **4**: Write operations are forbidden. * **2**: Read operations are forbidden. This parameter is required.', example='6'), topic?: string(name='Topic', description='The name of the topic that you want to manage. This parameter is required.', example='test'), } model OnsTopicUpdateResponseBody = { requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='81979ADA-4A78-4F64-9DEC-5700446D****'), } model OnsTopicUpdateResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsTopicUpdateResponseBody(name='body'), } /** * @deprecated OpenAPI OnsTopicUpdate is deprecated * * @summary Configures the read/write mode for a specified topic. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can call this operation to forbid read or write operations on a specific topic. * * @param request OnsTopicUpdateRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsTopicUpdateResponse */ // Deprecated async function onsTopicUpdateWithOptions(request: OnsTopicUpdateRequest, runtime: $RuntimeOptions): OnsTopicUpdateResponse { request.validate(); var query = {}; if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.perm)) { query['Perm'] = request.perm; } if (!$isNull(request.topic)) { query['Topic'] = request.topic; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsTopicUpdate', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @deprecated OpenAPI OnsTopicUpdate is deprecated * * @summary Configures the read/write mode for a specified topic. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can call this operation to forbid read or write operations on a specific topic. * * @param request OnsTopicUpdateRequest * @return OnsTopicUpdateResponse */ // Deprecated async function onsTopicUpdate(request: OnsTopicUpdateRequest): OnsTopicUpdateResponse { var runtime = new $RuntimeOptions{}; return onsTopicUpdateWithOptions(request, runtime); } model OnsTraceGetResultRequest { instanceId?: string(name='InstanceId', description='The ID of the instance to which the message you want to query belongs.', example='MQ_INST_111111111111_DOxxxxxx'), queryId?: string(name='QueryId', description='The ID of the task that was created to query the trace of the message. This parameter is required.', example='272967562652883649157096685****'), topic?: string(name='Topic', description='The topic to which the message belongs.', example='test'), } model OnsTraceGetResultResponseBody = { requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='84EE24D2-851F-40D6-B99E-4D6AB909****'), traceData?: { createTime?: long(name='CreateTime', description='The point in time when the task was created.', example='1570966857000'), instanceId?: string(name='InstanceId', description='The ID of the instance', example='MQ_INST_111111111111_DOxxxxxx'), msgId?: string(name='MsgId', description='The ID of the message that is queried.', example='1E05791C117818B4AAC23B1BB0CE****'), msgKey?: string(name='MsgKey', description='The key of the message that is queried.', example='ORDERID_100'), queryId?: string(name='QueryId', description='The ID of the task.', example='272967562652883649157096685****'), status?: string(name='Status', description='The status of the task. Valid values: * **finish**: The task is complete. * **working**: The task is in progress. * **removed**: The task is deleted.', example='finish'), topic?: string(name='Topic', description='The topic in which the message is stored.', example='test'), traceList?: { traceMapDo?: [ { bornHost?: string(name='BornHost', description='The address of the producer that generated the message.', example='``30.5.**.**``'), costTime?: int32(name='CostTime', description='The period of time that the system took to send the message. Unit: milliseconds.', example='24'), msgId?: string(name='MsgId', description='The ID of the message.', example='0BC1F01800002A9F000000531246****'), msgKey?: string(name='MsgKey', description='The key of the message.', example='ORDERID_100'), pubGroupName?: string(name='PubGroupName', description='The ID of the group that contains the producer.', example='GID_test'), pubTime?: long(name='PubTime', description='The point in time when the message was sent.', example='1570850870478'), status?: string(name='Status', description='Indicates whether the message is sent. Valid values: * **SEND_SUCCESS**: The message is sent. * **SEND_FAILED**: The message failed to be sent. * **SEND_ROLLBACK:** The message is a transactional message and is rolled back. * **SEND_UNKNOWN:** The message is a transactional message and is not committed. * **SEND_DELAY:** The message is a scheduled or delayed message and is waiting to be consumed at the specified point in time.', example='SEND_SUCCESS'), subList?: { subMapDo?: [ { clientList?: { subClientInfoDo?: [ { clientHost?: string(name='ClientHost', description='The address of the consumer.', example='``30.5.**.**``'), costTime?: int32(name='CostTime', description='The period of time that the system took to consume the message. Unit: milliseconds.', example='43'), reconsumeTimes?: int32(name='ReconsumeTimes', description='The number of attempts that the ApsaraMQ for RocketMQ broker tried to send the message to the consumer.', example='1'), status?: string(name='Status', description='Indicates whether the message is consumed. Valid values: * **CONSUME_FAILED**: The message failed to be consumed. * **CONSUME_SUCCESS**: The message is consumed. * **CONSUME_NOT_RETURN:** No responses are returned. * **SEND_UNKNOWN:** The message is a transactional message and is not committed. * **SEND_DELAY:** The message is a scheduled or delayed message and is waiting to be consumed at the specified point in time.', example='CONSUME_SUCCESS'), subGroupName?: string(name='SubGroupName', description='The ID of the group that contains the consumer.', example='GID_test'), subTime?: long(name='SubTime', description='The earliest point in time when the message was consumed.', example='1570851590511'), } ](name='SubClientInfoDo') }(name='ClientList', description='The information about message consumption by consumers in the group.'), failCount?: int32(name='FailCount', description='The number of consumption failures.', example='0'), subGroupName?: string(name='SubGroupName', description='The ID of the consumer group.', example='GID_test'), successCount?: int32(name='SuccessCount', description='The number of successful consumptions.', example='1'), } ](name='SubMapDo') }(name='SubList', description='The consumption traces of the message.'), tag?: string(name='Tag', description='The tag of the message.', example='TagA'), topic?: string(name='Topic', description='The topic to which the message belongs.', example='test'), } ](name='TraceMapDo') }(name='TraceList', description='The details of the message trace.'), updateTime?: long(name='UpdateTime', description='The most recent point in time when the task was updated.', example='1570966877000'), userId?: string(name='UserId', description='The ID of the user who created the task.', example='27296756265288****'), }(name='TraceData', description='The details of the message trace.'), } model OnsTraceGetResultResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsTraceGetResultResponseBody(name='body'), } /** * @summary The tracing results are queried by specifying the ID of a trace query task. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * Before you call this operation to query the details of the trace of a message, you must create a task to query the trace of the message based on the message ID or message key and obtain the task ID. Then, you can call this operation to query the details of the message trace based on the task ID. You can call the [OnsTraceQueryByMsgId](https://help.aliyun.com/document_detail/445322.html) operation or the [OnsTraceQueryByMsgKey](https://help.aliyun.com/document_detail/445324.html) operation to create a task to query the trace of the message and obtain the task ID from the **QueryId** response parameter. * * A trace query task is time-consuming. If you call this operation to query the details immediately after you create a trace query task, the results may be empty. In this case, we recommend that you try again later. * * @param request OnsTraceGetResultRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsTraceGetResultResponse */ async function onsTraceGetResultWithOptions(request: OnsTraceGetResultRequest, runtime: $RuntimeOptions): OnsTraceGetResultResponse { request.validate(); var query = {}; if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.queryId)) { query['QueryId'] = request.queryId; } if (!$isNull(request.topic)) { query['Topic'] = request.topic; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsTraceGetResult', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary The tracing results are queried by specifying the ID of a trace query task. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * Before you call this operation to query the details of the trace of a message, you must create a task to query the trace of the message based on the message ID or message key and obtain the task ID. Then, you can call this operation to query the details of the message trace based on the task ID. You can call the [OnsTraceQueryByMsgId](https://help.aliyun.com/document_detail/445322.html) operation or the [OnsTraceQueryByMsgKey](https://help.aliyun.com/document_detail/445324.html) operation to create a task to query the trace of the message and obtain the task ID from the **QueryId** response parameter. * * A trace query task is time-consuming. If you call this operation to query the details immediately after you create a trace query task, the results may be empty. In this case, we recommend that you try again later. * * @param request OnsTraceGetResultRequest * @return OnsTraceGetResultResponse */ async function onsTraceGetResult(request: OnsTraceGetResultRequest): OnsTraceGetResultResponse { var runtime = new $RuntimeOptions{}; return onsTraceGetResultWithOptions(request, runtime); } model OnsTraceQueryByMsgIdRequest { beginTime?: long(name='BeginTime', description='The beginning of the time range to query. The value of this parameter is a UNIX timestamp in milliseconds. This parameter is required.', example='1570852800000'), endTime?: long(name='EndTime', description='The end of the time range to query. The value of this parameter is a UNIX timestamp in milliseconds. This parameter is required.', example='1570968000000'), instanceId?: string(name='InstanceId', description='The ID of the ApsaraMQ for RocketMQ instance that contains the specified topic.', example='MQ_INST_111111111111_DOxxxxxx'), msgId?: string(name='MsgId', description='The ID of the message that you want to query. This parameter is required.', example='1E05791C117818B4AAC23B1BB0CE****'), topic?: string(name='Topic', description='The topic that contains the message you want to query. This parameter is required.', example='test'), } model OnsTraceQueryByMsgIdResponseBody = { queryId?: string(name='QueryId', description='The ID of the query task. You can call the [OnsTraceGetResult](https://help.aliyun.com/document_detail/59832.html) operation to query the details of the message trace based on the task ID.', example='272967562652883649157096685****'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='B93332A3-160D-404F-880F-1F8736D1****'), } model OnsTraceQueryByMsgIdResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsTraceQueryByMsgIdResponseBody(name='body'), } /** * @summary Creates a task to query the trace of a message based on the message ID and the name of the topic in which the message is stored. The task ID is returned. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * If you want to query the trace of a message based on the message ID, you can call this operation to create a query task. After you obtain the task ID, you can call the [OnsTraceGetResult](https://help.aliyun.com/document_detail/59832.html) operation to query the details of the message trace based on the task ID. * * @param request OnsTraceQueryByMsgIdRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsTraceQueryByMsgIdResponse */ async function onsTraceQueryByMsgIdWithOptions(request: OnsTraceQueryByMsgIdRequest, runtime: $RuntimeOptions): OnsTraceQueryByMsgIdResponse { request.validate(); var query = {}; if (!$isNull(request.beginTime)) { query['BeginTime'] = request.beginTime; } if (!$isNull(request.endTime)) { query['EndTime'] = request.endTime; } if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.msgId)) { query['MsgId'] = request.msgId; } if (!$isNull(request.topic)) { query['Topic'] = request.topic; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsTraceQueryByMsgId', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Creates a task to query the trace of a message based on the message ID and the name of the topic in which the message is stored. The task ID is returned. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * If you want to query the trace of a message based on the message ID, you can call this operation to create a query task. After you obtain the task ID, you can call the [OnsTraceGetResult](https://help.aliyun.com/document_detail/59832.html) operation to query the details of the message trace based on the task ID. * * @param request OnsTraceQueryByMsgIdRequest * @return OnsTraceQueryByMsgIdResponse */ async function onsTraceQueryByMsgId(request: OnsTraceQueryByMsgIdRequest): OnsTraceQueryByMsgIdResponse { var runtime = new $RuntimeOptions{}; return onsTraceQueryByMsgIdWithOptions(request, runtime); } model OnsTraceQueryByMsgKeyRequest { beginTime?: long(name='BeginTime', description='The start of the time range to query. The value of this parameter is a UNIX timestamp in milliseconds. This parameter is required.', example='1570852800000'), endTime?: long(name='EndTime', description='The end of the time range to query. The value of this parameter is a UNIX timestamp in milliseconds. This parameter is required.', example='1570968000000'), instanceId?: string(name='InstanceId', description='The ID of the ApsaraMQ for RocketMQ instance that contains the specified topic.', example='MQ_INST_111111111111_DOxxxxxx'), msgKey?: string(name='MsgKey', description='The key of the message that you want to query. This parameter is required.', example='ORDERID_100'), topic?: string(name='Topic', description='The topic that contains the message you want to query. This parameter is required.', example='test'), } model OnsTraceQueryByMsgKeyResponseBody = { queryId?: string(name='QueryId', description='The ID of the query task. You can call the [OnsTraceGetResult](https://help.aliyun.com/document_detail/59832.html) operation to query the details of the message trace based on the task ID.', example='272967562652883649157096685****'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='F8654231-122A-4DBD-801F-38E35538****'), } model OnsTraceQueryByMsgKeyResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsTraceQueryByMsgKeyResponseBody(name='body'), } /** * @summary Creates a trace query task based on the topic name and message key and obtains the ID of the query task. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * If you want to query the trace of a message based on the message key that you obtained, you can call this operation to create a query task. After you obtain the task ID, you can call the OnsTraceGetResult operation to query the details of the message trace based on the task ID. * * @param request OnsTraceQueryByMsgKeyRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsTraceQueryByMsgKeyResponse */ async function onsTraceQueryByMsgKeyWithOptions(request: OnsTraceQueryByMsgKeyRequest, runtime: $RuntimeOptions): OnsTraceQueryByMsgKeyResponse { request.validate(); var query = {}; if (!$isNull(request.beginTime)) { query['BeginTime'] = request.beginTime; } if (!$isNull(request.endTime)) { query['EndTime'] = request.endTime; } if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.msgKey)) { query['MsgKey'] = request.msgKey; } if (!$isNull(request.topic)) { query['Topic'] = request.topic; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsTraceQueryByMsgKey', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Creates a trace query task based on the topic name and message key and obtains the ID of the query task. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * If you want to query the trace of a message based on the message key that you obtained, you can call this operation to create a query task. After you obtain the task ID, you can call the OnsTraceGetResult operation to query the details of the message trace based on the task ID. * * @param request OnsTraceQueryByMsgKeyRequest * @return OnsTraceQueryByMsgKeyResponse */ async function onsTraceQueryByMsgKey(request: OnsTraceQueryByMsgKeyRequest): OnsTraceQueryByMsgKeyResponse { var runtime = new $RuntimeOptions{}; return onsTraceQueryByMsgKeyWithOptions(request, runtime); } model OnsTrendGroupOutputTpsRequest { beginTime?: long(name='BeginTime', description='The timestamp that indicates the beginning of the time range to query. Unit: milliseconds. This parameter is required.', example='1570852800000'), endTime?: long(name='EndTime', description='The timestamp that indicates the end of the time range to query. Unit: milliseconds. This parameter is required.', example='1570868400000'), groupId?: string(name='GroupId', description='The ID of the consumer group that you want to query. This parameter is required.', example='GID_test'), instanceId?: string(name='InstanceId', description='The ID of the instance to which the consumer group you want to query belongs.', example='MQ_INST_111111111111_DOxxxxxx'), period?: long(name='Period', description='The sampling period. Unit: minutes. Valid values: 1, 5, and 10.', example='10'), topic?: string(name='Topic', description='The name of the topic that you want to query. This parameter is required.', example='test'), type?: int32(name='Type', description='The type of information that you want to query. Valid values: * **0**: the number of messages that are consumed during each sampling period. * **1**: the TPS for message consumption during each sampling period. This parameter is required.', example='0'), } model OnsTrendGroupOutputTpsResponseBody = { data?: { records?: { statsDataDo?: [ { x?: long(name='X', description='The X axis. The value of this parameter is a UNIX timestamp in milliseconds.', example='1570867800000'), y?: float(name='Y', description='The Y axis. This parameter indicates the TPS for message consumption or the number of messages that are consumed.', example='0'), } ](name='StatsDataDo') }(name='Records', description='The data set returned based on sampling period.'), title?: string(name='Title', description='The name of the table.', example='MQ_INST_111111111111_DOxxxxxx%test@MQ_INST_111111111111_DOxxxxxx%GID_test trend chart of delivered messages'), XUnit?: string(name='XUnit', description='The unit of the timestamp.', example='time'), YUnit?: string(name='YUnit', description='The total number of messages.', example='msg'), }(name='Data', description='The data returned.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use the ID to troubleshoot issues.', example='CE57AEDC-8FD2-43ED-8E3B-1F878077****'), } model OnsTrendGroupOutputTpsResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsTrendGroupOutputTpsResponseBody(name='body'), } /** * @summary Queries the statistics about messages that are consumed by a consumer group within a specific period of time. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can call this operation to query the following statistics that are collected in a production environment: * * The number of messages that are consumed during each sampling period * * The transactions per second (TPS) for message consumption during each sampling period * If your application consumes a small number of messages and does not consume messages at specific intervals, we recommend that you query the number of messages that are consumed during each sampling period because the statistics of TPS may not show a clear change trend. * * @param request OnsTrendGroupOutputTpsRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsTrendGroupOutputTpsResponse */ async function onsTrendGroupOutputTpsWithOptions(request: OnsTrendGroupOutputTpsRequest, runtime: $RuntimeOptions): OnsTrendGroupOutputTpsResponse { request.validate(); var query = {}; if (!$isNull(request.beginTime)) { query['BeginTime'] = request.beginTime; } if (!$isNull(request.endTime)) { query['EndTime'] = request.endTime; } if (!$isNull(request.groupId)) { query['GroupId'] = request.groupId; } if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.period)) { query['Period'] = request.period; } if (!$isNull(request.topic)) { query['Topic'] = request.topic; } if (!$isNull(request.type)) { query['Type'] = request.type; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsTrendGroupOutputTps', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries the statistics about messages that are consumed by a consumer group within a specific period of time. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can call this operation to query the following statistics that are collected in a production environment: * * The number of messages that are consumed during each sampling period * * The transactions per second (TPS) for message consumption during each sampling period * If your application consumes a small number of messages and does not consume messages at specific intervals, we recommend that you query the number of messages that are consumed during each sampling period because the statistics of TPS may not show a clear change trend. * * @param request OnsTrendGroupOutputTpsRequest * @return OnsTrendGroupOutputTpsResponse */ async function onsTrendGroupOutputTps(request: OnsTrendGroupOutputTpsRequest): OnsTrendGroupOutputTpsResponse { var runtime = new $RuntimeOptions{}; return onsTrendGroupOutputTpsWithOptions(request, runtime); } model OnsTrendTopicInputTpsRequest { beginTime?: long(name='BeginTime', description='The timestamp that indicates the beginning of the time range to query. Unit: milliseconds. This parameter is required.', example='1570852800000'), endTime?: long(name='EndTime', description='The timestamp that indicates the end of the time range to query. Unit: milliseconds. This parameter is required.', example='1570868400000'), instanceId?: string(name='InstanceId', description='The ID of the instance to which the topic you want to query belongs.', example='MQ_INST_111111111111_DOxxxxxx'), period?: long(name='Period', description='The sampling period. Unit: minutes. Valid values: 1, 5, and 10.', example='10'), topic?: string(name='Topic', description='The name of the topic that you want to query. This parameter is required.', example='test'), type?: int32(name='Type', description='The type of information that you want to query. Valid values: * **0**: the number of messages that are published to the topic during each sampling period. * **1**: the TPS for message publishing in the topic during each sampling period. This parameter is required.', example='0'), } model OnsTrendTopicInputTpsResponseBody = { data?: { records?: { statsDataDo?: [ { x?: long(name='X', description='The X axis. The value of this parameter is a UNIX timestamp in milliseconds.', example='1570852800000'), y?: float(name='Y', description='The Y axis. This parameter indicates the TPS for message publishing or the number of messages that are published.', example='0'), } ](name='StatsDataDo') }(name='Records', description='The data set returned based on sampling period.'), title?: string(name='Title', description='The name of the table.', example='MQ_INST_111111111111_DOxxxxxx%test trend of received messages'), XUnit?: string(name='XUnit', description='The unit of the timestamp.', example='time'), YUnit?: string(name='YUnit', description='The unit of the Y axis.', example='msg'), }(name='Data', description='The data returned.'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use the ID to troubleshoot issues.', example='E213AD8A-0730-4B3D-A35A-340DA47D****'), } model OnsTrendTopicInputTpsResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OnsTrendTopicInputTpsResponseBody(name='body'), } /** * @summary Queries the statistics about messages that are published to a topic within a specific period of time. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can call this operation to query the statistics of messages that are published to a specific topic in a production environment. You can query the number of messages that are published to the topic or the transactions per second (TPS) for message publishing within a specified time range based on your business requirements. * If your application publishes a small number of messages and does not publish messages at specific intervals, we recommend that you query the number of messages that are published to the topic during each sampling period because the statistics of TPS may not show a clear change trend. * * @param request OnsTrendTopicInputTpsRequest * @param runtime runtime options for this request RuntimeOptions * @return OnsTrendTopicInputTpsResponse */ async function onsTrendTopicInputTpsWithOptions(request: OnsTrendTopicInputTpsRequest, runtime: $RuntimeOptions): OnsTrendTopicInputTpsResponse { request.validate(); var query = {}; if (!$isNull(request.beginTime)) { query['BeginTime'] = request.beginTime; } if (!$isNull(request.endTime)) { query['EndTime'] = request.endTime; } if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.period)) { query['Period'] = request.period; } if (!$isNull(request.topic)) { query['Topic'] = request.topic; } if (!$isNull(request.type)) { query['Type'] = request.type; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'OnsTrendTopicInputTps', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Queries the statistics about messages that are published to a topic within a specific period of time. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can call this operation to query the statistics of messages that are published to a specific topic in a production environment. You can query the number of messages that are published to the topic or the transactions per second (TPS) for message publishing within a specified time range based on your business requirements. * If your application publishes a small number of messages and does not publish messages at specific intervals, we recommend that you query the number of messages that are published to the topic during each sampling period because the statistics of TPS may not show a clear change trend. * * @param request OnsTrendTopicInputTpsRequest * @return OnsTrendTopicInputTpsResponse */ async function onsTrendTopicInputTps(request: OnsTrendTopicInputTpsRequest): OnsTrendTopicInputTpsResponse { var runtime = new $RuntimeOptions{}; return onsTrendTopicInputTpsWithOptions(request, runtime); } model OpenOnsServiceResponseBody = { orderId?: string(name='OrderId', description='The ID of the order.', example='2068689****0272'), requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.', example='8C5B4603-8977-4513-AB60-9C3E2F88****'), } model OpenOnsServiceResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: OpenOnsServiceResponseBody(name='body'), } /** * @summary Activates ApsaraMQ for RocketMQ. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can call this operation the first time you use ApsaraMQ for RocketMQ. You can use ApsaraMQ for RocketMQ only after the service is activated. * The ApsaraMQ for RocketMQ service can be activated only in the China (Hangzhou) region. Service activation is not billed. * * @param request OpenOnsServiceRequest * @param runtime runtime options for this request RuntimeOptions * @return OpenOnsServiceResponse */ async function openOnsServiceWithOptions(runtime: $RuntimeOptions): OpenOnsServiceResponse { var req = new OpenApiUtil.OpenApiRequest{}; var params = new OpenApiUtil.Params{ action = 'OpenOnsService', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Activates ApsaraMQ for RocketMQ. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can call this operation the first time you use ApsaraMQ for RocketMQ. You can use ApsaraMQ for RocketMQ only after the service is activated. * The ApsaraMQ for RocketMQ service can be activated only in the China (Hangzhou) region. Service activation is not billed. * * @return OpenOnsServiceResponse */ async function openOnsService(): OpenOnsServiceResponse { var runtime = new $RuntimeOptions{}; return openOnsServiceWithOptions(runtime); } model TagResourcesRequest { instanceId?: string(name='InstanceId', description='The ID of the ApsaraMQ for RocketMQ instance that contains the resource to which you want to attach tags. > This parameter is required when you attach tags to a topic or a group.', example='MQ_INST_188077086902****_BXSuW61e'), resourceId?: [ string ](name='ResourceId', description='The resource IDs. This parameter is required.', example='TopicA'), resourceType?: string(name='ResourceType', description='The type of the resource to which you want to attach tags. Valid values: * **INSTANCE** * **TOPIC** * **GROUP** This parameter is required.', example='TOPIC'), tag?: [ { key?: string(name='Key', description='The tag key. If you configure this parameter, you must also configure the **Value** parameter.**** * The value of this parameter cannot be an empty string. * A tag key must be 1 to 128 characters in length and cannot contain `http://` or `https://`. A tag key cannot start with `acs:` or `aliyun`. This parameter is required.', example='FinanceDept'), value?: string(name='Value', description='The value of the tag that you want to attach to the resource. If you configure this parameter, you must also configure the **Key** parameter.**** * The value of this parameter can be an empty string. * A tag value must be 1 to 128 characters in length and cannot contain `http://` or `https://`. A tag value cannot start with `acs:` or `aliyun`. This parameter is required.', example='FinanceJoshua'), } ](name='Tag', description='The tags that you want to attach to the resource. This parameter is required.'), } model TagResourcesResponseBody = { requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use the ID to troubleshoot issues.', example='301D2CBE-66F8-403D-AEC0-82582478****'), } model TagResourcesResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: TagResourcesResponseBody(name='body'), } /** * @summary Attaches tags to resources. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can call this operation to attach tags to a source. You can use tags to classify resources in ApsaraMQ for RocketMQ. This can help you aggregate and search resources in an efficient manner. * * @param request TagResourcesRequest * @param runtime runtime options for this request RuntimeOptions * @return TagResourcesResponse */ async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: $RuntimeOptions): TagResourcesResponse { request.validate(); var query = {}; if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.resourceId)) { query['ResourceId'] = request.resourceId; } if (!$isNull(request.resourceType)) { query['ResourceType'] = request.resourceType; } if (!$isNull(request.tag)) { query['Tag'] = request.tag; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'TagResources', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Attaches tags to resources. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * You can call this operation to attach tags to a source. You can use tags to classify resources in ApsaraMQ for RocketMQ. This can help you aggregate and search resources in an efficient manner. * * @param request TagResourcesRequest * @return TagResourcesResponse */ async function tagResources(request: TagResourcesRequest): TagResourcesResponse { var runtime = new $RuntimeOptions{}; return tagResourcesWithOptions(request, runtime); } model UntagResourcesRequest { all?: boolean(name='All', description='Specifies whether to remove all tags that are attached to the specified resource. This parameter takes effect only if the **TagKey** parameter is empty. Default value: **false**.', example='false'), instanceId?: string(name='InstanceId', description='This parameter is required when you detach tags from a topic or a group.', example='MQ_INST_188077086902****_BX4jvZZG'), resourceId?: [ string ](name='ResourceId', description='The resource IDs. This parameter is required.', example='TopicA'), resourceType?: string(name='ResourceType', description='The type of the resource from which you want to detach tags. Valid values: * **INSTANCE** * **TOPIC** * **GROUP** This parameter is required.', example='TOPIC'), tagKey?: [ string ](name='TagKey', description='The tag keys of the resource.', example='CartService'), } model UntagResourcesResponseBody = { requestId?: string(name='RequestId', description='The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use the ID to troubleshoot issues.', example='19780F2E-7841-4E0F-A5D9-C64A0530****'), } model UntagResourcesResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: UntagResourcesResponseBody(name='body'), } /** * @summary Detaches and removes tags from a specific resource. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * @param request UntagResourcesRequest * @param runtime runtime options for this request RuntimeOptions * @return UntagResourcesResponse */ async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: $RuntimeOptions): UntagResourcesResponse { request.validate(); var query = {}; if (!$isNull(request.all)) { query['All'] = request.all; } if (!$isNull(request.instanceId)) { query['InstanceId'] = request.instanceId; } if (!$isNull(request.resourceId)) { query['ResourceId'] = request.resourceId; } if (!$isNull(request.resourceType)) { query['ResourceType'] = request.resourceType; } if (!$isNull(request.tagKey)) { query['TagKey'] = request.tagKey; } var req = new OpenApiUtil.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApiUtil.Params{ action = 'UntagResources', version = '2019-02-14', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; if ($isNull(@signatureVersion) || @signatureVersion != 'v4') { return callApi(params, req, runtime); } else { return execute(params, req, runtime); } } /** * @summary Detaches and removes tags from a specific resource. * * @description > API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur. * * @param request UntagResourcesRequest * @return UntagResourcesResponse */ async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse { var runtime = new $RuntimeOptions{}; return untagResourcesWithOptions(request, runtime); }