云服务器内容精选

  • 响应参数 状态码: 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 OK { "total" : 91, "size" : 1, "permissions" : [ "modify" ], "topics" : [ { "policiesOnly" : false, "name" : "topic-test", "replication" : 3, "partition" : 3, "retention_time" : 72, "sync_replication" : false, "sync_message_flush" : false, "app_id" : "ba1408c8-xxxx-xxxx-xxxx-21a218f4xxxx", "app_name" : "app-test", "permissions" : [ "read", "access", "delete", "modify" ], "external_configs" : { }, "description" : "", "sensitive_word" : "", "topic_type" : 0 } ], "remain_partitions" : 37, "max_partitions" : 300 } 状态码: 400 Bad Request { "error_code" : 400, "error_msg" : "Bad Request" } 状态码: 403 Forbidden { "error_code" : 403, "error_msg" : "Forbidden" }
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 total Integer topic的总数。 size Integer 当前查询的topic数量。 permissions Array of strings 允许操作的权限。 topics Array of topics objects Topic列表。 remain_partitions Integer 剩余分区数。 max_partitions Integer 分区总数。 表5 topics 参数 参数类型 描述 policiesOnly Boolean 是否只更新策略。 name String topic名称。 replication Integer 副本数,配置数据的可靠性。 partition Integer topic分区数,设置消费的并发数。 retention_time Integer 消息老化时间。 sync_message_flush Boolean 是否使用同步落盘。默认值为false。同步落盘会导致性能降低。 sync_replication Boolean 是否开启同步复制,开启后,客户端生产消息时相应的也要设置acks=-1,否则不生效,默认关闭。 app_id String 集成应用key。 app_key String 集成应用key。 app_name String 应用名称。 permissions Array of strings 允许操作的权限。 external_configs Object 其他配置。 description String 描述。 sensitive_word String 敏感字段。 topic_type Integer topic类型。 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误信息 状态码: 403 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误信息
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 表3 请求Body参数 参数 是否必选 参数类型 描述 name 是 String topic名称,以字母开头,仅能包含数字,字母,下划线(_),中划线(-),长度3-200字符。 app_id 是 String 集成应用key。 app_key 否 String 集成应用key。 partition 否 Integer topic分区数,设置消费的并发数。 取值范围:1-100。 默认值:3。 replication 否 Integer 副本数,配置数据的可靠性。 取值范围:1-3。 默认值:3。 access_policy 是 String 权限类型。 all:发布+订阅 pub:发布 sub:订阅 sync_message_flush 否 Boolean 是否使用同步落盘。默认值为false。同步落盘会导致性能降低。 sync_replication 否 Boolean 是否开启同步复制,开启后,客户端生产消息时相应的也要设置acks=-1,否则不生效,默认关闭。 retention_time 否 Integer 消息老化时间。默认值为72。取值范围1~168,单位小时。 tag 否 String 权限类型对应的标签。 当权限类型是all时,发布和订阅的标签用符号“&”隔开。 当有多个标签时,标签用符号“||”隔开。 description 否 String 描述。长度0-1000字符。 sensitive_word 否 String 敏感字段。 当有多个敏感字段时,敏感字段用符号“||”隔开。
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 name String topic名称。 状态码: 400 表5 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误信息 状态码: 403 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误信息
  • 请求示例 创建一个Topic,分区数为3,副本数为3,消息老化时间为72小时 POST https://{endpoint}/v2/{project_id}/mqs/instances/{instance_id}/topics { "name" : "topic-test-2", "app_id" : "c5abd910-02b1-4bc4-b587-c3fe4c49dab9", "partition" : 3, "access_policy" : "all", "replication" : 3, "retention_time" : 72, "sync_replication" : false, "sync_message_flush" : false, "tag" : "11 || 22 || aa || bb&11 || 22 || aa || bb", "description" : "test", "sensitive_word" : "sss || ddd" }
  • URI GET /v2/{project_id}/mqs/instances/{instance_id}/topics/diskusage 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID。 instance_id 是 String 实例ID。 表2 Query参数 参数 是否必选 参数类型 描述 minSize 否 String 占用磁盘大小,默认单位G (K ,M , G)。范围:1-10000 top 否 String 占用磁盘大小,查询top N。范围:1-1000 percentage 否 String 占用磁盘大小,查询大于占比的分区。范围:1-100
  • 请求示例 查询成功。 "GET https://{endpoint}/v2/{project_id}/instances/{instance_id}/topics/diskusage" { "broker_list" : [ { "broker_name" : "broker-0", "data_disk_size" : "66G", "data_disk_use" : "53M", "data_disk_free" : "63G", "data_disk_use_percentage" : "1", "status" : "Success get info", "topic_list" : [ { "size" : "12K", "topic_name" : "topic-test", "topic_partition" : "2", "percentage" : 1.7339533025568183E-5 }, { "size" : "12K", "topic_name" : "__consumer_offsets", "topic_partition" : "4", "percentage" : 1.7339533025568183E-5 }, { "size" : "12K", "topic_name" : "__consumer_offsets", "topic_partition" : "3", "percentage" : 1.7339533025568183E-5 }, { "size" : "8.0K", "topic_name" : "__trace", "topic_partition" : "6", "percentage" : 1.1559688683712121E-5 }, { "size" : "8.0K", "topic_name" : "__trace", "topic_partition" : "4", "percentage" : 1.1559688683712121E-5 }, { "size" : "8.0K", "topic_name" : "__trace", "topic_partition" : "2", "percentage" : 1.1559688683712121E-5 }, { "size" : "8.0K", "topic_name" : "__trace", "topic_partition" : "0", "percentage" : 1.1559688683712121E-5 }, { "size" : "8.0K", "topic_name" : "topic-test", "topic_partition" : "0", "percentage" : 1.1559688683712121E-5 }, { "size" : "8.0K", "topic_name" : "topic-1568537362", "topic_partition" : "2", "percentage" : 1.1559688683712121E-5 }, { "size" : "8.0K", "topic_name" : "__consumer_offsets", "topic_partition" : "7", "percentage" : 1.1559688683712121E-5 } ] } ] }
  • 响应示例 状态码: 200 OK { "broker_list" : [ { "broker_name" : "broker-0", "data_disk_size" : "66G", "data_disk_use" : "53M", "data_disk_free" : "63G", "data_disk_use_percentage" : "1", "status" : "Success get info", "topic_list" : [ { "size" : "12K", "topic_name" : "topic-test", "topic_partition" : "2", "percentage" : 1.7339533025568183E-5 }, { "size" : "12K", "topic_name" : "__consumer_offsets", "topic_partition" : "4", "percentage" : 1.7339533025568183E-5 }, { "size" : "12K", "topic_name" : "__consumer_offsets", "topic_partition" : "3", "percentage" : 1.7339533025568183E-5 }, { "size" : "8.0K", "topic_name" : "__trace", "topic_partition" : "6", "percentage" : 1.1559688683712121E-5 }, { "size" : "8.0K", "topic_name" : "__trace", "topic_partition" : "4", "percentage" : 1.1559688683712121E-5 }, { "size" : "8.0K", "topic_name" : "__trace", "topic_partition" : "2", "percentage" : 1.1559688683712121E-5 }, { "size" : "8.0K", "topic_name" : "__trace", "topic_partition" : "0", "percentage" : 1.1559688683712121E-5 }, { "size" : "8.0K", "topic_name" : "topic-test", "topic_partition" : "0", "percentage" : 1.1559688683712121E-5 }, { "size" : "8.0K", "topic_name" : "topic-1568537362", "topic_partition" : "2", "percentage" : 1.1559688683712121E-5 }, { "size" : "8.0K", "topic_name" : "__consumer_offsets", "topic_partition" : "7", "percentage" : 1.1559688683712121E-5 } ] } ] } 状态码: 400 查询失败。 { "error_code" : 400, "error_msg" : "Bad Request" } 状态码: 403 查询失败。 { "error_code" : 403, "error_msg" : "Forbidden" }
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 broker_name String broker名称 data_disk_size String 磁盘大小 data_disk_use String 已使用磁盘大小 data_disk_free String 空闲磁盘大小 data_disk_use_percentage Integer 磁盘使用率 status String 查询状态 topic_list Array of TopicListEnity objects topic列表 表5 TopicListEnity 参数 参数类型 描述 size String 大小 topic_name String topic名称 topic_partition Integer topic分区 percentage String 使用百分比 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误信息 状态码: 403 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误信息
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String IAM Token workspace 是 String DataArts Studio工作空间ID 表3 请求Body参数 参数 是否必选 参数类型 描述 ids 是 Array of longs ID列表 del_types 否 String 删除物理表 枚举值: PHYSICAL_TABLE
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 data Object 返回的数据信息 状态码: 400 表5 响应Body参数 参数 参数类型 描述 error_code String 错误码,如DS.000,请求处理成功 error_msg String 错误信息 data Object 返回的数据信息 状态码: 401 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码,如DS.000,请求处理成功 error_msg String 错误信息 data Object 返回的数据信息 状态码: 403 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码,如DS.000,请求处理成功 error_msg String 错误信息 data Object 返回的数据信息 状态码: 404 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码,如DS.000,请求处理成功 error_msg String 错误信息 data Object 返回的数据信息
  • 响应示例 状态码: 200 Success,返回data数据是 CatalogVO 数组, 以及总数 { "data" : { "value" : { "records" : [ { "name_ch" : "城市交通", "name_en" : "city_traffic", "description" : "", "qualified_name" : "city_traffic@Business.xxx", "guid" : "f6e674d6-f657-4734-b417-837536c12eee", "code" : null, "status" : "DRAFT", "new_biz" : null, "alias" : "", "data_owner" : "", "data_owner_list" : "[\"abc\"]", "data_department" : null, "path" : "城市交通", "level" : 1, "ordinal" : 1, "owner" : "abc", "parent_id" : null, "swap_order_id" : null, "id" : "873232498044411904", "qualified_id" : null, "create_by" : "abc", "update_by" : "abc", "create_time" : "2021-08-06T15:54:11+08:00", "update_time" : "2022-08-30T10:59:38+08:00", "self_defined_fields" : [ { "fd_name_ch" : "备注", "fd_name_en" : "ez", "not_null" : false, "fd_value" : "" } ], "children_num" : null, "children" : null } ] } } }
  • URI GET /v2/{project_id}/design/subjects 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目id 表2 Query参数 参数 是否必选 参数类型 描述 name 否 String 按名称或编码模糊查询 create_by 否 String 按创建者查询 owner 否 String 按负责人查询 status 否 String 业务状态 枚举值: DRAFT PUBLISH_DEVELOPING PUBLISHED OFFLINE_DEVELOPING OFFLINE REJECT begin_time 否 String 时间过滤左边界,与end_time一起使用,只支持时间范围过滤,单边过滤无效 end_time 否 String 时间过滤右边界,与begin_time一起使用只支持时间范围过滤,单边过滤无效 limit 否 Integer 查询条数,即查询Y条数据。默认值50,取值范围[1,100] 最大值:100 缺省值:50 offset 否 Integer 查询起始坐标,即跳过X条数据,仅支持0或limit的整数倍,不满足则向下取整。默认值0 缺省值:0 parent_id 否 Long 父目录ID,根节点没有此ID,空值为所有,-1为根节点下节点