Updates a ConfigMap instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation uses only common request headers. For more information, see Common request and response headers.

Request syntax

PUT /pop/v1/sam/configmap/configMap HTTP/1.1

Request parameters

Parameter Type Location Required Example Description
ConfigMapId Long Query Yes 1

The ID of the ConfigMap instance that you want to update. You can call the ListNamespacedConfigMaps operation to obtain the ID of the ConfigMap instance.

Object Body No

The ConfigMap data.

Data String Body Yes {"env.home": "/root", "env.shell": "/bin/sh"}

The data of ConfigMap key-value pairs. This parameter is required. Format:

{"Data":"{\"k1\":\"v1\", \"k2\":\"v2\"}"}

k specifies a key and v specifies a value. For more information, see Manage and use configurations.

Description String Query No test-desc

The description.

Response parameters

Parameter Type Example Description
RequestId String 91F93257-7A4A-4BD3-9A7E-2F6EAE6D****

The ID of the request.

Message String success

The returned information.

TraceId String 0a98a02315955564772843261e****

The ID of the trace. The ID is used to query the details of a request.

Data Object

The returned result.

ConfigMapId String 1

The ID of the ConfigMap instance.

ErrorCode String Empty

The returned error code. Valid values:

  • If the call is successful, the ErrorCode parameter is not returned.
  • If the call fails, the ErrorCode parameter is returned. For more information, see the "Error codes" section of this topic.
Code String 200

The HTTP status code. Valid values:

  • 2xx:: indicates that the call was successful.
  • 3xx: indicates that the call was redirected.
  • 4xx: indicates that the call failed.
  • 5xx: indicates that a server error occurred.
Success Boolean true

Indicates whether the ConfigMap instance was updated. Valid values:

  • true: The instance was updated.
  • false: The instance failed to be updated.

Examples

Sample requests

PUT /pop/v1/sam/configmap/configMap?ConfigMapId=1&Description=test-desc HTTP/1.1
Host:sae.aliyuncs.com
Content-Type:application/json

{
  "Data" : "{\"env.home\": \"/root\", \"env.shell\": \"/bin/sh\"}"
}

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<UpdateConfigMapResponse>
    <RequestId>91F93257-7A4A-4BD3-9A7E-2F6EAE6D****</RequestId>
    <Message>success</Message>
    <TraceId>0a98a02315955564772843261e****</TraceId>
    <Data>
        <ConfigMapId>1</ConfigMapId>
    </Data>
    <Code>200</Code>
    <Success>true</Success>
</UpdateConfigMapResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "91F93257-7A4A-4BD3-9A7E-2F6EAE6D****",
  "Message" : "success",
  "TraceId" : "0a98a02315955564772843261e****",
  "Data" : {
    "ConfigMapId" : "1"
  },
  "Code" : "200",
  "Success" : true
}

Error codes

HttpCode Error code Error message Description
400 InvalidParameter.NotEmpty You must specify the parameter %s. The error message returned because the value of the %s parameter is invalid. This parameter cannot be left empty.
400 InvalidParameter.Obviously The specified parameter is invalid {%s}. The error message returned because the value of the %s parameter is invalid.
400 InvalidParameter.WithMessage The parameter is invalid {%s}: %s The error message returned because the value of the %s parameter is invalid: %s.
400 NotFound.ConfigMap The ConfigMap object (ID: %s) does not exist. The error message returned because the specified ConfigMap object whose ID is %s does not exist.
400 TooMany.Configmap The maximum number of keys or the maximum length of Configmap is exceeded. The error message returned because the number of keys in the ConfigMap object or the length of the object body exceeds the limit.
500 OperationFailed.RPCError Internal RPC request processing error. The error message returned because the system failed to process an internal RPC request.

For a list of error codes, visit the API Error Center.