查询集群详情
更新时间:2023-06-30
该接口用于查询指定集群的详细信息。
请求结构
Java
1GET /v{version}/clusters/{clusterId} HTTP/1.1
2Host: kafka-api.bj.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其他特殊头域。
请求参数
参数名称 | 类型 | 是否必须 | 参数位置 | 描述 |
---|---|---|---|---|
version | String | 是 | URL参数 | API版本号 |
clusterId | String | 是 | URL参数 | 待查询的集群ID |
返回头域
除公共头域外,无其他特殊头域。
返回参数
参数名称 | 类型 | 描述 |
---|---|---|
cluster | ClusterDetail | 返回的集群详细信息 |
错误码
错误码 | 错误描述 | HTTP状态码 | 描述 |
---|---|---|---|
ERROR_PARAMS | 请求参数错误 | 400 | 请求参数错误 |
CLUSTER_NOT_FOUND | 集群不存在 | 451 | 集群不存在 |
CLUSTER_HAD_DELETED | 集群已删除 | 451 | 集群已删除 |
CLUSTER_NOT_BELONGED | 未拥有该集群 | 451 | 未拥有该集群 |
INTERNAL_ERROR | 服务内部错误 | 500 | 服务内部错误 |
请求示例
Java
1GET http://kafka-api.bj.baidubce.com/v2/clusters/33a168bb70c0459787416077114ab233
2Authorization: bce-auth-v1/ALTAKaiKeDfBD880eMWBE5oIGE/2023-05-08T11:43:45Z/1800/host;x-bce-date/322f3f98ce57d296c0f5abc64e5554b640ea035c5cb462fcaeab54b9810a3c61
3Host: kafka-api.bj.baidubce.com
返回示例
Java
1HTTP/1.1 200 OK
2x-bce-request-id: 97e6d4ad-6fca-4609-ad4d-9a27c4d1a362
3Date: Mon, 08 May 2023 09:39:11 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6
7{
8 "cluster": {
9 "clusterId": "33a168bb70c0459787416077114ab233",
10 "clusterSid": "kafka-o8uu8JKS",
11 "name": "demo",
12 "region":"bj",
13 "type": "PROVISIONED",
14 "mode": "HP",
15 "state": "ACTIVE",
16 "provisioned": {
17 "kafkaVersion": "2.7.2",
18 "billing": {
19 "payment": "Prepaid",
20 "timeLength": 1,
21 "timeUnit": "month",
22 "expireTime":"2023-05-15T03:06:01Z",
23 "renewEnabled": true,
24 "renewTimeLength": 1,
25 "renewTimeUnit": "month"
26 },
27 "vpc": {
28 "vpcId":"vpc-tf3xqatke54b",
29 "name":"默认私有网络",
30 "cidr":"172.18.0.0/16"
31 },
32 "subnets": [
33 {
34 "subnetId": "sbn-12kruawmu30u",
35 "name": "系统预定义子网",
36 "subnetType": "BCC",
37 "zone": "cn-fwh-a",
38 "vpcId": "vpc-tf3xqatke54b",
39 "cidr": "172.18.0.0/20"
40 }
41 ],
42 "logicalZones": [
43 "cn-fwh-a"
44 ],
45 "securityGroup": {
46 "securityGroupId": "g-bqw18bis4cm4",
47 "name": "KAFKA默认安全组",
48 "vpcId": "vpc-tf3xqatke54b"
49 },
50 "publicIpEnabled": false,
51 "publicIpBandwidth": 0,
52 "intranetIpEnabled": false,
53 "authentications": [
54 {
55 "mode": "NONE"
56 },
57 {
58 "mode": "SASL_SCRAM"
59 }
60 ],
61 "aclEnabled": true,
62 "numberOfBrokerNodes": 3,
63 "numberOfBrokerNodesPerZone": 3,
64 "nodeType": "kafka.g4.c2m8",
65 "storageMeta": {
66 "storageType": "ENHANCED_SSD_PL1",
67 "storageSize": 100,
68 "numberOfDisk": 1
69 },
70 "configMeta": {
71 "configId": null,
72 "revisionId": null,
73 "context": {
74 "log.retention.hours":"24"
75 }
76 },
77 "deploySetEnabled": false,
78 },
79 "tags": [
80 {
81 "tagKey": "KAFKA-Cluster",
82 "tagValue": ""
83 }
84 ],
85 "createTime": "2023-05-10T03:06:01Z"
86 }
87}