替换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 Pod. | 必须 |
| 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. | 非必须 |
RequestBody的详细描述请参见 数据结构 表
示例:
Plain Text
1{
2 "apiVersion": "v1",
3 "data": {
4 "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",
5 "special.env": "env_value",
6 "ui.properties": "color.good=purple\ncolor.bad=yellow\nallow.textmode=true\nhow.nice.to.look=fairlyNice\n",
7 "new.property": "new.value"
8 },
9 "kind": "ConfigMap",
10 "metadata": {
11 "name": "baidu-configmap-niumingliang-test",
12 "namespace": "bec-user-ns-9aq1oagp",
13 "selfLink": "/api/v1/namespaces/bec-user-ns-9aq1oagp/configmaps/baidu-configmap-lisa-test"
14 }
15}
响应头域
除公共头域外,无其它特殊头域。
响应参数
响应参数的详细描述请参见 数据结构 表
错误码
请参照前文的网关错误码和平台错误码。
请求示例
Plain Text
1GET /api/v1/namespaces/test-namespace/pods/test-pod/status 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 "new.property": "new.value"
9 },
10 "kind": "ConfigMap",
11 "metadata": {
12 "annotations": null,
13 "clusterName": null,
14 "creationTimestamp": null,
15 "deletionGracePeriodSeconds": null,
16 "deletionTimestamp": null,
17 "finalizers": null,
18 "generateName": null,
19 "generation": null,
20 "initializers": null,
21 "labels": null,
22 "name": "baidu-configmap-test",
23 "namespace": "bec-user-ns-9aq1oagp",
24 "ownerReferences": null,
25 "resourceVersion": null,
26 "selfLink": "/api/v1/namespaces/test-namespace/configmaps/baidu-configmap-test",
27 "uid": null
28 }
29}
评价此篇文章
