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

ParameterTypeLocationRequiredExampleDescription
ConfigMapIdLongQueryYes1

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.

ObjectBodyNo

The ConfigMap data.

DataStringBodyYes{"env.shell": "/bin/sh"}

The data of ConfigMap key-value pairs. JSON format:

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

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

DescriptionStringQueryNotest-desc

The description.

Response parameters

ParameterTypeExampleDescription
RequestIdString91F93257-7A4A-4BD3-9A7E-2F6EAE6D****

The ID of the request.

MessageStringsuccess

The returned information.

TraceIdString0a98a02315955564772843261e****

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

DataObject

The returned result.

ConfigMapIdString1

The ID of the ConfigMap instance.

ErrorCodeStringEmpty

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.
CodeString200

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.
SuccessBooleantrue

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.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

HttpCodeError codeError messageDescription
400InvalidParameter.NotEmptyYou must specify the parameter %s.The error message returned because the value of the %s parameter is invalid. This parameter cannot be left empty.
400InvalidParameter.ObviouslyThe specified parameter is invalid {%s}.The error message returned because the value of the %s parameter is invalid.
400InvalidParameter.WithMessageThe parameter is invalid {%s}: %sThe error message returned because the value of the %s parameter is invalid: %s.
400NotFound.ConfigMapThe ConfigMap object (ID: %s) does not exist.The error message returned because the specified ConfigMap object whose ID is %s does not exist.
400TooMany.ConfigmapThe 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.
500OperationFailed.RPCErrorInternal 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.