华为云用户手册

  • 响应示例 状态码: 200 查询成功 { "id": "8a9e6a5d-8d65-48fb-a40c-5150c8479da8", "key": "string", "labels": { "key1": "value1", "key2": "value2" }, "value": "string", "value_type": "text", "status": "enabled", "create_time": 1623139038, "update_time": 1623139038, "create_revision": 13, "update_revision": 13 }
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 Authorization 否 String 若ServiceComb引擎专享版开启了安全认证,此参数必填。否则,无此参数。 开启了安全认证的ServiceComb引擎专享版Token,格式为: Authorization:Bearer {Token} Token获取方法,请参考获取ServiceComb引擎专享版用户Token。
  • 请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 Content-Type 是 String 该字段内容填为 "application/json;charset=UTF-8"。 X-Auth-Token 是 String 用户Token。 x-engine-id 是 String 微服务引擎专享版的实例ID。 X-Enterprise-Project-ID 是 String 企业项目ID。
  • 响应参数 状态码: 200 表5 响应Body参数 参数 参数类型 描述 services Array of DelServicesRspInfo objects 需要删除的服务信息列表。 表6 DelServicesRspInfo 参数 参数类型 描述 serviceId String 微服务id。 状态码: 400 表7 响应Body参数 参数 参数类型 描述 errorCode String 错误代码。 errorMessage String 错误信息。 detail String 详细定位信息。 状态码: 500 表8 响应Body参数 参数 参数类型 描述 errorCode String 错误代码。 errorMessage String 错误信息。 detail String 详细定位信息。
  • 请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 Authorization 否 String 若ServiceComb引擎专享版开启了安全认证,此参数必填。否则,无此参数。 开启了安全认证的ServiceComb引擎专享版Token,格式为: Authorization:Bearer {Token} Token获取方法,请参考获取ServiceComb引擎专享版用户Token。 表4 请求Body参数 参数 是否必选 参数类型 描述 serviceIds 是 Array of strings 服务ID列表,获取方法请参考查询所有微服务信息。
  • URI DELETE /v4/{project_id}/registry/microservices 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 请填固定值:default。 表2 Query参数 参数 是否必选 参数类型 描述 force 否 Boolean 是否强制删除。 true表示强制删除,false表示非强制删除。 选择强制删除会自动注销所有服务实例,并且删除相关的服务依赖关系。如果未传此参数,那么在服务拥有实例时,无法被删除。 缺省值:false。
  • 响应参数 状态码: 400 表3 响应Body参数 参数 参数类型 描述 errorCode String 错误代码。 errorMessage String 错误信息。 detail String 详细定位信息。 状态码: 500 表4 响应Body参数 参数 参数类型 描述 errorCode String 错误代码。 errorMessage String 错误信息。 detail String 详细定位信息。
  • URI PUT /v4/{project_id}/registry/microservices/{service_id}/instances/{instance_id}/heartbeat 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 请填固定值:default。 service_id 是 String 微服务唯一标识。字符长度为1~64,正则表达式为^.*$。获取方法请参考查询所有微服务信息。 instance_id 是 String 微服务实例唯一标识。字符长度不超过64位, 正则表达式为^[A-Za-z0-9_.-]*$。获取方法请参考根据service_id查询微服务实例。
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 Authorization 否 String 若ServiceComb引擎专享版开启了安全认证,此参数必填。否则,无此参数。 开启了安全认证的ServiceComb引擎专享版Token,格式为: Authorization:Bearer {Token} Token获取方法,请参考获取ServiceComb引擎专享版用户Token。
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 imagePullPolicy String 拉取OCI镜像的行为 枚举值: UNSPECIFIED_POLICY IfNotPresent Always imagePullSecret String 拉取OCI 镜像的凭据 phase String 确定插件将在过滤器链中的何处注入。 枚举值: UNSPECIFIED_PHASE AUTHN AUTHZ STATS pluginConfig Object 传递给插件的配置。 pluginName String 插件名。 priority Integer 插件的调用优先级。 sha256 String 用于校验插件和容器的校验和。 url String 插件或容器的下载地址。 verificationKey String 校验值。
  • 响应示例 状态码: 200 查询实例的扩容规格列表成功。 { "engine" : "kafka", "versions" : [ "1.1.0", "2.7" ], "products" : [ { "type" : "cluster", "product_id" : "c6.2u4g.cluster", "ecs_flavor_id" : "c3.large.2", "arch_types" : [ "X86" ], "charging_mode" : [ "monthly", "hourly" ], "ios" : [ { "io_spec" : "dms.physical.storage.high.v2", "available_zones" : [ "xxx" ], "type" : "evs", "unavailable_zones" : [ ] }, { "io_spec" : "dms.physical.storage.ultra.v2", "available_zones" : [ "xxx" ], "type" : "evs", "unavailable_zones" : [ ] } ], "support_features" : [ { "name" : "connector_obs", "properties" : { "max_task" : "10", "max_node" : "10", "min_task" : "1", "min_node" : "2" } } ], "properties" : { "max_partition_per_broker" : "250", "max_broker" : "30", "max_storage_per_node" : "10000", "max_consumer_per_broker" : "4000", "min_broker" : "3", "product_alias" : "kafka.2u4g.cluster", "max_bandwidth_per_broker" : "100", "min_storage_per_node" : "100", "max_tps_per_broker" : "30000" }, "available_zones" : [ "xxx" ], "unavailable_zones" : [ ] }, { "type" : "cluster", "product_id" : "c6.2u4g.cluster.dec", "ecs_flavor_id" : "c6.large.2", "arch_types" : [ "X86" ], "charging_mode" : [ "monthly", "hourly" ], "ios" : [ { "io_spec" : "dms.physical.storage.high.dss.v2", "available_zones" : [ "xxx" ], "type" : "evs", "unavailable_zones" : [ ] }, { "io_spec" : "dms.physical.storage.ultra.dss.v2", "available_zones" : [ "xxx" ], "type" : "evs", "unavailable_zones" : [ ] }, { "io_spec" : "dms.physical.storage.ultra.v2", "available_zones" : [ "xxx" ], "type" : "evs", "unavailable_zones" : [ ] }, { "io_spec" : "dms.physical.storage.high.v2", "available_zones" : [ "xxx" ], "type" : "evs", "unavailable_zones" : [ ] } ], "support_features" : [ { "name" : "connector_obs", "properties" : { "max_task" : "10", "max_node" : "10", "min_task" : "1", "min_node" : "2" } } ], "properties" : { "max_partition_per_broker" : "100", "max_broker" : "30", "max_storage_per_node" : "400", "max_consumer_per_broker" : "4000", "min_broker" : "3", "product_alias" : "kafka.2u4g.cluster.dec", "max_bandwidth_per_broker" : "100", "min_storage_per_node" : "100", "max_tps_per_broker" : "30000" }, "available_zones" : [ ], "unavailable_zones" : [ "xxx" ] }, { "type" : "cluster", "product_id" : "c6.4u8g.cluster", "ecs_flavor_id" : "c3.xlarge.2", "arch_types" : [ "X86" ], "charging_mode" : [ "monthly", "hourly" ], "ios" : [ { "io_spec" : "dms.physical.storage.high.v2", "available_zones" : [ "xxx" ], "type" : "evs", "unavailable_zones" : [ ] }, { "io_spec" : "dms.physical.storage.ultra.v2", "available_zones" : [ "xxx" ], "type" : "evs", "unavailable_zones" : [ ] } ], "support_features" : [ { "name" : "connector_obs", "properties" : { "max_task" : "10", "max_node" : "10", "min_task" : "1", "min_node" : "2" } } ], "properties" : { "max_partition_per_broker" : "500", "max_broker" : "30", "max_storage_per_node" : "20000", "max_consumer_per_broker" : "4000", "min_broker" : "3", "product_alias" : "kafka.4u8g.cluster", "max_bandwidth_per_broker" : "100", "min_storage_per_node" : "100", "max_tps_per_broker" : "100000" }, "available_zones" : [ "xxx" ], "unavailable_zones" : [ ] }, { "type" : "cluster", "product_id" : "c6.8u16g.cluster", "ecs_flavor_id" : "c3.2xlarge.2", "arch_types" : [ "X86" ], "charging_mode" : [ "monthly", "hourly" ], "ios" : [ { "io_spec" : "dms.physical.storage.high.v2", "available_zones" : [ "xxx" ], "type" : "evs", "unavailable_zones" : [ ] }, { "io_spec" : "dms.physical.storage.ultra.v2", "available_zones" : [ "xxx" ], "type" : "evs", "unavailable_zones" : [ ] } ], "support_features" : [ { "name" : "connector_obs", "properties" : { "max_task" : "10", "max_node" : "10", "min_task" : "1", "min_node" : "2" } } ], "properties" : { "max_partition_per_broker" : "1000", "max_broker" : "30", "max_storage_per_node" : "30000", "max_consumer_per_broker" : "4000", "min_broker" : "3", "product_alias" : "kafka.8u16g.cluster", "max_bandwidth_per_broker" : "100", "min_storage_per_node" : "100", "max_tps_per_broker" : "150000" }, "available_zones" : [ "xxx" ], "unavailable_zones" : [ ] }, { "type" : "cluster", "product_id" : "c6.12u24g.cluster", "ecs_flavor_id" : "c3.3xlarge.2", "arch_types" : [ "X86" ], "charging_mode" : [ "monthly", "hourly" ], "ios" : [ { "io_spec" : "dms.physical.storage.high.v2", "available_zones" : [ "xxx" ], "type" : "evs", "unavailable_zones" : [ ] }, { "io_spec" : "dms.physical.storage.ultra.v2", "available_zones" : [ "xxx" ], "type" : "evs", "unavailable_zones" : [ ] } ], "support_features" : [ { "name" : "connector_obs", "properties" : { "max_task" : "10", "max_node" : "10", "min_task" : "1", "min_node" : "2" } } ], "properties" : { "max_partition_per_broker" : "1500", "max_broker" : "30", "max_storage_per_node" : "30000", "max_consumer_per_broker" : "4000", "min_broker" : "3", "product_alias" : "kafka.12u24g.cluster", "max_bandwidth_per_broker" : "100", "min_storage_per_node" : "100", "max_tps_per_broker" : "200000" }, "available_zones" : [ "xxx" ], "unavailable_zones" : [ ] }, { "type" : "cluster", "product_id" : "c6.16u32g.cluster", "ecs_flavor_id" : "c3.4xlarge.2", "arch_types" : [ "X86" ], "charging_mode" : [ "monthly", "hourly" ], "ios" : [ { "io_spec" : "dms.physical.storage.high.v2", "available_zones" : [ "xxx" ], "type" : "evs", "unavailable_zones" : [ ] }, { "io_spec" : "dms.physical.storage.ultra.v2", "available_zones" : [ "xxx" ], "type" : "evs", "unavailable_zones" : [ ] } ], "support_features" : [ { "name" : "connector_obs", "properties" : { "max_task" : "10", "max_node" : "10", "min_task" : "1", "min_node" : "2" } } ], "properties" : { "max_partition_per_broker" : "2000", "max_broker" : "30", "max_storage_per_node" : "30000", "max_consumer_per_broker" : "4000", "min_broker" : "3", "product_alias" : "kafka.16u32g.cluster", "max_bandwidth_per_broker" : "100", "min_storage_per_node" : "100", "max_tps_per_broker" : "250000" }, "available_zones" : [ "xxx" ], "unavailable_zones" : [ ] } ] }
  • URI GET /v2/{engine}/{project_id}/instances/{instance_id}/extend 表1 路径参数 参数 是否必选 参数类型 描述 engine 是 String 消息引擎。 project_id 是 String 项目ID,获取方式请参见获取项目ID。 instance_id 是 String 实例ID。 表2 Query参数 参数 是否必选 参数类型 描述 type 是 String 产品的类型。 advanced: 专享版
  • 响应示例 状态码: 200 获取实例配置成功。 { "kafka_configs" : [ { "name" : "min.insync.replicas", "valid_values" : "1~3", "default_value" : "1", "config_type" : "dynamic", "value" : "1", "value_type" : "integer" }, { "name" : "message.max.bytes", "valid_values" : "0~10485760", "default_value" : "10485760", "config_type" : "dynamic", "value" : "10485760", "value_type" : "integer" }, { "name" : "auto.create.groups.enable", "valid_values" : "true,false", "default_value" : "true", "config_type" : "dynamic", "value" : "true", "value_type" : "enum" }, { "name" : "connections.max.idle.ms", "valid_values" : "5000~600000", "default_value" : "600000", "config_type" : "static", "value" : "600000", "value_type" : "integer" }, { "name" : "log.retention.hours", "valid_values" : "1~168", "default_value" : "72", "config_type" : "static", "value" : "72", "value_type" : "integer" }, { "name" : "max.connections.per.ip", "valid_values" : "100~20000", "default_value" : "1000", "config_type" : "dynamic", "value" : "1000", "value_type" : "integer" }, { "name" : "group.max.session.timeout.ms", "valid_values" : "6000~1800000", "default_value" : "1800000", "config_type" : "static", "value" : "1800000", "value_type" : "integer" }, { "name" : "unclean.leader.election.enable", "valid_values" : "true,false", "default_value" : "false", "config_type" : "dynamic", "value" : "false", "value_type" : "enum" }, { "name" : "default.replication.factor", "valid_values" : "1~3", "default_value" : "3", "config_type" : "static", "value" : "3", "value_type" : "integer" }, { "name" : "offsets.retention.minutes", "valid_values" : "1440~30240", "default_value" : "20160", "config_type" : "dynamic", "value" : "20160", "value_type" : "integer" }, { "name" : "num.partitions", "valid_values" : "1~200", "default_value" : "3", "config_type" : "static", "value" : "3", "value_type" : "integer" }, { "name" : "group.min.session.timeout.ms", "valid_values" : "6000~300000", "default_value" : "6000", "config_type" : "static", "value" : "6000", "value_type" : "integer" } ] }
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 kafka_configs Array of InstanceConfig objects kafka配置列表。 表3 InstanceConfig 参数 参数类型 描述 name String 配置名称。 valid_values String 有效值。 default_value String 默认值。 config_type String 配置类型:static/dynamic。 value String 配置当前值。 value_type String 值类型。
  • 请求消息 请求参数 参数说明见表2。 表2 参数说明 参数 类型 是否必选 说明 id String 是 topic名称,长度为4-64,以字母开头且只支持大小写字母、中横线、下划线以及数字。 partition Integer 否 topic分区数,设置消费的并发数。 默认值为3,取值范围为1~100。 replication Integer 否 副本数,配置数据的可靠性 默认值为3,取值范围为1~3。 sync_replication Boolean 否 是否开启同步复制,开启后,客户端生产消息时相应的也要设置acks=-1,否则不生效。 默认关闭。 retention_time Integer 否 消息老化时间。默认值为72。 取值范围1~720,单位小时。 sync_message_flush Boolean 否 是否使用同步落盘。默认值为false。同步落盘会导致性能降低。 请求示例 POST https://{dms_endpoint}/v1.0/{project_id}/instances/{instance_id}/topics { "id" : "haha", "partition" : 3, "replication" : 3, "sync_replication " : true, "retention_time" : 10, "sync_message_flush" : true }
  • 响应消息 响应参数 参数说明见表2。 表2 响应参数说明 参数 类型 说明 dimensions Array of object dimensions 监控维度。参数参考表3。 instance_ids Array of object instance_ids 实例信息。参数参考表4。 nodes Array of object nodes 节点信息。参数参考表5。 queues Array of object queues 队列信息。参数参考表6。 groups Array of object groups 消费组信息。参数参考表7。 表3 dimensions参数说明 参数 类型 说明 name String 监控维度名称。 metrics Array of object metrics 监控指标名称。参数参考表10。 key_name Array of object key_name 监控查询使用的key。 dim_router Array of object dim_router 监控维度路由。 children Array of object children 子维度列表。参数参考表8。 表4 instance_ids参数说明 参数 类型 说明 name String 实例ID。 表5 nodes参数说明 参数 类型 说明 name String 节点名称。 表6 queues参数说明 参数 类型 说明 name String topic名称。 partitions Array of object partitions 分区列表。参数参见表9。 表7 groups参数说明 参数 类型 说明 name String 消费组名称。 queues Array of object queues 队列信息。 表8 children参数说明 参数 类型 说明 name String 子维度名称。 metrics Array of String 监控指标名称列表。参数参见表10。 key_name Array of String 监控查询使用的key。 dim_router Array of String 监控维度路由 表9 partitions参数说明 参数 类型 说明 name String 分区id 表10 metrics说明 维度 指标ID 说明 kafka_instance_id (kafka实例维度) current_topics topic个数 current_partitions 分区个数 group_messages 消费组堆积消息数 kafka_broker(kafka节点维度) broker_data_size 节点数据容量 broker_messages_in_rate 消息生产速率,每秒生产的消息数量 broker_bytes_out_rate 消费流量,每秒消费的字节数 broker_bytes_in_rate 生产流量,每秒生产的字节数 broker_public_bytes_in_rate 公网入流量,每秒节点公网访问流入流量 broker_public_bytes_out_rate 公网出流量,每秒节点公网访问流出流量 broker_produce_mean 消息生产平均处理时长,服务端处理消息生产请求平均时长 broker_fetch_mean 消息消费平均处理时长,服务端处理消息消费请求平均时长 kafka_topics(kafka topic维度) topic_data_size 队列数据容量,当前队列的数据容量 topic_messages_in_rate 消息生产速率,每秒钟生产的消息数量 topic_bytes_out_rate 消费流量,每秒钟消费的字节数 topic_bytes_in_rate 生产流量,每秒钟生产的字节数 topic_messages 队列消息总数,当前队列的总消息数 kafka_partitions(kafka分区维度) produced_messages 生产消息数,已经生产的消息数 partition_messages 分区消息数,分区当前的消息数 messages_consumed 分区已消费消息数,当前消费组已经消费的消息个数 messages_remained 分区剩余可消费数,消费组剩余可消费的消息个数 kafka_groups_partitions(kafka消费组维度) messages_consumed 分区已消费消息数,当前消费组已经消费的消息个数 messages_remained 分区剩余可消费消息数,当前消费组剩余可消费的消息个数 响应示例 { "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所示 表1 状态码 状态码 编码 错误码说明 100 Continue 继续请求。 这个临时响应用来通知客户端,它的部分请求已经被服务器接收,且仍未被拒绝。 101 Switching Protocols 切换协议。只能切换到更高级的协议。 例如,切换到HTTP的新版本协议。 200 OK 请求成功。 201 Created 创建类的请求完全成功。 202 Accepted 已经接受请求,但未处理完成。 203 Non-Authoritative Information 非授权信息,请求成功。 204 NoContent 请求完全成功,同时HTTP响应不包含响应体。 在响应OPTIONS方法的HTTP请求时返回此状态码。 205 Reset Content 重置内容,服务器处理成功。 206 Partial Content 服务器成功处理了部分GET请求。 300 Multiple Choices 多种选择。请求的资源可包括多个位置,相应可返回一个资源特征与地址的列表用于用户终端(例如:浏览器)选择。 301 Moved Permanently 永久移动,请求的资源已被永久的移动到新的URI,返回信息会包括新的URI。 302 Found 资源被临时移动。 303 See Other 查看其它地址。 使用GET和POST请求查看。 304 Not Modified 所请求的资源未修改,服务器返回此状态码时,不会返回任何资源。 305 Use Proxy 所请求的资源必须通过代理访问。 306 Unused 已经被废弃的HTTP状态码。 400 BadRequest 非法请求。 建议直接修改该请求,不要重试该请求。 401 Unauthorized 在客户端提供认证信息后,返回该状态码,表明服务端指出客户端所提供的认证信息不正确或非法。 402 Payment Required 保留请求。 403 Forbidden 请求被拒绝访问。 返回该状态码,表明请求能够到达服务端,且服务端能够理解用户请求,但是拒绝做更多的事情,因为该请求被设置为拒绝访问,建议直接修改该请求,不要重试该请求。 404 NotFound 所请求的资源不存在。 建议直接修改该请求,不要重试该请求。 405 MethodNotAllowed 请求中带有该资源不支持的方法。 建议直接修改该请求,不要重试该请求。 406 Not Acceptable 服务器无法根据客户端请求的内容特性完成请求。 407 Proxy Authentication Required 请求要求代理的身份认证,与401类似,但请求者应当使用代理进行授权。 408 Request Time-out 服务器等候请求时发生超时。 客户端可以随时再次提交该请求而无需进行任何更改。 409 Conflict 服务器在完成请求时发生冲突。 返回该状态码,表明客户端尝试创建的资源已经存在,或者由于冲突请求的更新操作不能被完成。 410 Gone 客户端请求的资源已经不存在。 返回该状态码,表明请求的资源已被永久删除。 411 Length Required 服务器无法处理客户端发送的不带Content-Length的请求信息。 412 Precondition Failed 未满足前提条件,服务器未满足请求者在请求中设置的其中一个前提条件。 413 Request Entity Too Large 由于请求的实体过大,服务器无法处理,因此拒绝请求。为防止客户端的连续请求,服务器可能会关闭连接。如果只是服务器暂时无法处理,则会包含一个Retry-After的响应信息。 414 Request-URI Too Large 请求的URI过长(URI通常为网址),服务器无法处理。 415 Unsupported Media Type 服务器无法处理请求附带的媒体格式。 416 Requested range not satisfiable 客户端请求的范围无效。 417 Expectation Failed 服务器无法满足Expect的请求头信息。 422 UnprocessableEntity 请求格式正确,但是由于含有语义错误,无法响应。 429 TooManyRequests 表明请求超出了客户端访问频率的限制或者服务端接收到多于它能处理的请求。建议客户端读取相应的Retry-After首部,然后等待该首部指出的时间后再重试。 500 InternalServerError 表明服务端能被请求访问到,但是不能理解用户的请求。 501 Not Implemented 服务器不支持请求的功能,无法完成请求。 502 Bad Gateway 充当网关或代理的服务器,从远端服务器接收到了一个无效的请求。 503 ServiceUnavailable 被请求的服务无效。 建议直接修改该请求,不要重试该请求。 504 ServerTimeout 请求在给定的时间内无法完成。客户端仅在为请求指定超时(Timeout)参数时会得到该响应。 505 HTTP Version not supported 服务器不支持请求的HTTP协议的版本,无法完成处理。 父主题: 附录
  • 调用API获取项目ID 项目ID可以通过调用查询指定条件下的项目信息API获取。 获取项目ID的接口为“GET https://{Endpoint}/v3/projects”,其中{Endpoint}为IAM的终端节点,可以从地区和终端节点获取。接口的认证鉴权请参见认证鉴权。 响应示例如下,其中projects下的“id”即为项目ID。 { "projects": [ { "domain_id": "65382450e8f64ac0870cd180d14e684b", "is_domain": false, "parent_id": "65382450e8f64ac0870cd180d14e684b", "name": "xxx-xxx-xxx", "description": "", "links": { "next": null, "previous": null, "self": "https://www.example.com/v3/projects/a4a5d4098fb4474fa22cd05f897d6b99" }, "id": "a4a5d4098fb4474fa22cd05f897d6b99", "enabled": true } ], "links": { "next": null, "previous": null, "self": "https://www.example.com/v3/projects" } }
  • 响应消息 响应参数 表2 响应参数说明 参数 类型 说明 cluster Object of cluster 集群基本信息。参数请查看表3。 表3 cluster参数说明 参数 类型 说明 controller String 控制器ID。 brokers Array Object of brokers 节点列表。参数请查看表4。 topics_count Integer 总topic数量。 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 Boolean 服务端版本。 register_time Long broker注册时间,为unix时间戳格式。 is_health Boolean Kafka实例节点的连通性是否正常。 响应示例 { "cluster": { "controller": "1", "brokers": [ { "broker_id": "1", "is_controller": true, "version": "1.1.0", "register_time": 1569059680711, "is_health": true }, { "broker_id": "2", "is_controller": false, "version": "1.1.0", "register_time": 1569059684548, "is_health": true } ], "topics_count": 4, "partitions_count": 13, "online_partitions_count": 12, "replicas_count": 31, "isr_replicas_count": 21, "consumers_count": 7 } }
  • 请求示例 创建一个转储任务,转储topic-test中的数据到OBS。 POST https://{endpoint}/v2/{project_id}/connectors/{connector_id}/sink-tasks { "source_type" : "BLOB", "task_name" : "obsTransfer-1122976956", "destination_type" : "OBS", "obs_destination_descriptor" : { "consumer_strategy" : "earliest", "destination_file_type" : "TEXT", "access_key" : "XXXXXXXXXXXXXXXXXXXX", "secret_key" : "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "obs_bucket_name" : "6666", "obs_path" : "obsTransfer-1122976956", "partition_format" : "yyyy/MM/dd/HH/mm", "record_delimiter" : "", "deliver_time_interval" : 300, "topics" : "topic-test" } }
  • URI GET /v2/{project_id}/instances/{instance_id}/management/topics/{topic}/partitions/{partition}/end-message 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID,获取方式请参见获取项目ID。 instance_id 是 String 实例ID。 topic 是 String Topic名称。 Topic名称必现以字母开头且只支持大小写字母、中横线、下划线以及数字。 partition 是 Integer 分区编号。
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 total Integer 总条数 最小值:0 最大值:10000 producers Array of producers objects 生产者列表 数组长度:0 - 50 表4 producers 参数 参数类型 描述 producer_address String 生产者地址 最小长度:0 最大长度:64 broker_address String broker地址 最小长度:0 最大长度:64 join_time Long 加入时间 最小值:0 最大值:9223372036854775807
  • URI GET /v2/{project_id}/kafka/instances/{instance_id}/topics/{topic}/producers 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID,获取方式请参见获取项目ID。 最小长度:1 最大长度:64 instance_id 是 String 实例id 最小长度:1 最大长度:64 topic 是 String 主题 最小长度:1 最大长度:200 表2 Query参数 参数 是否必选 参数类型 描述 offset 否 Integer 偏移量,表示查询该偏移量后面的记录 最小值:0 最大值:10000 limit 否 Integer 查询返回记录的数量限制 最小值:1 最大值:50
  • 响应示例 状态码: 200 查询topic的当前生产者列表成功 { "total" : 3, "producers" : [ { "producer_address" : "192.0.0.149:40443", "broker_address" : "192.0.0.146:9092", "join_time" : 1687204743328 }, { "producer_address" : "192.0.0.149:13807", "broker_address" : "192.0.0.80:9092", "join_time" : 1687204745939 }, { "producer_address" : "192.0.0.149:31876", "broker_address" : "192.0.0.71:9092", "join_time" : 1687204744934 } ] }
  • 响应示例 状态码: 200 查询成功。 { "messages" : [ { "topic" : "topic-test", "partition" : 0, "value" : "hello world", "size" : 21, "timestamp" : 1607598463502, "huge_message" : false, "message_offset" : 4, "message_id" : "", "app_id" : "", "tag" : "" } ], "total" : 1, "size" : 1 }
  • 请求示例 查询消息偏移量。 GET https://{endpoint}/v2/{project_id}/instances/{instance_id}/messages?asc=false&end_time=1608609032042&limit=10&offset=0&start_time=1608608432042&topic=topic-test 查询消息内容。 GET https://{endpoint}/v2/{project_id}/instances/{instance_id}/messages?download=false&message_offset=0&partition=0&topic=topic-test
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 messages Array of MessagesEntity objects 消息列表。 total Long 消息总条数。 size Long 每页消息条数。 表4 MessagesEntity 参数 参数类型 描述 topic String topic名称。 partition Integer 消息所在的分区。 key String 消息key。 value String 消息内容。 size Integer 消息大小。 timestamp Long 生产消息的时间。 格式为Unix时间戳。单位为毫秒。 huge_message Boolean 大数据标识。 message_offset Long 消息偏移量。 message_id String 消息ID。 app_id String 应用ID。 tag String 消息标签。 状态码: 400 表5 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误描述。 状态码: 403 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误描述。
  • URI GET /v2/{project_id}/instances/{instance_id}/messages 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID,获取方式请参见获取项目ID。 instance_id 是 String 实例ID。 表2 Query参数 参数 是否必选 参数类型 描述 topic 是 String Topic名称。 Topic名称必现以字母开头且只支持大小写字母、中横线、下划线以及数字。 asc 否 Boolean 是否按照时间排序。 start_time 否 String 开始时间。 Unix毫秒时间戳。 查询消息偏移量时,为必选参数。 end_time 否 String 结束时间。 Unix毫秒时间戳。 查询消息偏移量时,为必选参数。 limit 否 String 每一页显示的message数量。 offset 否 String 页数。 download 否 Boolean 是否下载。 message_offset 否 String 消息偏移量。 查询消息内容时,为必选参数。 若start_time、end_time参数不为空,该参数无效。 partition 否 String 分区。 查询消息内容时,为必选参数。 若start_time、end_time参数不为空,该参数无效。 keyword 否 String 关键词。 取值范围为0~50。 最小长度:0 最大长度:50
  • 功能介绍 在创建kafka实例时,需要配置订购的产品ID(即product_id),可通过该接口查询产品规格。 例如,要订购按需计费、基准带宽为100MB的kafka实例,可从接口响应消息中,查找Hourly的消息体,然后找到bandwidth为100MB的记录对应的product_id,该product_id的值即是创建上述kafka实例时需要配置的产品ID。 同时,unavailable_zones字段表示资源不足的可用区列表,如果为空,则表示所有可用区都有资源,如果不为空,则表示字段值的可用区没有资源。所以必须确保您购买的资源所在的可用区有资源,不在该字段列表内。
  • 响应消息 响应参数 Hourly或者Monthly的参数说明见表3。 表2 参数说明 参数 类型 说明 Hourly Array 表示按需付费的产品列表。 Monthly Array 表示包年包月的产品列表。当前暂不支持通过API创建包年包月的kafka实例。 表3 参数说明 参数 类型 说明 name String 消息引擎的名称,该字段显示为kafka。 version String 消息引擎的版本,当前支持1.1.0、2.3.0和2.7。 values Array 产品规格列表。具体参数,请参见表4。 表4 values参数说明 参数 类型 说明 detail Array 规格详情。具体参数,请参见表5。 name String 实例类型。 unavailable_zones Array 资源售罄的可用区。 available_zones Array 有可用资源的可用区。 表5 Kafka实例的detail参数说明 参数 类型 说明 tps String 单位时间内的消息量最大值。 storage String 消息存储空间。 partition_num String Kafka实例的最大Topic数。 product_id String 产品ID。 spec_code String 规格ID。 io Array IO信息。具体参数,请参见表6。 bandwidth String Kafka实例的基准带宽。 available_zones Array 实例资源未售罄的可用区。 ecs_flavor_id String 该产品规格对应的虚拟机规格。 arch_type String 实例规格架构类型。当前仅支持X86。 表6 io参数说明 参数 类型 说明 io_type String IO类型。 storage_spec_code String IO规格。 available_zones Array IO未售罄的可用区。 unavailable_zones Array of strings IO已售罄的不可用区列表。 volume_type String 磁盘类型。 响应示例 { "Hourly": [{ "name": "kafka", "version": "XXX", "values": [{ "detail": [{ "tps": "50000", "storage": "600", "partition_num": "300", "product_id": "00300-30308-0--0", "spec_code": "dms.instance.kafka.cluster.c3.mini", "io": [{ "io_type": "high", "storage_spec_code": "dms.physical.storage.high", "volume_type": "SAS" }, { "io_type": "ultra", "storage_spec_code": "dms.physical.storage.ultra", "volume_type": "SSD" }], "bandwidth": "100MB", "unavailable_zones": [], "ecs_flavor_id": "c3.large.2" }, { "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": "high", "storage_spec_code": "dms.physical.storage.high", "volume_type": "SAS" }, { "io_type": "ultra", "storage_spec_code": "dms.physical.storage.ultra", "volume_type": "SSD" }], "bandwidth": "300MB", "unavailable_zones": [], "ecs_flavor_id": "c3.xlarge.2" }, { "tps": "200000", "storage": "2400", "partition_num": "1800", "product_id": "00300-30312-0--0", "spec_code": "dms.instance.kafka.cluster.c3.middle.2", "io": [{ "io_type": "ultra", "storage_spec_code": "dms.physical.storage.ultra", "volume_type": "SSD" }], "bandwidth": "600MB", "unavailable_zones": [], "ecs_flavor_id": "c3.2xlarge.2" }, { "tps": "300000", "storage": "4800", "partition_num": "1800", "product_id": "00300-30314-0--0", "spec_code": "dms.instance.kafka.cluster.c3.high.2", "io": [{ "io_type": "ultra", "storage_spec_code": "dms.physical.storage.ultra", "volume_type": "SSD" }], "bandwidth": "1200MB", "unavailable_zones": [], "ecs_flavor_id": "c3ne.2xlarge.2" }], "name": "cluster", "unavailable_zones": [] }] }], "Monthly": [{ "name": "kafka", "version": "XXX", "values": [{ "detail": [{ "tps": "50000", "storage": "600", "partition_num": "300", "product_id": "00300-30309-0--0", "spec_code": "dms.instance.kafka.cluster.c3.mini", "io": [{ "io_type": "high", "storage_spec_code": "dms.physical.storage.high", "volume_type": "SAS" }, { "io_type": "ultra", "storage_spec_code": "dms.physical.storage.ultra", "volume_type": "SSD" }], "bandwidth": "100MB", "unavailable_zones": [], "ecs_flavor_id": "c3.large.2" }, { "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": "high", "storage_spec_code": "dms.physical.storage.high", "volume_type": "SAS" }, { "io_type": "ultra", "storage_spec_code": "dms.physical.storage.ultra", "volume_type": "SSD" }], "bandwidth": "300MB", "unavailable_zones": [], "ecs_flavor_id": "c3.xlarge.2" }, { "tps": "200000", "storage": "2400", "partition_num": "1800", "product_id": "00300-30313-0--0", "spec_code": "dms.instance.kafka.cluster.c3.middle.2", "io": [{ "io_type": "ultra", "storage_spec_code": "dms.physical.storage.ultra", "volume_type": "SSD" }], "bandwidth": "600MB", "unavailable_zones": [], "ecs_flavor_id": "c3.2xlarge.2" }, { "tps": "300000", "storage": "4800", "partition_num": "1800", "product_id": "00300-30315-0--0", "spec_code": "dms.instance.kafka.cluster.c3.high.2", "io": [{ "io_type": "ultra", "storage_spec_code": "dms.physical.storage.ultra", "volume_type": "SSD" }], "bandwidth": "1200MB", "unavailable_zones": [], "ecs_flavor_id": "c3ne.2xlarge.2" }], "name": "cluster", "unavailable_zones": [] }] }] }
共100000条