Creating a ConfigMap

Function

This API is used to create a configMap.

URI

POST /api/v1/namespaces/{namespace}/configmaps

Table 1 Path parameter

Parameter

Description

namespace

Object name and auth scope, such as for teams and projects.

Table 2 Query parameter

Parameter

Mandatory

Description

pretty

No

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

Request

Request parameters

For the description about request parameters, see Table 121.

Example request

{
    "apiVersion": "v1",
    "data": {
        "property_1": "test"
    },
    "kind": "ConfigMap",
    "metadata": {
        "name": "configmap-test"
    }
}

Response

Response parameters

For the description about response parameters, see Table 121.

Example response

{
    "kind": "ConfigMap",
    "apiVersion": "v1",
    "metadata": {
        "name": "configmap-test",
        "namespace": "namespace-test",
        "selfLink": "/api/v1/namespaces/namespace-test/configmaps/configmap-test",
        "uid": "379519a3-aff0-11e8-8f17-c81fbe371a17",
        "resourceVersion": "5170290",
        "creationTimestamp": "2018-09-04T03:11:29Z",
        "enable": true
    },
    "data": {
        "property_1": "test"
    }
}

Status Codes

Table 3 describes the status codes of this API.

Table 3 Status codes

Status Code

Description

200

OK

201

Created

202

Accepted

For more status codes, see Status Codes.