华为云用户手册

  • 响应消息 响应参数 参数说明见表2。 表2 响应参数说明 参数 类型 说明 topic String topic名称。 partitions Array of object partitions 分区列表。参数查看表3。 group_subscribed Array of String 订阅该topic的消费组名称列表。 表3 partitions参数说明 参数 类型 说明 partition Integer 分区ID。 leader Integer leader副本所在节点的id。 leo long 分区leader副本的LEO(Log End Offset)。 hw long 分区高水位(HW,High Watermark)。 lso long 分区leader副本的LSO(Log Start Offset)。 last_update_timestamp long 分区上次写入消息的时间。 replicas Array of object replicas 副本列表。参数查看表4。 表4 replicas参数说明 参数 类型 说明 broker Integer 副本所在的节点ID。 leader Boolean 该副本是否为leader。 in_sync Boolean 该副本是否在ISR副本中。 size Long 该副本当前日志大小。 lag Long 该副本当前落后hw的消息数。 响应示例 { "topic": "test", "partitions": [ { "partition": 0, "leader": 2, "replicas": [ { "broker": 2, "leader": true, "in_sync": true, "size": 123971146, "lag": 0 }, { "broker": 1, "leader": false, "in_sync": true, "size": 123971146, "lag": 0 }, { "broker": 0, "leader": false, "in_sync": true, "size": 123971146, "lag": 0 } ], "lso": 0, "leo": 13598, "hw": 13598, "last_update_timestamp": 1571477180985 }, { "partition": 2, "leader": 1, "replicas": [ { "broker": 1, "leader": true, "in_sync": true, "size": 123889531, "lag": 0 }, { "broker": 0, "leader": false, "in_sync": true, "size": 123889531, "lag": 0 }, { "broker": 2, "leader": false, "in_sync": true, "size": 123889531, "lag": 0 } ], "lso": 0, "leo": 13601, "hw": 13601, "last_update_timestamp": 1571477077146 }, { "partition": 1, "leader": 0, "replicas": [ { "broker": 0, "leader": true, "in_sync": true, "size": 127245604, "lag": 0 }, { "broker": 2, "leader": false, "in_sync": true, "size": 127245604, "lag": 0 }, { "broker": 1, "leader": false, "in_sync": true, "size": 127245604, "lag": 0 } ], "lso": 0, "leo": 13599, "hw": 13599, "last_update_timestamp": 1571477172959 } ], "group_subscribed": [ "test-consumer-group" ] }
  • URI GET /v2/{project_id}/instances/{instance_id}/topics 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID,获取方式请参见获取项目ID。 instance_id 是 String 实例ID。 表2 Query参数 参数 是否必选 参数类型 描述 offset 否 String 偏移量,表示从此偏移量开始查询, offset大于等于0。 limit 否 String 当次查询返回的最大实例个数,默认值为10,取值范围为1~50。
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 total Integer topic总数。 size Integer 分页查询的大小。 remain_partitions Integer 剩余分区数。 max_partitions Integer 分区总数。 topic_max_partitions Integer 单个topic最大占用分区数。 topics Array of TopicEntity objects topic列表。 表4 TopicEntity 参数 参数类型 描述 policiesOnly Boolean 是否为默认策略。 name String topic名称。 replication Integer 副本数,配置数据的可靠性。 partition Integer topic分区数,设置消费的并发数。 retention_time Integer 消息老化时间。 sync_replication Boolean 是否开启同步复制,开启后,客户端生产消息时相应的也要设置acks=-1,否则不生效,默认关闭。 sync_message_flush Boolean 是否使用同步落盘。默认值为false。同步落盘会导致性能降低。 external_configs Object 扩展配置。 topic_type Integer topic类型(0:普通Topic 1:系统(内部)Topic)。 topic_other_configs Array of topic_other_configs objects topic其他配置 topic_desc String topic描述 created_at Long topic创建时间 表5 topic_other_configs 参数 参数类型 描述 name String 配置名称 valid_values String 配置有效值 default_value String 配置默认值 config_type String 配置类型:dynamic/static value String 配置值 value_type String 配置值类型
  • 响应示例 状态码: 200 查询成功。 { "total" : 1, "size" : 0, "topics" : [ { "policiesOnly" : false, "name" : "Topic-test01", "replication" : 3, "partition" : 3, "retention_time" : 72, "sync_replication" : "false", "sync_message_flush" : "false", "topic_other_configs" : [ { "name" : "max.message.bytes", "valid_values" : "[0...10485760]", "default_value" : "10485760", "config_type" : "dynamic", "value" : "10485760", "value_type" : "int" }, { "name" : "message.timestamp.type", "valid_values" : "[CreateTime, LogAppendTime]", "default_value" : "LogAppendTime", "config_type" : "dynamic", "value" : "LogAppendTime", "value_type" : "string" } ], "external_configs" : { }, "topic_type" : 0, "topic_desc" : "This is a test topic", "created_at" : 1688112779916 } ], "remain_partitions" : 294, "max_partitions" : 300, "topic_max_partitions" : 200 }
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 users Array of ShowInstanceUsersEntity objects 用户列表。 表3 ShowInstanceUsersEntity 参数 参数类型 描述 user_name String 用户名称。 由英文字符开头,只能由英文字母、数字、中划线、下划线组成,长度为4~64的字符。 user_desc String 用户描述。 role String 用户角色。 default_app Boolean 是否为默认应用。 created_time Long 创建时间。
  • 响应示例 状态码: 200 查询成功。 { "users" : [ { "user_name" : "xxxa", "role" : "guest", "default_app" : false, "created_time" : 1615431764734 }, { "user_name" : "test", "role" : "guest", "default_app" : false, "created_time" : 1615364062463 }, { "user_name" : "ROOT", "role" : "guest", "default_app" : false, "created_time" : 1617194246328 } ] }
  • 响应消息 响应参数 参数说明见表3。 表3 参数说明 参数 类型 说明 topics Array Topic列表 表4 topics参数说明 参数 类型 说明 id String Topic名称 success Boolean 是否删除成功。 响应示例 { "topics" : [{ "id" : "haha", "success" : true }, { "id" : "aabb", "success" : true } ] }
  • 请求示例 批量重启实例。 POST https://{endpoint}/v2/{project_id}/instances/action { "action" : "restart", "instances" : [ "54602a9d-5e22-4239-9123-77e350df4a34", "7166cdea-dbad-4d79-9610-7163e6f8b640" ] } 批量删除实例。 POST https://{endpoint}/v2/{project_id}/instances/action { "action" : "delete", "instances" : [ "54602a9d-5e22-4239-9123-77e350df4a34", "7166cdea-dbad-4d79-9610-7163e6f8b640" ] } 删除所有创建失败的实例。 POST https://{endpoint}/v2/{project_id}/instances/action { "action" : "delete", "all_failure" : "kafka" }
  • 响应示例 状态码: 200 查询指定实例成功。 查询实例成功返回示例如下。 { "name" : "kafka-2085975099", "engine" : "kafka", "port" : 9092, "status" : "RUNNING", "type" : "cluster", "specification" : "100MB", "engine_version" : "1.1.0", "connect_address" : "192.168.0.100,192.168.0.61,192.168.0.72", "instance_id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "resource_spec_code" : "dms.instance.kafka.cluster.c3.mini", "charging_mode" : 1, "vpc_id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "vpc_name" : "dms-test", "created_at" : "1585618587087", "product_id" : "00300-30308-0--0", "security_group_id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "security_group_name" : "Sys-default", "subnet_id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "available_zones" : [ "38b0f7a602344246bcb0da47b5d548e7" ], "user_id" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "user_name" : "paas_dms", "kafka_manager_enable" : false, "kafka_manager_user" : "root", "maintain_begin" : "02:00:00", "maintain_end" : "06:00:00", "enable_log_collection" : false, "storage_space" : 492, "total_storage_space" : 600, "used_storage_space" : 25, "partition_num" : "300", "enable_publicip" : false, "ssl_enable" : false, "management_connect_address" : "https://192.168.0.100:9999", "cross_vpc_info" : "{\"192.168.0.61\":{\"advertised_ip\":\"192.168.0.61\",\"port\":9011,\"port_id\":\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"},\"192.168.0.72\":{\"advertised_ip\":\"192.168.0.72\",\"port\":9011,\"port_id\":\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"},\"192.168.0.100\":{\"advertised_ip\":\"192.168.0.100\",\"port\":9011,\"port_id\":\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"}}", "storage_resource_id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "storage_spec_code" : "dms.physical.storage.ultra", "service_type" : "advanced", "storage_type" : "hec", "enterprise_project_id" : "0", "is_logical_volume" : true, "extend_times" : 0, "retention_policy" : "produce_reject", "ipv6_enable" : false, "ipv6_connect_addresses" : [ ], "connector_enable" : false, "connector_id" : "", "rest_enable" : false, "rest_connect_address" : "", "kafka_public_status" : "closed", "public_bandwidth" : 0, "message_query_inst_enable" : true, "vpc_client_plain" : false, "support_features" : "kafka.new.pod.port,feature.physerver.kafka.topic.modify,feature.physerver.kafka.topic.accesspolicy,message_trace_enable,features.pod.token.access,feature.physerver.kafka.pulbic.dynamic,roma_app_enable,features.log.collection,auto_topic_switch,feature.physerver.kafka.user.manager", "trace_enable" : false, "agent_enable" : false, "pod_connect_address" : "100.86.75.15:9080,100.86.142.77:9080,100.86.250.167:9080", "disk_encrypted" : false, "kafka_private_connect_address" : "192.168.0.61:9092,192.168.0.100:9092,192.168.0.72:9092", "enable_auto_topic" : false, "ces_version" : "linux" }
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 name String 实例名称。 engine String 引擎。 engine_version String 版本。 description String 实例描述。 specification String 实例规格。 storage_space Integer 消息存储空间,单位:GB。 partition_num String Kafka实例的分区数量。 used_storage_space Integer 已使用的消息存储空间,单位:GB。 connect_address String 实例连接IP地址。 port Integer 实例连接端口。 status String 实例的状态。详细状态说明请参考实例状态说明。 instance_id String 实例ID。 resource_spec_code String 资源规格标识。 dms.instance.kafka.cluster.c3.mini:Kafka实例的基准带宽为100MByte/秒。 dms.instance.kafka.cluster.c3.small.2:Kafka实例的基准带宽为300MByte/秒。 dms.instance.kafka.cluster.c3.middle.2:Kafka实例的基准带宽为600MByte/秒。 dms.instance.kafka.cluster.c3.high.2:Kafka实例的基准带宽为1200MByte/秒。 charging_mode Integer 付费模式,1表示按需计费,0表示包年/包月计费。 vpc_id String VPC ID。 vpc_name String VPC的名称。 created_at String 完成创建时间。 格式为时间戳,指从格林威治时间 1970年01月01日00时00分00秒起至指定时间的偏差总毫秒数。 subnet_name String 子网名称。 subnet_cidr String 子网网段。 user_id String 用户ID。 user_name String 用户名。 access_user String 实例访问用户名。 order_id String 订单ID,只有在包周期计费时才会有order_id值,其他计费方式order_id值为空。 maintain_begin String 维护时间窗开始时间,格式为HH:mm:ss。 maintain_end String 维护时间窗结束时间,格式为HH:mm:ss。 enable_publicip Boolean 实例是否开启公网访问功能。 true:开启 false:未开启 management_connect_address String Kafka实例的Kafka Manager连接地址。 ssl_enable Boolean 是否开启安全认证。 true:开启 false:未开启 kafka_security_protocol String 开启SASL后使用的安全协议。 SASL_SSL: 采用SSL证书进行加密传输,支持账号密码认证,安全性更高。 SASL_PLAINTEXT: 明文传输,支持账号密码认证,性能更好,建议使用SC RAM -SHA-512机制。 sasl_enabled_mechanisms Array of strings 开启SASL后使用的认证机制。 PLAIN: 简单的用户名密码校验。 SCRAM-SHA-512: 用户凭证校验,安全性比PLAIN机制更高。 ssl_two_way_enable Boolean 是否开启双向认证。 cert_replaced Boolean 是否能够证书替换。 public_management_connect_address String 公网访问Kafka Manager连接地址。 enterprise_project_id String 企业项目ID。 is_logical_volume Boolean 实例扩容时用于区分老实例与新实例。 true:新创建的实例,允许磁盘动态扩容不需要重启。 false:老实例 extend_times Integer 实例扩容磁盘次数,如果超过20次则无法扩容磁盘。 enable_auto_topic Boolean 是否打开kafka自动创建topic功能。 true:开启 false:关闭 type String 实例类型:集群,cluster。 product_id String 产品标识。 security_group_id String 安全组ID。 security_group_name String 租户安全组名称。 subnet_id String 子网ID。 available_zones Array of strings 实例节点所在的可用区,返回“可用区ID”。 total_storage_space Integer 总共消息存储空间,单位:GB。 public_connect_address String 实例公网连接IP地址。当实例开启了公网访问,实例才包含该参数。 storage_resource_id String 存储资源ID。 storage_spec_code String IO规格。 service_type String 服务类型。 storage_type String 存储类型。 retention_policy String 消息老化策略。 kafka_public_status String Kafka公网开启状态。 public_bandwidth Integer kafka公网访问带宽。 kafka_manager_enable Boolean 是否已开启kafka manager kafka_manager_user String 登录Kafka Manager的用户名。 enable_log_collection Boolean 是否开启消息收集功能。 cross_vpc_info String 跨VPC访问信息。 ipv6_enable Boolean 是否开启ipv6。 ipv6_connect_addresses Array of strings IPv6的连接地址。 connector_enable Boolean 是否开启转储。新规格产品暂不支持开启转储。 connector_id String 转储任务ID。 rest_enable Boolean 是否开启Kafka rest功能。 rest_connect_address String Kafka rest连接地址。 public_boundwidth Integer kafka公网访问带宽。待删除版本。 message_query_inst_enable Boolean 是否开启消息查询功能。 vpc_client_plain Boolean 是否开启VPC明文访问。 support_features String Kafka实例支持的特性功能。 trace_enable Boolean 是否开启消息轨迹功能。 agent_enable Boolean 是否开启代理。 pod_connect_address String 租户侧连接地址。 disk_encrypted Boolean 是否开启磁盘加密。 disk_encrypted_key String 磁盘加密key,未开启磁盘加密时为空。 kafka_private_connect_address String Kafka实例私有连接地址。 ces_version String 云监控 版本。 public_access_enabled String 区分实例什么时候开启的公网访问:true,actived,closed,false。 node_num Integer 节点数。 enable_acl Boolean 是否开启访问控制。 new_spec_billing_enable Boolean 是否启用新规格计费。 broker_num Integer 节点数量。 tags Array of TagEntity objects 标签列表。 dr_enable Boolean 是否为容灾实例。 表3 TagEntity 参数 参数类型 描述 key String 标签键。 不能为空。 对于同一个实例,Key值唯一。 长度为1~128个字符(中文也可以输入128个字符)。 由任意语种字母、数字、空格和字符组成,字符仅支持_ . : = + - @ 首尾字符不能为空格。 value String 标签值。 长度为0~255个字符(中文也可以输入255个字符)。 由任意语种字母、数字、空格和字符组成,字符仅支持_ . : = + - @ 首尾字符不能为空格。
  • URI POST /v2/{project_id}/instances/{instance_id}/management/topics/{topic}/partitions-reassignment 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID,获取方式请参见获取项目ID。 instance_id 是 String 实例ID。 topic 是 String Topic名称。
  • 响应示例 状态码: 200 查询单个转储任务成功。 { "task_name" : "obsTransfer-56997523", "destination_type" : "OBS", "create_time" : 1628126621283, "status" : "RUNNING", "topics" : "topic-sdk-no-delete", "obs_destination_descriptor" : { "consumer_strategy" : "earliest", "destination_file_type" : "TEXT", "obs_bucket_name" : "testobs", "obs_path" : "obsTransfer-56997523", "partition_format" : "yyyy/MM/dd/HH/mm", "record_delimiter" : "", "deliver_time_interval" : 300, "obs_part_size" : 5242880 }, "topics_info" : [ { "topic" : "topic-sdk-no-delete", "partitions" : [ { "partition_id" : "2", "status" : "RUNNING", "last_transfer_offset" : "3", "log_end_offset" : "3", "lag" : "0" }, { "partition_id" : "1", "status" : "RUNNING", "last_transfer_offset" : "3", "log_end_offset" : "3", "lag" : "0" }, { "partition_id" : "0", "status" : "RUNNING", "last_transfer_offset" : "3", "log_end_offset" : "3", "lag" : "0" } ] } ] }
  • URI GET /v2/{project_id}/connectors/{connector_id}/sink-tasks/{task_id} 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID,获取方式请参见获取项目ID。 connector_id 是 String 实例转储ID。 请参考查询实例返回的数据。 task_id 是 String 转储任务ID。 表2 Query参数 参数 是否必选 参数类型 描述 topic-info 否 String 是否包含topic信息。默认是false。
  • 响应消息体(可选) 该部分可选。响应消息体通常以结构化格式(如JSON或XML)返回,与响应消息头中Content-type对应,传递除响应消息头之外的内容。 对于获取用户Token接口,返回如下消息体。为篇幅起见,这里只展示部分内容。 { "token": { "expires_at": "2019-02-13T06:52:13.855000Z", "methods": [ "password" ], "catalog": [ { "endpoints": [ { "region_id": "XXXXXX", ...... 当接口调用出错时,会返回错误码及错误信息说明,错误响应的Body体格式如下所示。 { "error_msg": "The format of message is error", "error_code": "AS.0001" } 其中,error_code表示错误码,error_msg表示错误描述信息。
  • 请求示例 创建一个Topic,Topic名称为test01。 POST https://{endpoint}/v2/{project_id}/instances/{instance_id}/topics { "id" : "test01", "partition" : 3, "replication" : 3, "retention_time" : 72, "sync_message_flush" : false, "sync_replication" : "false", "topic_other_configs" : [ { "name" : "message.timestamp.type", "value" : "LogAppendTime" }, { "name" : "max.message.bytes", "value" : 10485760 } ], "topic_desc" : "" }
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 id 是 String topic名称,长度为3-200,以字母开头且只支持大小写字母、中横线、下划线、点以及数字。 最小长度:3 最大长度:200 replication 否 Integer 副本数,配置数据的可靠性。 取值范围:1-3。 最小值:1 最大值:3 sync_message_flush 否 Boolean 是否使用同步落盘。默认值为false。同步落盘会导致性能降低。 partition 否 Integer topic分区数,设置消费的并发数。取值范围:1-100。 最小值:1 最大值:100 sync_replication 否 Boolean 是否开启同步复制,开启后,客户端生产消息时相应的也要设置acks=-1,否则不生效,默认关闭。 retention_time 否 Integer 消息老化时间。默认值为72。取值范围1~168,单位小时。 topic_other_configs 否 Array of topic_other_configs objects topic配置 数组长度:0 - 100 topic_desc 否 String topic描述 最小长度:0 最大长度:200 表3 topic_other_configs 参数 是否必选 参数类型 描述 name 否 String 配置名称 value 否 String 配置值
  • AK/SK认证 AK/SK签名认证方式仅支持消息体大小12M以内,12M以上的请求请使用Token认证。 AK/SK认证就是使用AK/SK对请求进行签名,在请求时将签名信息添加到消息头,从而通过身份认证。 AK(Access Key ID):访问密钥ID。与私有访问密钥关联的唯一标识符;访问密钥ID和私有访问密钥一起使用,对请求进行加密签名。 SK(Secret Access Key):与访问密钥ID结合使用的密钥,对请求进行加密签名,可标识发送方,并防止请求被修改。 使用AK/SK认证时,您可以基于签名算法使用AK/SK对请求进行签名,也可以使用专门的签名SDK对请求进行签名。详细的签名方法和SDK使用方法请参见API签名指南。 签名SDK只提供签名功能,与服务提供的SDK不同,使用时请注意。
  • Token认证 Token的有效期为24小时,需要使用一个Token鉴权时,可以先缓存起来,避免频繁调用。 Token在计算机系统中代表令牌(临时)的意思,拥有Token就代表拥有某种权限。Token认证就是在调用API的时候将Token加到请求消息头,从而通过身份认证,获得操作API的权限。Token可通过调用获取用户Token接口获取。 云服务存在两种部署方式:项目级服务和全局级服务。其中: 项目级服务需要获取项目级别的Token,此时请求body中auth.scope的取值为project。 全局级服务需要获取全局级别的Token,此时请求body中auth.scope的取值为domain。 调用本服务API需要project级别的Token,即调用获取用户Token接口时,请求body中auth.scope的取值需要选择project,如下所示。 { "auth": { "identity": { "methods": [ "password" ], "password": { "user": { "name": "username", "password": "********", "domain": { "name": "domainname" } } } }, "scope": { "project": { "name": "xxxxxxxx" } } } } 获取Token 后,再调用其他接口时,您需要在请求消息头中添加“X-Auth-Token”,其值即为Token。例如Token值为“ABCDEFJ....”,则调用接口时将“X-Auth-Token: ABCDEFJ....”加到请求消息头即可,如下所示。 POST https://iam.cn-north-4.myhuaweicloud.com/v3/auth/projects Content-Type: application/json X-Auth-Token: ABCDEFJ.... 您还可以通过这个视频教程了解如何使用Token认证:https://bbs.huaweicloud.com/videos/101333。
  • 请求示例 创建一个按需付费的Kafka实例,版本为2.7,规格为2U4G*3,300GB的存储空间。 POST https://{endpoint}/v2/{engine}/{project_id}/instances { "name" : "kafka-test", "description" : "", "engine" : "kafka", "engine_version" : "2.7", "storage_space" : 300, "vpc_id" : "********-9b4a-44c5-a964-************", "subnet_id" : "********-8fbf-4438-ba71-************", "security_group_id" : "********-e073-4aad-991f-************", "available_zones" : [ "********706d4c1fb0eb72f0********" ], "product_id" : "c6.2u4g.cluster", "ssl_enable" : true, "kafka_security_protocol" : "SASL_SSL", "sasl_enabled_mechanisms" : [ "SCRAM-SHA-512" ], "storage_spec_code" : "dms.physical.storage.ultra.v2", "broker_num" : 3, "arch_type" : "X86", "enterprise_project_id" : "0", "access_user" : "********", "password" : "********", "enable_publicip" : true, "tags" : [ { "key" : "aaa", "value" : "111" } ], "retention_policy" : "time_base", "disk_encrypted_enable" : true, "disk_encrypted_key" : "********-b953-4875-a743-************", "publicip_id" : "********-88fc-4a8c-86d0-************,********-16af-455d-8d54-************,********-3d69-4367-95ab-************", "vpc_client_plain" : true, "enable_auto_topic" : true } 创建一个包年包月的Kafka实例,版本为2.7,规格为2U4G*3,300GB的存储空间。 POST https://{endpoint}/v2/{engine}/{project_id}/instances { "name" : "kafka-test1", "description" : "", "engine" : "kafka", "engine_version" : "2.7", "storage_space" : 300, "vpc_id" : "********-9b4a-44c5-a964-************", "subnet_id" : "********-8fbf-4438-ba71-************", "security_group_id" : "********-e073-4aad-991f-************", "available_zones" : [ "********706d4c1fb0eb72f0********" ], "product_id" : "c6.2u4g.cluster", "ssl_enable" : true, "kafka_security_protocol" : "SASL_SSL", "sasl_enabled_mechanisms" : [ "SCRAM-SHA-512" ], "storage_spec_code" : "dms.physical.storage.ultra.v2", "broker_num" : 3, "arch_type" : "X86", "enterprise_project_id" : "0", "access_user" : "********", "password" : "********", "enable_publicip" : true, "tags" : [ { "key" : "aaa", "value" : "111" } ], "retention_policy" : "time_base", "publicip_id" : "********-88fc-4a8c-86d0-************,********-16af-455d-8d54-************,********-3d69-4367-95ab-************", "vpc_client_plain" : true, "enable_auto_topic" : true, "bss_param" : { "charging_mode" : "prePaid", "period_type" : "month", "period_num" : 1, "is_auto_pay" : true } }
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 topics 是 Array of AccessPolicyTopicEntity objects topic列表。 表3 AccessPolicyTopicEntity 参数 是否必选 参数类型 描述 name 是 String topic名称。 policies 是 Array of AccessPolicyEntity objects 权限列表。 表4 AccessPolicyEntity 参数 是否必选 参数类型 描述 user_name 否 String 用户名称。 设置用户权限时,为必选参数。 access_policy 否 String 权限类型。 all:拥有发布、订阅权限; pub:拥有发布权限; sub:拥有订阅权限。 设置用户权限时,为必选参数。
  • 请求示例 设置用户权限,为root用户授予发布和订阅topic-test的权限。 POST https://{endpoint}/v1/{project_id}/instances/{instance_id}/topics/accesspolicy { "topics" : [ { "name" : "topic-test", "policies" : [ { "user_name" : "root", "access_policy" : "all" } ] } ] }
  • 响应消息 响应参数 参数说明见表2。 表2 响应参数说明 参数 类型 说明 topic String Topic名称。 partition Integer 分区编号。 message_offset Long 最新消息位置。 timestamp Long 最新消息时间戳。 响应示例 { "topic": "mytest", "partition": 0, "message_offset": 9, "timestamp": 1568125039164 }
  • URI GET /v1.0/{project_id}/instances/{instance_id}/manage/topics/{topic}/partitions/{partition}/end-message 参数说明如下表所示。 表1 参数说明 参数 类型 必选 说明 project_id String 是 项目ID。 instance_id String 是 实例ID。 topic String 是 Topic名称。 partition Integer 是 分区编号。取值范围:0~19。
  • 标签管理 表9 标签管理 权限 对应API接口 授权项 IAM 项目(Project) 企业项目(Enterprise Project) 批量添加或删除实例标签 POST /v2/{project_id}/kafka/{instance_id}/tags/action dms:instance:modify √ √ 查询实例标签 GET /v2/{project_id}/kafka/{instance_id}/tags dms:instance:get √ √ 查询项目标签 GET /v2/{project_id}/kafka/tags dms:instance:get √ √
  • 用户管理 表6 用户管理 权限 对应API接口 授权项 IAM项目(Project) 企业项目(Enterprise Project) 查询用户列表 GET /v2/{project_id}/instances/{instance_id}/users dms:instance:get √ √ 创建用户 POST /v2/{project_id}/instances/{instance_id}/users dms:instance:modify √ √ 批量删除用户 PUT /v2/{project_id}/instances/{instance_id}/users dms:instance:modify √ √ 重置用户密码 PUT /v2/{project_id}/instances/{instance_id}/users/{user_name} dms:instance:get √ √ 查询用户权限 GET /v1/{project_id}/instances/{instance_id}/topics/{topic_name}/accesspolicy dms:instance:get √ √ 设置用户权限 POST /v1/{project_id}/instances/{instance_id}/topics/accesspolicy dms:instance:modify √ √
  • 后台任务管理 表8 后台任务管理 权限 对应API接口 授权项 IAM项目(Project) 企业项目(Enterprise Project) 查询实例的后台任务列表 GET /v2/{project_id}/instances/{instance_id}/tasks dms:instance:getBackgroundTask √ √ 查询后台任务管理中的指定记录 GET /v2/{project_id}/instances/{instance_id}/tasks/{task_id} dms:instance:getBackgroundTask √ √ 删除后台任务管理中的指定记录 DELETE /v2/{project_id}/instances/{instance_id}/tasks/{task_id} dms:instance:deleteBackgroundTask √ √
  • 生命周期管理 表1 生命周期管理 权限 对应API接口 授权项(Action) IAM项目 (Project) 企业项目 (Enterprise Project) 创建实例 POST /v2/{engine}/{project_id}/instances dms:instance:create √ √ 查询所有实例列表 GET /v2/{project_id}/instances dms:instance:list √ √ 查询指定实例 GET /v2/{project_id}/instances/{instance_id} dms:instance:get √ √ 删除指定的实例 DELETE /v2/{project_id}/instances/{instance_id} dms:instance:delete √ √ 修改实例信息 PUT /v2/{project_id}/instances/{instance_id} dms:instance:modify √ √ 批量重启或删除实例 POST /v2/{project_id}/instances/action 重启:dms:instance:modifyStatus 删除:dms:instance:delete √ √
  • 实例管理 表2 实例管理 权限 对应API接口 授权项(Action) IAM项目 (Project) 企业项目 (Enterprise Project) 重置密码 POST /v2/{project_id}/instances/{instance_id}/password dms:instance:resetAuthInfo √ √ 重置Manager密码 PUT /v2/{project_id}/instances/{instance_id}/kafka-manager-password dms:instance:resetAuthInfo √ √ 重启Manager PUT /v2/{project_id}/instances/{instance_id}/restart-kafka-manager dms:instance:modifyStatus √ √ 开启或关闭实例自动创建topic功能 POST /v2/{project_id}/instances/{instance_id}/autotopic dms:instance:modify √ √ 修改实例跨VPC访问的内网IP POST /v2/{project_id}/instances/{instance_id}/crossvpc/modify dms:instance:modify √ √ 重置消费组消费进度到指定位置 POST /v2/{project_id}/instances/{instance_id}/management/groups/{group}/reset-message-offset dms:instance:modify √ √
  • 主题管理 表5 主题管理 权限 对应API接口 授权项 IAM项目(Project) 企业项目(Enterprise Project) Kafka实例创建Topic POST /v2/{project_id}/instances/{instance_id}/topics dms:instance:modify √ √ Kafka实例查询Topic GET /v2/{project_id}/instances/{instance_id}/topics dms:instance:get √ √ 修改Kafka实例Topic PUT /v2/{project_id}/instances/{instance_id}/topics dms:instance:modify √ √ Kafka实例批量删除Topic POST /v2/{project_id}/instances/{instance_id}/topics/delete dms:instance:modify √ √
  • 转储管理 表3 转储管理 权限 对应API接口 授权项 IAM项目(Project) 企业项目(Enterprise Project) 创建实例的转储节点 POST /v2/{project_id}/instances/{instance_id}/connector dms:instance:connector √ √ 创建转储任务 POST /v2/{project_id}/connectors/{connector_id}/sink-tasks dms:instance:createConnectorSinkTask √ √ 查询转储任务列表 GET /v2/{project_id}/connectors/{connector_id}/sink-tasks dms:instance:listConnectorSinkTask √ √ 修改转储任务的配额 PUT /v2/{project_id}/connectors/{connector_id}/sink-tasks dms:instance:createConnectorSinkTask √ √ 查询单个转储任务 GET /v2/{project_id}/connectors/{connector_id}/sink-tasks/{task_id} dms:instance:getConnectorSinkTask √ √ 删除单个转储任务 POST /v2/{project_id}/connectors/{connector_id}/sink-tasks/{task_id} dms:instance:deleteConnectorSinkTask √ √
共100000条