Creating a ConfigMap
Function
This API is used to create a ConfigMap.
Request
Request parameters:
For the description about request parameters, see Table 2.
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
apiVersion |
Yes |
String |
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. |
|
kind |
Yes |
String |
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. |
|
metadata |
Yes |
metadata object |
Standard list metadata. |
|
data |
Yes |
Object |
Data contains the configuration data. Each key must consist of alphanumeric characters, '-', '_' or '.'. |
Example request:
{
"apiVersion": "v1",
"data": {
"property_1": "test"
},
"kind": "ConfigMap",
"metadata": {
"name": "test-12130306"
}
}
Response
Response parameters:
For the description about response parameters, see Table 2.
Example response:
{
"kind": "ConfigMap",
"apiVersion": "v1",
"metadata": {
"name": "test-12130306",
"namespace": "ns-12130306-s",
"selfLink": "/api/v1/namespaces/ns-12130306-s/configmaps/test-12130306",
"uid": "efd6d9e0-dfb3-11e7-9c19-fa163e2d897b",
"resourceVersion": "419081",
"creationTimestamp": "2017-12-13T03:15:57Z",
"enable": true
},
"data": {
"property_1": "test"
}
}
Status Code
Table 3 describes the status code of this API.
|
Status Code |
Description |
|---|---|
|
201 |
The request has been fulfilled, resulting in the creation of a new resource. |
For the description about error status codes, see Status Code.
Last Article: ConfigMap
Next Article: Deleting a ConfigMap
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.