文档首页 > > API参考> Kubernetes API> ConfigMap> 列出指定的ConfigMap

列出指定的ConfigMap

分享
更新时间:2020/05/26 GMT+08:00

功能介绍

This API is used to obtain a ConfigMap list.

URI

GET /api/v1/configmaps

表1描述该API的参数。

表1 参数解释

参数

是否必选

描述

pretty

No

If 'true', then the output is pretty printed.

labelSelector

No

A selector to restrict the list of returned objects by their labels. Defaults to everything.

includeUninitialized

No

If true, partially initialized resources are included in the response.

fieldSelector

No

A selector to restrict the list of returned objects by their fields. Defaults to everything.

watch

No

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

resourceVersion

No

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.

timeoutSeconds

No

Timeout for the list/watch call.

请求消息

N/A

响应消息

响应参数:

响应参数的详细描述请参见表4

响应示例:

{
    "kind": "ConfigMapList",
    "apiVersion": "v1",
    "metadata": {
        "selfLink": "/api/v1/configmaps",
        "resourceVersion": "419140"
    },
    "items": [
        {
            "metadata": {
                "name": "cluster-versions",
                "namespace": "kube-system",
                "selfLink": "/api/v1/namespaces/kube-system/configmaps/cluster-versions",
                "uid": "89dff34e-dc8e-11e7-9c19-fa163e2d897b",
                "resourceVersion": "19743",
                "creationTimestamp": "2017-12-09T03:10:41Z",
                "enable": true
            },
            "data": {
                "192.168.0.197": "v1.7.3-r13",
                "192.168.0.200": "v1.7.3-r13",
                "master": "v1.7.3-r13"
            }
        },
        {
            "metadata": {
                "name": "extension-apiserver-authentication",
                "namespace": "kube-system",
                "selfLink": "/api/v1/namespaces/kube-system/configmaps/extension-apiserver-authentication",
                "uid": "842ce75c-dc8e-11e7-9c19-fa163e2d897b",
                "resourceVersion": "69",
                "creationTimestamp": "2017-12-09T03:10:31Z",
                "enable": true
            },
            "data": {
                "client-ca-file": ""
            }
        },
        {
            "metadata": {
                "name": "kube-dns",
                "namespace": "kube-system",
                "selfLink": "/api/v1/namespaces/kube-system/configmaps/kube-dns",
                "uid": "86f45cfb-dc8e-11e7-9c19-fa163e2d897b",
                "resourceVersion": "80",
                "creationTimestamp": "2017-12-09T03:10:36Z",
                "labels": {
                    "addonmanager.kubernetes.io/mode": "EnsureExists"
                },
                "enable": true
            }
        },
        {
            "metadata": {
                "name": "cm-12130306",
                "namespace": "ns-12130306-s",
                "selfLink": "/api/v1/namespaces/ns-12130306-s/configmaps/cm-12130306",
                "uid": "efd6d9e0-dfb3-11e7-9c19-fa163e2d897b",
                "resourceVersion": "419081",
                "creationTimestamp": "2017-12-13T03:15:57Z",
                "enable": true
            },
            "data": {
                "property_1": "cm-test"
            }
        }
    ]
}

状态码

表2描述API的状态码。

表2 状态码

状态码

描述

200

This operation succeeds, and the JSONs of a group of ConfigMap objects are returned.

异常状态码请参见状态码

分享:

    相关文档

    相关产品

文档是否有解决您的问题?

提交成功!非常感谢您的反馈,我们会继续努力做到更好!
反馈提交失败,请稍后再试!

*必选

请至少选择或填写一项反馈信息

字符长度不能超过200

提交反馈 取消

如您有其它疑问,您也可以通过华为云社区问答频道来与我们联系探讨

智能客服提问云社区提问