华为云用户手册

  • URI GET /v1.0/{project_id}/instances?engine={engine}&name={name}&status={status}&id={id}&includeFailure={includeFailure}&exactMatchName={exactMatchName}&enterprise_project_id={enterprise_project_id} 参数说明见表1。 表1 参数说明 参数 类型 必选 说明 project_id String 是 项目ID。 engine String 否 消息引擎:kafka。 name String 否 实例名称。 id String 否 实例ID。 status String 否 实例状态。详细状态说明见实例状态说明。 includeFailure String 否 是否返回创建失败的实例数。 当参数值为“true”时,返回创建失败的实例数。参数值为“false”或者其他值,不返回创建失败的实例数。 exactMatchName String 否 是否按照实例名称进行精确匹配查询。 默认为“false”,表示模糊匹配实例名称查询。若参数值为“true”表示按照实例名称进行精确匹配查询。 enterprise_project_id String 否 企业项目ID。
  • URI GET /v1.0/{project_id}/instances/{instance_id}/manage/topics/{topic}/partitions/{partition}/beginning-message 参数说明如下表所示。 表1 参数说明 参数 类型 必选 说明 project_id String 是 项目ID。 instance_id String 是 实例ID。 topic String 是 Topic名称。 partition Integer 是 分区编号。
  • 响应消息 响应参数 参数说明见表2。 表2 响应参数说明 参数 类型 说明 topic String topic名称。 partition Integer 分区编号。 message_offset Long 最早消息位置。 timestamp Long 最早消息时间戳。 响应示例 { "topic": "mytest", "partition": 0, "message_offset ": 9, "timestamp": 1568125039164 }
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 user 否 String 用户名 client 否 String 客户端ID user-default 否 Boolean 是否使用用户默认设置(是则表示对全部用户限流)。 client-default 否 Boolean 是否使用客户端默认设置(是则表示对全部客户端限流)。 producer-byte-rate 否 Long 生产上限速率(单位为B/s) consumer-byte-rate 否 Long 消费上限速率(单位为B/s)
  • 请求示例 修改用户/客户端流控配置。 PUT https://{endpoint}/v2/kafka/{project_id}/instances/{instance_id}/kafka-user-client-quota { "user" : "", "client" : "", "user-default" : false, "client-default" : true, "producer-byte-rate" : 3145728, "consumer-byte-rate" : 2097152 }
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 cluster cluster object 集群基本信息。 表3 cluster 参数 参数类型 描述 controller String 控制器ID。 brokers Array of brokers objects 节点列表。 topics_count Integer 主题数量。 partitions_count Integer 分区数量。 online_partitions_count Integer 在线分区数量。 replicas_count Integer 副本数量。 isr_replicas_count Integer ISR(In-Sync Replicas) 副本总数。 consumers_count Integer 消费组数量。 表4 brokers 参数 参数类型 描述 host String 节点IP。 port Integer 端口号。 broker_id String 节点ID。 is_controller Boolean 是否为contoller节点。 version String 服务端版本。 register_time Long broker注册时间,为unix时间戳格式。 is_health Boolean Kafka实例节点的连通性是否正常。
  • 响应示例 状态码: 200 查询Kafka集群元数据信息成功。 { "cluster" : { "controller" : "2", "brokers" : [ { "host" : "192.168.0.159", "port" : 9093, "broker_id" : "0", "is_controller" : false, "version" : "1.1.0", "register_time" : 1588754647872, "is_health" : true }, { "host" : "192.168.0.48", "port" : 9093, "broker_id" : "1", "is_controller" : false, "version" : "1.1.0", "register_time" : 1588754647653, "is_health" : true }, { "host" : "192.168.0.212", "port" : 9093, "broker_id" : "2", "is_controller" : true, "version" : "1.1.0", "register_time" : 1588754647284, "is_health" : true } ], "topics_count" : 3, "partitions_count" : 9, "online_partitions_count" : 9, "replicas_count" : 27, "isr_replicas_count" : 27, "consumers_count" : 0 } }
  • 修订记录 发布日期 修订记录 2023-11-10 本次变更如下: 新增获取实例配置和修改实例配置接口。 2023-07-26 本次变更如下: 新增查询Topic的分区列表和查询Topic的当前生产者列表接口。 2023-06-06 本次变更如下: 新增创建消费组接口。 2023-04-23 本次变更如下: 新增Kafka实例批量删除Group接口。 2023-02-03 本次变更如下: 更新创建实例、实例规格变更和查询实例的扩容规格列表的URI,支持实例新规格。 2022-06-30 本次变更如下: 在创建实例的“specification”参数中,增加新规格描述。 在创建实例中,新增“broker_num”参数。 2022-01-26 本次变更如下: 查询产品规格列表V2接口变更为新版本,旧版本接口移入历史API中。 2021-12-14 本次变更如下: 在权限和授权项中,将授权项明细接口从V1改为V2。 2021-09-13 本次变更如下: 在修改Kafka实例Topic中,增加Topic名称不能修改的描述。 2021-08-16 本次变更如下: 修改Kafka实例创建Topic和新增Kafka实例指定Topic分区的分区数最大值。 2021-05-11 本次变更如下: 修改开启或关闭实例自动创建topic功能的返回状态码和返回描述。 2021-04-16 新增以下接口: 查询用户列表 创建用户 批量删除用户 重置用户密码 查询用户权限 设置用户权限 2020-08-25 新增以下接口: 创建实例的转储节点 创建转储任务 查询转储任务列表 修改转储任务的配额 查询单个转储任务 删除单个转储任务 查询实例的扩容规格列表 实例规格变更 2020-08-18 新增以下接口: 重置密码 重置Manager密码 开启或关闭实例自动创建topic功能 修改实例跨VPC访问的内网IP 修改Kafka实例Topic 查询实例的后台任务列表 查询后台任务管理中的指定记录 删除后台任务管理中的指定记录 批量添加或删除实例标签 查询实例标签 查询项目标签 2020-08-06 本次变更如下: 将API V1移动至历史API。 2020-07-07 本次变更如下: 新增API V2(推荐)章节的V2接口。 2019-12-10 新增以下接口: 查询分区指定偏移量的消息 查询分区指定时间段的消息 查询分区最新消息的位置 查询分区最早消息的位置 查询Kafka集群元数据信息 查询消费组信息 重置消费组消费进度到指定位置 查询实例在CES的监控层级关系 查询Kafka实例所有消费组对应的协调器信息 新增Kafka实例指定Topic分区 调整Kafka实例Topic分区的副本 2019-06-04 第一次正式发布。
  • 响应消息 响应参数 参数说明见表2。 表2 参数说明 参数 类型 说明 coordinators Array 所有消费组对应的协调器列表。参数参见表3。 表3 coordinators参数说明 参数 类型 说明 group_id String 消费组ID。 id Integer 对应协调器的broker id。 host String 对应协调器的地址。 port Integer 端口号。 响应示例 { "coordinators": [ { "group_id": "XXXX", "id": 2, "host": "172.31.1.15", "port": 9091 }, { "group_id": "XXXX", "id": 2, "host": "172.31.1.15", "port": 9092 }, { "group_id": "XXXX", "id": 2, "host": "172.31.1.15", "port": 9092 } ] }
  • 响应示例 状态码: 200 查询Kafka实例的协调器信息成功。 { "coordinators" : [ { "group_id" : "XXXX", "id" : 2, "host" : "172.31.1.15", "port" : 9091 }, { "group_id" : "XXXX", "id" : 2, "host" : "172.31.1.15", "port" : 9092 }, { "group_id" : "XXXX", "id" : 2, "host" : "172.31.1.15", "port" : 9092 } ] }
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 coordinators Array of coordinators objects 所有消费组对应的协调器列表。 表3 coordinators 参数 参数类型 描述 group_id String 消费组ID。 id Integer 对应协调器的broker id。 host String 对应协调器的地址。 port Integer 端口号。
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 topic 否 String topic名称。 partition 是 Integer 分区编号,默认值为-1,若传入值为-1,则重置所有分区。 message_offset 否 Long 重置消费进度到指定偏移量。 如果传入offset小于当前最小的offset,则重置到最小的offset。 如果大于最大的offset,则重置到最大的offset。 message_offset、timestamp二者必选其一。 timestamp 否 Long 重置消费进度到指定时间,格式为unix时间戳,单位为毫秒。 如果传入timestamp早于当前最早的timestamp,则重置到最早的timestamp。 如果晚于最晚的timestamp,则重置到最晚的timestamp。 message_offset、timestamp二者必选其一。
  • URI POST /v2/{project_id}/instances/{instance_id}/management/groups/{group}/reset-message-offset 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID,获取方式请参见获取项目ID。 instance_id 是 String 实例ID。 group 是 String 消费组名称。
  • 请求示例 重置的消费进度到指定偏移量。 POST https://{endpoint}/v2/{project_id}/instances/{instance_id}/management/groups/{group}/reset-message-offset { "topic" : "test", "partition" : 0, "message_offset" : 10 } 重置的消费进度到指定时间。 POST https://{endpoint}/v2/{project_id}/instances/{instance_id}/management/groups/{group}/reset-message-offset { "topic" : "test", "partition" : 0, "timestamp" : 1571812144000 }
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 reassignments 是 Array of PartitionReassignEntity objects 重平衡分配方案。 throttle 否 Integer 重平衡门限值。 is_schedule 否 Boolean 是否作为定时任务执行。若非定时执行,则is_schedule 和execute_at字段可为空;若为定时执行,is_schedule为true,execute_at字段非空。 execute_at 否 Long 定时时间,格式为Unix时间戳,单位为毫秒 表3 PartitionReassignEntity 参数 是否必选 参数类型 描述 topic 是 String topic名称 brokers 否 Array of integers 分区重平衡到的broker列表,自动生成分配方案时需指定该参数。 replication_factor 否 Integer 副本因子,自动生成分配方案时可指定。 assignment 否 Array of TopicAssignment objects 手动指定的分配方案。brokers参数与该参数不能同时为空。 表4 TopicAssignment 参数 是否必选 参数类型 描述 partition 否 Integer 手动指定分配方案时的分区号。 partition_brokers 否 Array of integers 手动指定某个分区将要分配的broker列表
  • 请求示例 POST https://{endpoint}/v2/kafka/{project_id}/instances/{instance_id}/reassign { "reassignments" : [ { "topic" : "topic-1513476102", "brokers" : [ 0, 1, 2 ], "replication_factor" : 3, "assignment" : [ { "partition" : 0, "partition_brokers" : [ 0, 1, 2 ] }, { "partition" : 1, "partition_brokers" : [ 1, 2, 0 ] }, { "partition" : 2, "partition_brokers" : [ 2, 0, 1 ] } ] }, { "topic" : "topic-1513558717", "brokers" : [ 0, 1, 4 ], "replication_factor" : 3, "assignment" : [ { "partition" : 0, "partition_brokers" : [ 0, 1, 2 ] }, { "partition" : 1, "partition_brokers" : [ 1, 2, 0 ] }, { "partition" : 2, "partition_brokers" : [ 2, 0, 1 ] } ] } ], "throttle" : 10000000 }
  • 实例状态说明 表1 实例状态说明 状态 说明 Creating 申请实例后,在实例状态进入运行中之前的状态。 Running 实例正常运行状态。在这个状态的实例可以运行您的业务。 Faulty 实例处于故障的状态。 Restarting 实例正在进行重启操作。 Starting 实例从已冻结到运行中的中间状态。 Changing 实例正在进行规格变更操作。 Change failed 实例处于规格变更操作失败的状态。 Frozen 实例处于已冻结状态,用户可以在“我的订单”中续费开启冻结的实例。 Freezing 实例从运行中到已冻结的中间状态。 Upgrading 实例正在进行升级操作。 Rolling back 实例正在进行回滚操作。 父主题: 附录
  • 响应消息 响应参数 参数说明见表2。 表2 响应参数说明 参数 类型 说明 group_id String 消费组名称。 state String 消费组状态。包含以下状态: Dead:消费组内没有任何成员,且没有任何元数据。 Empty:消费组内没有任何成员,存在元数据。 PreparingRebalance:准备开启rebalance。 CompletingRebalance:所有成员加入group。 Stable:消费组内成员可正常消费。 coordinator_id Integer 协调器编号 members Array of object members 消费者列表。参数参见表3。 group_message_offsets Array of group_offsets 消费进度。参数参见表4。 assignment_strategy String 分区分配策略。 表3 members参数说明 参数 类型 说明 host String 消费组consumer地址。 assignment Array of object assignment consumer分配到的分区信息。参数请参见表5。 member_id String 消费组consumer的ID。 client_id String 客户端ID。 表4 group_message_offsets参数说明 参数 类型 说明 topic String topic名称。 partition Integer 分区编号。 message_current_offset Long 当前消费进度。 message_log_end_offset Long 最大消息位置(LEO)。 lag Long 剩余可消费消息数,即消息堆积数。 表5 assignment参数说明 参数 类型 说明 topic String topic名称。 partitions Array of integer 分区列表。 响应示例 { "group": { "members": [ { "host": "/172.31.1.102", "assignment": [ { "topic": "test", "partitions": [ 0, 1, 2 ] } ], "member_id": "consumer-1-6b8ee551-d499-47d4-9beb-ba1527496785", "client_id": "consumer-1" } ], "state": "STABLE", "group_id": "test-consumer-group", "coordinator_id": 2, "group_message_offsets": [ { "partition": 0, "lag": 31396, "topic": "test", "message_current_offset": 935, "message_log_end_offset": 32331 }, { "partition": 0, "lag": 0, "topic": "aaaa", "message_current_offset": 0, "message_log_end_offset ": 0 }, { "partition": 1, "lag": 31279, "topic": "test", "message_current_offset": 1058, "message_log_end_offset ": 32337 }, { "partition": 1, "lag": 0, "topic": "aaaa", "message_current_offset": 0, "message_log_end_offset": 0 }, { "partition": 2, "lag": 31603, "topic": "test", "message_current_offset": 739, "message_log_end_offset": 32342 } ], "assignment_strategy": "range" } }
  • 响应示例 状态码: 200 查询实例集群的消费组信息成功。 { "group" : { "members" : [ { "host" : "/172.31.1.102", "assignment" : [ { "topic" : "test", "partitions" : [ 0, 1, 2 ] } ], "member_id" : "consumer-1-6b8ee551-d499-47d4-9beb-ba1527496785", "client_id" : "consumer-1" } ], "state" : "STABLE", "group_id" : "test-consumer-group", "coordinator_id" : 2, "group_message_offsets" : [ { "partition" : 0, "lag" : 31396, "topic" : "test", "message_current_offset" : 935, "message_log_end_offset" : 32331 }, { "partition" : 0, "lag" : 0, "topic" : "aaaa", "message_current_offset" : 0, "message_log_end_offset" : 0 }, { "partition" : 1, "lag" : 31279, "topic" : "test", "message_current_offset" : 1058, "message_log_end_offset" : 32337 }, { "partition" : 1, "lag" : 0, "topic" : "aaaa", "message_current_offset" : 0, "message_log_end_offset" : 0 }, { "partition" : 2, "lag" : 31603, "topic" : "test", "message_current_offset" : 739, "message_log_end_offset" : 32342 } ], "assignment_strategy" : "range" } }
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 group group object 消费组信息。 表3 group 参数 参数类型 描述 group_id String 消费组名称。 state String 消费组状态。包含以下状态: Dead:消费组内没有任何成员,且没有任何元数据。 Empty:消费组内没有任何成员,存在元数据。 PreparingRebalance:准备开启rebalance。 CompletingRebalance:所有成员加入group。 Stable:消费组内成员可正常消费。 coordinator_id Integer 协调器编号。 members Array of members objects 消费者列表。 group_message_offsets Array of group_message_offsets objects 消费进度。 assignment_strategy String 分区分配策略。 表4 members 参数 参数类型 描述 host String 消费组consumer地址。 assignment Array of assignment objects consumer分配到的分区信息。 member_id String 消费组consumer的ID。 client_id String 客户端ID。 表5 assignment 参数 参数类型 描述 topic String topic名称。 partitions Array of integers 分区列表。 表6 group_message_offsets 参数 参数类型 描述 partition Integer 分区编号。 lag Long 剩余可消费消息数,即消息堆积数。 topic String topic名称。 message_current_offset Long 当前消费进度。 message_log_end_offset Long 最大消息位置(LEO)。
  • 请求消息 请求参数 表2 参数说明 参数 类型 必选 说明 topic String 是 topic名称。 partition Integer 否 分区编号,默认值为-1,若传入值为-1,则重置所有分区。 message_offset Long 二者必选其一 重置的消费进度到指定偏移量,如果传入offset小于当前最小的offset,则重置到最小的offset,如果大于最大的offset,则重置到最大的offset。 timestamp Long 重置的消费进度到指定时间,格式为unix时间戳。如果传入timestamp早于当前最早的timestamp,则重置到最早的timestamp,如果晚于最晚的timestamp,则重置到最晚的timestamp。 请求示例1 { "topic": "test", "partition": 0, "message_offset": 10 } 请求示例2 { "topic": "test", "partition": 0, "timestamp": 1571812144 }
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 topic String topic名称。 partitions Array of partitions objects 分区列表。 group_subscribed Array of strings 订阅该topic的消费组名称列表。 表3 partitions 参数 参数类型 描述 partition Integer 分区ID。 leader Integer leader副本所在节点的id。 leo Integer 分区leader副本的LEO(Log End Offset)。 hw Integer 分区高水位(HW,High Watermark)。 lso Integer 分区leader副本的LSO(Log Start Offset)。 last_update_timestamp Long 分区上次写入消息的时间。 格式为Unix时间戳。 单位:毫秒。 replicas Array of replicas objects 副本列表。 表4 replicas 参数 参数类型 描述 broker Integer 副本所在的节点ID。 leader Boolean 该副本是否为leader。 in_sync Boolean 该副本是否在ISR副本中。 size Integer 该副本当前日志大小。单位:Byte。 lag Long 该副本当前落后hw的消息数。
  • 响应示例 状态码: 200 查询成功。 { "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" ] }
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 dimensions Array of dimensions objects 监控维度。 instance_ids Array of instance_ids objects 实例信息。 nodes Array of nodes objects 节点信息。 queues Array of queues objects 队列信息。 groups Array of groups objects 消费组信息。 表3 dimensions 参数 参数类型 描述 name String 监控维度名称。 metrics Array of strings 监控指标名称。 key_name Array of strings 监控查询使用的key。 dim_router Array of strings 监控维度路由。 children Array of children objects 子维度列表。 表4 children 参数 参数类型 描述 name String 子维度名称。 metrics Array of strings 监控指标名称列表。 key_name Array of strings 监控查询使用的key。 dim_router Array of strings 监控维度路由。 表5 instance_ids 参数 参数类型 描述 name String 实例ID。 表6 nodes 参数 参数类型 描述 name String 节点名称。 表7 queues 参数 参数类型 描述 name String topic名称。 partitions Array of partitions objects 分区列表。 表8 partitions 参数 参数类型 描述 name String 分区名称。 表9 groups 参数 参数类型 描述 name String 消费组名称。 queues Array of queues objects topic信息。 表10 queues 参数 参数类型 描述 name String topic名称。 partitions Array of partitions objects 分区信息。 表11 partitions 参数 参数类型 描述 name String 分区名称。
  • 响应示例 状态码: 200 查询成功。 { "dimensions" : [ { "name" : "kafka_instance_id", "metrics" : [ "current_partitions", "current_topics", "group_messages" ], "key_name" : [ "instance_ids" ], "dim_router" : [ "kafka_instance_id" ] }, { "name" : "kafka_broker", "metrics" : [ "broker_data_size", "broker_messages_in_rate", "broker_bytes_out_rate", "broker_bytes_in_rate", "broker_produce_mean", "broker_fetch_mean" ], "key_name" : [ "nodes" ], "dim_router" : [ "kafka_instance_id", "kafka_broker" ] }, { "name" : "kafka_rest", "metrics" : [ "rest_produce_success", "rest_produce_failed", "rest_produce_latency", "rest_produce_msg_num", "rest_produce_flow", "rest_consume_success", "rest_consume_failed", "rest_consume_latency", "rest_consume_msg_num", "rest_consume_flow", "rest_commit_success", "rest_commit_failed", "rest_commit_latency", "rest_commit_msg_num", "rest_commit_flow" ], "key_name" : [ "nodes" ], "dim_router" : [ "kafka_instance_id", "kafka_rest" ] }, { "name" : "kafka_topics", "metrics" : [ "topic_data_size", "topic_messages_in_rate", "topic_bytes_out_rate", "topic_bytes_in_rate", "topic_messages" ], "key_name" : [ "queues" ], "dim_router" : [ "kafka_instance_id", "kafka_topics" ], "children" : [ { "name" : "kafka_partitions", "metrics" : [ "produced_messages", "partition_messages" ], "key_name" : [ "queues", "partitions" ], "dim_router" : [ "kafka_instance_id", "kafka_topics", "kafka_partitions" ] } ] }, { "name" : "kafka_groups_partitions", "metrics" : [ "messages_consumed", "messages_remained" ], "key_name" : [ "groups", "queues", "partitions" ], "dim_router" : [ "kafka_instance_id", "kafka_groups", "kafka_groups_topics", "kafka_groups_partitions" ] } ], "instance_ids" : [ { "name" : "68f3f6a0-3741-453b-bda9-a6ff6b5bb6f7" } ], "nodes" : [ { "name" : "broker-0" }, { "name" : "broker-1" }, { "name" : "broker-2" } ], "queues" : [ { "name" : "aaaa", "partitions" : [ { "name" : "0" } ] }, { "name" : "mytest", "partitions" : [ { "name" : "0" }, { "name" : "1" }, { "name" : "2" } ] }, { "name" : "topic-84234378", "partitions" : [ { "name" : "0" }, { "name" : "1" }, { "name" : "2" } ] } ], "groups" : [ { "name" : "test-consumer-group", "queues" : [ { "name" : "mytest", "partitions" : [ { "name" : "0" }, { "name" : "1" }, { "name" : "2" } ] } ] } ] }
  • 响应消息 响应参数 参数说明见表1、表2。 表1 参数说明 参数 类型 说明 region_id String 区域ID。 available_zones Array 可用区数组,具体请参考表2。 表2 available_zones参数说明 参数 类型 说明 soldOut Boolean 是否售罄。 id String 可用区ID。 code String 可用区编码。 name String 可用区名称。 port String 可用区端口号。 resource_availability String 分区上是否还有可用资源。 true:还有资源。 false:资源已售罄。 响应示例 { regionId: "XXXX", available_zones:[ { "id":"1d7b939b382c4c3bb3481a8ca10da768", "name":"az10.dc1", "code":"az10.dc1", "port":"8002", "resource_availability": "true" }, { "id":"1d7b939b382c4c3bb3481a8ca10da769", "name":"az10.dc2", "code":"az10.dc2", "port":"8002", "resource_availability": "true" } ] }
  • 请求示例 修改实例的连接空闲超时和日志删除的时间阈值。 PUT https://{endpoint}/v2/{project_id}/instances/{instance_id}/configs { "kafka_configs" : [ { "name" : "connections.max.idle.ms", "value" : "500000" }, { "name" : "log.retention.hours", "value" : "66" } ] }
  • 响应消息 响应参数 参数说明见表表1、表2 表1 响应参数说明 参数 类型 说明 maintain_windows Array 支持的维护时间窗列表 表2 maintain_windows参数说明 参数 类型 说明 seq Integer 序号。 begin String 维护时间窗开始时间。 end String 维护时间窗结束时间。 default Boolean 是否为默认时间段。 响应示例 { "maintain_windows": [{ "default": false, "seq": 1, "begin": "22:00:00", "end": "02:00:00" }, { "default": true, "seq": 2, "begin": "02:00:00", "end": "06:00:00" }, { "default": false, "seq": 3, "begin": "06:00:00", "end": "10:00:00" }, { "default": false, "seq": 4, "begin": "10:00:00", "end": "14:00:00" }, { "default": false, "seq": 5, "begin": "14:00:00", "end": "18:00:00" }, { "default": false, "seq": 6, "begin": "18:00:00", "end": "22:00:00" }] }
  • 响应示例 状态码: 200 查询产品规格列表成功。 { "Hourly" : [ { "name" : "kafka", "version" : "1.1.0", "values" : [ { "detail" : [ { "tps" : "50000", "storage" : "200", "partition_num" : "300", "product_id" : "00300-30308-0--0", "spec_code" : "dms.instance.kafka.cluster.c3.mini", "io" : [ { "io_type" : "normal", "storage_spec_code" : "dms.physical.storage.normal", "available_zones" : [ "cn-north-7b", "cn-north-7a", "cn-north-7c" ], "volume_type" : "SATA" }, { "io_type" : "high", "storage_spec_code" : "dms.physical.storage.high", "unavailable_zones" : [ "cn-north-7b", "cn-north-7a", "cn-north-7c" ], "available_zones" : [ ], "volume_type" : "SAS" }, { "io_type" : "ultra", "storage_spec_code" : "dms.physical.storage.ultra", "unavailable_zones" : [ "cn-north-7b", "cn-north-7a", "cn-north-7c" ], "available_zones" : [ ], "volume_type" : "SSD" } ], "bandwidth" : "100MB", "unavailable_zones" : [ "cn-north-7b", "cn-north-7a" ], "available_zones" : [ "cn-north-7c" ], "ecs_flavor_id" : "s6.large.2", "arch_type" : "X86" }, { "tps" : "100000", "storage" : "1200", "partition_num" : "900", "product_id" : "00300-30310-0--0", "spec_code" : "dms.instance.kafka.cluster.c3.small.2", "io" : [ { "io_type" : "normal", "storage_spec_code" : "dms.physical.storage.normal", "available_zones" : [ "cn-north-7b", "cn-north-7a", "cn-north-7c" ], "volume_type" : "SATA" }, { "io_type" : "high", "storage_spec_code" : "dms.physical.storage.high", "unavailable_zones" : [ "cn-north-7b", "cn-north-7a", "cn-north-7c" ], "available_zones" : [ ], "volume_type" : "SAS" }, { "io_type" : "ultra", "storage_spec_code" : "dms.physical.storage.ultra", "unavailable_zones" : [ "cn-north-7b", "cn-north-7a", "cn-north-7c" ], "available_zones" : [ ], "volume_type" : "SSD" } ], "bandwidth" : "300MB", "unavailable_zones" : [ "cn-north-7b", "cn-north-7a" ], "available_zones" : [ "cn-north-7c" ], "ecs_flavor_id" : "c3.medium.2", "arch_type" : "X86" } ], "name" : "cluster", "unavailable_zones" : [ "cn-north-7b", "cn-north-7a" ], "available_zones" : [ "cn-north-7c" ] } ] } ], "Monthly" : [ { "name" : "kafka", "version" : "1.1.0", "values" : [ { "detail" : [ { "tps" : "50000", "storage" : "200", "partition_num" : "300", "product_id" : "00300-30309-0--0", "spec_code" : "dms.instance.kafka.cluster.c3.mini", "io" : [ { "io_type" : "normal", "storage_spec_code" : "dms.physical.storage.normal", "available_zones" : [ "cn-north-7b", "cn-north-7a", "cn-north-7c" ], "volume_type" : "SATA" }, { "io_type" : "high", "storage_spec_code" : "dms.physical.storage.high", "unavailable_zones" : [ "cn-north-7b", "cn-north-7a", "cn-north-7c" ], "available_zones" : [ ], "volume_type" : "SAS" }, { "io_type" : "ultra", "storage_spec_code" : "dms.physical.storage.ultra", "unavailable_zones" : [ "cn-north-7b", "cn-north-7a", "cn-north-7c" ], "available_zones" : [ ], "volume_type" : "SSD" } ], "bandwidth" : "100MB", "unavailable_zones" : [ "cn-north-7b", "cn-north-7a" ], "available_zones" : [ "cn-north-7c" ], "ecs_flavor_id" : "s6.large.2", "arch_type" : "X86" }, { "tps" : "100000", "storage" : "1200", "partition_num" : "900", "product_id" : "00300-30311-0--0", "spec_code" : "dms.instance.kafka.cluster.c3.small.2", "io" : [ { "io_type" : "normal", "storage_spec_code" : "dms.physical.storage.normal", "available_zones" : [ "cn-north-7b", "cn-north-7a", "cn-north-7c" ], "volume_type" : "SATA" }, { "io_type" : "high", "storage_spec_code" : "dms.physical.storage.high", "unavailable_zones" : [ "cn-north-7b", "cn-north-7a", "cn-north-7c" ], "available_zones" : [ ], "volume_type" : "SAS" }, { "io_type" : "ultra", "storage_spec_code" : "dms.physical.storage.ultra", "unavailable_zones" : [ "cn-north-7b", "cn-north-7a", "cn-north-7c" ], "available_zones" : [ ], "volume_type" : "SSD" } ], "bandwidth" : "300MB", "unavailable_zones" : [ "cn-north-7b", "cn-north-7a" ], "available_zones" : [ "cn-north-7c" ], "ecs_flavor_id" : "c3.medium.2", "arch_type" : "X86" } ], "name" : "cluster", "unavailable_zones" : [ "cn-north-7b", "cn-north-7a" ], "available_zones" : [ "cn-north-7c" ] } ] } ] }
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 Hourly Array of Hourly objects 表示按需付费的产品列表。 Monthly Array of Monthly objects 表示包年包月的产品列表。当前暂不支持通过API创建包年包月的Kafka实例。 表3 Hourly 参数 参数类型 描述 name String 消息引擎的名称,该字段显示为kafka。 version String 消息引擎的版本,当前支持1.1.0、2.3.0和2.7。 values Array of values objects 产品规格列表。 表4 values 参数 参数类型 描述 detail Array of detail objects 规格详情。 name String 实例类型。 unavailable_zones Array of strings 资源售罄的可用区列表。 available_zones Array of strings 有可用资源的可用区列表。 表5 detail 参数 参数类型 描述 tps String 单位时间内的消息量最大值。 storage String 消息存储空间。 partition_num String Kafka实例的分区数量。 product_id String 产品ID。 spec_code String 规格ID。 io Array of io objects IO信息。 bandwidth String Kafka实例的基准带宽。 unavailable_zones Array of strings 资源售罄的可用区列表。 available_zones Array of strings 有可用资源的可用区列表。 ecs_flavor_id String 该产品规格对应的虚拟机规格。 arch_type String 实例规格架构类型。当前仅支持X86。 表6 io 参数 参数类型 描述 io_type String IO类型。 storage_spec_code String IO规格。 available_zones Array of strings IO未售罄的可用区列表。 unavailable_zones Array of strings IO已售罄的不可用区列表。 volume_type String 磁盘类型。 表7 Monthly 参数 参数类型 描述 name String 消息引擎的名称,该字段显示为kafka。 version String 消息引擎的版本,当前支持1.1.0、2.3.0和2.7。 values Array of values objects 产品规格列表。 表8 values 参数 参数类型 描述 detail Array of detail objects 规格详情。 name String 实例类型。 unavailable_zones Array of strings 资源售罄的可用区列表。 available_zones Array of strings 有可用资源的可用区列表。 表9 detail 参数 参数类型 描述 tps String 单位时间内的消息量最大值。 storage String 消息存储空间。 partition_num String Kafka实例的分区数量。 product_id String 产品ID。 spec_code String 规格ID。 io Array of io objects IO信息。 bandwidth String Kafka实例的基准带宽。 unavailable_zones Array of strings 资源售罄的可用区列表。 available_zones Array of strings 有可用资源的可用区列表。 ecs_flavor_id String 该产品规格对应的虚拟机规格。 arch_type String 实例规格架构类型。当前仅支持X86。 表10 io 参数 参数类型 描述 io_type String IO类型。 storage_spec_code String IO规格。 available_zones Array of strings IO未售罄的可用区列表。 unavailable_zones Array of strings IO已售罄的不可用区列表。 volume_type String 磁盘类型。
共100000条