This topic describes the syntax of the UpdateImage operation and provides examples of this operation. You can call this operation to update image information on an Image Search instance.
Description
This operation updates image information on an Image Search instance.
Limits are imposed on the instance creation time.
This operation is supported by instances that are created in the Singapore (Singapore) region after December 2021. This operation is not supported in other regions.
QPS limits
By default, the maximum number of queries supported by this operation is 20. In this case, the system can process at most 20 requests every second.
Debugging
Request parameters
Name | Type | Required | Example | Description |
Action | String | Yes | UpdateImage | The operation that you want to perform. Set the value to UpdateImage. |
InstanceName | String | Yes | demoinstance1 | The name of the Image Search instance. The name can be up to 20 characters in length. |
ProductId | String | Yes | 2092061_1 | The ID of the product. The ID can be up to 512 characters in length. Note A product may have multiple images. |
PicName | String | Yes | namexxx.jpg | The name of the image. The name can be up to 512 characters in length. Note
|
CustomContent | String | No | zidingyi | The user-defined content. The value can be up to 4,096 characters in length. Note If you set this parameter, the response includes this parameter and its value. You can add text such as an image description. |
IntAttr | Integer | No | 2 | The attribute, which is an integer. The attribute can be used to filter images when you search for images. If you set this parameter, the response includes this parameter and its value. |
StrAttr | String | No | ss | The attribute, which is a string. The value can be up to 128 characters in length. The attribute can be used to filter images. If you set this parameter, the response includes this parameter and its value. |
IntAttr2 | Integer | No | 22 | The attribute, which is an integer. The attribute can be used to filter images when you search for images. If you specify this parameter, the response includes this parameter and its value. Note This parameter is applicable only to instances that are created after January 3, 2023. |
StrAttr2 | String | No | ss | The attribute, which is a string. The value can be up to 128 characters in length. The attribute can be used to filter images when you search for images. If you specify this parameter, the response includes this parameter and its value. Note
|
Response parameters
Name | Type | Example | Description |
Message | String | success | Id of the request |
RequestId | String | E0845DE6-52AF-4B50-9F15-51ED4044E6AB | The ID of the request. |
Code | Integer | 0 | The error code returned.
|
Success | Boolean | true | Indicates whether the request is successful. |
Examples
Sample requests
{
"InstanceName": "demoinstance",
"PicName": "test",
"CustomContent": "demo content",
"ProductId": "test",
"IntAttr": "0",
"StrAttr": "demo str attr"
}
Sample success responses
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"Message" : "success",
"RequestId" : "B253A127-DF89-4DDC-A295-618DD22B00B2",
"Success" : true,
"Code" : 0
}
Error codes
HttpCode | Error code | Error message | Description |
400 | BadRequest | The request has invalid parameters. | The error message returned because a parameter is set to an invalid value. |
400 | InstanceStatusError | Your instance is unavailable. | The error message returned because the instance is unavailable. |
400 | InvalidInstance | The specified instance name is invalid. | The error message returned because the instance name is invalid. |
400 | NoCaretSeperator | The body content is missing the ^ separator. | The error message returned because specific symbols are missing in the request body. |
400 | EmptyMeta | The body content has an empty meta field. | The error message returned because the request body contains empty fields. |
400 | InvalidMetaItem | The meta field is invalid. | The error message returned because the meta field is set to an invalid value. |
400 | NoPicList | The body content is missing the pic_list parameter. | The error message returned because the pic_list field is empty. |
400 | InvalidPicList | The specified pic_list parameter is invalid. | The error message returned because the pic_list field is set to an invalid value. |
400 | NoSpecifiedPic | The content of an image is not specified in the HTTP POST body. | The error message returned because no image is specified. |
400 | InvalidCategory | The specified category is invalid. | The error message returned because the category ID is invalid. |
400 | OverflowMaxResultNum | The specified number of total results exceeds the maximum of 500. | The error message returned because the specified number of images to return exceeds the upper limit, which is 500. |
400 | OverflowMaxReturnNum | The specified number of results for each request exceeds the maximum of 100. | The error message returned because the specified number of images to return in a single call exceeds the upper limit, which is 100. |
400 | InvalidIntAttr | The specified int_attr field is invalid. | The error message returned because the int filter field is set to an invalid value. |
400 | UnsupportedPicFormat | The specified image format is invalid. | The error message returned because the image format is invalid. |
400 | InvalidFilterClause | The specified filtering condition is invalid. | The error message returned because the filter condition is invalid. |
400 | InstanceOverQuota | The number of items exceeds the limit. | The error message returned because the number of images on the instance exceeds the upper limit. |
400 | IncorrectOrientation | The image contains incorrect rotation flags in the meta data. | The error message returned because the image carries rotation settings. Rotation settings are not supported. |
400 | UnsupportedPicPixels | The specified pixels is not supported. | The error message returned because the specified image pixel is not supported. |
403 | NoPermission | You are not authorized to perform this operation. | The error message returned because you are not authorized to perform this operation. |
403 | DeniedRequest | Your request was denied due to instance flow control. | The error message returned because your request has been denied due to throttling. |
500 | NetworkException | A network error occurred. | The error message returned because a network error occurred. |
500 | UnsupportedInstanceType | The instance type is not supported. | The error message returned because the instance type is not supported. |
500 | UnsupportedOperationType | The specified action is not supported. | The error message returned because the specified action is not supported. |
500 | AccessEngineFailed | An error occurred while accessing the search engine. | The error message returned because an error occurred while accessing the search engine. |
500 | InternalOssError | An internal OAS error occurred. | The error message returned because an internal algorithm error occurred. |
500 | InternalSwiftError | An internal SWIFT error occurred. | The error message returned because an internal message queue error occurred. |
500 | InternalTableStoreError | An internal Table Store error occurred. | The error message returned because an internal storage error occurred. |
For a list of error codes, visit the API Error Center.
Error codes
For a list of error codes, visit the API Error Center.