Updating a ConfigMap
Function
This API is used to update a specified configMap.
The following fields can be updated:
- metadata.labels
- metadata.annotations
- data
URI
PATCH /api/v1/namespaces/{namespace}/configmaps/{name}
|
Parameter |
Description |
|---|---|
|
namespace |
Object name and auth scope, such as for teams and projects. |
|
name |
Name of the ConfigMap. |
|
Parameter |
Mandatory |
Description |
|---|---|---|
|
pretty |
No |
If 'true', then the output is pretty printed. |
Request
Request parameters
For the description about the Content-Type field, see Patch Request Method Operation Description.
Example request
Add a key-value pair property_2 for the configMap created in Creating a ConfigMap.
Content-Type: application/merge-patch+json
{
"data": {
"property_2": "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": "5171481",
"creationTimestamp": "2018-09-04T03:11:29Z",
"enable": true
},
"data": {
"property_1": "test",
"property_2": "test"
}
}
Status Code
Table 3 describes the status code of this API.
|
Status Code |
Description |
|---|---|
|
200 |
This operation succeeds, and a ConfigMap resource object is returned. |
For more status codes, see Status Codes.
Last Article: Replacing a 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.