• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference 2.0
  4. Kubernetes API
  5. ConfigMap
  6. Listing ConfigMaps

Listing ConfigMaps

Function

This API is used to list all ConfigMap resource objects.

URI

GET /api/v1/configmaps

Table 1 describes the parameters of this API.

Table 1 Parameter description

Parameter

Mandatory

Description

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.

Request

N/A

Response

Response parameters:

For the description about response parameters, see Table 4.

Example response:

{
    "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.11.3-r1",
                "192.168.0.200": "v1.11.3-r1",
                "master": "v1.11.3-r1"
            }
        },
        {
            "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"
            }
        }
    ]
}

Status Code

Table 2 describes the status code of this API.

Table 2 Status code

Status Code

Description

200

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

For the description about status codes, see section Status Codes.