查询ConfigMap
更新时间:2025-08-05
接口描述
查询ConfigMap的详细信息。 |
请求结构
Plain Text
1GET /api/v1/{namespace}/configmaps/{name} HTTP/1.1
2Host: bec.bdcloudapi.com
3Content-Type: application/json; charset=utf-8
4Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
表1 Path参数描述
| 参数 | 类型 | 参数位置 | 描述 | 是否必须 |
|---|---|---|---|---|
| name | String | URI参数 | Name of the Configmap. | 必须 |
| namespace | String | URI参数 | Object name and auth scope, such as for teams and projects. | 必须 |
表2 Query参数描述
| 参数 | 类型 | 描述 | 是否必须 |
|---|---|---|---|
| pretty | String | If 'true', then the output is pretty printed. | 非必须 |
| exact | String | Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. | 非必须 |
| export | String | Should this value be exported. Export strips fields that a user cannot specify. | 非必须 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
响应参数的详细描述请参见 数据结构 表
错误码
请参照前文的网关错误码和平台错误码。
请求示例
Plain Text
1GET /api/v1/namespaces/test-namespace/configmaps/baidu-configmap-test HTTP/1.1
2Host: bec.bdcloudapi.com
3Content-Type: application/json; charset=utf-8
4Authorization: bce-auth-v1/318857a8f08b11e9845ca7e54775a0c2/2019-10-17T03:07:21Z/1800/host/212eef8cfe1ac94be56c4afedb9360bba621ef646c3c8288971d36801d70501a
响应示例
Plain Text
1{
2 "apiVersion": "v1",
3 "binaryData": null,
4 "data": {
5 "game.properties": "enemies=aliens\nlives=3\nenemies.cheat=true\nenemies.cheat.level=noGoodRotten\nsecret.code.passphrase=UUDDLRLRBABAS\nsecret.code.allowed=true\nsecret.code.lives=30\n",
6 "special.env": "env_value",
7 "ui.properties": "color.good=purple\ncolor.bad=yellow\nallow.textmode=true\nhow.nice.to.look=fairlyNice\n"
8 },
9 "kind": "ConfigMap",
10 "metadata": {
11 "annotations": null,
12 "clusterName": null,
13 "creationTimestamp": 1575604629000,
14 "deletionGracePeriodSeconds": null,
15 "deletionTimestamp": null,
16 "finalizers": null,
17 "generateName": null,
18 "generation": null,
19 "initializers": null,
20 "labels": null,
21 "name": "baidu-configmap-test",
22 "namespace": "test-namespace",
23 "ownerReferences": null,
24 "resourceVersion": "48996670",
25 "selfLink": "/api/v1/namespaces/test-namespace/configmaps/baidu-configmap-test",
26 "uid": "7a047c03-17dc-11ea-8506-6c92bfc728ee"
27 }
28}
