查询ConfigMap
更新时间:2020-01-03
接口描述
查询ConfigMap的详细信息。 |
请求结构
GET /api/v1/{namespace}/configmaps/{name} HTTP/1.1
Host: bec.bdcloudapi.com
Content-Type: application/json; charset=utf-8
Authorization: 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. | 非必须 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
响应参数的详细描述请参见 数据结构 表
错误码
请参照前文的网关错误码和平台错误码。
请求示例
GET /api/v1/namespaces/test-namespace/configmaps/baidu-configmap-test HTTP/1.1
Host: bec.bdcloudapi.com
Content-Type: application/json; charset=utf-8
Authorization: bce-auth-v1/318857a8f08b11e9845ca7e54775a0c2/2019-10-17T03:07:21Z/1800/host/212eef8cfe1ac94be56c4afedb9360bba621ef646c3c8288971d36801d70501a
响应示例
{
"apiVersion": "v1",
"binaryData": null,
"data": {
"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",
"special.env": "env_value",
"ui.properties": "color.good=purple\ncolor.bad=yellow\nallow.textmode=true\nhow.nice.to.look=fairlyNice\n"
},
"kind": "ConfigMap",
"metadata": {
"annotations": null,
"clusterName": null,
"creationTimestamp": 1575604629000,
"deletionGracePeriodSeconds": null,
"deletionTimestamp": null,
"finalizers": null,
"generateName": null,
"generation": null,
"initializers": null,
"labels": null,
"name": "baidu-configmap-test",
"namespace": "test-namespace",
"ownerReferences": null,
"resourceVersion": "48996670",
"selfLink": "/api/v1/namespaces/test-namespace/configmaps/baidu-configmap-test",
"uid": "7a047c03-17dc-11ea-8506-6c92bfc728ee"
}
}