huaweicloud-sdk-python-v3/huaweicloud-sdk-rocketmq/huaweicloudsdkrocketmq/v2/rocketmq_async_client.py

2682 lines
90 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# coding: utf-8
from __future__ import absolute_import
import importlib
from huaweicloudsdkcore.client import Client, ClientBuilder
from huaweicloudsdkcore.utils import http_utils
from huaweicloudsdkcore.sdk_stream_request import SdkStreamRequest
class RocketMQAsyncClient(Client):
def __init__(self):
super(RocketMQAsyncClient, self).__init__()
self.model_package = importlib.import_module("huaweicloudsdkrocketmq.v2.model")
@classmethod
def new_builder(cls, clazz=None):
if not clazz:
client_builder = ClientBuilder(cls)
else:
if clazz.__name__ != "RocketMQAsyncClient":
raise TypeError("client type error, support client type is RocketMQAsyncClient")
client_builder = ClientBuilder(clazz)
return client_builder
def batch_create_or_delete_rocketmq_tag_async(self, request):
"""批量添加或删除实例标签
批量添加或删除实例标签。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for BatchCreateOrDeleteRocketmqTag
:type request: :class:`huaweicloudsdkrocketmq.v2.BatchCreateOrDeleteRocketmqTagRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.BatchCreateOrDeleteRocketmqTagResponse`
"""
return self._batch_create_or_delete_rocketmq_tag_with_http_info(request)
def _batch_create_or_delete_rocketmq_tag_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/rocketmq/{instance_id}/tags/action',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='BatchCreateOrDeleteRocketmqTagResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def batch_delete_instances_async(self, request):
"""批量删除实例
批量删除实例。**实例删除后,实例中原有的数据将被删除,且没有备份,请谨慎操作。**
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for BatchDeleteInstances
:type request: :class:`huaweicloudsdkrocketmq.v2.BatchDeleteInstancesRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.BatchDeleteInstancesResponse`
"""
return self._batch_delete_instances_with_http_info(request)
def _batch_delete_instances_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/action',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='BatchDeleteInstancesResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def batch_update_consumer_group_async(self, request):
"""批量修改消费组
批量修改消费组。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for BatchUpdateConsumerGroup
:type request: :class:`huaweicloudsdkrocketmq.v2.BatchUpdateConsumerGroupRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.BatchUpdateConsumerGroupResponse`
"""
return self._batch_update_consumer_group_with_http_info(request)
def _batch_update_consumer_group_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/groups',
method='PUT',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='BatchUpdateConsumerGroupResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def create_consumer_group_or_batch_delete_consumer_group_async(self, request):
"""创建消费组或批量删除消费组
创建消费组或批量删除消费组。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for CreateConsumerGroupOrBatchDeleteConsumerGroup
:type request: :class:`huaweicloudsdkrocketmq.v2.CreateConsumerGroupOrBatchDeleteConsumerGroupRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.CreateConsumerGroupOrBatchDeleteConsumerGroupResponse`
"""
return self._create_consumer_group_or_batch_delete_consumer_group_with_http_info(request)
def _create_consumer_group_or_batch_delete_consumer_group_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'action' in local_var_params:
query_params.append(('action', local_var_params['action']))
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/groups',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='CreateConsumerGroupOrBatchDeleteConsumerGroupResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def create_instance_by_engine_async(self, request):
"""创建实例
该接口支持创建按需和包周期两种计费方式的实例。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for CreateInstanceByEngine
:type request: :class:`huaweicloudsdkrocketmq.v2.CreateInstanceByEngineRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.CreateInstanceByEngineResponse`
"""
return self._create_instance_by_engine_with_http_info(request)
def _create_instance_by_engine_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'engine' in local_var_params:
path_params['engine'] = local_var_params['engine']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{engine}/{project_id}/instances',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='CreateInstanceByEngineResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def create_post_paid_instance_async(self, request):
"""创建实例(按需)
创建实例,该接口创建的实例为按需计费的方式。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for CreatePostPaidInstance
:type request: :class:`huaweicloudsdkrocketmq.v2.CreatePostPaidInstanceRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.CreatePostPaidInstanceResponse`
"""
return self._create_post_paid_instance_with_http_info(request)
def _create_post_paid_instance_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='CreatePostPaidInstanceResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def create_rocket_mq_migration_task_async(self, request):
"""新建元数据迁移任务
新建元数据迁移任务。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for CreateRocketMqMigrationTask
:type request: :class:`huaweicloudsdkrocketmq.v2.CreateRocketMqMigrationTaskRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.CreateRocketMqMigrationTaskResponse`
"""
return self._create_rocket_mq_migration_task_with_http_info(request)
def _create_rocket_mq_migration_task_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'overwrite' in local_var_params:
query_params.append(('overwrite', local_var_params['overwrite']))
if 'name' in local_var_params:
query_params.append(('name', local_var_params['name']))
if 'type' in local_var_params:
query_params.append(('type', local_var_params['type']))
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/metadata',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='CreateRocketMqMigrationTaskResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def create_user_async(self, request):
"""创建用户
创建用户。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for CreateUser
:type request: :class:`huaweicloudsdkrocketmq.v2.CreateUserRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.CreateUserResponse`
"""
return self._create_user_with_http_info(request)
def _create_user_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/users',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='CreateUserResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def delete_consumer_group_async(self, request):
"""删除指定消费组
删除指定消费组。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for DeleteConsumerGroup
:type request: :class:`huaweicloudsdkrocketmq.v2.DeleteConsumerGroupRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.DeleteConsumerGroupResponse`
"""
return self._delete_consumer_group_with_http_info(request)
def _delete_consumer_group_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'group' in local_var_params:
path_params['group'] = local_var_params['group']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/groups/{group}',
method='DELETE',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='DeleteConsumerGroupResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def delete_instance_async(self, request):
"""删除指定的实例
删除指定的实例,释放该实例的所有资源。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for DeleteInstance
:type request: :class:`huaweicloudsdkrocketmq.v2.DeleteInstanceRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.DeleteInstanceResponse`
"""
return self._delete_instance_with_http_info(request)
def _delete_instance_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}',
method='DELETE',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='DeleteInstanceResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def delete_rocket_mq_migration_task_async(self, request):
"""删除元数据迁移任务
删除元数据迁移任务。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for DeleteRocketMqMigrationTask
:type request: :class:`huaweicloudsdkrocketmq.v2.DeleteRocketMqMigrationTaskRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.DeleteRocketMqMigrationTaskResponse`
"""
return self._delete_rocket_mq_migration_task_with_http_info(request)
def _delete_rocket_mq_migration_task_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/metadata',
method='DELETE',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='DeleteRocketMqMigrationTaskResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def delete_user_async(self, request):
"""删除用户
删除用户。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for DeleteUser
:type request: :class:`huaweicloudsdkrocketmq.v2.DeleteUserRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.DeleteUserResponse`
"""
return self._delete_user_with_http_info(request)
def _delete_user_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'user_name' in local_var_params:
path_params['user_name'] = local_var_params['user_name']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/users/{user_name}',
method='DELETE',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='DeleteUserResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def export_dlq_message_async(self, request):
"""导出死信消息
导出死信消息。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ExportDlqMessage
:type request: :class:`huaweicloudsdkrocketmq.v2.ExportDlqMessageRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ExportDlqMessageResponse`
"""
return self._export_dlq_message_with_http_info(request)
def _export_dlq_message_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/messages/export',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ExportDlqMessageResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_available_zones_async(self, request):
"""查询可用区信息
在创建实例时需要配置实例所在的可用区ID可通过该接口查询可用区的ID。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ListAvailableZones
:type request: :class:`huaweicloudsdkrocketmq.v2.ListAvailableZonesRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ListAvailableZonesResponse`
"""
return self._list_available_zones_with_http_info(request)
def _list_available_zones_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/available-zones',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ListAvailableZonesResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_brokers_async(self, request):
"""查询代理列表
查询代理列表。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ListBrokers
:type request: :class:`huaweicloudsdkrocketmq.v2.ListBrokersRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ListBrokersResponse`
"""
return self._list_brokers_with_http_info(request)
def _list_brokers_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/brokers',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ListBrokersResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_consume_group_access_policy_async(self, request):
"""查询消费组的授权用户列表
查询消费组的授权用户列表。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ListConsumeGroupAccessPolicy
:type request: :class:`huaweicloudsdkrocketmq.v2.ListConsumeGroupAccessPolicyRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ListConsumeGroupAccessPolicyResponse`
"""
return self._list_consume_group_access_policy_with_http_info(request)
def _list_consume_group_access_policy_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'engine' in local_var_params:
path_params['engine'] = local_var_params['engine']
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'group_id' in local_var_params:
path_params['group_id'] = local_var_params['group_id']
query_params = []
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{engine}/{project_id}/instances/{instance_id}/groups/{group_id}/accesspolicy',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ListConsumeGroupAccessPolicyResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_instance_consumer_groups_async(self, request):
"""查询消费组列表
查询消费组列表。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ListInstanceConsumerGroups
:type request: :class:`huaweicloudsdkrocketmq.v2.ListInstanceConsumerGroupsRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ListInstanceConsumerGroupsResponse`
"""
return self._list_instance_consumer_groups_with_http_info(request)
def _list_instance_consumer_groups_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'group' in local_var_params:
query_params.append(('group', local_var_params['group']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/groups',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ListInstanceConsumerGroupsResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_instances_async(self, request):
"""查询所有实例列表
查询租户的实例列表,支持按照条件查询。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ListInstances
:type request: :class:`huaweicloudsdkrocketmq.v2.ListInstancesRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ListInstancesResponse`
"""
return self._list_instances_with_http_info(request)
def _list_instances_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
query_params = []
if 'engine' in local_var_params:
query_params.append(('engine', local_var_params['engine']))
if 'name' in local_var_params:
query_params.append(('name', local_var_params['name']))
if 'instance_id' in local_var_params:
query_params.append(('instance_id', local_var_params['instance_id']))
if 'status' in local_var_params:
query_params.append(('status', local_var_params['status']))
if 'include_failure' in local_var_params:
query_params.append(('include_failure', local_var_params['include_failure']))
if 'exact_match_name' in local_var_params:
query_params.append(('exact_match_name', local_var_params['exact_match_name']))
if 'enterprise_project_id' in local_var_params:
query_params.append(('enterprise_project_id', local_var_params['enterprise_project_id']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ListInstancesResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_message_trace_async(self, request):
"""查询消息轨迹
查询消息轨迹。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ListMessageTrace
:type request: :class:`huaweicloudsdkrocketmq.v2.ListMessageTraceRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ListMessageTraceResponse`
"""
return self._list_message_trace_with_http_info(request)
def _list_message_trace_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'engine' in local_var_params:
path_params['engine'] = local_var_params['engine']
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'msg_id' in local_var_params:
query_params.append(('msg_id', local_var_params['msg_id']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{engine}/{project_id}/instances/{instance_id}/trace',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ListMessageTraceResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_messages_async(self, request):
"""查询消息
查询消息。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ListMessages
:type request: :class:`huaweicloudsdkrocketmq.v2.ListMessagesRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ListMessagesResponse`
"""
return self._list_messages_with_http_info(request)
def _list_messages_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'engine' in local_var_params:
path_params['engine'] = local_var_params['engine']
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'topic' in local_var_params:
query_params.append(('topic', local_var_params['topic']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'key' in local_var_params:
query_params.append(('key', local_var_params['key']))
if 'start_time' in local_var_params:
query_params.append(('start_time', local_var_params['start_time']))
if 'end_time' in local_var_params:
query_params.append(('end_time', local_var_params['end_time']))
if 'msg_id' in local_var_params:
query_params.append(('msg_id', local_var_params['msg_id']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{engine}/{project_id}/instances/{instance_id}/messages',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ListMessagesResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_rocket_mq_migration_task_async(self, request):
"""查询实例下所有迁移任务或查询指定迁移任务信息
1. 查询实例下所有迁移任务
2. 查询指定迁移任务信息
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ListRocketMqMigrationTask
:type request: :class:`huaweicloudsdkrocketmq.v2.ListRocketMqMigrationTaskRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ListRocketMqMigrationTaskResponse`
"""
return self._list_rocket_mq_migration_task_with_http_info(request)
def _list_rocket_mq_migration_task_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'id' in local_var_params:
query_params.append(('id', local_var_params['id']))
if 'type' in local_var_params:
query_params.append(('type', local_var_params['type']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
if 'name' in local_var_params:
query_params.append(('name', local_var_params['name']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/metadata',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ListRocketMqMigrationTaskResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_topic_access_policy_async(self, request):
"""查询主题的授权用户列表
查询主题的授权用户列表。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ListTopicAccessPolicy
:type request: :class:`huaweicloudsdkrocketmq.v2.ListTopicAccessPolicyRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ListTopicAccessPolicyResponse`
"""
return self._list_topic_access_policy_with_http_info(request)
def _list_topic_access_policy_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'topic' in local_var_params:
path_params['topic'] = local_var_params['topic']
query_params = []
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/topics/{topic}/accesspolicy',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ListTopicAccessPolicyResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_user_async(self, request):
"""查询用户列表
查询用户列表。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ListUser
:type request: :class:`huaweicloudsdkrocketmq.v2.ListUserRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ListUserResponse`
"""
return self._list_user_with_http_info(request)
def _list_user_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/users',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ListUserResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def reset_consume_offset_async(self, request):
"""重置消费进度
重置消费进度。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ResetConsumeOffset
:type request: :class:`huaweicloudsdkrocketmq.v2.ResetConsumeOffsetRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ResetConsumeOffsetResponse`
"""
return self._reset_consume_offset_with_http_info(request)
def _reset_consume_offset_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'engine' in local_var_params:
path_params['engine'] = local_var_params['engine']
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'group_id' in local_var_params:
path_params['group_id'] = local_var_params['group_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{engine}/{project_id}/instances/{instance_id}/groups/{group_id}/reset-message-offset',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ResetConsumeOffsetResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def send_dlq_message_async(self, request):
"""重发死信消息
重发死信消息。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for SendDlqMessage
:type request: :class:`huaweicloudsdkrocketmq.v2.SendDlqMessageRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.SendDlqMessageResponse`
"""
return self._send_dlq_message_with_http_info(request)
def _send_dlq_message_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'engine' in local_var_params:
path_params['engine'] = local_var_params['engine']
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{engine}/{project_id}/instances/{instance_id}/messages/deadletter-resend',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='SendDlqMessageResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def show_consumer_connections_async(self, request):
"""查询消费者列表
查询消费组内消费者列表
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ShowConsumerConnections
:type request: :class:`huaweicloudsdkrocketmq.v2.ShowConsumerConnectionsRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ShowConsumerConnectionsResponse`
"""
return self._show_consumer_connections_with_http_info(request)
def _show_consumer_connections_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'group' in local_var_params:
path_params['group'] = local_var_params['group']
query_params = []
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'is_detail' in local_var_params:
query_params.append(('is_detail', local_var_params['is_detail']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/rocketmq/{project_id}/instances/{instance_id}/groups/{group}/clients',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ShowConsumerConnectionsResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def show_consumer_list_or_details_async(self, request):
"""查询消费列表或详情
查询消费列表或详情。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ShowConsumerListOrDetails
:type request: :class:`huaweicloudsdkrocketmq.v2.ShowConsumerListOrDetailsRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ShowConsumerListOrDetailsResponse`
"""
return self._show_consumer_list_or_details_with_http_info(request)
def _show_consumer_list_or_details_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'group' in local_var_params:
path_params['group'] = local_var_params['group']
query_params = []
if 'topic' in local_var_params:
query_params.append(('topic', local_var_params['topic']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/groups/{group}/topics',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ShowConsumerListOrDetailsResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def show_group_async(self, request):
"""查询指定消费组
查询指定消费组详情。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ShowGroup
:type request: :class:`huaweicloudsdkrocketmq.v2.ShowGroupRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ShowGroupResponse`
"""
return self._show_group_with_http_info(request)
def _show_group_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'group' in local_var_params:
path_params['group'] = local_var_params['group']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/groups/{group}',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ShowGroupResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def show_instance_async(self, request):
"""查询指定实例
查询指定实例的详细信息。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ShowInstance
:type request: :class:`huaweicloudsdkrocketmq.v2.ShowInstanceRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ShowInstanceResponse`
"""
return self._show_instance_with_http_info(request)
def _show_instance_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ShowInstanceResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def show_rocketmq_project_tags_async(self, request):
"""查询项目标签
查询项目标签。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ShowRocketmqProjectTags
:type request: :class:`huaweicloudsdkrocketmq.v2.ShowRocketmqProjectTagsRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ShowRocketmqProjectTagsResponse`
"""
return self._show_rocketmq_project_tags_with_http_info(request)
def _show_rocketmq_project_tags_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/rocketmq/tags',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ShowRocketmqProjectTagsResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def show_rocketmq_tags_async(self, request):
"""查询实例标签
查询实例标签。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ShowRocketmqTags
:type request: :class:`huaweicloudsdkrocketmq.v2.ShowRocketmqTagsRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ShowRocketmqTagsResponse`
"""
return self._show_rocketmq_tags_with_http_info(request)
def _show_rocketmq_tags_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/rocketmq/{instance_id}/tags',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ShowRocketmqTagsResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def show_user_async(self, request):
"""查询用户详情
查询用户详情。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ShowUser
:type request: :class:`huaweicloudsdkrocketmq.v2.ShowUserRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ShowUserResponse`
"""
return self._show_user_with_http_info(request)
def _show_user_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'user_name' in local_var_params:
path_params['user_name'] = local_var_params['user_name']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/users/{user_name}',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ShowUserResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def update_consumer_group_async(self, request):
"""修改消费组
修改指定消费组参数。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for UpdateConsumerGroup
:type request: :class:`huaweicloudsdkrocketmq.v2.UpdateConsumerGroupRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.UpdateConsumerGroupResponse`
"""
return self._update_consumer_group_with_http_info(request)
def _update_consumer_group_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'group' in local_var_params:
path_params['group'] = local_var_params['group']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/groups/{group}',
method='PUT',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='UpdateConsumerGroupResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def update_instance_async(self, request):
"""修改实例信息
修改实例的名称和描述信息。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for UpdateInstance
:type request: :class:`huaweicloudsdkrocketmq.v2.UpdateInstanceRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.UpdateInstanceResponse`
"""
return self._update_instance_with_http_info(request)
def _update_instance_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}',
method='PUT',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='UpdateInstanceResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def update_user_async(self, request):
"""修改用户参数
修改用户参数。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for UpdateUser
:type request: :class:`huaweicloudsdkrocketmq.v2.UpdateUserRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.UpdateUserResponse`
"""
return self._update_user_with_http_info(request)
def _update_user_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'user_name' in local_var_params:
path_params['user_name'] = local_var_params['user_name']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/users/{user_name}',
method='PUT',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='UpdateUserResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def validate_consumed_message_async(self, request):
"""消费验证
消费验证。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ValidateConsumedMessage
:type request: :class:`huaweicloudsdkrocketmq.v2.ValidateConsumedMessageRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ValidateConsumedMessageResponse`
"""
return self._validate_consumed_message_with_http_info(request)
def _validate_consumed_message_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'engine' in local_var_params:
path_params['engine'] = local_var_params['engine']
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{engine}/{project_id}/instances/{instance_id}/messages/resend',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ValidateConsumedMessageResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def create_topic_or_batch_delete_topic_async(self, request):
"""创建主题或批量删除主题
创建主题或批量删除主题。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for CreateTopicOrBatchDeleteTopic
:type request: :class:`huaweicloudsdkrocketmq.v2.CreateTopicOrBatchDeleteTopicRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.CreateTopicOrBatchDeleteTopicResponse`
"""
return self._create_topic_or_batch_delete_topic_with_http_info(request)
def _create_topic_or_batch_delete_topic_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'action' in local_var_params:
query_params.append(('action', local_var_params['action']))
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/topics',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='CreateTopicOrBatchDeleteTopicResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def delete_topic_async(self, request):
"""删除指定主题
删除指定主题。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for DeleteTopic
:type request: :class:`huaweicloudsdkrocketmq.v2.DeleteTopicRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.DeleteTopicResponse`
"""
return self._delete_topic_with_http_info(request)
def _delete_topic_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'topic' in local_var_params:
path_params['topic'] = local_var_params['topic']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/topics/{topic}',
method='DELETE',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='DeleteTopicResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_consumer_group_of_topic_async(self, request):
"""查询主题消费组列表
查询主题消费组列表。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ListConsumerGroupOfTopic
:type request: :class:`huaweicloudsdkrocketmq.v2.ListConsumerGroupOfTopicRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ListConsumerGroupOfTopicResponse`
"""
return self._list_consumer_group_of_topic_with_http_info(request)
def _list_consumer_group_of_topic_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'topic' in local_var_params:
path_params['topic'] = local_var_params['topic']
query_params = []
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/topics/{topic}/groups',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ListConsumerGroupOfTopicResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_rocket_instance_topics_async(self, request):
"""查询主题列表
该接口用于查询指定RocketMQ实例的Topic列表。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ListRocketInstanceTopics
:type request: :class:`huaweicloudsdkrocketmq.v2.ListRocketInstanceTopicsRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ListRocketInstanceTopicsResponse`
"""
return self._list_rocket_instance_topics_with_http_info(request)
def _list_rocket_instance_topics_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
query_params = []
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/topics',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ListRocketInstanceTopicsResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def show_one_topic_async(self, request):
"""查询单个主题
查询单个主题。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ShowOneTopic
:type request: :class:`huaweicloudsdkrocketmq.v2.ShowOneTopicRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ShowOneTopicResponse`
"""
return self._show_one_topic_with_http_info(request)
def _show_one_topic_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'topic' in local_var_params:
path_params['topic'] = local_var_params['topic']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/topics/{topic}',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ShowOneTopicResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def show_topic_status_async(self, request):
"""查询主题的消息数
查询主题的消息数。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for ShowTopicStatus
:type request: :class:`huaweicloudsdkrocketmq.v2.ShowTopicStatusRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.ShowTopicStatusResponse`
"""
return self._show_topic_status_with_http_info(request)
def _show_topic_status_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'topic' in local_var_params:
path_params['topic'] = local_var_params['topic']
query_params = []
header_params = {}
form_params = {}
body_params = None
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/topics/{topic}/status',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='ShowTopicStatusResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def update_topic_async(self, request):
"""修改主题
修改主题。
Please refer to HUAWEI cloud API Explorer for details.
:param request: Request instance for UpdateTopic
:type request: :class:`huaweicloudsdkrocketmq.v2.UpdateTopicRequest`
:rtype: :class:`huaweicloudsdkrocketmq.v2.UpdateTopicResponse`
"""
return self._update_topic_with_http_info(request)
def _update_topic_with_http_info(self, request):
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
cname = None
collection_formats = {}
path_params = {}
if 'instance_id' in local_var_params:
path_params['instance_id'] = local_var_params['instance_id']
if 'topic' in local_var_params:
path_params['topic'] = local_var_params['topic']
query_params = []
header_params = {}
form_params = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
if isinstance(request, SdkStreamRequest):
body_params = request.get_file_stream()
response_headers = []
header_params['Content-Type'] = http_utils.select_header_content_type(
['application/json'])
auth_settings = []
return self.call_api(
resource_path='/v2/{project_id}/instances/{instance_id}/topics/{topic}',
method='PUT',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
cname=cname,
response_type='UpdateTopicResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None, body=None,
post_params=None, cname=None, response_type=None, response_headers=None, auth_settings=None,
collection_formats=None, request_type=None):
"""Makes the HTTP request and returns deserialized data.
:param resource_path: Path to method endpoint.
:param method: Method to call.
:param path_params: Path parameters in the url.
:param query_params: Query parameters in the url.
:param header_params: Header parameters to be
placed in the request header.
:param body: Request body.
:param post_params: Request post form parameters,
for `application/x-www-form-urlencoded`, `multipart/form-data`.
:param cname: Used for obs endpoint.
:param auth_settings: Auth Settings names for the request.
:param response_type: Response data type.
:param response_headers: Header should be added to response data.
:param collection_formats: dict of collection formats for path, query,
header, and post parameters.
:param request_type: Request data type.
:return:
Return the response directly.
"""
return self.do_http_request(
method=method,
resource_path=resource_path,
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body,
post_params=post_params,
cname=cname,
response_type=response_type,
response_headers=response_headers,
collection_formats=collection_formats,
request_type=request_type,
async_request=True)