本文为您介绍DeleteImage接口的语法及示例,用于向图像搜索实例中删除图片信息。

使用说明

本接口用于向图像搜索实例中删除图片信息。

说明
  • 如果指定图片在图像搜索实例中不存在,该接口依然会返回成功。不能用返回结果来判断图片是否存在。
  • 如需了解更多产品详情和获取技术支持,请单击在线咨询或通过钉钉群(35035130)联系我们。

QPS限制

删除操作默认的并发量为20,也就是每秒钟最多处理20个删除请求。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String DeleteImage

系统规定参数。取值:DeleteImage。

InstanceName String demoinstance1

图搜实例名称。最多支持20个字符。

如果已经购买图搜实例可登录图像搜索管控台查看。

如果没有购买图搜实例可参考开通服务创建实例

说明 这里的实例名称并非实例ID,且实例名称同区域内唯一不可重复,使用时请区分。
ProductId String 2092061_1

商品ID。

说明 一个商品可以有多张图片。
PicName String 2092061_1.jpg

图片名称。

  • 如果不指定本参数,则删除ProductId下所有图片。
  • 如果指定本参数,则删除ProductId+PicName指定的图片。

返回数据

名称 类型 示例值 描述
Message String success

错误信息。

RequestId String 0703956F-9BCC-48FA-99F7-96C0BF449C69

请求ID。

Code Integer 0

错误码。

  • 0:成功。
  • 非0:失败。
Success Boolean true

请求是否成功。

Data Object

删除结果返回。

PicNames Array of String xxx.jpg

删除的PicName。

示例

请求示例

{
        "InstanceName": "demoinstance",
        "PicName": "test",
        "ProductId": "test"
    }

正常返回示例

JSON格式

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

{
  "Message" : "success",
  "RequestId" : "1F59AE0A-8B57-14A6-BCE8-E2592CA5FA0F",
  "Data" : {
    "PicNames" : [ "5555.jpg" ]
  },
  "Code" : 0,
  "Success" : true
}

错误码

HttpCode 错误码 错误信息 描述
400 BadRequest The request has invalid parameters. 无效的参数
400 InvalidInstance The specified instance name is invalid. 实例名错误
400 NoCaretSeperator The body content is missing the ^ separator. 请求body缺少特定符号
400 EmptyMeta The body content has an empty meta field. 请求body含有空的字段
400 InvalidMetaItem The meta field is invalid. 无效的元信息字段
400 InvalidPicList The specified pic_list parameter is invalid. 无效的pic_list字段
400 NoSpecifiedPic The content of an image is not specified in the HTTP POST body. 图片未指定
400 InvalidCategory The specified category is invalid. 无效的类目id
400 OverflowMaxResultNum The specified number of total results exceeds the maximum of 500. 超过了最大的返回结果限制数500
400 OverflowMaxReturnNum The specified number of results for each request exceeds the maximum of 100. 单次返回数超过限制值100
400 InvalidIntAttr The specified int_attr field is invalid. 无效的int过滤字段
400 UnsupportedPicFormat The specified image format is invalid. 无效的图片格式
400 InvalidFilterClause The specified filtering condition is invalid. 无效的过滤条件
400 InstanceOverQuota The number of items exceeds the limit. 实例的图片数量超过限制值
400 IncorrectOrientation The image contains incorrect rotation flags in the meta data. 图片包含不支持的旋转参数
400 UnsupportedPicPixels The specified pixels is not supported. 图片像素值不支持
403 NoPermission You are not authorized to perform this operation. 没有权限进行此操作,请先让管理员账号授权.
403 DeniedRequest Your request was denied due to instance flow control. 请求被限流
500 NetworkException A network error occurred. 内部错误:请求网络异常
500 UnsupportedInstanceType The instance type is not supported. 内部错误:不支持的实例类型
500 UnsupportedOperationType The specified action is not supported. 内部错误:不支持的action
500 AccessEngineFailed An error occurred while accessing the search engine. 内部错误:请求引擎失败
500 InternalOssError An internal OAS error occurred. 内部错误:请求内部算法错误
500 InternalSwiftError An internal SWIFT error occurred. 内部错误:请求内部消息队列错误
500 InternalTableStoreError An internal Table Store error occurred. 内部错误:请求特征存储错误

访问错误中心查看更多错误码。

错误码

请参见错误码